From 9a0d477acd645976d50aa5df5d6e77aecb78b024 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Fri, 24 May 2013 21:34:53 +0200 Subject: [PATCH] Fix warning because of wrong time_t format specifier on FreeBSD i386 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 | 4 ++-- src/epggrab/module/eit.c | 2 +- src/tvheadend.h | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index c48eafff..c5726b01 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -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 */ diff --git a/src/epggrab/module/eit.c b/src/epggrab/module/eit.c index c20c32d5..c2e54610 100644 --- a/src/epggrab/module/eit.c +++ b/src/epggrab/module/eit.c @@ -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; diff --git a/src/tvheadend.h b/src/tvheadend.h index 4bc951dc..9586a063 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -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