aboutsummaryrefslogtreecommitdiff
path: root/src/or/microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-14 13:01:38 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-14 13:17:06 -0400
commit47c8433a0c3c579588e1e5d4f67f16843ba26bca (patch)
treea6424ad37a2337eb1dc24de50e1f3adc75c2c497 /src/or/microdesc.c
parent22efe2030901e7ef878c8ec358e819bbdb1239f6 (diff)
downloadtor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.tar.gz
tor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.zip
Make the get_options() return const
This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r--src/or/microdesc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 7ebb1e14fd..cae31fe4cb 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -595,7 +595,7 @@ microdesc_list_missing_digest256(networkstatus_t *ns, microdesc_cache_t *cache,
void
update_microdesc_downloads(time_t now)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
networkstatus_t *consensus;
smartlist_t *missing;
digestmap_t *pending;
@@ -654,7 +654,7 @@ update_microdescs_from_networkstatus(time_t now)
/** Return true iff we should prefer to use microdescriptors rather than
* routerdescs for building circuits. */
int
-we_use_microdescriptors_for_circuits(or_options_t *options)
+we_use_microdescriptors_for_circuits(const or_options_t *options)
{
int ret = options->UseMicrodescriptors;
if (ret == -1) {
@@ -673,7 +673,7 @@ we_use_microdescriptors_for_circuits(or_options_t *options)
/** Return true iff we should try to download microdescriptors at all. */
int
-we_fetch_microdescriptors(or_options_t *options)
+we_fetch_microdescriptors(const or_options_t *options)
{
if (directory_caches_dir_info(options))
return 1;
@@ -682,7 +682,7 @@ we_fetch_microdescriptors(or_options_t *options)
/** Return true iff we should try to download router descriptors at all. */
int
-we_fetch_router_descriptors(or_options_t *options)
+we_fetch_router_descriptors(const or_options_t *options)
{
if (directory_caches_dir_info(options))
return 1;