[xiph-commits] r3602 - in liboggplay/trunk/src: examples liboggplay

conrad at svn.annodex.net conrad at svn.annodex.net
Sun May 25 00:30:09 PDT 2008


Author: conrad
Date: 2008-05-25 00:30:08 -0700 (Sun, 25 May 2008)
New Revision: 3602

Modified:
   liboggplay/trunk/src/examples/glut-player.c
   liboggplay/trunk/src/liboggplay/oggplay_data.c
Log:
cast to long long as ogg_int64_t is %ld on 64 bit archs.
Patch from ogg.k.ogg.k


Modified: liboggplay/trunk/src/examples/glut-player.c
===================================================================
--- liboggplay/trunk/src/examples/glut-player.c	2008-05-24 09:34:52 UTC (rev 3601)
+++ liboggplay/trunk/src/examples/glut-player.c	2008-05-25 07:30:08 UTC (rev 3602)
@@ -24,6 +24,16 @@
 #include <unistd.h>
 #include <fcntl.h>
 
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#if LONG_MAX==2147483647L
+#define PRId64 "lld"
+#else
+#define PRId64 "ld"
+#endif
+#endif
+
 #if !(defined(__APPLE__) || defined(WIN32))
 #define USE_AUDIO 1
 #else
@@ -298,7 +308,7 @@
         case OGGPLAY_KATE:
           required = oggplay_callback_info_get_required(track_info[i]);
           for (j = 0; j < required; j++) {
-            printf("[%d] [duration %lld] %s\n",
+            printf("[%d] [duration %"PRId64"] %s\n",
                 i,
                 oggplay_callback_info_get_record_size(headers[j]),
                 oggplay_callback_info_get_text_data(headers[j]));

Modified: liboggplay/trunk/src/liboggplay/oggplay_data.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_data.c	2008-05-24 09:34:52 UTC (rev 3601)
+++ liboggplay/trunk/src/liboggplay/oggplay_data.c	2008-05-25 07:30:08 UTC (rev 3602)
@@ -41,6 +41,16 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#if LONG_MAX==2147483647L
+#define PRId64 "lld"
+#else
+#define PRId64 "ld"
+#endif
+#endif
+
 /*
  * the normal lifecycle for a frame is:
  *
@@ -102,7 +112,7 @@
 _print_list(char *name, OggPlayDataHeader *p) {
     printf("%s: ", name);
     for (; p != NULL; p = p->next) {
-      printf("%lld[%d]", p->presentation_time >> 32, p->lock);
+      printf("%"PRId64"[%d]", p->presentation_time >> 32, p->lock);
       if (p->next != NULL) printf("->");
     }
     printf("\n");



More information about the commits mailing list