[libxml2] Fix format string warnings



commit c2545cbb6d9a87e3e0bce167eabcb8f3c9153edc
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Aug 22 11:44:18 2016 +0200

    Fix format string warnings
    
    Also fixes bug #768199:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768199

 runtest.c    |    2 +-
 testlimits.c |    9 +++++----
 timsort.h    |    2 +-
 xmlIO.c      |    2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/runtest.c b/runtest.c
index 1861577..b2ce693 100644
--- a/runtest.c
+++ b/runtest.c
@@ -688,7 +688,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) {
     }
     if (info.st_size != size) {
         fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n",
-               filename, info.st_size, size);
+               filename, (long) info.st_size, size);
         return(-1);
     }
     fd = open(filename, RD_FLAGS);
diff --git a/testlimits.c b/testlimits.c
index 577f593..68c94db 100644
--- a/testlimits.c
+++ b/testlimits.c
@@ -1284,13 +1284,14 @@ saxTest(const char *filename, size_t limit, int options, int fail) {
         if (fail)
             res = 0;
         else {
-            fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit);
+            fprintf(stderr, "Failed to parse '%s' %lu\n", filename,
+                    (unsigned long) limit);
             res = 1;
         }
     } else {
         if (fail) {
             fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                    filename, limit);
+                    filename, (unsigned long) limit);
             res = 1;
         } else
             res = 0;
@@ -1339,7 +1340,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to parse '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long) limit);
             res = 1;
         }
     } else {
@@ -1349,7 +1350,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long) limit);
             res = 1;
         } else
             res = 0;
diff --git a/timsort.h b/timsort.h
index 795f272..9369e7c 100644
--- a/timsort.h
+++ b/timsort.h
@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
     SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
     if (tempstore == NULL)
     {
-      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * 
new_size);
+      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", (unsigned long) 
(sizeof(SORT_TYPE) * new_size));
       exit(1);
     }
     store->storage = tempstore;
diff --git a/xmlIO.c b/xmlIO.c
index 1a79c09..300ee47 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -1674,7 +1674,7 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) {
        xmlStrPrintf(msg, 500,
                    "xmlZMemBuffExtend:  %s %lu bytes.\n",
                    "Allocation failure extending output buffer to",
-                   new_size );
+                   (unsigned long) new_size );
        xmlIOErr(XML_IO_WRITE, (const char *) msg);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]