Replaced "%lld" and "%llX" print format specifiers with "PRId64" and "PRIX64"

This commit is contained in:
Klaus Schmidinger 2011-03-27 15:12:20 +02:00
parent 9f0ac31f0d
commit 4ed9d95394
5 changed files with 23 additions and 9 deletions

View File

@ -2681,3 +2681,4 @@ Juergen Lock <vdr-l@jelal.kn-bremen.de>
Sergiu Dotenco <sergiu.dotenco@googlemail.com>
for reporting a missing initialization in sDvbSpuRect
for replacing "%lld" and "%llX" print format specifiers with "PRId64" and "PRIX64"

View File

@ -6583,3 +6583,9 @@ Video Disk Recorder Revision History
- Fixed scaling subtitles in case the OSD size is exactly the same as the display
size of the subtitles.
- Added a missing initialization to sDvbSpuRect (reported by Sergiu Dotenco).
- Replaced "%lld" and "%llX" print format specifiers with "PRId64" and "PRIX64" to
avoid compiler warnings with gcc 4.5.2 (thanks to Sergiu Dotenco).
On a personal note: I find it a step in the totally wrong direction that there
have been macros introduced to work around this problem in the first place. There
should have been "real" format specifiers defined that address this. These macros
are nothing but an ugly workaround.

View File

@ -7,10 +7,13 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
* $Id: dvbsubtitle.c 2.15 2011/03/27 13:52:58 kls Exp $
* $Id: dvbsubtitle.c 2.16 2011/03/27 15:02:12 kls Exp $
*/
#include "dvbsubtitle.h"
#define __STDC_FORMAT_MACROS // Required for format specifiers
#include <inttypes.h>
#include "device.h"
#define PAGE_COMPOSITION_SEGMENT 0x10
@ -735,7 +738,7 @@ int cDvbSubtitleConverter::ConvertFragments(const uchar *Data, int Length)
if (Length > PayloadOffset + SubstreamHeaderLength) {
int64_t pts = PesHasPts(Data) ? PesGetPts(Data) : 0;
if (pts)
dbgconverter("Converter PTS: %lld\n", pts);
dbgconverter("Converter PTS: %"PRId64"\n", pts);
const uchar *data = Data + PayloadOffset + SubstreamHeaderLength; // skip substream header
int length = Length - PayloadOffset - SubstreamHeaderLength; // skip substream header
if (ResetSubtitleAssembler)
@ -771,7 +774,7 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length)
if (Length > PayloadOffset) {
int64_t pts = PesGetPts(Data);
if (pts)
dbgconverter("Converter PTS: %lld\n", pts);
dbgconverter("Converter PTS: %"PRId64"\n", pts);
const uchar *data = Data + PayloadOffset;
int length = Length - PayloadOffset;
if (length > 3) {
@ -830,7 +833,7 @@ void cDvbSubtitleConverter::Action(void)
if (AssertOsd()) {
sb->Draw(osd);
Timeout.Set(sb->Timeout() * 1000);
dbgconverter("PTS: %lld STC: %lld (%lld) timeout: %d\n", sb->Pts(), cDevice::PrimaryDevice()->GetSTC(), Delta, sb->Timeout());
dbgconverter("PTS: %"PRId64" STC: %"PRId64" (%"PRId64") timeout: %d\n", sb->Pts(), cDevice::PrimaryDevice()->GetSTC(), Delta, sb->Timeout());
}
bitmaps->Del(sb);
}
@ -920,7 +923,7 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
page->SetTimeout(Data[6]);
page->SetState((Data[6 + 1] & 0x0C) >> 2);
page->regions.Clear();
dbgpages("Update page id %d version %d pts %lld timeout %d state %d\n", pageId, page->Version(), page->Pts(), page->Timeout(), page->State());
dbgpages("Update page id %d version %d pts %"PRId64" timeout %d state %d\n", pageId, page->Version(), page->Pts(), page->Timeout(), page->State());
for (int i = 6 + 2; i < segmentLength; i += 6) {
cSubtitleRegion *region = page->GetRegionById(Data[i], true);
region->SetHorizontalAddress((Data[i + 2] << 8) + Data[i + 3]);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 2.27 2011/03/20 10:33:30 kls Exp $
* $Id: recording.c 2.28 2011/03/27 15:02:53 kls Exp $
*/
#include "recording.h"
@ -12,6 +12,8 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#define __STDC_FORMAT_MACROS // Required for format specifiers
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -1566,7 +1568,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording)
delta = int(buf.st_size % sizeof(tIndexTs));
if (delta) {
delta = sizeof(tIndexTs) - delta;
esyslog("ERROR: invalid file size (%lld) in '%s'", buf.st_size, fileName);
esyslog("ERROR: invalid file size (%"PRId64") in '%s'", buf.st_size, fileName);
}
last = int((buf.st_size + delta) / sizeof(tIndexTs) - 1);
if (!Record && last >= 0) {

View File

@ -4,11 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: remote.c 2.2 2010/12/24 15:26:05 kls Exp $
* $Id: remote.c 2.3 2011/03/27 15:03:36 kls Exp $
*/
#include "remote.h"
#include <fcntl.h>
#define __STDC_FORMAT_MACROS // Required for format specifiers
#include <inttypes.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/types.h>
@ -122,7 +124,7 @@ bool cRemote::PutMacro(eKeys Key)
bool cRemote::Put(uint64_t Code, bool Repeat, bool Release)
{
char buffer[32];
snprintf(buffer, sizeof(buffer), "%016llX", Code);
snprintf(buffer, sizeof(buffer), "%016"PRIX64, Code);
return Put(buffer, Repeat, Release);
}