[xiph-commits] r3432 - in liboggz/trunk: . src/examples src/tests src/tools

erikd at svn.annodex.net erikd at svn.annodex.net
Sat Feb 9 04:22:19 PST 2008


Author: erikd
Date: 2008-02-09 04:22:17 -0800 (Sat, 09 Feb 2008)
New Revision: 3432

Modified:
   liboggz/trunk/configure.ac
   liboggz/trunk/src/examples/read-io.c
   liboggz/trunk/src/tests/seek-stress.c
   liboggz/trunk/src/tools/oggz-sort.c
   liboggz/trunk/src/tools/oggz-validate.c
   liboggz/trunk/src/tools/oggzdump.c
   liboggz/trunk/src/tools/oggzmerge.c
Log:
Fix a bunch of x86-64 compiler warnings.

Modified: liboggz/trunk/configure.ac
===================================================================
--- liboggz/trunk/configure.ac	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/configure.ac	2008-02-09 12:22:17 UTC (rev 3432)
@@ -244,7 +244,7 @@
     OGGZ_OFF_MAX="0x7FFFFFFF"
     PRI_OGGZ_OFF_T="l"
 elif test $SIZEOF_OGGZ_OFF_T = 8 ; then
-    PRI_OGGZ_OFF_T="q"
+    PRI_OGGZ_OFF_T=PRId64
 fi
 
 dnl The following configured variables are written into the public header

Modified: liboggz/trunk/src/examples/read-io.c
===================================================================
--- liboggz/trunk/src/examples/read-io.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/examples/read-io.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -30,10 +30,18 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <oggz/oggz.h>
 
+#ifdef HAVE_INTTYPES_H
+#  include <inttypes.h>
+#else
+#  define PRId64 "I64d"
+#endif
+
 static int got_an_eos = 0;
 
 static int
@@ -47,12 +55,12 @@
 #endif
 
   if (op->b_o_s) {
-    printf ("%010ld: [%lld] BOS %8s\n", serialno, op->granulepos, op->packet);
+    printf ("%010ld: [%" PRId64 "] BOS %8s\n", serialno, op->granulepos, op->packet);
   }
 
   if (op->e_o_s) {
     got_an_eos = 1;
-    printf ("%010ld: [%lld] EOS\n", serialno, op->granulepos);
+    printf ("%010ld: [%" PRId64 "] EOS\n", serialno, op->granulepos);
   }
 
   return 0;
@@ -113,11 +121,11 @@
   while ((n = oggz_read (oggz, 1024)) > 0);
 
   units = oggz_tell_units (oggz);
-  printf ("Total length: %lld ms\n", units);
+  printf ("Total length: %" PRId64 " ms\n", units);
 
   oggz_seek_units (oggz, units/2, SEEK_SET);
 
-  printf ("seeked to byte offset %lld\n", oggz_tell (oggz));
+  printf ("seeked to byte offset %" PRId64 "\n", oggz_tell (oggz));
 
   while ((n = oggz_read (oggz, 1024)) > 0);
 

Modified: liboggz/trunk/src/tests/seek-stress.c
===================================================================
--- liboggz/trunk/src/tests/seek-stress.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/tests/seek-stress.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -30,9 +30,18 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#ifdef HAVE_INTTYPES_H
+#  include <inttypes.h>
+#else
+#  define PRId64 "I64d"
+#endif
+
 #include <oggz/oggz.h>
 
 #include "oggz_tests.h"
@@ -64,13 +73,13 @@
   ogg_int64_t result, diff;
 
   if (verbose)
-    printf ("\tAttempt seek to %lld ms:\n", units);
+    printf ("\tAttempt seek to %" PRId64 " ms:\n", units);
 
   result = oggz_seek_units (oggz, units, SEEK_SET);
   diff = result - units;
 
   if (verbose)
-    printf ("\t%0" PRI_OGGZ_OFF_T "x: %lld ms (%+lld ms)\n",
+    printf ("\t%0" PRId64 "x: %" PRId64 " ms (%+" PRId64 " ms)\n",
 	    oggz_tell (oggz), oggz_tell_units (oggz), diff);
 
   if (result < 0) {
@@ -124,7 +133,7 @@
   
   max_units = oggz_seek_units (oggz, 0, SEEK_END);
   if (verbose)
-    printf ("\t%0" PRI_OGGZ_OFF_T "x: %lld ms\n",
+    printf ("\t%0" PRId64 "x: %" PRId64 " ms\n",
             oggz_tell (oggz), oggz_tell_units (oggz));
 
   try_seek_units (oggz, max_units / 2);

Modified: liboggz/trunk/src/tools/oggz-sort.c
===================================================================
--- liboggz/trunk/src/tools/oggz-sort.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/tools/oggz-sort.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -269,7 +269,7 @@
 	  if (osdata->verbose) {
 	    ot_fprint_time (stdout, (double)units/1000);
 	    printf (": Got index %d serialno %010d %lld units: ",
-		    i, ogg_page_serialno ((ogg_page *)input->og), units);
+		    i, ogg_page_serialno ((ogg_page *)input->og), (long long) units);
 	  }
 
 	  if (min_units == -1 || units == 0 ||

Modified: liboggz/trunk/src/tools/oggz-validate.c
===================================================================
--- liboggz/trunk/src/tools/oggz-validate.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/tools/oggz-validate.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -30,12 +30,20 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <getopt.h>
 #include <errno.h>
 
+#ifdef HAVE_INTTYPES_H
+#  include <inttypes.h>
+#else
+#  define PRId64 "I64d"
+#endif
+
 #include <oggz/oggz.h>
 
 #include "oggz_tools.h"
@@ -192,7 +200,7 @@
 
   if(gpos != -1 && ogg_page_packets((ogg_page *)og) == 0) {
     ret = log_error ();
-    fprintf (stderr, "serialno %010ld: granulepos %lld on page with no completed packets, must be -1\n", serialno, gpos);
+    fprintf (stderr, "serialno %010ld: granulepos %" PRId64 " on page with no completed packets, must be -1\n", serialno, gpos);
   }
 
   return ret;
@@ -286,7 +294,7 @@
   if ((feed_err = oggz_write_feed (ovdata->writer, op, serialno, flush, NULL)) != 0) {
     ret = log_error ();
     if (timestamp == -1.0) {
-      fprintf (stderr, "%" PRI_OGGZ_OFF_T "d", oggz_tell (oggz));
+      fprintf (stderr, "%" PRId64 , oggz_tell (oggz));
     } else {
       ot_fprint_time (stderr, (double)timestamp/SUBSECONDS);
     }

Modified: liboggz/trunk/src/tools/oggzdump.c
===================================================================
--- liboggz/trunk/src/tools/oggzdump.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/tools/oggzdump.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -246,7 +246,7 @@
   } else {
     units = oggz_tell_units (oggz);
     if (units == -1) {
-      fprintf (outfile, "%0" PRI_OGGZ_OFF_T "x", oggz_tell (oggz));
+      fprintf (outfile, "%" PRId64 "x", oggz_tell (oggz));
     } else {
       time_offset = (double)units / 1000.0;
       ot_fprint_time (outfile, time_offset);
@@ -392,12 +392,12 @@
       line_offset = 0;
 
     is_packetinfo = 0;
-    if (sscanf (&line[line_offset], "%x: serialno %ld, granulepos %lld, packetno %lld%n",
+    if (sscanf (&line[line_offset], "%x: serialno %ld, granulepos %" PRId64 ", packetno %" PRId64 "%n",
 		&offset, &serialno, &granulepos, &packetno,
 		&line_offset) >= 4) {
       is_packetinfo = 1;
     } else {
-      if (sscanf (&line[line_offset], "%x: serialno %ld, granulepos %lld|%lld, packetno %lld%n",
+      if (sscanf (&line[line_offset], "%x: serialno %ld, granulepos %" PRId64 "%" PRId64 ", packetno %" PRId64 "%n",
 		  &offset, &serialno, &iframe, &pframe, &packetno,
 		  &line_offset) >= 5) {
 	int granuleshift = oggz_get_granuleshift (oggz, serialno);

Modified: liboggz/trunk/src/tools/oggzmerge.c
===================================================================
--- liboggz/trunk/src/tools/oggzmerge.c	2008-02-09 11:59:13 UTC (rev 3431)
+++ liboggz/trunk/src/tools/oggzmerge.c	2008-02-09 12:22:17 UTC (rev 3432)
@@ -40,6 +40,12 @@
 #include <getopt.h>
 #include <errno.h>
 
+#ifdef HAVE_INTTYPES_H
+#  include <inttypes.h>
+#else
+#  define PRId64 "I64d"
+#endif
+
 #include <oggz/oggz.h>
 #include "oggz_tools.h"
 
@@ -271,7 +277,7 @@
 
 	  if (omdata->verbose) {
 	    ot_fprint_time (stdout, (double)units/1000);
-	    printf (": Got index %d serialno %010d %lld units: ",
+	    printf (": Got index %d serialno %010d %" PRId64 " units: ",
 		    i, ogg_page_serialno ((ogg_page *)input->og), units);
 	  }
 



More information about the commits mailing list