libctf: eschew %zi format specifier
authorNick Alcock <nick.alcock@oracle.com>
Wed, 5 Jun 2019 12:34:36 +0000 (13:34 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 5 Jun 2019 12:34:36 +0000 (13:34 +0100)
Too many platforms don't support it, and we can always safely use %lu or
%li anyway, because the only uses are in debugging output.

libctf/
* ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
(ctf_arc_open_by_offset): Likewise.
* ctf-create.c (ctf_add_type): Likewise.

libctf/ChangeLog
libctf/ctf-archive.c
libctf/ctf-create.c

index 7fb72318b57d2efac51aa4ec55fb0f91d6d6ac8b..6b0a425353c96f680ed6b4a38f02f0f363411aca 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-05  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
+       (ctf_arc_open_by_offset): Likewise.
+       * ctf-create.c (ctf_add_type): Likewise.
+
 2019-06-04  Tom Tromey  <tromey@adacore.com>
 
        * ctf-create.c (ctf_add_encoded, ctf_add_slice)
index 90cd020b781bdd23d43ebd8c721fce46db5e36bb..24144937a707a3b07c7128d80352c4db2b91cc0c 100644 (file)
@@ -68,7 +68,8 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
   off_t nameoffs;
   struct ctf_archive_modent *modent;
 
-  ctf_dprintf ("Writing archive %s with %zi files\n", file, ctf_file_cnt);
+  ctf_dprintf ("Writing archive %s with %lu files\n", file,
+              (unsigned long) ctf_file_cnt);
 
   if ((fd = open (file, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0666)) < 0)
     {
@@ -82,7 +83,7 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
      uint64_t's.  */
   headersz = sizeof (struct ctf_archive)
     + (ctf_file_cnt * sizeof (uint64_t) * 2);
-  ctf_dprintf ("headersz is %zi\n", headersz);
+  ctf_dprintf ("headersz is %lu\n", (unsigned long) headersz);
 
   /* From now on we work in two pieces: an mmap()ed region from zero up to the
      headersz, and a region updated via write() starting after that, containing
@@ -510,7 +511,7 @@ ctf_arc_open_by_offset (const struct ctf_archive *arc,
   ctf_sect_t ctfsect;
   ctf_file_t *fp;
 
-  ctf_dprintf ("ctf_arc_open_by_offset(%zi): opening\n", offset);
+  ctf_dprintf ("ctf_arc_open_by_offset(%lu): opening\n", (unsigned long) offset);
 
   memset (&ctfsect, 0, sizeof (ctf_sect_t));
 
index 356d51295f57777163ca5c092d17876bfff8e5cb..5bcc36eff811f9755e1f29bf41d0dcb35e5edd02 100644 (file)
@@ -1822,9 +1822,10 @@ ctf_add_type (ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type)
                ctf_type_size (dst_fp, dst_type))
              {
                ctf_dprintf ("Conflict for type %s against ID %lx: "
-                            "union size differs, old %zi, new %zi\n",
-                            name, dst_type, ctf_type_size (src_fp, src_type),
-                            ctf_type_size (dst_fp, dst_type));
+                            "union size differs, old %li, new %li\n",
+                            name, dst_type,
+                            (long) ctf_type_size (src_fp, src_type),
+                            (long) ctf_type_size (dst_fp, dst_type));
                return (ctf_set_errno (dst_fp, ECTF_CONFLICT));
              }
 
This page took 0.030282 seconds and 4 git commands to generate.