]> granicus.if.org Git - libevent/commitdiff
r14498@catbus: nickm | 2007-08-10 11:58:32 -0400
authorNick Mathewson <nickm@torproject.org>
Fri, 10 Aug 2007 15:59:31 +0000 (15:59 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 10 Aug 2007 15:59:31 +0000 (15:59 +0000)
 Fix compilation warnings in trunk on linux with gcc 4.1.2.  In time-test.c, always include time.h, so that time() is defined.  In test/Makefile.am, put -I../compat in CPPFLAGS, and fix a typo.  In test/regress.c, cast unsigned char pointers to char* before passing them to str[n]cmp.

svn:r385

sample/time-test.c
test/Makefile.am
test/regress.c

index f0f93995124cdc41483625195ea2d9be0b6e5ca2..073d6ff1dd4bd14743602a835db68e7328960a99 100644 (file)
@@ -13,9 +13,8 @@
 #ifndef WIN32
 #include <sys/queue.h>
 #include <unistd.h>
-#else
-#include <time.h>
 #endif
+#include <time.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
index 840e5f33ff9cbe4fffe3a291193553b09a6d70a3..39849fca6e0c47056ee54edac0a62a5c3e0433ae 100644 (file)
@@ -1,8 +1,7 @@
 AUTOMAKE_OPTIONS = foreign no-dependencies
 
 LDADD = ../libevent.la
-CPPFPLAGS = -I.. 
-CFLAGS = -I../compat @CFLAGS@
+CPPFLAGS = -I.. -I../compat
 
 EXTRA_DIST = regress.rpc
 
index bdfc9062066f4a5818d1decc928bd7294a5209cd..77742457f2943a98ff07f16979387af3b126843d 100644 (file)
@@ -599,7 +599,7 @@ test_evbuffer(void) {
        evbuffer_add_printf(evb, "%s/%d", "hello", 1);
 
        if (EVBUFFER_LENGTH(evb) == 7 &&
-           strcmp(EVBUFFER_DATA(evb), "hello/1") == 0)
+           strcmp((char*)EVBUFFER_DATA(evb), "hello/1") == 0)
            test_ok = 1;
        
        cleanup_test();
@@ -650,7 +650,7 @@ test_evbuffer_find(void)
        /* simple test for match at end of allocated buffer */
        fprintf(stdout, "Testing evbuffer_find 3: ");
        p = evbuffer_find(buf, (u_char *)"ax", 2);
-       if (p != NULL && strncmp(p, "ax", 2) == 0) {
+       if (p != NULL && strncmp((char*)p, "ax", 2) == 0) {
                printf("OK\n");
        } else {
                fprintf(stdout, "FAILED\n");