]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix warning because of wrong time_t format specifier on FreeBSD i386
authorBernhard Froehlich <decke@bluelife.at>
Fri, 24 May 2013 19:34:53 +0000 (21:34 +0200)
committerBernhard Froehlich <decke@bluelife.at>
Fri, 24 May 2013 19:34:53 +0000 (21:34 +0200)
and fix places where format specifier is hardcoded for time_t and
correctly use PRItime_t instead.

src/epg.c:1412: warning: format '%ld' expects type 'long int', but argument 7 has type 'time_t'
src/dvr/dvr_rec.c:596: warning: format '%ld' expects type 'long int', but argument 4 has type 'time_t'
src/epggrab/module/eit.c:536: warning: format '%lu' expects type 'long unsigned int', but argument 8 has type 'time_t'

src/dvr/dvr_rec.c
src/epggrab/module/eit.c
src/tvheadend.h

index c48eafff2a09171de3194622e2a6675ccaa0ab62..c5726b019b11f58ad46739a7fc5188fc325019f1 100644 (file)
@@ -593,8 +593,8 @@ dvr_spawn_postproc(dvr_entry_t *de, const char *dvr_postproc)
   }
 
   fbasename = strdup(de->de_filename); 
-  snprintf(start, sizeof(start), "%ld", de->de_start - de->de_start_extra);
-  snprintf(stop, sizeof(stop),   "%ld", de->de_stop  + de->de_stop_extra);
+  snprintf(start, sizeof(start), "%"PRItime_t, de->de_start - de->de_start_extra);
+  snprintf(stop, sizeof(stop),   "%"PRItime_t, de->de_stop  + de->de_stop_extra);
 
   memset(fmap, 0, sizeof(fmap));
   fmap['f'] = de->de_filename; /* full path to recoding */
index c20c32d555d4819b791ce0927117b769c1d6f2a0..c2e54610bf4b65c2caf50b34e398408c22b105fb 100644 (file)
@@ -533,7 +533,7 @@ static int _eit_process_event
 
   /* Find broadcast */
   ebc  = epg_broadcast_find_by_time(svc->s_ch, start, stop, eid, 1, &save2);
-  tvhtrace("eit", "eid=%5d, start=%lu, stop=%lu, ebc=%p",
+  tvhtrace("eit", "eid=%5d, start=%"PRItime_t", stop=%"PRItime_t", ebc=%p",
          eid, start, stop, ebc);
   if (!ebc) return dllen + 12;
 
index 4bc951dc0ae4deb007fed1d2153df1e7e260e23e..9586a0634779a90c638e9daf775dc8d6a9afa32c 100644 (file)
@@ -561,7 +561,11 @@ char *regexp_escape ( const char *str );
 #define PRIulongword_t  "lu"
 #define PRIsize_t       PRIuword_t
 #define PRIssize_t      PRIsword_t
+#if __WORDSIZE == 32 && defined(PLATFORM_FREEBSD)
+#define PRItime_t       PRIsword_t
+#else
 #define PRItime_t       PRIslongword_t
+#endif
 #if _FILE_OFFSET_BITS == 64
 #define PRIoff_t        PRId64
 #else