aboutsummaryrefslogtreecommitdiff
path: root/src/or/policies.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/policies.c
parent22efe2030901e7ef878c8ec358e819bbdb1239f6 (diff)
downloadtor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.tar
tor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.tar.gz
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/policies.c')
-rw-r--r--src/or/policies.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 73e510689..983df8696 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -164,7 +164,7 @@ parse_addr_policy(config_line_t *cfg, smartlist_t **dest,
static int
parse_reachable_addresses(void)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
int ret = 0;
if (options->ReachableDirAddresses &&
@@ -356,7 +356,7 @@ authdir_policy_badexit_address(uint32_t addr, uint16_t port)
* options in <b>options</b>, return -1 and set <b>msg</b> to a newly
* allocated description of the error. Else return 0. */
int
-validate_addr_policies(or_options_t *options, char **msg)
+validate_addr_policies(const or_options_t *options, char **msg)
{
/* XXXX Maybe merge this into parse_policies_from_options, to make sure
* that the two can't go out of sync. */
@@ -440,7 +440,7 @@ load_policy_from_option(config_line_t *config, smartlist_t **policy,
/** Set all policies based on <b>options</b>, which should have been validated
* first by validate_addr_policies. */
int
-policies_parse_from_options(or_options_t *options)
+policies_parse_from_options(const or_options_t *options)
{
int ret = 0;
if (load_policy_from_option(options->SocksPolicy, &socks_policy, -1) < 0)