[140636] trunk/base/src/pextlib1.0/tracelib.c

cal at macports.org cal at macports.org
Mon Sep 28 13:33:13 PDT 2015


Revision: 140636
          https://trac.macports.org/changeset/140636
Author:   cal at macports.org
Date:     2015-09-28 13:33:13 -0700 (Mon, 28 Sep 2015)
Log Message:
-----------
base: tracelib: Cleanup printf format specifiers

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/tracelib.c

Modified: trunk/base/src/pextlib1.0/tracelib.c
===================================================================
--- trunk/base/src/pextlib1.0/tracelib.c	2015-09-28 20:12:42 UTC (rev 140635)
+++ trunk/base/src/pextlib1.0/tracelib.c	2015-09-28 20:33:13 UTC (rev 140636)
@@ -5,7 +5,7 @@
  * $Id$
  *
  * Copyright (c) 2007-2008 Eugene Pimenov (GSoC)
- * Copyright (c) 2008-2010, 2012-2013 The MacPorts Project
+ * Copyright (c) 2008-2010, 2012-2013, 2014-2015 The MacPorts Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <pthread.h>
 #include <stdarg.h>
@@ -303,13 +304,13 @@
         } else if (ret == 0) {
             /* this usually means the socket was closed by the remote side */
         } else {
-            fprintf(stderr, "tracelib: partial data received: expected %ld, but got %ld on socket %d\n", (unsigned long) sizeof(len), (unsigned long) ret, sock);
+            fprintf(stderr, "tracelib: partial data received: expected %zu, but got %zd on socket %d\n", sizeof(len), ret, sock);
         }
         return 0;
     }
 
     if (len > BUFSIZE - 1) {
-        fprintf(stderr, "tracelib: transfer too large: %ld bytes sent, but buffer holds %d on socket %d\n", (unsigned long) len, (int) (BUFSIZE - 1), sock);
+        fprintf(stderr, "tracelib: transfer too large: %" PRIu32 " bytes sent, but buffer holds %d on socket %d\n", len, BUFSIZE - 1, sock);
         return 0;
     }
 
@@ -317,7 +318,7 @@
         if (ret < 0) {
             perror("tracelib: recv");
         } else {
-            fprintf(stderr, "tracelib: partial data received: expected %ld, but got %ld on socket %d\n", (unsigned long) len, (unsigned long) ret, sock);
+            fprintf(stderr, "tracelib: partial data received: expected %" PRIu32 ", but got %zd on socket %d\n", len, ret, sock);
         }
         return 0;
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150928/c9de8bab/attachment.html>


More information about the macports-changes mailing list