]> granicus.if.org Git - libevent/commitdiff
Fix a number of warnings from gcc -pedantic
authorNick Mathewson <nickm@torproject.org>
Sat, 23 Jan 2010 21:38:36 +0000 (16:38 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 23 Jan 2010 21:38:36 +0000 (16:38 -0500)
bufferevent-internal.h
evutil.c
include/event2/rpc.h
test/regress.c
test/regress_rpc.c
test/test-ratelim.c
util-internal.h

index eca52e77340413a00dbe241c544bd48de1c04942..90fce0b04006bf0d263d7715fb42af2917894347 100644 (file)
@@ -173,7 +173,7 @@ struct bufferevent_private {
 enum bufferevent_ctrl_op {
        BEV_CTRL_SET_FD,
        BEV_CTRL_GET_FD,
-       BEV_CTRL_GET_UNDERLYING,
+       BEV_CTRL_GET_UNDERLYING
 };
 
 /** Possible data types for a control callback */
index c75c8471b3f1e49a5b4dc881c3af25b68c6518d5..af673b253a07521eef3f52d3b215734b3dbac8d5 100644 (file)
--- a/evutil.c
+++ b/evutil.c
@@ -1743,7 +1743,7 @@ const ev_uint32_t EVUTIL_ISUPPER_TABLE[8] = { 0, 0, 0x7fffffe, 0, 0, 0, 0, 0 };
 const ev_uint32_t EVUTIL_ISLOWER_TABLE[8] = { 0, 0, 0, 0x7fffffe, 0, 0, 0, 0 };
 /* Upper-casing and lowercasing tables to map characters to upper/lowercase
  * equivalents. */
-const char EVUTIL_TOUPPER_TABLE[256] = {
+const unsigned char EVUTIL_TOUPPER_TABLE[256] = {
   0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
   32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
@@ -1761,7 +1761,7 @@ const char EVUTIL_TOUPPER_TABLE[256] = {
   224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
   240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
 };
-const char EVUTIL_TOLOWER_TABLE[256] = {
+const unsigned char EVUTIL_TOLOWER_TABLE[256] = {
   0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
   32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
index 2858de8091ed5c91daac6e56af422845535b2680..ad18e4c346e877eb6b88ad79d3554a5a555aa531 100644 (file)
@@ -467,7 +467,7 @@ enum EVRPC_HOOK_TYPE {
 enum EVRPC_HOOK_RESULT {
        EVRPC_TERMINATE = -1,   /**< indicates the rpc should be terminated */
        EVRPC_CONTINUE = 0,     /**< continue processing the rpc */
-       EVRPC_PAUSE = 1,        /**< pause processing request until resumed */
+       EVRPC_PAUSE = 1         /**< pause processing request until resumed */
 };
 
 /** adds a processing hook to either an rpc base or rpc pool
index f34890a143b1f43fe30079f7030d0553b51a99fb..74c3b9c13c072819ed01f8097d5767975bdc0529 100644 (file)
@@ -1526,7 +1526,7 @@ evtag_fuzz(void *ptr)
        evtag_marshal_timeval(tmp, 0, &tv);
        evbuffer_add(tmp, buffer, sizeof(buffer));
 
-       ((char *)EVBUFFER_DATA(tmp))[1] = 0xff;
+       ((char *)EVBUFFER_DATA(tmp))[1] = '\xff';
        if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1) {
                 tt_abort_msg("evtag_unmarshal_timeval should have failed");
        }
index 73462c65291d32b2a3793af6fdf59ca14d34e198..c74b863b3de2a8657ac2993151d07f715b67e80a 100644 (file)
@@ -84,11 +84,11 @@ http_setup(short *pport)
        return (myhttp);
 }
 
-EVRPC_HEADER(Message, msg, kill);
-EVRPC_HEADER(NeverReply, msg, kill);
+EVRPC_HEADER(Message, msg, kill)
+EVRPC_HEADER(NeverReply, msg, kill)
 
-EVRPC_GENERATE(Message, msg, kill);
-EVRPC_GENERATE(NeverReply, msg, kill);
+EVRPC_GENERATE(Message, msg, kill)
+EVRPC_GENERATE(NeverReply, msg, kill)
 
 static int need_input_hook = 0;
 static int need_output_hook = 0;
index a26d00e1a5cbfb1ebd3dba3020e5e20492be82af..ed3d41aba90d7194a1b9435be560b913d6f6868d 100644 (file)
@@ -213,16 +213,16 @@ test_ratelimiting(void)
                total_received += states[i].received;
                total_persec += persec;
                total_sq_persec += persec*persec;
-               printf("%d: %lf per second\n", i, persec);
+               printf("%d: %f per second\n", i, persec);
        }
-       printf("   total: %lf per second\n",
+       printf("   total: %f per second\n",
            ((double)total_received)/cfg_duration);
-       printf(" average: %lf per second\n",
+       printf(" average: %f per second\n",
            (((double)total_received)/cfg_duration)/cfg_n_connections);
 
        variance = total_sq_persec/cfg_n_connections - total_persec*total_persec/(cfg_n_connections*cfg_n_connections);
 
-       printf("  stddev: %lf per second\n", sqrt(variance));
+       printf("  stddev: %f per second\n", sqrt(variance));
 }
 
 static struct option {
@@ -275,7 +275,8 @@ usage(void)
 "Pushes bytes through a number of possibly rate-limited connections, and\n"
 "displays average throughput.\n\n"
 "  -n INT: Number of connections to open (default: 30)\n"
-"  -d INT: Duration of the test in seconds (default: 5 sec)\n"
+"  -d INT: Duration of the test in seconds (default: 5 sec)\n");
+       fprintf(stderr,
 "  -c INT: Connection-rate limit applied to each connection in bytes per second\n"
 "          (default: None.)\n"
 "  -g INT: Group-rate limit applied to sum of all usage in bytes per second\n"
index 5fcb86c869eee6e30c3c1287708125ada30099f3..8d1420fee91c32a9c12e19ef6dc368eb232b5e30 100644 (file)
@@ -113,10 +113,10 @@ DECLARE_CTYPE_FN(ISXDIGIT)
 DECLARE_CTYPE_FN(ISPRINT)
 DECLARE_CTYPE_FN(ISLOWER)
 DECLARE_CTYPE_FN(ISUPPER)
-extern const char EVUTIL_TOUPPER_TABLE[];
-extern const char EVUTIL_TOLOWER_TABLE[];
-#define EVUTIL_TOLOWER(c) (EVUTIL_TOLOWER_TABLE[(ev_uint8_t)c])
-#define EVUTIL_TOUPPER(c) (EVUTIL_TOUPPER_TABLE[(ev_uint8_t)c])
+extern const unsigned char EVUTIL_TOUPPER_TABLE[];
+extern const unsigned char EVUTIL_TOLOWER_TABLE[];
+#define EVUTIL_TOLOWER(c) ((char)EVUTIL_TOLOWER_TABLE[(ev_uint8_t)c])
+#define EVUTIL_TOUPPER(c) ((char)EVUTIL_TOUPPER_TABLE[(ev_uint8_t)c])
 
 /** Helper macro.  If we know that a given pointer points to a field in a
     structure, return a pointer to the structure itself.  Used to implement