]> granicus.if.org Git - gc/commitdiff
Fix printf format specifiers in extra files
authorIvan Maidanski <ivmai@mail.ru>
Thu, 29 Sep 2016 21:53:23 +0000 (00:53 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 29 Sep 2016 21:53:23 +0000 (00:53 +0300)
(to eliminate cppcheck warnings)

* extra/MacOS.c (GC_MacFreeTemporaryMemory): Cast GC_gc_no to unsigned
long, and adjust fprintf format specifier appropriately.
* extra/msvc_dbg.c (GetDescriptionFromAddress): Cast line_number to
int when passed to wsprintf() to match format specifier.

extra/MacOS.c
extra/msvc_dbg.c

index 13e239d416c7c22ba98b45c43c60ea595de2a1c6..57c224826c07ffc1b5f2d98a7a29a355cfcd0d7f 100644 (file)
@@ -133,7 +133,8 @@ void GC_MacFreeTemporaryMemory()
           if (GC_print_stats) {
             fprintf(stdout, "[total memory used:  %ld bytes.]\n",
                   totalMemoryUsed);
-            fprintf(stdout, "[total collections:  %ld.]\n", GC_gc_no);
+            fprintf(stdout, "[total collections: %lu]\n",
+                    (unsigned long)GC_gc_no);
           }
 #       endif
     }
index ea7fc7b6c3cf418a54abfae716aa839e7a03cdb7..abf4671781d98a7524c911a0fdfce691103ca94f 100644 (file)
@@ -317,7 +317,7 @@ size_t GetDescriptionFromAddress(void* address, const char* format,
   size = (GC_ULONG_PTR)end < (GC_ULONG_PTR)buffer ? 0 : end - buffer;
 
   if (line_number) {
-    wsprintf(str, "(%d) : ", line_number);
+    wsprintf(str, "(%d) : ", (int)line_number);
     if (size) {
       strncpy(buffer, str, size)[size - 1] = 0;
     }