[tor-commits] [obfsproxy/master] Fix gcc 4.6.0 compilation warnings

nickm at torproject.org nickm at torproject.org
Wed Jun 1 15:56:43 UTC 2011


commit 1061249f51056278890e3e566774f2672ef1b031
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jun 1 11:56:37 2011 -0400

    Fix gcc 4.6.0 compilation warnings
---
 src/main.c                |    6 ++----
 src/test/unittest_obfs2.c |    2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 4c3c48c..8af4934 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,7 +44,7 @@ int
 main(int argc, const char **argv)
 {
   int protocol;
-  int is_client, is_socks = 0, mode;
+  int is_socks = 0, mode;
   struct sockaddr_storage ss_listen, ss_target;
   struct sockaddr *sa_target=NULL;
   int sl_listen, sl_target=0;
@@ -59,16 +59,13 @@ main(int argc, const char **argv)
   if (argc < 4)
     usage();
   if (!strcmp(argv[1], "client")) {
-    is_client = 1;
     defport = "48988"; /* bf5c */
     mode = LSN_SIMPLE_CLIENT;
   } else if (!strcmp(argv[1], "socks")) {
-    is_client = 1;
     is_socks = 1;
     defport = "23548"; /* 5bf5 */
     mode = LSN_SOCKS_CLIENT;
   } else if (!strcmp(argv[1], "server")) {
-    is_client = 0;
     defport = "11253"; /* 2bf5 */
     mode = LSN_SIMPLE_SERVER;
   } else {
@@ -122,6 +119,7 @@ main(int argc, const char **argv)
   /* Handle signals */
   signal(SIGPIPE, SIG_IGN);
   sigevent = evsignal_new(base, SIGINT, handle_signal_cb, (void*) base);
+  event_add(sigevent, NULL);
 
   /* start an evconnlistener on the appropriate port(s) */
   listener = listener_new(base,
diff --git a/src/test/unittest_obfs2.c b/src/test/unittest_obfs2.c
index b04040d..0de4766 100644
--- a/src/test/unittest_obfs2.c
+++ b/src/test/unittest_obfs2.c
@@ -207,6 +207,8 @@ test_proto_transfer(void *data)
   n = evbuffer_peek(dummy_buffer, -1, NULL, &v[1], 2);
   tt_int_op(0, ==, strncmp(msg2, v[1].iov_base, 55));
 
+  (void) n; /* XXXX: use n for something, or remove it. */
+
  end:
   if (client_proto->state)
     proto_destroy(client_proto);



More information about the tor-commits mailing list