diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-06-14 13:01:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-06-14 13:17:06 -0400 |
commit | 47c8433a0c3c579588e1e5d4f67f16843ba26bca (patch) | |
tree | a6424ad37a2337eb1dc24de50e1f3adc75c2c497 /src/or/hibernate.c | |
parent | 22efe2030901e7ef878c8ec358e819bbdb1239f6 (diff) | |
download | tor-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/hibernate.c')
-rw-r--r-- | src/or/hibernate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index aebce4cc88..f03433a279 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -134,7 +134,7 @@ static void accounting_set_wakeup_time(void); * options->AccountingStart. Return 0 on success, -1 on failure. If * <b>validate_only</b> is true, do not change the current settings. */ int -accounting_parse_options(or_options_t *options, int validate_only) +accounting_parse_options(const or_options_t *options, int validate_only) { time_unit_t unit; int ok, idx; @@ -249,7 +249,7 @@ accounting_parse_options(or_options_t *options, int validate_only) * hibernate, return 1, else return 0. */ int -accounting_is_enabled(or_options_t *options) +accounting_is_enabled(const or_options_t *options) { if (options->AccountingMax) return 1; @@ -411,7 +411,7 @@ static void update_expected_bandwidth(void) { uint64_t expected; - or_options_t *options= get_options(); + const or_options_t *options= get_options(); uint64_t max_configured = (options->RelayBandwidthRate > 0 ? options->RelayBandwidthRate : options->BandwidthRate) * 60; @@ -750,7 +750,7 @@ static void hibernate_begin(hibernate_state_t new_state, time_t now) { connection_t *conn; - or_options_t *options = get_options(); + const or_options_t *options = get_options(); if (new_state == HIBERNATE_STATE_EXITING && hibernate_state != HIBERNATE_STATE_LIVE) { |