From: Nick Mathewson Date: Fri, 10 Aug 2007 15:59:31 +0000 (+0000) Subject: r14498@catbus: nickm | 2007-08-10 11:58:32 -0400 X-Git-Tag: release-2.0.1-alpha~599 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21a7e7ed67979b9f2444f4671d9bd668ef2ebabf;p=libevent r14498@catbus: nickm | 2007-08-10 11:58:32 -0400 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 --- diff --git a/sample/time-test.c b/sample/time-test.c index f0f93995..073d6ff1 100644 --- a/sample/time-test.c +++ b/sample/time-test.c @@ -13,9 +13,8 @@ #ifndef WIN32 #include #include -#else -#include #endif +#include #ifdef HAVE_SYS_TIME_H #include #endif diff --git a/test/Makefile.am b/test/Makefile.am index 840e5f33..39849fca 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 diff --git a/test/regress.c b/test/regress.c index bdfc9062..77742457 100644 --- a/test/regress.c +++ b/test/regress.c @@ -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");