Commit e90cda5e authored by erikd's avatar erikd

Fix a bunch of x86-64 compiler warnings.

git-svn-id: http://svn.annodex.net/liboggz/trunk@3432 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 5eff6736
......@@ -244,7 +244,7 @@ if test $SIZEOF_OGGZ_OFF_T = 4 ; then
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
......
......@@ -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 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
#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 @@ main (int argc, char ** argv)
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);
......
......@@ -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 @@ try_seek_units (OGGZ * oggz, ogg_int64_t units)
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 @@ main (int argc, char * argv[])
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);
......
......@@ -269,7 +269,7 @@ oggz_sort (OSData * osdata, FILE * outfile)
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 ||
......
......@@ -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 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
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 @@ 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, "%" PRI_OGGZ_OFF_T "d", oggz_tell (oggz));
fprintf (stderr, "%" PRId64 , oggz_tell (oggz));
} else {
ot_fprint_time (stderr, (double)timestamp/SUBSECONDS);
}
......
......@@ -246,7 +246,7 @@ read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
} 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 @@ revert_file (char * infilename)
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);
......
......@@ -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 @@ oggz_merge (OMData * omdata, FILE * outfile)
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);
}
......
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