From: Adam Sutton Date: Wed, 10 Apr 2013 11:05:31 +0000 (+0100) Subject: Fix some printing errors. X-Git-Tag: v3.9~98 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da25793bcbd8fdc9a4dcd74fd51bc8e7a1e52235;p=thirdparty%2Ftvheadend.git Fix some printing errors. --- diff --git a/src/timeshift/timeshift_reader.c b/src/timeshift/timeshift_reader.c index 3701ddee3..f2a3b6bcf 100644 --- a/src/timeshift/timeshift_reader.c +++ b/src/timeshift/timeshift_reader.c @@ -318,7 +318,7 @@ static int _timeshift_read ts->id, (*cur_file)->path); *fd = open((*cur_file)->path, O_RDONLY); } - tvhtrace("timeshift", "ts %d seek to %lu", ts->id, *cur_off); + tvhtrace("timeshift", "ts %d seek to %"PRIoff_t, ts->id, *cur_off); lseek(*fd, *cur_off, SEEK_SET); /* Read msg */ @@ -329,7 +329,7 @@ static int _timeshift_read tvhlog(LOG_ERR, "timeshift", "ts %d could not read buffer", ts->id); return -1; } - tvhtrace("timeshift", "ts %d read msg %p (%ld)", + tvhtrace("timeshift", "ts %d read msg %p (%"PRIssize_t")", ts->id, *sm, r); /* Incomplete */ diff --git a/src/tvheadend.h b/src/tvheadend.h index f0dbdcd4d..55cdd517c 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -549,10 +549,22 @@ int rmtree ( const char *path ); char *regexp_escape ( const char *str ); /* printing */ -#if __SIZEOF_LONG__ == 8 - #define PRItime_t PRId64 +# if __WORDSIZE == 64 +#define PRIsword_t PRId64 +#define PRIuword_t PRIu64 #else - #define PRItime_t "l" PRId32 +#define PRIsword_t PRId32 +#define PRIuword_t PRIu32 +#endif +#define PRIslongword_t "ld" +#define PRIulongword_t "lu" +#define PRIsize_t PRIuword_t +#define PRIssize_t PRIsword_t +#define PRItime_t PRIslongword_t +#if _FILE_OFFSET_BITS == 64 +#define PRIoff_t PRId64 +#else +#define PRIoff_t PRIslongword_t #endif #endif /* TV_HEAD_H */