ソースを参照

Clean up a few warnings that make gcc twig out a bit.

svn:r5062
Nick Mathewson 20 年 前
コミット
922cee3d0c
4 ファイル変更11 行追加5 行削除
  1. 6 1
      src/common/compat.c
  2. 1 1
      src/or/circuitbuild.c
  3. 1 1
      src/or/config.c
  4. 3 2
      src/or/dirserv.c

+ 6 - 1
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 {

+ 1 - 1
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];

+ 1 - 1
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);

+ 3 - 2
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 };