From 922cee3d0c63e72f2e7a7d9b495b8fa65f2312e2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 14 Sep 2005 20:59:25 +0000 Subject: [PATCH] Clean up a few warnings that make gcc twig out a bit. svn:r5062 --- src/common/compat.c | 7 ++++++- src/or/circuitbuild.c | 2 +- src/or/config.c | 2 +- src/or/dirserv.c | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/common/compat.c b/src/common/compat.c index 07b21ccb7d..39b8f953fe 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -1001,7 +1001,12 @@ tor_mutex_free(tor_mutex_t *m) unsigned long tor_get_thread_id(void) { - return (unsigned long)pthread_self(); + union { + pthread_t thr; + unsigned long id; + } r; + r.thr = pthread_self(); + return r.id; } #else struct tor_mutex_t { diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index e535d9add1..b445b7d05c 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -461,7 +461,7 @@ circuit_deliver_create_cell(circuit_t *circ, uint8_t cell_type, char *payload) /** We've decided to start our reachability testing. If all * is set, log this to the user. Return 1 if we did, or 0 if * we chose not to log anything. */ -int +static int inform_testing_reachability(void) { char dirbuf[128]; diff --git a/src/or/config.c b/src/or/config.c index a8e185fa6f..69217df622 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3171,7 +3171,7 @@ init_libevent(void) */ suppress_libevent_log_msg("Function not implemented"); #ifdef __APPLE__ - putenv("EVENT_NOKQUEUE=1"); + setenv("EVENT_NOKQUEUE","1",1); #endif event_init(); suppress_libevent_log_msg(NULL); diff --git a/src/or/dirserv.c b/src/or/dirserv.c index d34186a4bb..d916922f73 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -554,7 +554,8 @@ list_server_status(smartlist_t *routers, char **router_status_out) return 0; } -int +/* DOCDOC */ +static int _compare_tor_version_str_ptr(const void **_a, const void **_b) { const char *a = *_a, *b = *_b; @@ -695,7 +696,7 @@ dirserv_dump_directory_to_string(char **dir_out, static cached_dir_t the_directory = { NULL, NULL, 0, 0, 0 }; /* Used only by non-auth dirservers: The directory and runningrouters we'll -* serve when requested. */ + * serve when requested. */ static cached_dir_t cached_directory = { NULL, NULL, 0, 0, 0 }; static cached_dir_t cached_runningrouters = { NULL, NULL, 0, 0, 0 };