fixed some compiler warnings

Sun, 04 Nov 2012 20:50:12 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 04 Nov 2012 20:50:12 +0100
changeset 75
990734f548ef
parent 74
dc8bade7f2a3
child 76
655020a30e77

fixed some compiler warnings

test/logging_tests.c file | annotate | diff | comparison | revisions
ucx/mempool.c file | annotate | diff | comparison | revisions
--- a/test/logging_tests.c	Fri Oct 12 12:46:54 2012 +0200
+++ b/test/logging_tests.c	Sun Nov 04 20:50:12 2012 +0100
@@ -15,9 +15,9 @@
     ucx_logger_trace(logger, ST("[TRACE:] dont log this!\n"));
     ucx_logger_error(logger, ST("[ERROR:] error!\n"));
     fseek(stream, 0, SEEK_SET);
-    fread(buffer, 1, 100, stream);
+    int r = fread(buffer, 1, 100, stream);
 
-    UCX_TEST_ASSERT(strncmp(buffer,
+    UCX_TEST_ASSERT(r == 33 && strncmp(buffer,
             "[INFO:] allright\n[ERROR:] error!\n", 33) == 0, "incorrect logs");
 
     UCX_TEST_END
--- a/ucx/mempool.c	Fri Oct 12 12:46:54 2012 +0200
+++ b/ucx/mempool.c	Sun Nov 04 20:50:12 2012 +0100
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <inttypes.h>
 
 #include "mempool.h"
 
@@ -84,7 +85,8 @@
                 return newm + sizeof(ucx_destructor);
             }
         }
-        fprintf(stderr, "FATAL: %8x not in mpool %8x\n", ptr, pool);
+        fprintf(stderr, "FATAL: 0x%08"PRIxPTR" not in mpool 0x%08"PRIxPTR"\n",
+          (intptr_t)ptr, (intptr_t)pool);
         exit(1);
     } else {
         return newm + sizeof(ucx_destructor);

mercurial