Commit 8e745f50 authored by conrad's avatar conrad

fix PRI_OGGZ_OFF_T definition, use throughout tests and tools


git-svn-id: http://svn.annodex.net/liboggz/trunk@2956 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent ec459459
......@@ -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__ */
......@@ -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__ */
......@@ -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
......
......@@ -86,7 +86,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -84,7 +84,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -88,7 +88,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -102,7 +102,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -84,7 +84,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -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)); }
......
......@@ -77,7 +77,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -86,7 +86,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -84,7 +84,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
......
......@@ -70,7 +70,7 @@ try_seek_units (OGGZ * oggz, ogg_int64_t units)
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 @@ main (int argc, char * argv[])
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);
......
......@@ -118,14 +118,6 @@ filter_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
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)
{
......
......@@ -284,7 +284,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
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);
}
......
......@@ -231,14 +231,6 @@ bin_dump (unsigned char * buf, long n, int dump_char)
}
}
/* 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 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
} 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment