[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix some compiler warnings



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv10533/src/or

Modified Files:
	dirserv.c routerlist.c test.c 
Log Message:
Fix some compiler warnings

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -d -r1.240 -r1.241
--- dirserv.c	22 Sep 2005 06:34:29 -0000	1.240
+++ dirserv.c	23 Sep 2005 17:11:20 -0000	1.241
@@ -364,10 +364,10 @@
 authdir_wants_to_reject_router(routerinfo_t *ri,
                                const char **msg)
 {
-  tor_assert(msg);
   /* Okay.  Now check whether the fingerprint is recognized. */
   router_status_t status = dirserv_router_get_status(ri, msg);
   time_t now;
+  tor_assert(msg);
   if (status == FP_REJECT)
     return -1; /* msg is already set. */
 

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.309
retrieving revision 1.310
diff -u -d -r1.309 -r1.310
--- routerlist.c	22 Sep 2005 20:51:45 -0000	1.309
+++ routerlist.c	23 Sep 2005 17:11:20 -0000	1.310
@@ -2553,3 +2553,4 @@
     rs->next_attempt_at = 0;
   });
 }
+

Index: test.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/test.c,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- test.c	21 Sep 2005 00:41:06 -0000	1.204
+++ test.c	23 Sep 2005 17:11:20 -0000	1.205
@@ -1367,34 +1367,36 @@
   test_eq(IS_NOT_CVS, ver1.cvs);
   test_streq("", ver1.status_tag);
 
+#define test_eq_vs(vs1, vs2) test_eq_type(version_status_t, "%d", (vs1), (vs2))
+
   /* make sure tor_version_is_obsolete() works */
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "Tor 0.0.2"));
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2, Tor 0.0.3"));
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2,Tor 0.0.3"));
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.3,BetterTor 0.0.1"));
-  test_eq(VS_RECOMMENDED,tor_version_is_obsolete("0.0.2", "Tor 0.0.2,Tor 0.0.3"));
-  test_eq(VS_NEW_IN_SERIES,
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "Tor 0.0.2"));
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2, Tor 0.0.3"));
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2,Tor 0.0.3"));
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.3,BetterTor 0.0.1"));
+  test_eq_vs(VS_RECOMMENDED,tor_version_is_obsolete("0.0.2", "Tor 0.0.2,Tor 0.0.3"));
+  test_eq_vs(VS_NEW_IN_SERIES,
           tor_version_is_obsolete("0.0.2", "Tor 0.0.2pre1,Tor 0.0.3"));
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.2", "Tor 0.0.2.1,Tor 0.0.3"));
-  test_eq(VS_NEW, tor_version_is_obsolete("0.1.0", "Tor 0.0.2,Tor 0.0.3"));
-  test_eq(VS_RECOMMENDED,
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.2", "Tor 0.0.2.1,Tor 0.0.3"));
+  test_eq_vs(VS_NEW, tor_version_is_obsolete("0.1.0", "Tor 0.0.2,Tor 0.0.3"));
+  test_eq_vs(VS_RECOMMENDED,
           tor_version_is_obsolete("0.0.7rc2", "0.0.7,Tor 0.0.7rc2,Tor 0.0.8"));
-  test_eq(VS_OLD, tor_version_is_obsolete("0.0.5.0", "0.0.5.1-cvs"));
-  test_eq(VS_NEW_IN_SERIES, tor_version_is_obsolete("0.0.5.1-cvs", "0.0.5"));
+  test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.5.0", "0.0.5.1-cvs"));
+  test_eq_vs(VS_NEW_IN_SERIES, tor_version_is_obsolete("0.0.5.1-cvs", "0.0.5"));
   /* Not on list, but newer than any in same series. */
-  test_eq(VS_NEW_IN_SERIES,
+  test_eq_vs(VS_NEW_IN_SERIES,
        tor_version_is_obsolete("0.1.0.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
   /* Series newer than any on list. */
-  test_eq(VS_NEW,
+  test_eq_vs(VS_NEW,
        tor_version_is_obsolete("0.1.2.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
   /* Series older than any on list. */
-  test_eq(VS_OLD,
+  test_eq_vs(VS_OLD,
        tor_version_is_obsolete("0.0.1.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
   /* Not on list, not newer than any on same series. */
-  test_eq(VS_UNRECOMMENDED,
+  test_eq_vs(VS_UNRECOMMENDED,
        tor_version_is_obsolete("0.1.0.1", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
   /* On list, not newer than any on same series. */
-  test_eq(VS_UNRECOMMENDED,
+  test_eq_vs(VS_UNRECOMMENDED,
        tor_version_is_obsolete("0.1.0.1", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
 
   test_eq(0, tor_version_as_new_as("Tor 0.0.5", "0.0.9pre1-cvs"));