control: tags -1 +patch Here's a patch (attached). It is pretty massive, but all errors are of two kinds: C++11 considers letters after a string literal to be a suffix rather than a separate token, and implicit conversions from bool to pointer.
-- An imaginary friend squared is a real enemy.
>From b66c8027c3cb0636efd3ea26fa296b533f6606c6 Mon Sep 17 00:00:00 2001 From: Adam Borowski <kilob...@angband.pl> Date: Thu, 21 Jul 2016 03:54:22 +0200 Subject: [PATCH] Fix FTBFS with gcc-6. All of many errors are of only two types: * letters after string literals, sometimes fatal: "foo"name"bar", sometimes merely a warning: "foo"PRIx64 -- I've fixed either * "return false;" in a function returning a pointer --- applications/applestreamingclient/src/playlist.cpp | 2 +- .../src/protocols/key/inboundkeyprotocol.cpp | 2 +- common/src/platform/android/androidplatform.cpp | 6 ++-- common/src/platform/dfreebsd/dfreebsdplatform.cpp | 6 ++-- common/src/platform/freebsd/freebsdplatform.cpp | 6 ++-- common/src/platform/linux/linuxplatform.cpp | 6 ++-- common/src/platform/openbsd/openbsdplatform.cpp | 6 ++-- common/src/platform/osx/osxplatform.cpp | 6 ++-- common/src/platform/solaris/solarisplatform.cpp | 6 ++-- common/src/utils/logging/fileloglocation.cpp | 4 +-- common/src/utils/logging/syslogloglocation.cpp | 2 +- common/src/utils/misc/file.cpp | 10 +++---- common/src/utils/misc/mmapfile.cpp | 22 +++++++------- common/src/utils/misc/uri.cpp | 6 ++-- common/src/utils/misc/variant.cpp | 34 +++++++++++----------- crtmpserver/src/crtmpserver.cpp | 2 +- thelib/include/mediaformats/mediaframe.h | 2 +- thelib/include/protocols/ts/tspacketpmt.h | 2 +- thelib/src/application/baseclientapplication.cpp | 4 +-- thelib/src/configuration/configfile.cpp | 2 +- thelib/src/mediaformats/basemediadocument.cpp | 10 +++---- thelib/src/mediaformats/flv/flvdocument.cpp | 2 +- thelib/src/mediaformats/mp3/mp3document.cpp | 4 +-- thelib/src/mediaformats/mp4/baseatom.cpp | 6 ++-- thelib/src/mediaformats/mp4/boxatom.cpp | 2 +- thelib/src/mediaformats/mp4/mp4document.cpp | 14 ++++----- thelib/src/mediaformats/nsv/nsvdocument.cpp | 2 +- thelib/src/netio/epoll/iohandlermanager.cpp | 4 +-- thelib/src/netio/epoll/udpcarrier.cpp | 4 +-- thelib/src/netio/kqueue/iohandlermanager.cpp | 4 +-- thelib/src/netio/kqueue/udpcarrier.cpp | 4 +-- thelib/src/netio/select/iohandlermanager.cpp | 4 +-- thelib/src/netio/select/udpcarrier.cpp | 4 +-- thelib/src/protocols/http/httpauthhelper.cpp | 2 +- thelib/src/protocols/protocolfactorymanager.cpp | 4 +-- .../rawhttpstream/inboundrawhttpstreamprotocol.cpp | 2 +- thelib/src/protocols/rtmp/amf0serializer.cpp | 28 +++++++++--------- .../protocols/rtmp/basertmpappprotocolhandler.cpp | 8 ++--- thelib/src/protocols/rtmp/basertmpprotocol.cpp | 10 +++---- thelib/src/protocols/rtmp/header_le_ba.cpp | 2 +- thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp | 2 +- thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp | 2 +- .../src/protocols/rtmp/rtmpprotocolserializer.cpp | 2 +- .../rtmp/streaming/baseoutnetrtmpstream.cpp | 2 +- .../src/protocols/rtmp/streaming/debugging.patch | 24 +++++++-------- .../rtmp/streaming/infilertmpnsvstream.cpp_ | 12 ++++---- .../protocols/rtmp/streaming/infilertmpstream.cpp | 22 +++++++------- .../protocols/rtmp/streaming/innetrtmpstream.cpp | 4 +-- .../rtmp/streaming/outnetrtmp4tsstream.cpp | 6 ++-- .../protocols/rtp/basertspappprotocolhandler.cpp | 2 +- .../rtp/connectivity/inboundconnectivity.cpp | 6 ++-- .../rtp/connectivity/outboundconnectivity.cpp | 8 ++--- thelib/src/protocols/rtp/nattraversalprotocol.cpp | 4 +-- thelib/src/protocols/rtp/rtspprotocol.cpp | 8 ++--- thelib/src/protocols/rtp/sdp.cpp | 4 +-- .../src/protocols/rtp/streaming/innetrtpstream.cpp | 24 +++++++-------- thelib/src/protocols/ssl/basesslprotocol.cpp | 4 +-- thelib/src/protocols/ts/innettsstream.cpp | 4 +-- thelib/src/protocols/ts/tspacketpat.cpp | 4 +-- thelib/src/protocols/ts/tspacketpmt.cpp | 4 +-- thelib/src/streaming/baseinfilestream.cpp | 10 +++---- thelib/src/streaming/streamcapabilities.cpp | 16 +++++----- thelib/src/streaming/streamsmanager.cpp | 2 +- 63 files changed, 216 insertions(+), 216 deletions(-) diff --git a/applications/applestreamingclient/src/playlist.cpp b/applications/applestreamingclient/src/playlist.cpp index b5feb64..6c119af 100644 --- a/applications/applestreamingclient/src/playlist.cpp +++ b/applications/applestreamingclient/src/playlist.cpp @@ -223,7 +223,7 @@ uint32_t Playlist::GetIndex(uint32_t &sequence) { //2. We don't have it, and is a 0 value, that means it was never initialized if (sequence == 0) { FINEST("sequence is 0"); - FINEST("_itemMediaSequences.size(): %"PRIz"u", _itemMediaSequences.size()); + FINEST("_itemMediaSequences.size(): %" PRIz"u", _itemMediaSequences.size()); if (_itemMediaSequences.size() != 0) { //3. We have stuff. Init and return FINEST("Return the first entry"); diff --git a/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp b/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp index 6e90cb4..d95aff1 100644 --- a/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp +++ b/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp @@ -74,7 +74,7 @@ bool InboundKeyProtocol::SignalInputData(IOBuffer &buffer) { //6. Unbase64 the encrypted key string encryptedKey = unb64(temp); if (encryptedKey.size() != 16) { - FATAL("Invalid key length: %"PRIz"u", encryptedKey.size()); + FATAL("Invalid key length: %" PRIz"u", encryptedKey.size()); return false; } diff --git a/common/src/platform/android/androidplatform.cpp b/common/src/platform/android/androidplatform.cpp index a5bb585..b67ed2e 100644 --- a/common/src/platform/android/androidplatform.cpp +++ b/common/src/platform/android/androidplatform.cpp @@ -159,7 +159,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -168,7 +168,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -177,7 +177,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/dfreebsd/dfreebsdplatform.cpp b/common/src/platform/dfreebsd/dfreebsdplatform.cpp index 1bd6d42..7586d14 100644 --- a/common/src/platform/dfreebsd/dfreebsdplatform.cpp +++ b/common/src/platform/dfreebsd/dfreebsdplatform.cpp @@ -160,7 +160,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -169,7 +169,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -178,7 +178,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/freebsd/freebsdplatform.cpp b/common/src/platform/freebsd/freebsdplatform.cpp index 038ca50..588659b 100644 --- a/common/src/platform/freebsd/freebsdplatform.cpp +++ b/common/src/platform/freebsd/freebsdplatform.cpp @@ -164,7 +164,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -173,7 +173,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -182,7 +182,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/linux/linuxplatform.cpp b/common/src/platform/linux/linuxplatform.cpp index 6df0d9e..bd7813f 100644 --- a/common/src/platform/linux/linuxplatform.cpp +++ b/common/src/platform/linux/linuxplatform.cpp @@ -164,7 +164,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -173,7 +173,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -182,7 +182,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/openbsd/openbsdplatform.cpp b/common/src/platform/openbsd/openbsdplatform.cpp index 988e662..165b857 100644 --- a/common/src/platform/openbsd/openbsdplatform.cpp +++ b/common/src/platform/openbsd/openbsdplatform.cpp @@ -166,7 +166,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -175,7 +175,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -184,7 +184,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/osx/osxplatform.cpp b/common/src/platform/osx/osxplatform.cpp index 7f494c1..e303375 100644 --- a/common/src/platform/osx/osxplatform.cpp +++ b/common/src/platform/osx/osxplatform.cpp @@ -165,7 +165,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -174,7 +174,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -183,7 +183,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/platform/solaris/solarisplatform.cpp b/common/src/platform/solaris/solarisplatform.cpp index 2c2b486..81c8d71 100644 --- a/common/src/platform/solaris/solarisplatform.cpp +++ b/common/src/platform/solaris/solarisplatform.cpp @@ -194,7 +194,7 @@ bool setFdTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -203,7 +203,7 @@ bool setFdMulticastTTL(int32_t fd, uint8_t ttl) { int temp = ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_MULTICAST_TTL: %"PRIu8"; error was %"PRId32" %s", ttl, err, strerror(err)); + WARN("Unable to set IP_MULTICAST_TTL: %" PRIu8"; error was %" PRId32" %s", ttl, err, strerror(err)); } return true; } @@ -212,7 +212,7 @@ bool setFdTOS(int32_t fd, uint8_t tos) { int temp = tos; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &temp, sizeof (temp)) != 0) { int err = errno; - WARN("Unable to set IP_TOS: %"PRIu8"; error was %"PRId32" %s", tos, err, strerror(err)); + WARN("Unable to set IP_TOS: %" PRIu8"; error was %" PRId32" %s", tos, err, strerror(err)); } return true; } diff --git a/common/src/utils/logging/fileloglocation.cpp b/common/src/utils/logging/fileloglocation.cpp index 0c0955c..9176b8f 100644 --- a/common/src/utils/logging/fileloglocation.cpp +++ b/common/src/utils/logging/fileloglocation.cpp @@ -82,7 +82,7 @@ void FileLogLocation::Log(int32_t level, string fileName, uint32_t lineNumber, if (_fileIsClosed) return; } - string logEntry = format("%"PRIu64":%d:%s:%u:%s:%s", + string logEntry = format("%" PRIu64":%d:%s:%u:%s:%s", (uint64_t) time(NULL), level, STR(fileName), lineNumber, STR(functionName), STR(message)); if (_singleLine) { @@ -115,7 +115,7 @@ bool FileLogLocation::OpenFile() { double ts; GETCLOCKS(ts); ts = (ts / CLOCKS_PER_SECOND)*1000; - string temp = format("%s.%"PRIu64".%"PRIu64, STR(_fileName), (uint64_t) getpid(), (uint64_t) ts); + string temp = format("%s.%" PRIu64".%" PRIu64, STR(_fileName), (uint64_t) getpid(), (uint64_t) ts); ios_base::openmode openMode = ios_base::out | ios_base::binary | ios_base::trunc; _fileStream.open(STR(temp), openMode); if (_fileStream.fail()) { diff --git a/common/src/utils/logging/syslogloglocation.cpp b/common/src/utils/logging/syslogloglocation.cpp index 4bf232f..58e107f 100644 --- a/common/src/utils/logging/syslogloglocation.cpp +++ b/common/src/utils/logging/syslogloglocation.cpp @@ -84,7 +84,7 @@ void SyslogLogLocation::Log(int32_t level, string fileName, uint32_t lineNumber, int priority = (MAP_HAS1(_priorities, level) ? _priorities[level] : LOG_DEBUG) | LOG_USER; if (_appendSourceFileLine) { - syslog(priority, "%s %s:%"PRIu32":%s %s", + syslog(priority, "%s %s:%" PRIu32":%s %s", STR(le["loggerName"]), STR(fileName), lineNumber, diff --git a/common/src/utils/misc/file.cpp b/common/src/utils/misc/file.cpp index df8f894..bcc45bc 100644 --- a/common/src/utils/misc/file.cpp +++ b/common/src/utils/misc/file.cpp @@ -148,7 +148,7 @@ bool File::SeekAhead(int64_t count) { _file.seekg(count, ios_base::cur); if (_file.fail()) { - FATAL("Unable to seek ahead %"PRId64" bytes", count); + FATAL("Unable to seek ahead %" PRId64" bytes", count); return false; } return true; @@ -167,7 +167,7 @@ bool File::SeekBehind(int64_t count) { _file.seekg((-1) * count, ios_base::cur); if (_file.fail()) { - FATAL("Unable to seek behind %"PRId64" bytes", count); + FATAL("Unable to seek behind %" PRId64" bytes", count); return false; } return true; @@ -181,7 +181,7 @@ bool File::SeekTo(uint64_t position) { _file.seekg(position, ios_base::beg); if (_file.fail()) { - FATAL("Unable to seek to position %"PRIu64, position); + FATAL("Unable to seek to position %" PRIu64, position); return false; } @@ -261,7 +261,7 @@ bool File::ReadUI64(uint64_t *pValue, bool networkOrder) { bool File::ReadBuffer(uint8_t *pBuffer, uint64_t count) { _file.read((char *) pBuffer, count); if (_file.fail()) { - FATAL("Unable to read %"PRIu64" bytes from the file. Cursor: %"PRIu64" (0x%"PRIx64"); %d (%s)", + FATAL("Unable to read %" PRIu64" bytes from the file. Cursor: %" PRIu64" (0x%" PRIx64"); %d (%s)", count, Cursor(), Cursor(), errno, strerror(errno)); return false; } @@ -434,7 +434,7 @@ bool File::WriteString(string &value) { bool File::WriteBuffer(const uint8_t *pBuffer, uint64_t count) { _file.write((char *) pBuffer, count); if (_file.fail()) { - FATAL("Unable to write %"PRIu64" bytes to file", count); + FATAL("Unable to write %" PRIu64" bytes to file", count); return false; } return true; diff --git a/common/src/utils/misc/mmapfile.cpp b/common/src/utils/misc/mmapfile.cpp index cbc71e1..c859a36 100644 --- a/common/src/utils/misc/mmapfile.cpp +++ b/common/src/utils/misc/mmapfile.cpp @@ -71,7 +71,7 @@ bool MmapPointer::Allocate(int fd, uint64_t cursor, Free(); if (size > windowSize) { - FATAL("size is greater than window size: %"PRIu64" > %u", size, windowSize); + FATAL("size is greater than window size: %" PRIu64" > %u", size, windowSize); return false; } @@ -82,12 +82,12 @@ bool MmapPointer::Allocate(int fd, uint64_t cursor, //2. Compute the new size _size = windowSize; while (_cursor + _size < cursor + size) { - LOG_MMAP("We need to go a little bit further; Wanted: %"PRIu64"; got: %"PRIu64, + LOG_MMAP("We need to go a little bit further; Wanted: %" PRIu64"; got: %" PRIu64, cursor + size, _cursor + _size); _size += MmapFile::_pageSize; } - LOG_MMAP("Reading %"PRIu64" bytes from disk", _size); + LOG_MMAP("Reading %" PRIu64" bytes from disk", _size); _pData = (uint8_t *) mmap(NULL, _size, PROT_READ, @@ -148,7 +148,7 @@ bool MmapPointer::HasRange(uint64_t cursor, uint64_t count) { MmapPointer::operator string() { if (_size == 0) return "[N - N](0)"; - return format("[%"PRIu64" - %"PRIu64"](%u)", _cursor, _cursor + _size - 1, _size); + return format("[%" PRIu64" - %" PRIu64"](%u)", _cursor, _cursor + _size - 1, _size); } bool MmapFile::Initialize(string path, uint32_t windowSize, bool exclusive) { @@ -256,7 +256,7 @@ bool MmapFile::SeekTo(uint64_t position) { return false; } if (position > _size) { - FATAL("Invalid position: %"PRIu64". Must be at most: %"PRIu64, position, _size - 1); + FATAL("Invalid position: %" PRIu64". Must be at most: %" PRIu64, position, _size - 1); _failed = true; return false; } @@ -403,22 +403,22 @@ bool MmapFile::PeekUI64(uint64_t *pValue, bool networkOrder) { bool MmapFile::PeekBuffer(uint8_t *pDestBuffer, uint64_t count) { //1. Sanity checks if (_failed) { - DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); + DEBUG("_cursor: %" PRIu64"; count: %" PRIu64"; %s", _cursor, count, STR(_path)); FATAL("This mmap file is in inconsistent state"); return false; } if (_windowSize < count) { - DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); - FATAL("Invalid window size: _windowSize < count %u < %"PRIu64, + DEBUG("_cursor: %" PRIu64"; count: %" PRIu64"; %s", _cursor, count, STR(_path)); + FATAL("Invalid window size: _windowSize < count %u < %" PRIu64, _windowSize, count); _failed = true; return false; } if (_cursor + count > _size) { - DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); - FATAL("EOF will be reached: cursor: %"PRIu64"; count: %"PRIu64"; size: %"PRIu64, + DEBUG("_cursor: %" PRIu64"; count: %" PRIu64"; %s", _cursor, count, STR(_path)); + FATAL("EOF will be reached: cursor: %" PRIu64"; count: %" PRIu64"; size: %" PRIu64, _cursor, count, _size); _failed = true; return false; @@ -447,7 +447,7 @@ bool MmapFile::PeekBuffer(uint8_t *pDestBuffer, uint64_t count) { //3. Do the read if (pPointer->Copy(pDestBuffer, _cursor, 0, count) != count) { - FATAL("Unable to copy %"PRIu64" bytes", count); + FATAL("Unable to copy %" PRIu64" bytes", count); _failed = true; return false; } diff --git a/common/src/utils/misc/uri.cpp b/common/src/utils/misc/uri.cpp index 4ea4b2f..cefc29a 100644 --- a/common/src/utils/misc/uri.cpp +++ b/common/src/utils/misc/uri.cpp @@ -94,7 +94,7 @@ bool parseURI(string stringUri, URI &uri) { // FATAL("Scheme `%s` not supported", STR(scheme)); // return false; // } - LOG_URI("scheme: %s; default port: %"PRIu16, STR(scheme), port); + LOG_URI("scheme: %s; default port: %" PRIu16, STR(scheme), port); //3. get the authentication portion. the search starts from //where the scheme detection left and up to the first / character @@ -154,12 +154,12 @@ bool parseURI(string stringUri, URI &uri) { portString = hostPort.substr(pos + 1); portSpecified = true; port = (uint16_t) atoi(STR(portString)); - if (format("%"PRIu16, port) != portString) { + if (format("%" PRIu16, port) != portString) { FATAL("Invalid port number specified: `%s`", STR(portString)); return false; } } - LOG_URI("host: %s; port: %"PRIu16"; portSpecified: %d", STR(host), port, portSpecified); + LOG_URI("host: %s; port: %" PRIu16"; portSpecified: %d", STR(host), port, portSpecified); //5. fullDocumentPathWithParameters fullDocumentPath = "/"; diff --git a/common/src/utils/misc/variant.cpp b/common/src/utils/misc/variant.cpp index b240afe..6b5a293 100644 --- a/common/src/utils/misc/variant.cpp +++ b/common/src/utils/misc/variant.cpp @@ -271,7 +271,7 @@ string Variant::ToString(string name, uint32_t indent) { } case V_INT64: { - result += format("%s<INT64 name=\"%s\">%"PRId64"</INT64>", + result += format("%s<INT64 name=\"%s\">%" PRId64"</INT64>", STR(strIndent), STR(name), _value.i64); break; } @@ -295,7 +295,7 @@ string Variant::ToString(string name, uint32_t indent) { } case V_UINT64: { - result += format("%s<UINT64 name=\"%s\">%"PRIu64"</UINT64>", + result += format("%s<UINT64 name=\"%s\">%" PRIu64"</UINT64>", STR(strIndent), STR(name), _value.ui64); break; } @@ -331,7 +331,7 @@ string Variant::ToString(string name, uint32_t indent) { } case V_BYTEARRAY: { - result += format("%s<BYTEARRAY name=\"%s\">%"PRIz"u bytes</BYTEARRAY>", + result += format("%s<BYTEARRAY name=\"%s\">%" PRIz"u bytes</BYTEARRAY>", STR(strIndent), STR(name), _value.s->length()); break; } @@ -618,7 +618,7 @@ Variant::operator string() { } case V_INT64: { - return format("%"PRId64, this->operator int64_t()); + return format("%" PRId64, this->operator int64_t()); } case V_UINT8: case V_UINT16: @@ -628,7 +628,7 @@ Variant::operator string() { } case V_UINT64: { - return format("%"PRIu64, this->operator uint64_t()); + return format("%" PRIu64, this->operator uint64_t()); } case V_DOUBLE: { @@ -1590,7 +1590,7 @@ bool Variant::SerializeToJSON(string &result) { case V_INT64: { int64_t value = (int64_t) (*this); - result += format("%"PRId64, value); + result += format("%" PRId64, value); break; } case V_UINT8: @@ -1599,7 +1599,7 @@ bool Variant::SerializeToJSON(string &result) { case V_UINT64: { uint64_t value = (uint64_t) (*this); - result += format("%"PRIu64, value); + result += format("%" PRIu64, value); break; } case V_DOUBLE: @@ -1719,7 +1719,7 @@ TiXmlElement *Variant::SerializeToXmlElement(string &name) { case V_INT64: { pResult = new TiXmlElement("INT64"); - pResult->LinkEndChild(new TiXmlText(format("%"PRId64, _value.i64))); + pResult->LinkEndChild(new TiXmlText(format("%" PRId64, _value.i64))); break; } case V_UINT8: @@ -1743,7 +1743,7 @@ TiXmlElement *Variant::SerializeToXmlElement(string &name) { case V_UINT64: { pResult = new TiXmlElement("UINT64"); - pResult->LinkEndChild(new TiXmlText(format("%"PRIu64, _value.ui64))); + pResult->LinkEndChild(new TiXmlText(format("%" PRIu64, _value.ui64))); break; } case V_DOUBLE: @@ -2034,56 +2034,56 @@ bool Variant::DeserializeFromXml(TiXmlElement *pNode, Variant &variant) { variant.Reset(true); return true; } else if (nodeName == "int8") { - if (sscanf(STR(text), "%"PRId64, &val.i64) != 1) { + if (sscanf(STR(text), "%" PRId64, &val.i64) != 1) { FATAL("Invalid number"); return false; } variant = (int8_t) val.i64; return true; } else if (nodeName == "int16") { - if (sscanf(STR(text), "%"PRId64, &val.i64) != 1) { + if (sscanf(STR(text), "%" PRId64, &val.i64) != 1) { FATAL("Invalid number"); return false; } variant = (int16_t) val.i64; return true; } else if (nodeName == "int32") { - if (sscanf(STR(text), "%"PRId64, &val.i64) != 1) { + if (sscanf(STR(text), "%" PRId64, &val.i64) != 1) { FATAL("Invalid number"); return false; } variant = (int32_t) val.i64; return true; } else if (nodeName == "int64") { - if (sscanf(STR(text), "%"PRId64, &val.i64) != 1) { + if (sscanf(STR(text), "%" PRId64, &val.i64) != 1) { FATAL("Invalid number"); return false; } variant = (int64_t) val.i64; return true; } else if (nodeName == "uint8") { - if (sscanf(STR(text), "%"PRIu64, &val.ui64) != 1) { + if (sscanf(STR(text), "%" PRIu64, &val.ui64) != 1) { FATAL("Invalid number"); return false; } variant = (uint8_t) val.ui64; return true; } else if (nodeName == "uint16") { - if (sscanf(STR(text), "%"PRIu64, &val.ui64) != 1) { + if (sscanf(STR(text), "%" PRIu64, &val.ui64) != 1) { FATAL("Invalid number"); return false; } variant = (uint16_t) val.ui64; return true; } else if (nodeName == "uint32") { - if (sscanf(STR(text), "%"PRIu64, &val.ui64) != 1) { + if (sscanf(STR(text), "%" PRIu64, &val.ui64) != 1) { FATAL("Invalid number"); return false; } variant = (uint32_t) val.ui64; return true; } else if (nodeName == "uint64") { - if (sscanf(STR(text), "%"PRIu64, &val.ui64) != 1) { + if (sscanf(STR(text), "%" PRIu64, &val.ui64) != 1) { FATAL("Invalid number"); return false; } diff --git a/crtmpserver/src/crtmpserver.cpp b/crtmpserver/src/crtmpserver.cpp index 7f998e7..08058ff 100644 --- a/crtmpserver/src/crtmpserver.cpp +++ b/crtmpserver/src/crtmpserver.cpp @@ -385,7 +385,7 @@ void WritePidFile(pid_t pid) { return; } - string content = format("%"PRIz"d", pid); + string content = format("%" PRIz"d", pid); if (!f.WriteString(content)) { WARN("Unable to write PID to file %s", STR(pidFile)); return; diff --git a/thelib/include/mediaformats/mediaframe.h b/thelib/include/mediaformats/mediaframe.h index e19a9ca..ed724d7 100644 --- a/thelib/include/mediaformats/mediaframe.h +++ b/thelib/include/mediaformats/mediaframe.h @@ -37,7 +37,7 @@ typedef struct _MediaFrame { int32_t compositionOffset; operator string() { - return format("s: %"PRIx64"; l: %"PRIx64"; t: %hhu; dt: %.2f; kf: %hhu; at: %.2f; bh: %hhu", + return format("s: %" PRIx64"; l: %" PRIx64"; t: %hhu; dt: %.2f; kf: %hhu; at: %.2f; bh: %hhu", start, length, type, deltaTime, isKeyFrame, absoluteTime, isBinaryHeader); }; } MediaFrame; diff --git a/thelib/include/protocols/ts/tspacketpmt.h b/thelib/include/protocols/ts/tspacketpmt.h index dd9e4bc..88abe9d 100644 --- a/thelib/include/protocols/ts/tspacketpmt.h +++ b/thelib/include/protocols/ts/tspacketpmt.h @@ -56,7 +56,7 @@ typedef struct _TSStreamInfo { } string toString(int32_t indent) { - string result = format("%sstreamType: %hhx; elementaryPID: %hu; esInfoLength: %hu; descriptors count: %"PRIz"u\n", + string result = format("%sstreamType: %hhx; elementaryPID: %hu; esInfoLength: %hu; descriptors count: %" PRIz"u\n", STR(string(indent, '\t')), streamType, elementaryPID, esInfoLength, esDescriptors.size()); for (uint32_t i = 0; i < esDescriptors.size(); i++) { diff --git a/thelib/src/application/baseclientapplication.cpp b/thelib/src/application/baseclientapplication.cpp index f308186..41ef1c2 100644 --- a/thelib/src/application/baseclientapplication.cpp +++ b/thelib/src/application/baseclientapplication.cpp @@ -217,7 +217,7 @@ void BaseClientApplication::UnRegisterProtocol(BaseProtocol *pProtocol) { } void BaseClientApplication::SignalStreamRegistered(BaseStream *pStream) { - INFO("Stream %s(%"PRIu32") with name `%s` registered to application `%s` from protocol %s(%"PRIu32")", + INFO("Stream %s(%" PRIu32") with name `%s` registered to application `%s` from protocol %s(%" PRIu32")", STR(tagToString(pStream->GetType())), pStream->GetUniqueId(), STR(pStream->GetName()), @@ -228,7 +228,7 @@ void BaseClientApplication::SignalStreamRegistered(BaseStream *pStream) { } void BaseClientApplication::SignalStreamUnRegistered(BaseStream *pStream) { - INFO("Stream %s(%"PRIu32") with name `%s` unregistered from application `%s` from protocol %s(%"PRIu32")", + INFO("Stream %s(%" PRIu32") with name `%s` unregistered from application `%s` from protocol %s(%" PRIu32")", STR(tagToString(pStream->GetType())), pStream->GetUniqueId(), STR(pStream->GetName()), diff --git a/thelib/src/configuration/configfile.cpp b/thelib/src/configuration/configfile.cpp index 72d3c03..5dd0419 100644 --- a/thelib/src/configuration/configfile.cpp +++ b/thelib/src/configuration/configfile.cpp @@ -555,7 +555,7 @@ bool ConfigFile::NormalizeApplicationAcceptor(Variant &node, string baseFolder) if (node.HasKeyChain(_V_NUMERIC, false, 1, CONF_PORT)) port = (int32_t) node.GetValue(CONF_PORT, false); if (port <= 0 || port >= 65536) { - FATAL("Invalid port: %"PRId32, port); + FATAL("Invalid port: %" PRId32, port); return false; } node[CONF_PORT] = (uint16_t) port; diff --git a/thelib/src/mediaformats/basemediadocument.cpp b/thelib/src/mediaformats/basemediadocument.cpp index ff0eec2..742648a 100644 --- a/thelib/src/mediaformats/basemediadocument.cpp +++ b/thelib/src/mediaformats/basemediadocument.cpp @@ -36,8 +36,8 @@ bool BaseMediaDocument::Process() { //1. Compute the names _mediaFilePath = (string) _metadata[META_SERVER_FULL_PATH]; - _metaFilePath = _mediaFilePath + "."MEDIA_TYPE_META; - _seekFilePath = _mediaFilePath + "."MEDIA_TYPE_SEEK; + _metaFilePath = _mediaFilePath + "." MEDIA_TYPE_META; + _seekFilePath = _mediaFilePath + "." MEDIA_TYPE_SEEK; _keyframeSeek = (bool)_metadata[CONF_APPLICATION_KEYFRAMESEEK]; _seekGranularity = (uint32_t) _metadata[CONF_APPLICATION_SEEKGRANULARITY]; @@ -80,7 +80,7 @@ bool BaseMediaDocument::Process() { GETCLOCKS(endTime); - INFO("%"PRIz"u frames computed in %.2f seconds at a speed of %.2f FPS", + INFO("%" PRIz"u frames computed in %.2f seconds at a speed of %.2f FPS", _frames.size(), (endTime - startTime) / (double) CLOCKS_PER_SECOND, (double) _frames.size() / ((endTime - startTime) / (double) CLOCKS_PER_SECOND)); @@ -89,7 +89,7 @@ bool BaseMediaDocument::Process() { uint32_t hours = totalSeconds / 3600; uint32_t minutes = (totalSeconds - hours * 3600) / 60; uint32_t seconds = (totalSeconds - hours * 3600 - minutes * 60); - INFO("File size: %"PRIu64" bytes; Duration: %u:%u:%u (%u sec); Optimal bandwidth: %.2f kb/s", + INFO("File size: %" PRIu64" bytes; Duration: %u:%u:%u (%u sec); Optimal bandwidth: %.2f kb/s", _mediaFile.Size(), hours, minutes, seconds, totalSeconds, @@ -167,7 +167,7 @@ bool BaseMediaDocument::SaveSeekFile() { FOR_VECTOR(_frames, i) { MediaFrame frame = _frames[i]; if (maxFrameSize < frame.length) { - //WARN("maxFrameSize bumped up: %"PRIu64" -> %"PRIu64, maxFrameSize, frame.length); + //WARN("maxFrameSize bumped up: %" PRIu64" -> %" PRIu64, maxFrameSize, frame.length); maxFrameSize = frame.length; } hasVideo |= (frame.type == MEDIAFRAME_TYPE_VIDEO); diff --git a/thelib/src/mediaformats/flv/flvdocument.cpp b/thelib/src/mediaformats/flv/flvdocument.cpp index c916c91..8c3abcd 100644 --- a/thelib/src/mediaformats/flv/flvdocument.cpp +++ b/thelib/src/mediaformats/flv/flvdocument.cpp @@ -82,7 +82,7 @@ bool FLVDocument::BuildFrames() { frame.type = MEDIAFRAME_TYPE_DATA; break; default: - WARN("Invalid tag type: %hhu at cursor %"PRIu64, tagType, _mediaFile.Cursor()); + WARN("Invalid tag type: %hhu at cursor %" PRIu64, tagType, _mediaFile.Cursor()); mustBreak = true; break; } diff --git a/thelib/src/mediaformats/mp3/mp3document.cpp b/thelib/src/mediaformats/mp3/mp3document.cpp index f4f6ce0..81d9666 100644 --- a/thelib/src/mediaformats/mp3/mp3document.cpp +++ b/thelib/src/mediaformats/mp3/mp3document.cpp @@ -174,7 +174,7 @@ bool MP3Document::BuildFrames() { frame.length = _frameSizes[version][layer][bitRateIndex] [sampleRateIndex][paddingBit]; if (frame.length == 0) { - FATAL("Invalid frame length: %hhu:%hhu:%hhu:%hhu:%hhu; Cusror: %"PRIx64, + FATAL("Invalid frame length: %hhu:%hhu:%hhu:%hhu:%hhu; Cusror: %" PRIx64, version, layer, bitRateIndex, sampleRateIndex, paddingBit, _mediaFile.Cursor()); return false; @@ -192,7 +192,7 @@ bool MP3Document::BuildFrames() { //7. Seek to the next frame if (!_mediaFile.SeekTo(frame.start + frame.length)) { - WARN("Unable to seek to %"PRIx64, frame.start + frame.length); + WARN("Unable to seek to %" PRIx64, frame.start + frame.length); break; } diff --git a/thelib/src/mediaformats/mp4/baseatom.cpp b/thelib/src/mediaformats/mp4/baseatom.cpp index f4da8f9..c390774 100644 --- a/thelib/src/mediaformats/mp4/baseatom.cpp +++ b/thelib/src/mediaformats/mp4/baseatom.cpp @@ -60,7 +60,7 @@ MP4Document * BaseAtom::GetDoc() { } BaseAtom::operator string() { - return format("S: %"PRIu64"(0x%"PRIx64"); L: %"PRIu64"(0x%"PRIx64"); T: %u(%s)", + return format("S: %" PRIu64"(0x%" PRIx64"); L: %" PRIu64"(0x%" PRIx64"); T: %u(%s)", _start, _start, _size, _size, GetTypeNumeric(), STR(GetTypeString())); } @@ -83,7 +83,7 @@ void BaseAtom::SetParentAtom(BaseAtom *pParent) { bool BaseAtom::SkipRead(bool issueWarn) { if (issueWarn) - WARN("Atom type %s skipped. Position 0x%"PRIx64"(%"PRIu64"); Size: 0x%"PRIx64"(%"PRIu64")", + WARN("Atom type %s skipped. Position 0x%" PRIx64"(%" PRIu64"); Size: 0x%" PRIx64"(%" PRIu64")", STR(GetTypeString()), _start, _start, _size, _size); return _pDoc->GetMediaFile().SeekTo(_start + _size); } @@ -94,7 +94,7 @@ uint64_t BaseAtom::CurrentPosition() { bool BaseAtom::CheckBounds(uint64_t size) { if (CurrentPosition() + size > _start + _size) { - FATAL("Reached the end of the atom: Current pos: %"PRIu64"; Wanted size: %"PRIu64"; atom start: %"PRIu64"; atom size: %"PRIu64, + FATAL("Reached the end of the atom: Current pos: %" PRIu64"; Wanted size: %" PRIu64"; atom start: %" PRIu64"; atom size: %" PRIu64, CurrentPosition(), size, _start, _size); return false; } diff --git a/thelib/src/mediaformats/mp4/boxatom.cpp b/thelib/src/mediaformats/mp4/boxatom.cpp index 147cebd..58b2cb5 100644 --- a/thelib/src/mediaformats/mp4/boxatom.cpp +++ b/thelib/src/mediaformats/mp4/boxatom.cpp @@ -40,7 +40,7 @@ bool BoxAtom::Read() { } if (!pAtom->IsIgnored()) { if (!AtomCreated(pAtom)) { - FATAL("Unable to signal AtomCreated for atom %s (%"PRIx64")", + FATAL("Unable to signal AtomCreated for atom %s (%" PRIx64")", STR(GetTypeString()), _start); return false; } diff --git a/thelib/src/mediaformats/mp4/mp4document.cpp b/thelib/src/mediaformats/mp4/mp4document.cpp index e765a33..557f41a 100644 --- a/thelib/src/mediaformats/mp4/mp4document.cpp +++ b/thelib/src/mediaformats/mp4/mp4document.cpp @@ -290,7 +290,7 @@ BaseAtom * MP4Document::ReadAtom(BaseAtom *pParentAtom) { } if (currentPos + pAtom->GetSize() != _mediaFile.Cursor()) { - FATAL("atom start: %"PRIu64"; Atom size: %"PRIu64"; currentPos: %"PRIu64, + FATAL("atom start: %" PRIu64"; Atom size: %" PRIu64"; currentPos: %" PRIu64, currentPos, pAtom->GetSize(), _mediaFile.Cursor()); return NULL; } @@ -415,7 +415,7 @@ bool MP4Document::BuildFrames() { FATAL("Unable to initialize AAC codec"); return false; } - // FINEST("Start: %"PRIu64" (%"PRIx64"); Length: %"PRIu64" (%"PRIx64");", + // FINEST("Start: %" PRIu64" (%" PRIx64"); Length: %" PRIu64" (%" PRIx64");", // audioHeader.start, audioHeader.start, audioHeader.length, // audioHeader.length); } else { @@ -568,16 +568,16 @@ bool MP4Document::BuildMOOVFrames(bool audio) { if (pCTSS != NULL) { compositionOffsets = pCTSS->GetEntries(); if (sampleSize.size() != compositionOffsets.size()) { - WARN("composition offsets count != samples count; compositionOffsets: %"PRIz"u; sampleSize.size: %"PRIz"u", + WARN("composition offsets count != samples count; compositionOffsets: %" PRIz"u; sampleSize.size: %" PRIz"u", compositionOffsets.size(), sampleSize.size()); for (uint32_t i = compositionOffsets.size(); i < sampleSize.size(); i++) ADD_VECTOR_END(compositionOffsets, 0); - WARN("composition offsets padded with 0. Now size is %"PRIz"u", + WARN("composition offsets padded with 0. Now size is %" PRIz"u", compositionOffsets.size()); } } - INFO("audio: %hhu; keyFrames: %"PRIz"u; frames: %"PRIz"u; compositionOffsets: %"PRIz"u", + INFO("audio: %hhu; keyFrames: %" PRIz"u; frames: %" PRIz"u; compositionOffsets: %" PRIz"u", audio, keyFrames.size(), sampleSize.size(), compositionOffsets.size()); uint32_t timeScale = pMDHD->GetTimeScale(); @@ -743,12 +743,12 @@ string MP4Document::Hierarchy() { AtomTRAK * MP4Document::GetTRAK(bool audio) { if (_pMOOV == NULL) { FATAL("Unable to find moov"); - return false; + return 0; } vector<AtomTRAK *> tracks = _pMOOV->GetTracks(); if (tracks.size() == 0) { FATAL("No tracks defined"); - return false; + return 0; } for (uint32_t i = 0; i < tracks.size(); i++) { AtomHDLR *pHDLR = (AtomHDLR *) tracks[i]->GetPath(2, A_MDIA, A_HDLR); diff --git a/thelib/src/mediaformats/nsv/nsvdocument.cpp b/thelib/src/mediaformats/nsv/nsvdocument.cpp index 631217b..9f6002c 100644 --- a/thelib/src/mediaformats/nsv/nsvdocument.cpp +++ b/thelib/src/mediaformats/nsv/nsvdocument.cpp @@ -206,7 +206,7 @@ bool NSVDocument::ReadPayLoadData() { // 06 - SEI NAL unit if (NALU_TYPE_SEI == NALU_TYPE(nt)) { // get binary header from payload data - FINEST("video data offset %"PRIx64, _mediaFile.Cursor()); + FINEST("video data offset %" PRIx64, _mediaFile.Cursor()); uint64_t currentCursor = _mediaFile.Cursor(); _buffer.IgnoreAll(); _buffer.ReadFromFs(_mediaFile, aux_plus_vidlen); diff --git a/thelib/src/netio/epoll/iohandlermanager.cpp b/thelib/src/netio/epoll/iohandlermanager.cpp index 4f8546b..c7d38fd 100644 --- a/thelib/src/netio/epoll/iohandlermanager.cpp +++ b/thelib/src/netio/epoll/iohandlermanager.cpp @@ -96,7 +96,7 @@ void IOHandlerManager::RegisterIOHandler(IOHandler* pIOHandler) { SetupToken(pIOHandler); size_t before = _activeIOHandlers.size(); _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before + 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before + 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } @@ -105,7 +105,7 @@ void IOHandlerManager::UnRegisterIOHandler(IOHandler *pIOHandler) { FreeToken(pIOHandler); size_t before = _activeIOHandlers.size(); _activeIOHandlers.erase(pIOHandler->GetId()); - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before - 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before - 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } } diff --git a/thelib/src/netio/epoll/udpcarrier.cpp b/thelib/src/netio/epoll/udpcarrier.cpp index 458c4e0..67b915b 100644 --- a/thelib/src/netio/epoll/udpcarrier.cpp +++ b/thelib/src/netio/epoll/udpcarrier.cpp @@ -168,7 +168,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } uint32_t testVal = EHTONL(bindAddress.sin_addr.s_addr); if ((testVal > 0xe0000000) && (testVal < 0xefffffff)) { - INFO("Subscribe to multicast %s:%"PRIu16, STR(bindIp), bindPort); + INFO("Subscribe to multicast %s:%" PRIu16, STR(bindIp), bindPort); if (ttl <= 255) { if (!setFdMulticastTTL(sock, (uint8_t) ttl)) { FATAL("Unable to set ttl"); @@ -187,7 +187,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { int error = errno; - FATAL("Unable to bind on address: udp://%s:%"PRIu16"; Error was: %s (%"PRId32")", + FATAL("Unable to bind on address: udp://%s:%" PRIu16"; Error was: %s (%" PRId32")", STR(bindIp), bindPort, strerror(error), error); CLOSE_SOCKET(sock); return NULL; diff --git a/thelib/src/netio/kqueue/iohandlermanager.cpp b/thelib/src/netio/kqueue/iohandlermanager.cpp index d3b7a8d..681d6f1 100644 --- a/thelib/src/netio/kqueue/iohandlermanager.cpp +++ b/thelib/src/netio/kqueue/iohandlermanager.cpp @@ -143,7 +143,7 @@ void IOHandlerManager::RegisterIOHandler(IOHandler* pIOHandler) { size_t before = _activeIOHandlers.size(); _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; SetupToken(pIOHandler); - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before + 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before + 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } @@ -152,7 +152,7 @@ void IOHandlerManager::UnRegisterIOHandler(IOHandler *pIOHandler) { FreeToken(pIOHandler); size_t before = _activeIOHandlers.size(); _activeIOHandlers.erase(pIOHandler->GetId()); - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before - 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before - 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } } diff --git a/thelib/src/netio/kqueue/udpcarrier.cpp b/thelib/src/netio/kqueue/udpcarrier.cpp index 7133d1a..9cf71fd 100644 --- a/thelib/src/netio/kqueue/udpcarrier.cpp +++ b/thelib/src/netio/kqueue/udpcarrier.cpp @@ -163,7 +163,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } uint32_t testVal = EHTONL(bindAddress.sin_addr.s_addr); if ((testVal > 0xe0000000) && (testVal < 0xefffffff)) { - INFO("Subscribe to multicast %s:%"PRIu16, STR(bindIp), bindPort); + INFO("Subscribe to multicast %s:%" PRIu16, STR(bindIp), bindPort); if (ttl <= 255) { if (!setFdMulticastTTL(sock, (uint8_t) ttl)) { FATAL("Unable to set ttl"); @@ -182,7 +182,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { int error = errno; - FATAL("Unable to bind on address: udp://%s:%"PRIu16"; Error was: %s (%"PRId32")", + FATAL("Unable to bind on address: udp://%s:%" PRIu16"; Error was: %s (%" PRId32")", STR(bindIp), bindPort, strerror(error), error); CLOSE_SOCKET(sock); return NULL; diff --git a/thelib/src/netio/select/iohandlermanager.cpp b/thelib/src/netio/select/iohandlermanager.cpp index 7d32f60..fb6cd24 100644 --- a/thelib/src/netio/select/iohandlermanager.cpp +++ b/thelib/src/netio/select/iohandlermanager.cpp @@ -83,7 +83,7 @@ void IOHandlerManager::RegisterIOHandler(IOHandler* pIOHandler) { } size_t before = _activeIOHandlers.size(); _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before + 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before + 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } @@ -95,7 +95,7 @@ void IOHandlerManager::UnRegisterIOHandler(IOHandler *pIOHandler) { if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { size_t before = _activeIOHandlers.size(); _activeIOHandlers.erase(pIOHandler->GetId()); - DEBUG("Handlers count changed: %"PRIz"u->%"PRIz"u %s", before, before - 1, + DEBUG("Handlers count changed: %" PRIz"u->%" PRIz"u %s", before, before - 1, STR(IOHandler::IOHTToString(pIOHandler->GetType()))); } } diff --git a/thelib/src/netio/select/udpcarrier.cpp b/thelib/src/netio/select/udpcarrier.cpp index f03f8b7..2092df3 100644 --- a/thelib/src/netio/select/udpcarrier.cpp +++ b/thelib/src/netio/select/udpcarrier.cpp @@ -164,7 +164,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } uint32_t testVal = EHTONL(bindAddress.sin_addr.s_addr); if ((testVal > 0xe0000000) && (testVal < 0xefffffff)) { - INFO("Subscribe to multicast %s:%"PRIu16, STR(bindIp), bindPort); + INFO("Subscribe to multicast %s:%" PRIu16, STR(bindIp), bindPort); if (ttl <= 255) { if (!setFdMulticastTTL(sock, (uint8_t) ttl)) { FATAL("Unable to set ttl"); @@ -183,7 +183,7 @@ UDPCarrier* UDPCarrier::Create(string bindIp, uint16_t bindPort, } if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { int error = errno; - FATAL("Unable to bind on address: udp://%s:%"PRIu16"; Error was: %s (%"PRId32")", + FATAL("Unable to bind on address: udp://%s:%" PRIu16"; Error was: %s (%" PRId32")", STR(bindIp), bindPort, strerror(error), error); CLOSE_SOCKET(sock); return NULL; diff --git a/thelib/src/protocols/http/httpauthhelper.cpp b/thelib/src/protocols/http/httpauthhelper.cpp index e57fbf6..6de0cba 100644 --- a/thelib/src/protocols/http/httpauthhelper.cpp +++ b/thelib/src/protocols/http/httpauthhelper.cpp @@ -279,7 +279,7 @@ bool HTTPAuthHelper::ParseAuthLine(string challenge, } default: { - FATAL("Invalid stage: %"PRIu32, stage); + FATAL("Invalid stage: %" PRIu32, stage); return false; } } diff --git a/thelib/src/protocols/protocolfactorymanager.cpp b/thelib/src/protocols/protocolfactorymanager.cpp index 85f3f9f..c059646 100644 --- a/thelib/src/protocols/protocolfactorymanager.cpp +++ b/thelib/src/protocols/protocolfactorymanager.cpp @@ -53,7 +53,7 @@ bool ProtocolFactoryManager::RegisterProtocolFactory(BaseProtocolFactory *pFacto FOR_VECTOR(protocols, i) { if (MAP_HAS1(_factoriesByProtocolId, protocols[i])) { - FATAL("protocol %"PRIx64" already handled by factory %u", protocols[i], + FATAL("protocol %" PRIx64" already handled by factory %u", protocols[i], _factoriesByProtocolId[protocols[i]]->GetId()); return false; } @@ -137,7 +137,7 @@ BaseProtocol *ProtocolFactoryManager::CreateProtocolChain(vector<uint64_t> &chai FOR_VECTOR(chain, i) { if (!MAP_HAS1(_factoriesByProtocolId, chain[i])) { - FATAL("protocol %"PRIx64" not handled by anyone", chain[i]); + FATAL("protocol %" PRIx64" not handled by anyone", chain[i]); return NULL; } } diff --git a/thelib/src/protocols/rawhttpstream/inboundrawhttpstreamprotocol.cpp b/thelib/src/protocols/rawhttpstream/inboundrawhttpstreamprotocol.cpp index 1af6e2b..9f2fbf8 100644 --- a/thelib/src/protocols/rawhttpstream/inboundrawhttpstreamprotocol.cpp +++ b/thelib/src/protocols/rawhttpstream/inboundrawhttpstreamprotocol.cpp @@ -235,7 +235,7 @@ bool InboundRawHTTPStreamProtocol::SendCrossDomain() { _outputBuffer.ReadFromString(HTTP_HEADERS_SERVER": "HTTP_HEADERS_SERVER_US"\r\n"); _outputBuffer.ReadFromString(HTTP_HEADERS_X_POWERED_BY": "HTTP_HEADERS_X_POWERED_BY_US"\r\n"); _outputBuffer.ReadFromString(HTTP_HEADERS_CONTENT_TYPE": text/xml\r\n"); - _outputBuffer.ReadFromString(format("%s: %"PRIu64"\r\n\r\n", HTTP_HEADERS_CONTENT_LENGTH, cd.Size())); + _outputBuffer.ReadFromString(format("%s: %" PRIu64"\r\n\r\n", HTTP_HEADERS_CONTENT_LENGTH, cd.Size())); _outputBuffer.ReadFromFs(cd, cd.Size()); //FINEST("_outputBuffer:\n%s", STR(_outputBuffer)); if (!EnqueueForOutbound()) { diff --git a/thelib/src/protocols/rtmp/amf0serializer.cpp b/thelib/src/protocols/rtmp/amf0serializer.cpp index 3de6703..cbabe95 100644 --- a/thelib/src/protocols/rtmp/amf0serializer.cpp +++ b/thelib/src/protocols/rtmp/amf0serializer.cpp @@ -68,7 +68,7 @@ bool AMF0Serializer::ReadShortString(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_SHORT_STRING) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_SHORT_STRING, GETIBPOINTER(buffer)[0]); return false; } @@ -88,7 +88,7 @@ bool AMF0Serializer::ReadShortString(IOBuffer &buffer, Variant &variant, AMF_CHECK_BOUNDARIES(buffer, length); variant = string((char *) (GETIBPOINTER(buffer)), length); if (!buffer.Ignore(length)) { - FATAL("Unable to ignore %"PRIu16" bytes", length); + FATAL("Unable to ignore %" PRIu16" bytes", length); return false; } return true; @@ -110,7 +110,7 @@ bool AMF0Serializer::ReadLongString(IOBuffer &buffer, Variant &variant, bool rea if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_LONG_STRING) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_LONG_STRING, GETIBPOINTER(buffer)[0]); return false; } @@ -131,7 +131,7 @@ bool AMF0Serializer::ReadLongString(IOBuffer &buffer, Variant &variant, bool rea AMF_CHECK_BOUNDARIES(buffer, length); variant = string((char *) (GETIBPOINTER(buffer)), length); if (!buffer.Ignore(length)) { - FATAL("Unable to ignore %"PRIu32" bytes", length); + FATAL("Unable to ignore %" PRIu32" bytes", length); return false; } return true; @@ -154,7 +154,7 @@ bool AMF0Serializer::ReadDouble(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_NUMBER) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_NUMBER, GETIBPOINTER(buffer)[0]); return false; } @@ -193,7 +193,7 @@ bool AMF0Serializer::ReadObject(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_OBJECT) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_OBJECT, GETIBPOINTER(buffer)[0]); return false; } @@ -292,7 +292,7 @@ bool AMF0Serializer::ReadMixedArray(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_MIXED_ARRAY) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_MIXED_ARRAY, GETIBPOINTER(buffer)[0]); return false; } @@ -405,7 +405,7 @@ bool AMF0Serializer::ReadArray(IOBuffer &buffer, Variant &variant, bool readType if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_ARRAY) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_ARRAY, GETIBPOINTER(buffer)[0]); return false; } @@ -447,7 +447,7 @@ bool AMF0Serializer::ReadAMF3Object(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_AMF3_OBJECT) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_AMF3_OBJECT, GETIBPOINTER(buffer)[0]); return false; } @@ -483,7 +483,7 @@ bool AMF0Serializer::ReadBoolean(IOBuffer &buffer, Variant &variant, if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_BOOLEAN) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_BOOLEAN, GETIBPOINTER(buffer)[0]); return false; } @@ -521,7 +521,7 @@ bool AMF0Serializer::ReadTimestamp(IOBuffer &buffer, Variant &variant, bool read if (readType) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_TIMESTAMP) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_TIMESTAMP, GETIBPOINTER(buffer)[0]); return false; } @@ -567,7 +567,7 @@ bool AMF0Serializer::WriteTimestamp(IOBuffer &buffer, Timestamp value, bool writ bool AMF0Serializer::ReadNull(IOBuffer &buffer, Variant &variant) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_NULL) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_NULL, GETIBPOINTER(buffer)[0]); return false; } @@ -590,7 +590,7 @@ bool AMF0Serializer::WriteNull(IOBuffer &buffer) { bool AMF0Serializer::ReadUndefined(IOBuffer &buffer, Variant &variant) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != AMF0_UNDEFINED) { - FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, + FATAL("AMF type not valid: want: %" PRIu8"; got: %" PRIu8, AMF0_UNDEFINED, GETIBPOINTER(buffer)[0]); return false; } @@ -726,7 +726,7 @@ bool AMF0Serializer::Read(IOBuffer &buffer, Variant &variant) { } default: { - FATAL("Unable to de-serialize type %"PRIu8"; Buffer: %s", + FATAL("Unable to de-serialize type %" PRIu8"; Buffer: %s", GETIBPOINTER(buffer)[0], STR(buffer)); return false; } diff --git a/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp b/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp index 895c180..648a933 100644 --- a/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp +++ b/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp @@ -792,7 +792,7 @@ bool BaseRTMPAppProtocolHandler::ProcessInvokePublish(BaseRTMPProtocol *pFrom, map<uint32_t, BaseOutStream *> subscribedOutStreams = GetApplication()->GetStreamsManager()->GetWaitingSubscribers( streamName, pInNetRTMPStream->GetType()); - //FINEST("subscribedOutStreams count: %"PRIz"u", subscribedOutStreams.size()); + //FINEST("subscribedOutStreams count: %" PRIz"u", subscribedOutStreams.size()); //7. Bind the waiting subscribers @@ -1762,8 +1762,8 @@ Variant BaseRTMPAppProtocolHandler::GetMetaData(string streamName, //7. Load the rest of the metadata from a cache or load it from file and //cache it after that - string metaPath = (string) result[META_SERVER_FULL_PATH] + "."MEDIA_TYPE_META; - string seekPath = (string) result[META_SERVER_FULL_PATH] + "."MEDIA_TYPE_SEEK; + string metaPath = (string) result[META_SERVER_FULL_PATH] + "." MEDIA_TYPE_META; + string seekPath = (string) result[META_SERVER_FULL_PATH] + "." MEDIA_TYPE_SEEK; bool regenerateFiles = true; if (fileExists(metaPath) && fileExists(seekPath)) { StreamCapabilities capabilities; @@ -2102,7 +2102,7 @@ bool BaseRTMPAppProtocolHandler::ConnectForPullPush(BaseRTMPProtocol *pFrom, // string tcUrl = format("%s://%s%s/%s", // STR(uri.scheme()), // STR(uri.host()), -// STR(uri.portSpecified() ? format(":%"PRIu32) : ""), +// STR(uri.portSpecified() ? format(":%" PRIu32) : ""), // STR(appName)); //4. Get the user agent diff --git a/thelib/src/protocols/rtmp/basertmpprotocol.cpp b/thelib/src/protocols/rtmp/basertmpprotocol.cpp index 368d453..ce7cf78 100644 --- a/thelib/src/protocols/rtmp/basertmpprotocol.cpp +++ b/thelib/src/protocols/rtmp/basertmpprotocol.cpp @@ -222,7 +222,7 @@ void BaseRTMPProtocol::GetStats(Variant &info, uint32_t namespaceId) { bool BaseRTMPProtocol::ResetChannel(uint32_t channelId) { if (channelId >= MAX_CHANNELS_COUNT) { - FATAL("Invalid channel id in reset message: %"PRIu32, channelId); + FATAL("Invalid channel id in reset message: %" PRIu32, channelId); return false; } _channels[channelId].Reset(); @@ -342,7 +342,7 @@ void BaseRTMPProtocol::TrySetOutboundChunkSize(uint32_t chunkSize) { BaseStream * BaseRTMPProtocol::GetRTMPStream(uint32_t rtmpStreamId) { if (rtmpStreamId == 0 || rtmpStreamId >= MAX_STREAMS_COUNT) { FATAL("Invalid stream id: %u", rtmpStreamId); - return false; + return 0; } return _streams[rtmpStreamId]; } @@ -464,7 +464,7 @@ BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, } if (_streams[streamId]->GetType() != ST_NEUTRAL_RTMP) { - FATAL("Try to play a stream over a non neutral stream: id: %u; type: %"PRIu64, + FATAL("Try to play a stream over a non neutral stream: id: %u; type: %" PRIu64, streamId, _streams[streamId]->GetType()); return NULL; } @@ -719,7 +719,7 @@ bool BaseRTMPProtocol::ProcessBytes(IOBuffer &buffer) { case RM_HEADER_MESSAGETYPE_VIDEODATA: { if (H_SI(header) >= MAX_STREAMS_COUNT) { - FATAL("The server doesn't support stream ids bigger than %"PRIu32, + FATAL("The server doesn't support stream ids bigger than %" PRIu32, (uint32_t) MAX_STREAMS_COUNT); return false; } @@ -751,7 +751,7 @@ bool BaseRTMPProtocol::ProcessBytes(IOBuffer &buffer) { case RM_HEADER_MESSAGETYPE_AUDIODATA: { if (H_SI(header) >= MAX_STREAMS_COUNT) { - FATAL("The server doesn't support stream ids bigger than %"PRIu32, + FATAL("The server doesn't support stream ids bigger than %" PRIu32, (uint32_t) MAX_STREAMS_COUNT); return false; } diff --git a/thelib/src/protocols/rtmp/header_le_ba.cpp b/thelib/src/protocols/rtmp/header_le_ba.cpp index b2e2954..46235f9 100644 --- a/thelib/src/protocols/rtmp/header_le_ba.cpp +++ b/thelib/src/protocols/rtmp/header_le_ba.cpp @@ -346,7 +346,7 @@ bool Header::Write(IOBuffer &buffer) { } Header::operator string() { - return format("(RC: %"PRIu8"; HT: %"PRIu8"; CI: %02"PRIu32"; T: % 9"PRIu32"; L: % 6"PRIu32"; MT: % 2"PRIu8"; SI: % 2"PRIu32"; IA: %"PRIu8")", + return format("(RC: %" PRIu8"; HT: %" PRIu8"; CI: %02" PRIu32"; T: % 9" PRIu32"; L: % 6" PRIu32"; MT: % 2" PRIu8"; SI: % 2" PRIu32"; IA: %" PRIu8")", readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); } diff --git a/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp b/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp index b0717cb..ff5444d 100644 --- a/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp +++ b/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp @@ -143,7 +143,7 @@ BaseProtocol *InboundHTTP4RTMP::Bind(string sid) { //14. This might be a new connection. Do we have that sid generated? if (!MAP_HAS1(_generatedSids, sid)) { FATAL("Invalid sid: %s", STR(sid)); - return false; + return 0; } //15. See if we have to generate a new connection or we just pick up diff --git a/thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp b/thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp index 27cf209..c33a4c1 100644 --- a/thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp +++ b/thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp @@ -278,7 +278,7 @@ bool MonitorRTMPProtocol::ProcessBytes(IOBuffer &buffer) { if ((uint8_t) VH_MT(msg) == RM_HEADER_MESSAGETYPE_ABORTMESSAGE) { uint32_t channelId = (uint32_t) msg[RM_ABORTMESSAGE]; if (channelId >= _maxChannelsCount) { - FATAL("Invalid channel id in reset message: %"PRIu32, channelId); + FATAL("Invalid channel id in reset message: %" PRIu32, channelId); return false; } assert(_channels[channelId].id == channelId); diff --git a/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp b/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp index 9cd21d9..cafa485 100644 --- a/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp +++ b/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp @@ -676,7 +676,7 @@ bool RTMPProtocolSerializer::DeserializeFlexSharedObject(IOBuffer &buffer, Variant &message) { AMF_CHECK_BOUNDARIES(buffer, 1); if (GETIBPOINTER(buffer)[0] != 0) { - FATAL("Encoding %"PRIu8" not supported yet", GETIBPOINTER(buffer)[0]); + FATAL("Encoding %" PRIu8" not supported yet", GETIBPOINTER(buffer)[0]); return false; } diff --git a/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp b/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp index 3411699..a4e65d3 100644 --- a/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp +++ b/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp @@ -64,7 +64,7 @@ BaseOutNetRTMPStream::BaseOutNetRTMPStream(BaseProtocol *pProtocol, _videoCurrentFrameDropped = false; _maxBufferSize = 65536 * 2; _attachedStreamType = 0; - _clientId = format("%d_%d_%"PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); + _clientId = format("%d_%d_%" PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); _paused = false; diff --git a/thelib/src/protocols/rtmp/streaming/debugging.patch b/thelib/src/protocols/rtmp/streaming/debugging.patch index 1dae831..12c4032 100644 --- a/thelib/src/protocols/rtmp/streaming/debugging.patch +++ b/thelib/src/protocols/rtmp/streaming/debugging.patch @@ -112,7 +112,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp bool BaseRTMPProtocol::SendRawData(Header &header, Channel &channel, uint8_t *pData, uint32_t length) { -+ FINEST("URSI: %"PRIu32"; length: %"PRIu32, header._uniqueRTMPStreamId, length); ++ FINEST("URSI: %" PRIu32"; length: %" PRIu32, header._uniqueRTMPStreamId, length); #ifdef ENFORCE_RTMP_OUTPUT_CHECKS _intermediateBuffer.IgnoreAll(); if (!header.Write(channel, _intermediateBuffer)) { @@ -122,7 +122,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp -bool BaseRTMPProtocol::SendRawData(uint8_t *pData, uint32_t length) { +bool BaseRTMPProtocol::SendRawData(uint8_t *pData, uint32_t length, uint32_t uniqueRTMPStreamId) { -+ FINEST("URSI: %"PRIu32"; length: %"PRIu32, uniqueRTMPStreamId, length); ++ FINEST("URSI: %" PRIu32"; length: %" PRIu32, uniqueRTMPStreamId, length); #ifdef ENFORCE_RTMP_OUTPUT_CHECKS _intermediateBuffer.IgnoreAll(); _intermediateBuffer.ReadFromBuffer(pData, length); @@ -206,7 +206,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp + return true; + channel.state = CS_HEADER; + _selectedChannel = -1; -+ FINEST("%"PRIu32"; input: %s; channel.lastInProcBytes: %"PRIu32"; wanted: %"PRIu32, ++ FINEST("%" PRIu32"; input: %s; channel.lastInProcBytes: %" PRIu32"; wanted: %" PRIu32, + GetId(), + STR(header), + channel.lastInProcBytes, @@ -226,7 +226,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp - if (H_SI(header) >= MAX_STREAMS_COUNT) { - FATAL("Incorrect stream index"); + if (H_SI(header) >= MAX_STREAMS_COUNT) { -+ FATAL("The server doesn't support stream ids bigger than %"PRIu32, ++ FATAL("The server doesn't support stream ids bigger than %" PRIu32, + (uint32_t) MAX_STREAMS_COUNT); + return false; + } @@ -291,7 +291,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp - if (H_SI(header) >= MAX_STREAMS_COUNT) { - FATAL("Incorrect stream index"); + if (H_SI(header) >= MAX_STREAMS_COUNT) { -+ FATAL("The server doesn't support stream ids bigger than %"PRIu32, ++ FATAL("The server doesn't support stream ids bigger than %" PRIu32, + (uint32_t) MAX_STREAMS_COUNT); + return false; + } @@ -424,12 +424,12 @@ Index: ../../sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cp + _videoCurrentFrameDropped = false; _maxBufferSize = 65536 * 2; _attachedStreamType = 0; - _clientId = format("%d_%d_%"PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); + _clientId = format("%d_%d_%" PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); @@ -167,6 +169,10 @@ bool BaseOutNetRTMPStream::FeedData(uint8_t *pData, uint32_t dataLength, uint32_t processedLength, uint32_t totalLength, double absoluteTimestamp, bool isAudio) { -+ string str = format("### ursi: %"PRIu32"; DL: % 6"PRIu32"; processedLength: % 6"PRIu32"; totalLength: % 6"PRIu32"; isAudio: %d", ++ string str = format("### ursi: %" PRIu32"; DL: % 6" PRIu32"; processedLength: % 6" PRIu32"; totalLength: % 6" PRIu32"; isAudio: %d", + _uniqueId, dataLength, processedLength, totalLength, isAudio); + FINEST("%s", STR(str)); + assert(((BaseRTMPProtocol *) _pInStream->GetProtocol())->___lastInProcBytes == processedLength); @@ -595,18 +595,18 @@ Index: ../../sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cp + if (!isAudio) _path[(_pathIdx++) % 65536] = __LINE__; + if (currentFrameDropped) { + if (!isAudio) _path[(_pathIdx++) % 65536] = __LINE__; -+ FINEST("Frame already dropped on URSI: %"PRIu32, _uniqueId); ++ FINEST("Frame already dropped on URSI: %" PRIu32, _uniqueId); + //current frame was dropped. Test to see if we are in the middle + //of it or this is a new one + if (totalProcessed != 0) { + if (!isAudio) _path[(_pathIdx++) % 65536] = __LINE__; -+ FINEST("(middle) Frame already dropped on URSI: %"PRIu32, _uniqueId); ++ FINEST("(middle) Frame already dropped on URSI: %" PRIu32, _uniqueId); + //we are in the middle of it. Don't allow execution + bytesCounter += dataLength; + return false; + } else { + if (!isAudio) _path[(_pathIdx++) % 65536] = __LINE__; -+ FINEST("Exiting frame dropped state on URSI: %"PRIu32, _uniqueId); ++ FINEST("Exiting frame dropped state on URSI: %" PRIu32, _uniqueId); + //this is a new frame. We will detect later if it can be sent + currentFrameDropped = false; } @@ -649,7 +649,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cp + packetsCounter++; + bytesCounter += dataLength; + currentFrameDropped = true; -+ FINEST("Drop frame on URSI: %"PRIu32, _uniqueId); ++ FINEST("Drop frame on URSI: %" PRIu32, _uniqueId); + return false; } else { - // we are not allowed to drop frames @@ -765,7 +765,7 @@ Index: ../../sources/thelib/src/protocols/rtmp/header_le_ba.cpp - // return format("(RC: %u; HT: %u; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %u)", - // readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); - return "not yet implemented"; -+ return format("(RC: %"PRIu8"; HT: %"PRIu8"; CI: %02"PRIu32"; T: % 9"PRIu32"; L: % 6"PRIu32"; MT: % 2"PRIu8"; SI: % 2"PRIu32"; IA: %"PRIu8"; URSI: %"PRIu32")", ++ return format("(RC: %" PRIu8"; HT: %" PRIu8"; CI: %02" PRIu32"; T: % 9" PRIu32"; L: % 6" PRIu32"; MT: % 2" PRIu8"; SI: % 2" PRIu32"; IA: %" PRIu8"; URSI: %" PRIu32")", + readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute, _uniqueRTMPStreamId); } diff --git a/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp_ b/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp_ index a4734da..13da7c3 100644 --- a/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp_ +++ b/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp_ @@ -68,13 +68,13 @@ bool InFileRTMPNSVStream::BuildFrame(FileClass *pFile, MediaFrame &mediaFrame, //1. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //3. Read the data if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -104,13 +104,13 @@ bool InFileRTMPNSVStream::BuildFrame(FileClass *pFile, MediaFrame &mediaFrame, //1. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //3. Read the data if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -133,13 +133,13 @@ bool InFileRTMPNSVStream::BuildFrameHeaders(FileClass *pFile, MediaFrame &mediaF //1. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } IOBuffer pbuf; if (!pbuf.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } diff --git a/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp b/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp index 22ad46f..92d6e42 100644 --- a/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp +++ b/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp @@ -74,12 +74,12 @@ bool InFileRTMPStream::AVCBuilder::BuildFrame(FileClass* pFile, MediaFrame& medi } if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -107,13 +107,13 @@ bool InFileRTMPStream::AACBuilder::BuildFrame(FileClass* pFile, MediaFrame& medi //2. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //3. Read the data if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -134,13 +134,13 @@ bool InFileRTMPStream::MP3Builder::BuildFrame(FileClass *pFile, //2. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //3. Read the data if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -159,13 +159,13 @@ bool InFileRTMPStream::PassThroughBuilder::BuildFrame(FileClass *pFile, MediaFrame &mediaFrame, IOBuffer &buffer) { //1. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //2. Read the data if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } @@ -260,7 +260,7 @@ InFileRTMPStream *InFileRTMPStream::GetInstance(BaseRTMPProtocol *pRTMPProtocol, metadata[META_RTMP_META][HTTP_HEADERS_SERVER] = HTTP_HEADERS_SERVER_US; if (!fileExists(metadata[META_SERVER_FULL_PATH])) { FATAL("File not found. fullPath: `%s`", STR(metadata[META_SERVER_FULL_PATH])); - return false; + return 0; } InFileRTMPStream *pResult = NULL; @@ -329,14 +329,14 @@ bool InFileRTMPStream::BuildFrame(FileClass *pFile, MediaFrame &mediaFrame, bool InFileRTMPStream::FeedMetaData(FileClass *pFile, MediaFrame &mediaFrame) { //1. Seek into the data file at the correct position if (!pFile->SeekTo(mediaFrame.start)) { - FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); + FATAL("Unable to seek to position %" PRIu64, mediaFrame.start); return false; } //2. Read the data _metadataBuffer.IgnoreAll(); if (!_metadataBuffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { - FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); + FATAL("Unable to read %" PRIu64" bytes from offset %" PRIu64, mediaFrame.length, mediaFrame.start); return false; } diff --git a/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp b/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp index 7ac1d1a..f2dce71 100644 --- a/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp +++ b/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp @@ -33,7 +33,7 @@ InNetRTMPStream::InNetRTMPStream(BaseProtocol *pProtocol, _rtmpStreamId = rtmpStreamId; _chunkSize = chunkSize; _channelId = channelId; - _clientId = format("%d_%d_%"PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); + _clientId = format("%d_%d_%" PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); _lastVideoTime = 0; _lastAudioTime = 0; _pOutFileRTMPFLVStream = NULL; @@ -314,7 +314,7 @@ bool InNetRTMPStream::InitializeAudioCapabilities(uint8_t *pData, uint32_t lengt return false; } - // FINEST("Cached the AAC audio codec initialization: %"PRIu32, + // FINEST("Cached the AAC audio codec initialization: %" PRIu32, // GETAVAILABLEBYTESCOUNT(_audioCodecInit)); return true; diff --git a/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp b/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp index 22dc814..26092e2 100644 --- a/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp +++ b/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp @@ -285,18 +285,18 @@ bool OutNetRTMP4TSStream::FeedVideoData(uint8_t *pData, uint32_t dataLength, // uint32_t cursor = 5; // uint32_t computed = 5; // string dbg; -// dbg += format("5 bytes: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", +// dbg += format("5 bytes: %02" PRIx8" %02" PRIx8" %02" PRIx8" %02" PRIx8" %02" PRIx8"\n", // pBuffer[0], pBuffer[1], pBuffer[2], pBuffer[3], pBuffer[4]); // while (cursor < length) { // uint32_t size = ENTOHLP(pBuffer + cursor); -// dbg += format("%s(%08"PRIx32")(%02"PRIx8"), ", +// dbg += format("%s(%08" PRIx32")(%02" PRIx8"), ", // STR(NALUToString(pBuffer[cursor + 4])), // size, // pBuffer[cursor + 4 + size - 1]); // cursor += 4 + size; // computed += 4 + size; // } -// dbg += format("\ncomputed: %"PRIu32"; available: %"PRIu32"; ok: %"PRIu8"\n", +// dbg += format("\ncomputed: %" PRIu32"; available: %" PRIu32"; ok: %" PRIu8"\n", // computed, length, computed == length); // fprintf(stdout, "%s\n", STR(dbg)); //} diff --git a/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp b/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp index c9a8d8e..46d930e 100644 --- a/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp +++ b/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp @@ -1654,7 +1654,7 @@ string BaseRTSPAppProtocolHandler::ComputeSDP(RTSPProtocol *pFrom, //3. Prepare the body of the response string result = ""; result += "v=0\r\n"; - result += format("o=- %"PRIu32" 0 IN IP4 %s\r\n", pFrom->GetId(), STR(nearAddress)); + result += format("o=- %" PRIu32" 0 IN IP4 %s\r\n", pFrom->GetId(), STR(nearAddress)); result += "s=" + targetStreamName + "\r\n"; result += "u=http://www.evostream.com\r\n"; result += "e=cont...@evostream.com\r\n"; diff --git a/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp b/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp index 0af6e66..99ba466 100644 --- a/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp +++ b/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp @@ -243,7 +243,7 @@ bool InboundConnectivity::Initialize() { map<uint32_t, BaseOutStream *> subscribedOutStreams = pApplication->GetStreamsManager()->GetWaitingSubscribers( _streamName, _pInStream->GetType()); - //FINEST("subscribedOutStreams count: %"PRIz"u", subscribedOutStreams.size()); + //FINEST("subscribedOutStreams count: %" PRIz"u", subscribedOutStreams.size()); //8. Bind the waiting subscribers @@ -272,11 +272,11 @@ string InboundConnectivity::GetTransportHeaderLine(bool isAudio, bool isClient) InboundRTPProtocol *pRTP = isAudio ? _pRTPAudio : _pRTPVideo; RTCPProtocol *pRTCP = isAudio ? _pRTCPAudio : _pRTCPVideo; if (isClient) { - return format("RTP/AVP;unicast;client_port=%"PRIu16"-%"PRIu16, + return format("RTP/AVP;unicast;client_port=%" PRIu16"-%" PRIu16, ((UDPCarrier *) pRTP->GetIOHandler())->GetNearEndpointPort(), ((UDPCarrier *) pRTCP->GetIOHandler())->GetNearEndpointPort()); } else { - return format("RTP/AVP;unicast;client_port=%s;server_port=%"PRIu16"-%"PRIu16, + return format("RTP/AVP;unicast;client_port=%s;server_port=%" PRIu16"-%" PRIu16, STR(track["portsOrChannels"]["all"]), ((UDPCarrier *) pRTP->GetIOHandler())->GetNearEndpointPort(), ((UDPCarrier *) pRTCP->GetIOHandler())->GetNearEndpointPort()); diff --git a/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp b/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp index 0b06b01..ef61129 100644 --- a/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp +++ b/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp @@ -124,20 +124,20 @@ void OutboundConnectivity::SetOutStream(BaseOutNetRTPUDPStream *pOutStream) { } string OutboundConnectivity::GetVideoPorts() { - return format("%"PRIu16"-%"PRIu16, _videoDataPort, _videoRTCPPort); + return format("%" PRIu16"-%" PRIu16, _videoDataPort, _videoRTCPPort); } string OutboundConnectivity::GetAudioPorts() { - return format("%"PRIu16"-%"PRIu16, _audioDataPort, _audioRTCPPort); + return format("%" PRIu16"-%" PRIu16, _audioDataPort, _audioRTCPPort); } string OutboundConnectivity::GetVideoChannels() { - return format("%"PRIu8"-%"PRIu8, _rtpClient.videoDataChannel, + return format("%" PRIu8"-%" PRIu8, _rtpClient.videoDataChannel, _rtpClient.videoRtcpChannel); } string OutboundConnectivity::GetAudioChannels() { - return format("%"PRIu8"-%"PRIu8, _rtpClient.audioDataChannel, + return format("%" PRIu8"-%" PRIu8, _rtpClient.audioDataChannel, _rtpClient.audioRtcpChannel); } diff --git a/thelib/src/protocols/rtp/nattraversalprotocol.cpp b/thelib/src/protocols/rtp/nattraversalprotocol.cpp index 23e4345..d88261e 100644 --- a/thelib/src/protocols/rtp/nattraversalprotocol.cpp +++ b/thelib/src/protocols/rtp/nattraversalprotocol.cpp @@ -60,12 +60,12 @@ bool NATTraversalProtocol::SignalInputData(IOBuffer &buffer, sockaddr_in *pPeerA } string ipAddress = inet_ntoa(_pOutboundAddress->sin_addr); if (_pOutboundAddress->sin_port == pPeerAddress->sin_port) { - INFO("The client has public endpoint: %s:%"PRIu16, + INFO("The client has public endpoint: %s:%" PRIu16, STR(ipAddress), ENTOHS(_pOutboundAddress->sin_port)); } else { - INFO("The client is behind firewall: %s:%"PRIu16" -> %s:%"PRIu16, + INFO("The client is behind firewall: %s:%" PRIu16" -> %s:%" PRIu16, STR(ipAddress), ENTOHS(_pOutboundAddress->sin_port), STR(ipAddress), diff --git a/thelib/src/protocols/rtp/rtspprotocol.cpp b/thelib/src/protocols/rtp/rtspprotocol.cpp index 2074ef1..d5d70ea 100644 --- a/thelib/src/protocols/rtp/rtspprotocol.cpp +++ b/thelib/src/protocols/rtp/rtspprotocol.cpp @@ -372,14 +372,14 @@ OutboundConnectivity * RTSPProtocol::GetOutboundConnectivity( _pOutboundConnectivity = new OutboundConnectivity(forceTcp, this); if (!_pOutboundConnectivity->Initialize()) { FATAL("Unable to initialize outbound connectivity"); - return false; + return 0; } pOutStream->SetConnectivity(_pOutboundConnectivity); _pOutboundConnectivity->SetOutStream(pOutStream); if (!pInNetStream->Link(pOutStream)) { FATAL("Unable to link streams"); - return false; + return 0; } } @@ -463,7 +463,7 @@ bool RTSPProtocol::SendMessage(Variant &headers, string &content) { //2. Add the content length if required if (content.size() > 0) { - headers[RTSP_HEADERS][RTSP_HEADERS_CONTENT_LENGTH] = format("%"PRIz"u", content.size()); + headers[RTSP_HEADERS][RTSP_HEADERS_CONTENT_LENGTH] = format("%" PRIz"u", content.size()); } //3. Add the session id if necessary @@ -706,7 +706,7 @@ bool RTSPProtocol::HandleRTSPMessage(IOBuffer &buffer) { _inboundContent += string((char *) GETIBPOINTER(buffer), chunkLength); buffer.Ignore(chunkLength); if (_inboundContent.size() < _contentLength) { - FINEST("Not enough data. Wanted: %u; got: %"PRIz"u", _contentLength, _inboundContent.size()); + FINEST("Not enough data. Wanted: %u; got: %" PRIz"u", _contentLength, _inboundContent.size()); return true; } } diff --git a/thelib/src/protocols/rtp/sdp.cpp b/thelib/src/protocols/rtp/sdp.cpp index 33bbad7..8e899b3 100644 --- a/thelib/src/protocols/rtp/sdp.cpp +++ b/thelib/src/protocols/rtp/sdp.cpp @@ -222,10 +222,10 @@ bool SDP::ParseTransportLine(string raw, Variant &result) { FATAL("Invalid transport line: %s", STR(raw)); return false; } - all = format("%"PRIu16"-%"PRIu16, data, rtcp); + all = format("%" PRIu16"-%" PRIu16, data, rtcp); } else { data = atoi(STR(parts[0])); - all = format("%"PRIu16, data); + all = format("%" PRIu16, data); rtcp = 0; } if (all != raw) { diff --git a/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp b/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp index 6365420..3e36aee 100644 --- a/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp +++ b/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp @@ -161,9 +161,9 @@ bool InNetRTPStream::FeedData(uint8_t *pData, uint32_t dataLength, switch (_rtcpPresence) { case RTCP_PRESENCE_UNKNOWN: { - DEBUG_RTCP_PRESENCE("RTCP_PRESENCE_UNKNOWN: %"PRIz"u", (time(NULL) - _rtcpDetectionStart)); + DEBUG_RTCP_PRESENCE("RTCP_PRESENCE_UNKNOWN: %" PRIz"u", (time(NULL) - _rtcpDetectionStart)); if (_rtcpDetectionInterval == 0) { - WARN("RTCP disabled on stream %s(%"PRIu32") with name %s. A/V drifting may occur over long periods of time", + WARN("RTCP disabled on stream %s(%" PRIu32") with name %s. A/V drifting may occur over long periods of time", STR(tagToString(GetType())), GetUniqueId(), STR(GetName())); _rtcpPresence = RTCP_PRESENCE_ABSENT; return true; @@ -173,7 +173,7 @@ bool InNetRTPStream::FeedData(uint8_t *pData, uint32_t dataLength, return true; } if ((time(NULL) - _rtcpDetectionStart) > _rtcpDetectionInterval) { - WARN("Stream %s(%"PRIu32") with name %s doesn't have RTCP. A/V drifting may occur over long periods of time", + WARN("Stream %s(%" PRIu32") with name %s doesn't have RTCP. A/V drifting may occur over long periods of time", STR(tagToString(GetType())), GetUniqueId(), STR(GetName())); _rtcpPresence = RTCP_PRESENCE_ABSENT; return true; @@ -195,7 +195,7 @@ bool InNetRTPStream::FeedData(uint8_t *pData, uint32_t dataLength, videoRTCPPresent = true; } if (audioRTCPPresent && videoRTCPPresent) { - DEBUG_RTCP_PRESENCE("RTCP available on stream %s(%"PRIu32") with name %s.", + DEBUG_RTCP_PRESENCE("RTCP available on stream %s(%" PRIu32") with name %s.", STR(tagToString(GetType())), GetUniqueId(), STR(GetName())); _rtcpPresence = RTCP_PRESENCE_AVAILABLE; } @@ -221,7 +221,7 @@ bool InNetRTPStream::FeedData(uint8_t *pData, uint32_t dataLength, } default: { - ASSERT("Invalid _rtcpPresence: %"PRIu8, _rtcpPresence); + ASSERT("Invalid _rtcpPresence: %" PRIu8, _rtcpPresence); return false; } } @@ -234,7 +234,7 @@ bool InNetRTPStream::FeedData(uint8_t *pData, uint32_t dataLength, } if (lastTs * 100.00 > absoluteTimestamp * 100.00) { - WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f; isAudio: %"PRIu8, + WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f; isAudio: %" PRIu8, STR(GetName()), absoluteTimestamp, lastTs, @@ -289,7 +289,7 @@ bool InNetRTPStream::FeedVideoData(uint8_t *pData, uint32_t dataLength, return true; } else { if ((uint16_t) (_videoSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { - WARN("Missing video packet. Wanted: %"PRIu16"; got: %"PRIu16" on stream: %s", + WARN("Missing video packet. Wanted: %" PRIu16"; got: %" PRIu16" on stream: %s", (uint16_t) (_videoSequence + 1), (uint16_t) GET_RTP_SEQ(rtpHeader), STR(GetName())); @@ -308,7 +308,7 @@ bool InNetRTPStream::FeedVideoData(uint8_t *pData, uint32_t dataLength, uint8_t naluType = NALU_TYPE(pData[0]); if (naluType <= 23) { //3. Standard NALU - //FINEST("V: %08"PRIx32, rtpHeader._timestamp); + //FINEST("V: %08" PRIx32, rtpHeader._timestamp); _videoPacketsCount++; _videoBytesCount += dataLength; return FeedData(pData, dataLength, 0, dataLength, ts, false); @@ -329,7 +329,7 @@ bool InNetRTPStream::FeedVideoData(uint8_t *pData, uint32_t dataLength, //middle NAL _currentNalu.ReadFromBuffer(pData + 2, dataLength - 2); if (((pData[1] >> 6)&0x01) == 1) { - //FINEST("V: %08"PRIx32, rtpHeader._timestamp); + //FINEST("V: %08" PRIx32, rtpHeader._timestamp); _videoPacketsCount++; _videoBytesCount += GETAVAILABLEBYTESCOUNT(_currentNalu); if (!FeedData(GETIBPOINTER(_currentNalu), @@ -387,7 +387,7 @@ bool InNetRTPStream::FeedAudioData(uint8_t *pData, uint32_t dataLength, return true; } else { if ((uint16_t) (_audioSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { - WARN("Missing audio packet. Wanted: %"PRIu16"; got: %"PRIu16" on stream: %s", + WARN("Missing audio packet. Wanted: %" PRIu16"; got: %" PRIu16" on stream: %s", (uint16_t) (_audioSequence + 1), (uint16_t) GET_RTP_SEQ(rtpHeader), STR(GetName())); @@ -402,7 +402,7 @@ bool InNetRTPStream::FeedAudioData(uint8_t *pData, uint32_t dataLength, //1. Compute chunks count uint16_t chunksCount = ENTOHSP(pData); if ((chunksCount % 16) != 0) { - FATAL("Invalid AU headers length: %"PRIx16, chunksCount); + FATAL("Invalid AU headers length: %" PRIx16, chunksCount); return false; } chunksCount = chunksCount / 16; @@ -420,7 +420,7 @@ bool InNetRTPStream::FeedAudioData(uint8_t *pData, uint32_t dataLength, } ts = (double) (rtpTs + i * 1024) / (double) _capabilities.aac._sampleRate * 1000.00; if ((cursor + chunkSize) > dataLength) { - FATAL("Unable to feed data: cursor: %"PRIu32"; chunkSize: %"PRIu16"; dataLength: %"PRIu32"; chunksCount: %"PRIu16, + FATAL("Unable to feed data: cursor: %" PRIu32"; chunkSize: %" PRIu16"; dataLength: %" PRIu32"; chunksCount: %" PRIu16, cursor, chunkSize, dataLength, chunksCount); return false; } diff --git a/thelib/src/protocols/ssl/basesslprotocol.cpp b/thelib/src/protocols/ssl/basesslprotocol.cpp index e0892c9..3719b34 100644 --- a/thelib/src/protocols/ssl/basesslprotocol.cpp +++ b/thelib/src/protocols/ssl/basesslprotocol.cpp @@ -223,8 +223,8 @@ string BaseSSLProtocol::DumpBIO(BIO *pBIO) { formatString += "next_bio: %p\n"; formatString += "prev_bio: %p\n"; formatString += "references: %d\n"; - formatString += "num_read: %"PRId64"\n"; - formatString += "num_write: %"PRId64; + formatString += "num_read: %" PRId64"\n"; + formatString += "num_write: %" PRId64; return format(formatString, pBIO->method, pBIO->callback, diff --git a/thelib/src/protocols/ts/innettsstream.cpp b/thelib/src/protocols/ts/innettsstream.cpp index e64a625..72166d4 100644 --- a/thelib/src/protocols/ts/innettsstream.cpp +++ b/thelib/src/protocols/ts/innettsstream.cpp @@ -190,7 +190,7 @@ bool InNetTSStream::FeedData(uint8_t *pData, uint32_t length, bool packetStart, value = (value + roll)&0x1ffffffff; #endif /* __FORCE_ROLL_OVER_FOR_DEBUG */ #ifdef __DUMP_TIMESTAMP_INFO_FOR_DEBUG - string dbg = format("%c lastRawPts: %09"PRIx64" -> value: %09"PRIx64"; ", isAudio ? 'A' : 'V', lastRawPts, value); + string dbg = format("%c lastRawPts: %09" PRIx64" -> value: %09" PRIx64"; ", isAudio ? 'A' : 'V', lastRawPts, value); #endif /* __DUMP_TIMESTAMP_INFO_FOR_DEBUG */ if (((lastRawPts >> 32) == 1) && ((value >> 32) == 0)) { @@ -202,7 +202,7 @@ bool InNetTSStream::FeedData(uint8_t *pData, uint32_t length, bool packetStart, lastRawPts = value; value += (rollOverCount * 0x1ffffffffLL); #ifdef __DUMP_TIMESTAMP_INFO_FOR_DEBUG - dbg += format("final: %09"PRIx64"; ", value); + dbg += format("final: %09" PRIx64"; ", value); #endif /* __DUMP_TIMESTAMP_INFO_FOR_DEBUG */ double tempPtsTime = (double) value / 90.00; if (ptsTime > tempPtsTime) { diff --git a/thelib/src/protocols/ts/tspacketpat.cpp b/thelib/src/protocols/ts/tspacketpat.cpp index e0a6b35..220fe98 100644 --- a/thelib/src/protocols/ts/tspacketpat.cpp +++ b/thelib/src/protocols/ts/tspacketpat.cpp @@ -61,14 +61,14 @@ TSPacketPAT::operator string() { result += format("lastSectionNumber: %hhu\n", _lastSectionNumber); result += format("crc: %x\n", _crc); result += format("entriesCount: %u\n", _entriesCount); - result += format("NIT count: %"PRIz"u\n", _networkPids.size()); + result += format("NIT count: %" PRIz"u\n", _networkPids.size()); if (_networkPids.size() > 0) { FOR_MAP(_networkPids, uint16_t, uint16_t, i) { result += format("\tNIT %hu: %hu\n", MAP_KEY(i), MAP_VAL(i)); } } - result += format("PMT count: %"PRIz"u\n", _programPids.size()); + result += format("PMT count: %" PRIz"u\n", _programPids.size()); if (_programPids.size() > 0) { FOR_MAP(_programPids, uint16_t, uint16_t, i) { diff --git a/thelib/src/protocols/ts/tspacketpmt.cpp b/thelib/src/protocols/ts/tspacketpmt.cpp index 3a24896..186ec64 100644 --- a/thelib/src/protocols/ts/tspacketpmt.cpp +++ b/thelib/src/protocols/ts/tspacketpmt.cpp @@ -48,13 +48,13 @@ TSPacketPMT::operator string() { result += format("reserved5: %hhu\n", _reserved5); result += format("programInfoLength: %hu\n", _programInfoLength); result += format("crc: %x\n", _crc); - result += format("descriptors count: %"PRIz"u\n", _programInfoDescriptors.size()); + result += format("descriptors count: %" PRIz"u\n", _programInfoDescriptors.size()); for (uint32_t i = 0; i < _programInfoDescriptors.size(); i++) { result += format("\t%s", STR(_programInfoDescriptors[i])); if (i != _programInfoDescriptors.size() - 1) result += "\n"; } - result += format("streams count: %"PRIz"u\n", _streams.size()); + result += format("streams count: %" PRIz"u\n", _streams.size()); FOR_MAP(_streams, uint16_t, TSStreamInfo, i) { result += format("\t%hu: %s\n", MAP_KEY(i), STR(MAP_VAL(i).toString(1))); diff --git a/thelib/src/streaming/baseinfilestream.cpp b/thelib/src/streaming/baseinfilestream.cpp index 84b295d..4c3cba8 100644 --- a/thelib/src/streaming/baseinfilestream.cpp +++ b/thelib/src/streaming/baseinfilestream.cpp @@ -169,7 +169,7 @@ bool BaseInFileStream::ResolveCompleteMetadata(Variant &metaData) { bool BaseInFileStream::Initialize(int32_t clientSideBufferLength) { //1. Check to see if we have an universal seeking file - string seekFilePath = GetName() + "."MEDIA_TYPE_SEEK; + string seekFilePath = GetName() + "." MEDIA_TYPE_SEEK; if (!fileExists(seekFilePath)) { Variant temp; temp[META_SERVER_FULL_PATH] = GetName(); @@ -199,8 +199,8 @@ bool BaseInFileStream::Initialize(int32_t clientSideBufferLength) { } if (!StreamCapabilities::Deserialize(raw, _streamCapabilities)) { FATAL("Unable to deserialize stream Capabilities. Please delete %s and %s files so they can be regenerated", - STR(GetName() + "."MEDIA_TYPE_SEEK), - STR(GetName() + "."MEDIA_TYPE_META)); + STR(GetName() + "." MEDIA_TYPE_SEEK), + STR(GetName() + "." MEDIA_TYPE_META)); return false; } @@ -212,7 +212,7 @@ bool BaseInFileStream::Initialize(int32_t clientSideBufferLength) { //5. Compute the optimal window size by reading the biggest frame size //from the seek file. if (!_pSeekFile->SeekTo(_pSeekFile->Size() - 8)) { - FATAL("Unable to seek to %"PRIu64" position", _pSeekFile->Cursor() - 8); + FATAL("Unable to seek to %" PRIu64" position", _pSeekFile->Cursor() - 8); return false; } uint64_t maxFrameSize = 0; @@ -237,7 +237,7 @@ bool BaseInFileStream::Initialize(int32_t clientSideBufferLength) { //4. Read the frames count from the file if (!_pSeekFile->SeekTo(_seekBaseOffset)) { - FATAL("Unable to seek to _seekBaseOffset: %"PRIu64, _seekBaseOffset); + FATAL("Unable to seek to _seekBaseOffset: %" PRIu64, _seekBaseOffset); return false; } if (!_pSeekFile->ReadUI32(&_totalFrames, false)) { diff --git a/thelib/src/streaming/streamcapabilities.cpp b/thelib/src/streaming/streamcapabilities.cpp index 0ed66ed..3148475 100644 --- a/thelib/src/streaming/streamcapabilities.cpp +++ b/thelib/src/streaming/streamcapabilities.cpp @@ -40,7 +40,7 @@ _VIDEO_AVC::~_VIDEO_AVC() { #define CHECK_BA_LIMITS(name,length) \ if(ba.AvailableBits()<length) { \ - FATAL("Unable to read `"name"` value. Not enough bits. Wanted: %u; Have: %u", \ + FATAL("Unable to read `" name "` value. Not enough bits. Wanted: %u; Have: %u", \ (uint32_t)length, ba.AvailableBits()); \ return false; \ } @@ -55,7 +55,7 @@ if(ba.AvailableBits()<length) { \ { \ uint64_t ___value___=0; \ if(!ba.ReadExpGolomb(___value___)) { \ - FATAL("Unable to read `"name"` value"); \ + FATAL("Unable to read `" name "` value"); \ return false; \ } \ v[name]=(type)___value___; \ @@ -463,10 +463,10 @@ bool _VIDEO_AVC::Deserialize(IOBuffer &src, _VIDEO_AVC &dest) { _VIDEO_AVC::operator string() { string result; - result += format("_spsLength: %"PRIu16"\n", _spsLength); - result += format("_ppsLength: %"PRIu16"\n", _ppsLength); - result += format("_rate: %"PRIu32"\n", _rate); - result += format("WxH: %"PRIu32"x%"PRIu32, _width, _height); + result += format("_spsLength: %" PRIu16"\n", _spsLength); + result += format("_ppsLength: %" PRIu16"\n", _ppsLength); + result += format("_rate: %" PRIu32"\n", _rate); + result += format("WxH: %" PRIu32"x%" PRIu32, _width, _height); return result; } @@ -739,7 +739,7 @@ bool StreamCapabilities::Deserialize(string seekFilePath, StreamCapabilities &ca return false; } if (length > 1024 * 1024) { - FATAL("Invalid stream capabilities length in file %s: %"PRIu32, STR(seekFilePath), length); + FATAL("Invalid stream capabilities length in file %s: %" PRIu32, STR(seekFilePath), length); return false; } @@ -769,7 +769,7 @@ bool StreamCapabilities::Deserialize(IOBuffer &src, StreamCapabilities &capabili } uint64_t ver = ENTOHLLP(pBuffer); if (ver != __STREAM_CAPABILITIES_VERSION) { - FATAL("Invalid stream capabilities version. Wanted: %"PRIu64"; Got: %"PRIu64, + FATAL("Invalid stream capabilities version. Wanted: %" PRIu64"; Got: %" PRIu64, __STREAM_CAPABILITIES_VERSION, ver); return false; } diff --git a/thelib/src/streaming/streamsmanager.cpp b/thelib/src/streaming/streamsmanager.cpp index 0ec07f5..c43b753 100644 --- a/thelib/src/streaming/streamsmanager.cpp +++ b/thelib/src/streaming/streamsmanager.cpp @@ -102,7 +102,7 @@ map<uint32_t, BaseOutStream *> StreamsManager::GetWaitingSubscribers(string stre shortSubscribers = FindByTypeByName(ST_OUT, shortName, true, false); longSubscribers = FindByTypeByName(ST_OUT, streamName, true, false); - // FINEST("short count: %"PRIz"u; long count: %"PRIz"u", + // FINEST("short count: %" PRIz"u; long count: %" PRIz"u", // shortSubscribers.size(), longSubscribers.size()); //3. merge them -- 2.8.1