[xiph-commits] r2956 - in liboggz/trunk: include/oggz src/tests src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Sat Jun 16 03:24:34 PDT 2007


Author: conrad
Date: 2007-06-16 03:24:33 -0700 (Sat, 16 Jun 2007)
New Revision: 2956

Modified:
   liboggz/trunk/include/oggz/oggz_off_t.h
   liboggz/trunk/include/oggz/oggz_off_t.h.in
   liboggz/trunk/include/oggz/oggz_off_t_win32.h
   liboggz/trunk/src/tests/io-read-single.c
   liboggz/trunk/src/tests/io-read.c
   liboggz/trunk/src/tests/io-seek.c
   liboggz/trunk/src/tests/io-write-flush.c
   liboggz/trunk/src/tests/io-write.c
   liboggz/trunk/src/tests/oggz_tests.h
   liboggz/trunk/src/tests/read-generated.c
   liboggz/trunk/src/tests/read-stop-err.c
   liboggz/trunk/src/tests/read-stop-ok.c
   liboggz/trunk/src/tests/seek-stress.c
   liboggz/trunk/src/tools/oggz-scan.c
   liboggz/trunk/src/tools/oggz-validate.c
   liboggz/trunk/src/tools/oggzdump.c
Log:
fix PRI_OGGZ_OFF_T definition, use throughout tests and tools


Modified: liboggz/trunk/include/oggz/oggz_off_t.h
===================================================================
--- liboggz/trunk/include/oggz/oggz_off_t.h	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/include/oggz/oggz_off_t.h	2007-06-16 10:24:33 UTC (rev 2956)
@@ -69,9 +69,9 @@
 
 /* Note: This is an ugly fix for proper display in printf but will work for now */
 #if SIZEOF_OGGZ_OFF_T == 8
-#define PRI_OGGZ_OFF_T = "q"
+#define PRI_OGGZ_OFF_T "q"
 #else
-#define PRI_OGGZ_OFF_T = "l"
+#define PRI_OGGZ_OFF_T "l"
 #endif
 
 #endif /* __OGGZ_OFF_T__ */

Modified: liboggz/trunk/include/oggz/oggz_off_t.h.in
===================================================================
--- liboggz/trunk/include/oggz/oggz_off_t.h.in	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/include/oggz/oggz_off_t.h.in	2007-06-16 10:24:33 UTC (rev 2956)
@@ -69,9 +69,9 @@
 
 /* Note: This is an ugly fix for proper display in printf but will work for now */
 #if SIZEOF_OGGZ_OFF_T == 8
-#define PRI_OGGZ_OFF_T = "q"
+#define PRI_OGGZ_OFF_T "q"
 #else
-#define PRI_OGGZ_OFF_T = "l"
+#define PRI_OGGZ_OFF_T "l"
 #endif
 
 #endif /* __OGGZ_OFF_T__ */

Modified: liboggz/trunk/include/oggz/oggz_off_t_win32.h
===================================================================
--- liboggz/trunk/include/oggz/oggz_off_t_win32.h	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/include/oggz/oggz_off_t_win32.h	2007-06-16 10:24:33 UTC (rev 2956)
@@ -67,9 +67,9 @@
 
 /* Note: This is an ugly fix for proper display in printf but will work for now */
 #if SIZEOF_OGGZ_OFF_T == 8
-#define PRI_OGGZ_OFF_T = "q"
+#define PRI_OGGZ_OFF_T "q"
 #else
-#define PRI_OGGZ_OFF_T = "l"
+#define PRI_OGGZ_OFF_T "l"
 #endif
 
 #endif

Modified: liboggz/trunk/src/tests/io-read-single.c
===================================================================
--- liboggz/trunk/src/tests/io-read-single.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/io-read-single.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -86,7 +86,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/io-read.c
===================================================================
--- liboggz/trunk/src/tests/io-read.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/io-read.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -84,7 +84,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/io-seek.c
===================================================================
--- liboggz/trunk/src/tests/io-seek.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/io-seek.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -88,7 +88,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/io-write-flush.c
===================================================================
--- liboggz/trunk/src/tests/io-write-flush.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/io-write-flush.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -102,7 +102,7 @@
   newpage = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/io-write.c
===================================================================
--- liboggz/trunk/src/tests/io-write.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/io-write.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -84,7 +84,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/oggz_tests.h
===================================================================
--- liboggz/trunk/src/tests/oggz_tests.h	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/oggz_tests.h	2007-06-16 10:24:33 UTC (rev 2956)
@@ -41,14 +41,6 @@
 #  define PRId64 "I64d"
 #endif
 
-/* FIXME: on Mac OS X, off_t is 64-bits.  Obviously we want a nicer
- * way to do it than this, but a quick fix is a good fix */
-#ifdef __APPLE__
-#  define PRI_off_t "q"
-#else
-#  define PRI_off_t "l"
-#endif
-
 #define INFO(str) \
   { printf ("----  %s ...\n", (str)); }
 

Modified: liboggz/trunk/src/tests/read-generated.c
===================================================================
--- liboggz/trunk/src/tests/read-generated.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/read-generated.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -77,7 +77,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/read-stop-err.c
===================================================================
--- liboggz/trunk/src/tests/read-stop-err.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/read-stop-err.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -86,7 +86,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/read-stop-ok.c
===================================================================
--- liboggz/trunk/src/tests/read-stop-ok.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/read-stop-ok.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -84,7 +84,7 @@
   static long e_o_s = 0;
 
 #ifdef DEBUG
-  printf ("%08" PRI_off_t "x: serialno %010ld, "
+  printf ("%08" PRI_OGGZ_OFF_T "x: serialno %010ld, "
 	  "granulepos %" PRId64 ", packetno %" PRId64,
 	  oggz_tell (oggz), serialno, op->granulepos, op->packetno);
 

Modified: liboggz/trunk/src/tests/seek-stress.c
===================================================================
--- liboggz/trunk/src/tests/seek-stress.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tests/seek-stress.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -70,7 +70,7 @@
   diff = result - units;
 
   if (verbose)
-    printf ("\t%08lx: %lld ms (%+lld ms)\n",
+    printf ("\t%0" PRI_OGGZ_OFF_T "x: %lld ms (%+lld ms)\n",
 	    oggz_tell (oggz), oggz_tell_units (oggz), diff);
 
   if (result < 0) {
@@ -124,7 +124,8 @@
   
   max_units = oggz_seek_units (oggz, 0, SEEK_END);
   if (verbose)
-    printf ("\t%08lx: %lld ms\n", oggz_tell (oggz), oggz_tell_units (oggz));
+    printf ("\t%0" PRI_OGGZ_OFF_T "x: %lld ms\n",
+            oggz_tell (oggz), oggz_tell_units (oggz));
 
   try_seek_units (oggz, max_units / 2);
   try_seek_units (oggz, 0);

Modified: liboggz/trunk/src/tools/oggz-scan.c
===================================================================
--- liboggz/trunk/src/tools/oggz-scan.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tools/oggz-scan.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -118,14 +118,6 @@
   return OGGZ_CONTINUE;
 }
 
-/* FIXME: on Mac OS X, off_t is 64-bits.  Obviously we want a nicer
- * way to do it than this, but a quick fix is a good fix */
-#ifdef __APPLE__
-#  define PRI_off_t "q"
-#else
-#  define PRI_off_t "l"
-#endif
-
 static int
 read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
 {

Modified: liboggz/trunk/src/tools/oggz-validate.c
===================================================================
--- liboggz/trunk/src/tools/oggz-validate.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tools/oggz-validate.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -284,7 +284,7 @@
   if ((feed_err = oggz_write_feed (ovdata->writer, op, serialno, flush, NULL)) != 0) {
     ret = log_error ();
     if (timestamp == -1.0) {
-      fprintf (stderr, "%ld", oggz_tell (oggz));
+      fprintf (stderr, "%" PRI_OGGZ_OFF_T "d", oggz_tell (oggz));
     } else {
       ot_fprint_time (stderr, (double)timestamp/SUBSECONDS);
     }

Modified: liboggz/trunk/src/tools/oggzdump.c
===================================================================
--- liboggz/trunk/src/tools/oggzdump.c	2007-06-16 09:24:45 UTC (rev 2955)
+++ liboggz/trunk/src/tools/oggzdump.c	2007-06-16 10:24:33 UTC (rev 2956)
@@ -231,14 +231,6 @@
   }
 }
 
-/* FIXME: on Mac OS X, off_t is 64-bits.  Obviously we want a nicer
- * way to do it than this, but a quick fix is a good fix */
-#ifdef __APPLE__
-#  define PRI_off_t "q"
-#else
-#  define PRI_off_t "l"
-#endif
-
 static int
 read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
 {
@@ -251,7 +243,7 @@
   } else {
     units = oggz_tell_units (oggz);
     if (units == -1) {
-      fprintf (outfile, "%08" PRI_off_t "x", oggz_tell (oggz));
+      fprintf (outfile, "%0" PRI_OGGZ_OFF_T "x", oggz_tell (oggz));
     } else {
       time_offset = (double)units / 1000.0;
       ot_fprint_time (outfile, time_offset);



More information about the commits mailing list