Changeset 413
- Timestamp:
- 03/31/11 15:00:26 (14 months ago)
- Location:
- trunk
- Files:
-
- 144 edited
-
builders/cmake/CMakeLists.txt (modified) (1 diff)
-
sources/androidapplestreaming/src/api.cpp (modified) (5 diffs)
-
sources/applications/applestreamingclient/include/protocols/variant/messagestructure.h (modified) (1 diff)
-
sources/applications/applestreamingclient/src/clientcontext.cpp (modified) (6 diffs)
-
sources/applications/applestreamingclient/src/jnihelpers.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/playlist.cpp (modified) (4 diffs)
-
sources/applications/applestreamingclient/src/protocols/aes/aesappprotocolhandler.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/httpbuff/httpbuffappprotocolhandler.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/m3u8/childm3u8protocol.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/timer/finetimer.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/timer/scheduletimerprotocol.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/ts/tsappprotocolhandler.cpp (modified) (1 diff)
-
sources/applications/applestreamingclient/src/protocols/variant/variantappprotocolhandler.cpp (modified) (2 diffs)
-
sources/applications/proxypublish/src/proxypublishapplication.cpp (modified) (2 diffs)
-
sources/common/include/platform/android/androidplatform.h (modified) (2 diffs)
-
sources/common/include/platform/freebsd/freebsdplatform.h (modified) (2 diffs)
-
sources/common/include/platform/linux/linuxplatform.h (modified) (2 diffs)
-
sources/common/include/platform/openbsd/openbsdplatform.h (modified) (2 diffs)
-
sources/common/include/platform/osx/osxplatform.h (modified) (2 diffs)
-
sources/common/include/platform/solaris/solarisplatform.h (modified) (2 diffs)
-
sources/common/include/platform/windows/win32platform.h (modified) (3 diffs)
-
sources/common/include/utils/logging/logging.h (modified) (1 diff)
-
sources/common/include/utils/misc/variant.h (modified) (1 diff)
-
sources/common/src/platform/android/androidplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/freebsd/freebsdplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/linux/linuxplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/openbsd/openbsdplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/osx/osxplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/solaris/solarisplatform.cpp (modified) (3 diffs)
-
sources/common/src/platform/windows/strptime.cpp (modified) (3 diffs)
-
sources/common/src/platform/windows/win32platform.cpp (modified) (6 diffs)
-
sources/common/src/utils/buffering/iobuffer.cpp (modified) (4 diffs)
-
sources/common/src/utils/logging/consoleloglocation.cpp (modified) (2 diffs)
-
sources/common/src/utils/logging/fileloglocation.cpp (modified) (1 diff)
-
sources/common/src/utils/logging/logcatloglocation.cpp (modified) (1 diff)
-
sources/common/src/utils/lua/luautils.cpp (modified) (7 diffs)
-
sources/common/src/utils/misc/crypto.cpp (modified) (1 diff)
-
sources/common/src/utils/misc/file.cpp (modified) (6 diffs)
-
sources/common/src/utils/misc/mmapfile.cpp (modified) (9 diffs)
-
sources/common/src/utils/misc/timersmanager.cpp (modified) (1 diff)
-
sources/common/src/utils/misc/uri.cpp (modified) (2 diffs)
-
sources/common/src/utils/misc/variant.cpp (modified) (35 diffs)
-
sources/common/src/utils/tinyxml/tinyxml.cpp (modified) (3 diffs)
-
sources/crtmpserver/src/crtmpserver.cpp (modified) (1 diff)
-
sources/tests/include/basetestssuite.h (modified) (3 diffs)
-
sources/tests/src/main.cpp (modified) (1 diff)
-
sources/tests/src/thelibtestssuite.cpp (modified) (1 diff)
-
sources/thelib/include/mediaformats/mediaframe.h (modified) (1 diff)
-
sources/thelib/include/mediaformats/mp4/atomesds.h (modified) (1 diff)
-
sources/thelib/include/netio/epoll/tcpconnector.h (modified) (2 diffs)
-
sources/thelib/include/netio/kqueue/tcpconnector.h (modified) (2 diffs)
-
sources/thelib/include/netio/select/tcpconnector.h (modified) (1 diff)
-
sources/thelib/include/protocols/rtmp/amftypes.h (modified) (1 diff)
-
sources/thelib/include/protocols/rtp/rtpheader.h (modified) (1 diff)
-
sources/thelib/include/protocols/ts/streamdescriptors.h (modified) (1 diff)
-
sources/thelib/include/protocols/ts/tsboundscheck.h (modified) (1 diff)
-
sources/thelib/include/protocols/ts/tspacketpmt.h (modified) (2 diffs)
-
sources/thelib/src/application/baseclientapplication.cpp (modified) (4 diffs)
-
sources/thelib/src/application/clientapplicationmanager.cpp (modified) (2 diffs)
-
sources/thelib/src/configuration/configfile.cpp (modified) (4 diffs)
-
sources/thelib/src/mediaformats/basemediadocument.cpp (modified) (3 diffs)
-
sources/thelib/src/mediaformats/flv/flvdocument.cpp (modified) (2 diffs)
-
sources/thelib/src/mediaformats/mp3/id3parser.cpp (modified) (5 diffs)
-
sources/thelib/src/mediaformats/mp3/mp3document.cpp (modified) (3 diffs)
-
sources/thelib/src/mediaformats/mp4/atomavcc.cpp (modified) (1 diff)
-
sources/thelib/src/mediaformats/mp4/atomdata.cpp (modified) (2 diffs)
-
sources/thelib/src/mediaformats/mp4/atomesds.cpp (modified) (12 diffs)
-
sources/thelib/src/mediaformats/mp4/baseatom.cpp (modified) (3 diffs)
-
sources/thelib/src/mediaformats/mp4/boxatom.cpp (modified) (1 diff)
-
sources/thelib/src/mediaformats/mp4/mp4document.cpp (modified) (5 diffs)
-
sources/thelib/src/mediaformats/nsv/mp3media.cpp (modified) (1 diff)
-
sources/thelib/src/mediaformats/nsv/nsvdocument.cpp (modified) (5 diffs)
-
sources/thelib/src/netio/epoll/inboundnamedpipecarrier.cpp (modified) (2 diffs)
-
sources/thelib/src/netio/epoll/iohandler.cpp (modified) (1 diff)
-
sources/thelib/src/netio/epoll/iohandlermanager.cpp (modified) (11 diffs)
-
sources/thelib/src/netio/epoll/tcpacceptor.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/epoll/tcpcarrier.cpp (modified) (2 diffs)
-
sources/thelib/src/netio/epoll/udpcarrier.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/kqueue/inboundnamedpipecarrier.cpp (modified) (2 diffs)
-
sources/thelib/src/netio/kqueue/iohandler.cpp (modified) (1 diff)
-
sources/thelib/src/netio/kqueue/iohandlermanager.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/kqueue/iotimer.cpp (modified) (1 diff)
-
sources/thelib/src/netio/kqueue/stdiocarrier.cpp (modified) (1 diff)
-
sources/thelib/src/netio/kqueue/tcpacceptor.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/kqueue/tcpcarrier.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/kqueue/udpcarrier.cpp (modified) (4 diffs)
-
sources/thelib/src/netio/select/inboundnamedpipecarrier.cpp (modified) (2 diffs)
-
sources/thelib/src/netio/select/iohandler.cpp (modified) (1 diff)
-
sources/thelib/src/netio/select/iohandlermanager.cpp (modified) (4 diffs)
-
sources/thelib/src/netio/select/stdiocarrier.cpp (modified) (1 diff)
-
sources/thelib/src/netio/select/tcpacceptor.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/select/tcpcarrier.cpp (modified) (3 diffs)
-
sources/thelib/src/netio/select/udpcarrier.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/baseprotocol.cpp (modified) (7 diffs)
-
sources/thelib/src/protocols/dns/inbounddnsresolverprotocol.cpp (modified) (2 diffs)
-
sources/thelib/src/protocols/dns/outbounddnsresolverprotocol.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/http/basehttpprotocol.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/http/inboundhttpprotocol.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/liveflv/baseliveflvappprotocolhandler.cpp (modified) (2 diffs)
-
sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp (modified) (5 diffs)
-
sources/thelib/src/protocols/liveflv/innetliveflvstream.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/protocolfactorymanager.cpp (modified) (7 diffs)
-
sources/thelib/src/protocols/rtmfp/basertmfpprotocol.cpp (modified) (12 diffs)
-
sources/thelib/src/protocols/rtmp/amf0serializer.cpp (modified) (14 diffs)
-
sources/thelib/src/protocols/rtmp/amf3serializer.cpp (modified) (15 diffs)
-
sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp (modified) (8 diffs)
-
sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp (modified) (14 diffs)
-
sources/thelib/src/protocols/rtmp/header_be_ba.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtmp/header_le_ba.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtmp/header_le_sa.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp (modified) (2 diffs)
-
sources/thelib/src/protocols/rtmp/outboundrtmpprotocol.cpp (modified) (8 diffs)
-
sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp (modified) (15 diffs)
-
sources/thelib/src/protocols/rtmp/sharedobjects/so.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtmp/streaming/infilertmpflvstream.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/rtmp/streaming/infilertmpmp3stream.cpp (modified) (2 diffs)
-
sources/thelib/src/protocols/rtmp/streaming/infilertmpmp4stream.cpp (modified) (2 diffs)
-
sources/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp (modified) (14 diffs)
-
sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp (modified) (5 diffs)
-
sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp (modified) (10 diffs)
-
sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp (modified) (7 diffs)
-
sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp (modified) (7 diffs)
-
sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtp/rtcpprotocol.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtp/rtspprotocol.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtp/sdp.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp (modified) (5 diffs)
-
sources/thelib/src/protocols/ssl/basesslprotocol.cpp (modified) (4 diffs)
-
sources/thelib/src/protocols/ts/basetsappprotocolhandler.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/ts/inboundtsprotocol.cpp (modified) (5 diffs)
-
sources/thelib/src/protocols/ts/innettsstream.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/ts/tspacketpat.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/ts/tspacketpmt.cpp (modified) (3 diffs)
-
sources/thelib/src/streaming/baseinfilestream.cpp (modified) (1 diff)
-
sources/thelib/src/streaming/streamcapabilities.cpp (modified) (8 diffs)
-
sources/thelib/src/streaming/streamsmanager.cpp (modified) (2 diffs)
-
sources/trafficdissector/src/basefeeder.cpp (modified) (3 diffs)
-
sources/trafficdissector/src/main.cpp (modified) (1 diff)
-
sources/trafficdissector/src/monitorrtmpprotocol.cpp (modified) (3 diffs)
-
sources/vmtests/src/main.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/builders/cmake/CMakeLists.txt
r405 r413 139 139 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERIC_FLAGS}") 140 140 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERIC_FLAGS}") 141 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DWITH_SANITY_INPUT_BUFFER ")141 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DWITH_SANITY_INPUT_BUFFER -DVALIDATE_FROMAT_SPECIFIERS -Wformat=2") 142 142 SET(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing") 143 143 #SET(CMAKE_VERBOSE_MAKEFILE TRUE) -
trunk/sources/androidapplestreaming/src/api.cpp
r207 r413 29 29 using namespace app_applestreamingclient; 30 30 31 static sockaddr_in gAddress = {0};31 static sockaddr_in gAddress; 32 32 33 33 #define SEND_VARIANT_REQUEST(request,response) \ … … 92 92 configuration[CONF_APPLICATION_MEDIAFOLDER] = "./"; 93 93 configuration[CONF_APPLICATION_GENERATE_META_FILES] = (bool)false; 94 configuration["rtspHost"] = format("rtsp://127.0.0.1:% d/", port);94 configuration["rtspHost"] = format("rtsp://127.0.0.1:%hu/", port); 95 95 AppleStreamingClientApplication *pApp = new AppleStreamingClientApplication( 96 96 configuration); … … 175 175 UDPCarrier *pUDPCarrier = UDPCarrier::Create(acceptorConfig[CONF_IP], (uint16_t) acceptorConfig[CONF_PORT]); 176 176 if (pUDPCarrier == NULL) { 177 ASSERT("Unable to bind on udp://%s:% d", STR(acceptorConfig[CONF_IP]), (uint16_t) acceptorConfig[CONF_PORT]);177 ASSERT("Unable to bind on udp://%s:%hu", STR(acceptorConfig[CONF_IP]), (uint16_t) acceptorConfig[CONF_PORT]); 178 178 } 179 179 BaseProtocol *pTimer = ProtocolFactoryManager::CreateProtocolChain(chain, acceptorConfig); … … 184 184 185 185 inet_aton("127.0.0.1", &gAddress.sin_addr); 186 memset(&gAddress, 0, sizeof (gAddress)); 186 187 gAddress.sin_family = AF_INET; 187 188 gAddress.sin_port = EHTONS(port + 1); … … 311 312 httpSessionId = parts[2]; 312 313 } 313 FINEST("uri: `%s`\nkeyPassword: `%s`\nhttpSessionId: `%s`", STR(uri), 314 FINEST("uri: `%s`\nkeyPassword: `%s`\nhttpSessionId: `%s`", 315 STR(uri), 314 316 STR(keyPassword), STR(httpSessionId)); 315 317 if (uri == "") { -
trunk/sources/applications/applestreamingclient/include/protocols/variant/messagestructure.h
r399 r413 226 226 default: \ 227 227 { \ 228 ASSERT("Unknown status code: % d",(status)); \228 ASSERT("Unknown status code: %u",(uint32_t)(status)); \ 229 229 ASC_RES_STATUS_DESC(r)=ASC_RES_STATUS_UNKNOWN; \ 230 230 break;\ -
trunk/sources/applications/applestreamingclient/src/clientcontext.cpp
r411 r413 58 58 _avData.EnsureSize(_maxAVBufferSize * 3); 59 59 _firstFeedTime = 0; 60 INFO("Context created: %d (%p)", _id, this);61 60 } 62 61 63 62 ClientContext::~ClientContext() { 64 INFO("Context destroyed: %d (%p)", _id, this);65 63 if (_pMasterPlaylist != NULL) { 66 64 delete _pMasterPlaylist; … … 160 158 Playlist *ClientContext::ChildPlaylist(uint32_t bw) { 161 159 if (!MAP_HAS1(_childPlaylists, bw)) { 162 FATAL("Playlist for bandwidth % dnot found", bw);160 FATAL("Playlist for bandwidth %u not found", bw); 163 161 return NULL; 164 162 } … … 465 463 parameters["applicationId"]); 466 464 if (pApp == NULL) { 467 FATAL("Application id % dnot found", (uint32_t) parameters["applicationId"]);465 FATAL("Application id %u not found", (uint32_t) parameters["applicationId"]); 468 466 return false; 469 467 } … … 485 483 if (_allowedBitrates.size() > 0) { 486 484 if (!MAP_HAS1(_allowedBitrates, bw)) { 487 WARN("Skipping bitrate % d", bw);485 WARN("Skipping bitrate %u", bw); 488 486 continue; 489 487 } … … 492 490 493 491 if (MAP_HAS1(_childPlaylists, bw)) { 494 FATAL("Duplicate bandwidth detected: % d", bw);492 FATAL("Duplicate bandwidth detected: %u", bw); 495 493 return false; 496 494 } … … 522 520 delete pPl; 523 521 _childPlaylists.erase(bw); 524 WARN("bw % dremoved", bw);522 WARN("bw %u removed", bw); 525 523 return StartFeeding(); 526 524 } -
trunk/sources/applications/applestreamingclient/src/jnihelpers.cpp
r170 r413 123 123 default: 124 124 { 125 FATAL("Invalid variant type: % d", (VariantType) value);125 FATAL("Invalid variant type: %hhu", (VariantType) value); 126 126 pEnv->PopLocalFrame(NULL); 127 127 return NULL; -
trunk/sources/applications/applestreamingclient/src/playlist.cpp
r411 r413 155 155 } 156 156 if (!bandwidthFound) { 157 FATAL("Item number %u do wsn't have bandwidth info", MAP_KEY(i));157 FATAL("Item number %u doesn't have bandwidth info", MAP_KEY(i)); 158 158 return false; 159 159 } … … 213 213 uint32_t Playlist::GetIndex(uint32_t &sequence) { 214 214 FINEST("---------------------"); 215 FINEST("sequence requested: % d", sequence);215 FINEST("sequence requested: %u", sequence); 216 216 //1. We have it, we return it 217 217 if (MAP_HAS1(_itemMediaSequences, sequence)) { … … 224 224 if (sequence == 0) { 225 225 FINEST("sequence is 0"); 226 FINEST("_itemMediaSequences.size(): % d", _itemMediaSequences.size());226 FINEST("_itemMediaSequences.size(): %zu", _itemMediaSequences.size()); 227 227 if (_itemMediaSequences.size() != 0) { 228 228 //3. We have stuff. Init and return … … 248 248 249 249 FOR_MAP(_itemMediaSequences, uint32_t, uint32_t, i) { 250 FINEST("sequence: % d; MAP_KEY(i): %d", sequence, MAP_KEY(i));250 FINEST("sequence: %u; MAP_KEY(i): %u", sequence, MAP_KEY(i)); 251 251 if (MAP_KEY(i) >= sequence) { 252 252 sequence = MAP_KEY(i); -
trunk/sources/applications/applestreamingclient/src/protocols/aes/aesappprotocolhandler.cpp
r160 r413 39 39 BaseProtocol *pTSProtocol = ProtocolManager::GetProtocol(tsId); 40 40 if (pTSProtocol == NULL) { 41 FATAL("Unable to get TS protocol by id: % d", tsId);41 FATAL("Unable to get TS protocol by id: %u", tsId); 42 42 pProtocol->EnqueueForDelete(); 43 43 return; -
trunk/sources/applications/applestreamingclient/src/protocols/httpbuff/httpbuffappprotocolhandler.cpp
r160 r413 39 39 BaseProtocol *pTSProtocol = ProtocolManager::GetProtocol(tsId); 40 40 if (pTSProtocol == NULL) { 41 FATAL("Unable to get TS protocol by id: % d", tsId);41 FATAL("Unable to get TS protocol by id: %u", tsId); 42 42 pProtocol->EnqueueForDelete(); 43 43 return; -
trunk/sources/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp
r411 r413 75 75 string encryptedKey = unb64(temp); 76 76 if (encryptedKey.size() != 16) { 77 FATAL("Invalid key length: % d", encryptedKey.size());77 FATAL("Invalid key length: %zu", encryptedKey.size()); 78 78 return false; 79 79 } -
trunk/sources/applications/applestreamingclient/src/protocols/m3u8/childm3u8protocol.cpp
r160 r413 37 37 _bw = parameters["payload"]["bw"]; 38 38 if (_bw == 0) { 39 FATAL("Invalid bandwidth: % d", _bw);39 FATAL("Invalid bandwidth: %u", _bw); 40 40 return false; 41 41 } -
trunk/sources/applications/applestreamingclient/src/protocols/timer/finetimer.cpp
r411 r413 69 69 ClientContext *pContext = ClientContext::GetContext(MAP_VAL(i), 0, 0); 70 70 if (pContext == NULL) { 71 WARN("Unable to get context with id % d", MAP_VAL(i));71 WARN("Unable to get context with id %u", MAP_VAL(i)); 72 72 continue; 73 73 } -
trunk/sources/applications/applestreamingclient/src/protocols/timer/scheduletimerprotocol.cpp
r411 r413 43 43 ClientContext *pContext = ClientContext::GetContext(_contextId, 0, 0); 44 44 if (pContext == NULL) { 45 FATAL("Unable to get context with id % d", _contextId);45 FATAL("Unable to get context with id %u", _contextId); 46 46 return false; 47 47 } -
trunk/sources/applications/applestreamingclient/src/protocols/ts/tsappprotocolhandler.cpp
r160 r413 42 42 ClientContext *pContext = ClientContext::GetContext(contextId, 0, 0); 43 43 if (pContext == NULL) { 44 FATAL("Unable to get the context with id: % d", contextId);44 FATAL("Unable to get the context with id: %u", contextId); 45 45 pProtocol->EnqueueForDelete(); 46 46 return; -
trunk/sources/applications/applestreamingclient/src/protocols/variant/variantappprotocolhandler.cpp
r160 r413 130 130 131 131 FOR_MAP(ASC_REQ_COMMAND_SET_BITRATES_BWS(request), string, Variant, i) { 132 FINEST("(uint32_t)MAP_VAL(i): % d", (uint32_t) MAP_VAL(i));132 FINEST("(uint32_t)MAP_VAL(i): %u", (uint32_t) MAP_VAL(i)); 133 133 bws[(uint32_t) MAP_VAL(i)] = (uint32_t) MAP_VAL(i); 134 134 } … … 184 184 vector<string> allStreams; 185 185 for (uint32_t i = 0; i < contextIds.size(); i++) { 186 FINEST("Inspecting context id: % d", contextIds[i]);186 FINEST("Inspecting context id: %u", contextIds[i]); 187 187 ClientContext *pContext = GetContext(contextIds[i], 188 188 pProtocol->GetType()); 189 189 if (pContext == NULL) { 190 WARN("Context id % dis NULL", contextIds[i]);190 WARN("Context id %u is NULL", contextIds[i]); 191 191 continue; 192 192 } 193 193 if (pContext->EventSink()->GetType() != EVENT_SYNC_VARIANT) { 194 WARN("Context id % dis not Variant friendly", contextIds[i]);194 WARN("Context id %u is not Variant friendly", contextIds[i]); 195 195 continue; 196 196 } -
trunk/sources/applications/proxypublish/src/proxypublishapplication.cpp
r411 r413 179 179 Variant &target = MAP_VAL(i); 180 180 if (!InitiateForwardingStream(pStream, target)) { 181 WARN("Unable to forward stream % dof type %s with name `%s` owned by application `%s` to server %s",181 WARN("Unable to forward stream %u of type %s with name `%s` owned by application `%s` to server %s", 182 182 pStream->GetUniqueId(), 183 183 STR(tagToString(pStream->GetType())), … … 217 217 218 218 //3. Some nice info 219 INFO("Initiate forward stream % dof type %s with name `%s` owned by application `%s` to server %s with name `%s`",219 INFO("Initiate forward stream %u of type %s with name `%s` owned by application `%s` to server %s with name `%s`", 220 220 pStream->GetUniqueId(), 221 221 STR(tagToString(pStream->GetType())), -
trunk/sources/common/include/platform/android/androidplatform.h
r389 r413 26 26 27 27 //platform includes 28 #define __STDC_FORMAT_MACROS 29 #include <inttypes.h> 28 30 #include <algorithm> 29 31 #include <arpa/inet.h> … … 130 132 } select_event; 131 133 132 string format(string f ormat, ...);133 string vformat(string f ormat, va_list args);134 string format(string fmt, ...); 135 string vformat(string fmt, va_list args); 134 136 void replace(string &target, string search, string replacement); 135 137 bool fileExists(string path); -
trunk/sources/common/include/platform/freebsd/freebsdplatform.h
r389 r413 25 25 26 26 //platform includes 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 27 29 #include <algorithm> 28 30 #include <arpa/inet.h> … … 135 137 136 138 137 string format(string f ormat, ...);138 string vformat(string f ormat, va_list args);139 string format(string fmt, ...); 140 string vformat(string fmt, va_list args); 139 141 void replace(string &target, string search, string replacement); 140 142 bool fileExists(string path); -
trunk/sources/common/include/platform/linux/linuxplatform.h
r389 r413 25 25 26 26 //platform includes 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 27 29 #include <algorithm> 28 30 #include <arpa/inet.h> … … 138 140 } select_event; 139 141 140 string format(string f ormat, ...);141 string vformat(string f ormat, va_list args);142 string format(string fmt, ...); 143 string vformat(string fmt, va_list args); 142 144 void replace(string &target, string search, string replacement); 143 145 bool fileExists(string path); -
trunk/sources/common/include/platform/openbsd/openbsdplatform.h
r389 r413 25 25 26 26 //platform includes 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 27 29 #include <algorithm> 28 30 #include <arpa/inet.h> … … 137 139 138 140 139 string format(string f ormat, ...);140 string vformat(string f ormat, va_list args);141 string format(string fmt, ...); 142 string vformat(string fmt, va_list args); 141 143 void replace(string &target, string search, string replacement); 142 144 bool fileExists(string path); -
trunk/sources/common/include/platform/osx/osxplatform.h
r389 r413 25 25 26 26 //platform includes 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 27 29 #include <AvailabilityMacros.h> 28 30 #include <algorithm> … … 133 135 } select_event; 134 136 135 string format(string f ormat, ...);136 string vformat(string f ormat, va_list args);137 string format(string fmt, ...); 138 string vformat(string fmt, va_list args); 137 139 void replace(string &target, string search, string replacement); 138 140 bool fileExists(string path); -
trunk/sources/common/include/platform/solaris/solarisplatform.h
r389 r413 25 25 26 26 //platform includes 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 27 29 #include <algorithm> 28 30 #include <arpa/inet.h> … … 135 137 } select_event; 136 138 137 string format(string f ormat, ...);138 string vformat(string f ormat, va_list args);139 string format(string fmt, ...); 140 string vformat(string fmt, va_list args); 139 141 void replace(string &target, string search, string replacement); 140 142 bool fileExists(string path); -
trunk/sources/common/include/platform/windows/win32platform.h
r399 r413 24 24 #include "platform/baseplatform.h" 25 25 26 #define __STDC_FORMAT_MACROS 27 #include <inttypes.h> 26 28 #include <assert.h> 27 29 #include <time.h> … … 143 145 #define FD_COPY(f, t) (void)(*(t) = *(f)) 144 146 145 DLLEXP string format(string f ormat, ...);146 DLLEXP string vformat(string f ormat, va_list args);147 DLLEXP string format(string fmt, ...); 148 DLLEXP string vformat(string fmt, va_list args); 147 149 DLLEXP void replace(string &target, string search, string replacement); 148 150 DLLEXP bool fileExists(string path); … … 175 177 DLLEXP void InstallConfRereadSignal(SignalFnc pConfRereadSignalFnc); 176 178 DLLEXP time_t timegm(struct tm *tm); 177 DLLEXP char *strptime(const char *buf, const char *f ormat, struct tm *timeptr);179 DLLEXP char *strptime(const char *buf, const char *fmt, struct tm *timeptr); 178 180 DLLEXP int strcasecmp(const char *s1, const char *s2); 179 181 DLLEXP int strncasecmp(const char *s1, const char *s2, size_t n); -
trunk/sources/common/include/utils/logging/logging.h
r408 r413 29 29 #include "utils/logging/logger.h" 30 30 31 #define LOG(level,...) Logger::Log(level, __FILE__, __LINE__, __func__, __VA_ARGS__) 32 #define FATAL(...) Logger::Log(_FATAL_, __FILE__, __LINE__, __func__, __VA_ARGS__) 33 #define WARN(...) Logger::Log(_WARNING_, __FILE__, __LINE__, __func__, __VA_ARGS__) 34 #define INFO(...) Logger::Log(_INFO_, __FILE__, __LINE__, __func__, __VA_ARGS__) 35 #define DEBUG(...) Logger::Log(_DEBUG_, __FILE__, __LINE__, __func__, __VA_ARGS__) 36 #define FINE(...) Logger::Log(_FINE_, __FILE__, __LINE__, __func__, __VA_ARGS__) 37 #define FINEST(...) Logger::Log(_FINEST_, __FILE__, __LINE__, __func__, __VA_ARGS__) 38 #define ASSERT(...) {Logger::Log(_FATAL_, __FILE__, __LINE__, __func__, __VA_ARGS__);assert(false);abort();} 31 32 33 #ifdef VALIDATE_FROMAT_SPECIFIERS 34 #define __VALIDATE_FROMAT_SPECIFIERS(...) \ 35 do { \ 36 char ___tempLocation[1024]; \ 37 snprintf(___tempLocation,1023,__VA_ARGS__); \ 38 }while (0) 39 #else 40 #define __VALIDATE_FROMAT_SPECIFIERS(...) 41 #endif /* VALIDATE_FROMAT_SPECIFIERS */ 42 43 #define LOG(level,...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(level, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 44 #define FATAL(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_FATAL_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 45 46 #define WARN(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_WARNING_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 47 #define INFO(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_INFO_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 48 #define DEBUG(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_DEBUG_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 49 #define FINE(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_FINE_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 50 #define FINEST(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_FINEST_, __FILE__, __LINE__, __func__, __VA_ARGS__);}while(0) 51 #define ASSERT(...) do{__VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);Logger::Log(_FATAL_, __FILE__, __LINE__, __func__, __VA_ARGS__);assert(false);abort();}while(0) 39 52 #define NYI WARN("%s not yet implemented",__func__); 40 #define NYIR {NYI;return false;}41 #define NYIA {NYI;assert(false);abort();}53 #define NYIR do{NYI;return false;}while(0) 54 #define NYIA do{NYI;assert(false);abort();}while(0) 42 55 43 56 #endif /* _LOGGING_H */ -
trunk/sources/common/include/utils/misc/variant.h
r295 r413 28 28 29 29 #ifdef LOG_VARIANT_MEMORY_MANAGEMENT 30 #define CONSTRUCTOR printf(" + % d->%d\n",_constructorCount,_constructorCount+1); _constructorCount++;31 #define DESTRUCTOR printf(" - % d->%d\n",_constructorCount,_constructorCount-1); _constructorCount--;32 #define DYNAMIC_ALLOC(type) printf("(+) % d->%d(%s)\n",_dynamicAllocationCount,_dynamicAllocationCount+1,type); _dynamicAllocationCount++;33 #define DYNAMIC_FREE(type) printf("(-) % d->%d(%s)\n",_dynamicAllocationCount,_dynamicAllocationCount-1,type); _dynamicAllocationCount--;30 #define CONSTRUCTOR printf(" + %u->%u\n",_constructorCount,_constructorCount+1); _constructorCount++; 31 #define DESTRUCTOR printf(" - %u->%u\n",_constructorCount,_constructorCount-1); _constructorCount--; 32 #define DYNAMIC_ALLOC(type) printf("(+) %u->%u (%s)\n",_dynamicAllocationCount,_dynamicAllocationCount+1,type); _dynamicAllocationCount++; 33 #define DYNAMIC_FREE(type) printf("(-) %u->%u (%s)\n",_dynamicAllocationCount,_dynamicAllocationCount-1,type); _dynamicAllocationCount--; 34 34 #else 35 35 #define CONSTRUCTOR -
trunk/sources/common/src/platform/android/androidplatform.cpp
r408 r413 34 34 } 35 35 36 string format(string f ormat, ...) {36 string format(string fmt, ...) { 37 37 string result = ""; 38 38 va_list arguments; 39 va_start(arguments, f ormat);40 result = vformat(f ormat, arguments);39 va_start(arguments, fmt); 40 result = vformat(fmt, arguments); 41 41 va_end(arguments); 42 42 return result; 43 43 } 44 44 45 string vformat(string f ormat, va_list args) {45 string vformat(string fmt, va_list args) { 46 46 char *pBuffer = NULL; 47 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {47 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 48 48 assert(false); 49 49 return ""; … … 200 200 if (pHostEnt->h_length <= 0) 201 201 return ""; 202 string result = format("% u.%u.%u.%u",202 string result = format("%hhu.%hhu.%hhu.%hhu", 203 203 (uint8_t) pHostEnt->h_addr_list[0][0], 204 204 (uint8_t) pHostEnt->h_addr_list[0][1], … … 366 366 367 367 struct dirent *pDirent; 368 struct stat entryStat = {0}; 368 struct stat entryStat; 369 memset(&entryStat, 0, sizeof (entryStat)); 369 370 while ((pDirent = readdir(pDir)) != NULL) { 370 371 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/freebsd/freebsdplatform.cpp
r408 r413 31 31 } 32 32 33 string format(string f ormat, ...) {33 string format(string fmt, ...) { 34 34 string result = ""; 35 35 va_list arguments; 36 va_start(arguments, f ormat);37 result = vformat(f ormat, arguments);36 va_start(arguments, fmt); 37 result = vformat(fmt, arguments); 38 38 va_end(arguments); 39 39 return result; 40 40 } 41 41 42 string vformat(string f ormat, va_list args) {42 string vformat(string fmt, va_list args) { 43 43 char *pBuffer = NULL; 44 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {44 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 45 45 assert(false); 46 46 return ""; … … 205 205 if (pHostEnt->h_length <= 0) 206 206 return ""; 207 string result = format("% u.%u.%u.%u",207 string result = format("%hhu.%hhu.%hhu.%hhu", 208 208 (uint8_t) pHostEnt->h_addr_list[0][0], 209 209 (uint8_t) pHostEnt->h_addr_list[0][1], … … 371 371 372 372 struct dirent *pDirent; 373 struct stat entryStat = {0}; 373 struct stat entryStat; 374 memset(&entryStat, 0, sizeof (entryStat)); 374 375 while ((pDirent = readdir(pDir)) != NULL) { 375 376 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/linux/linuxplatform.cpp
r408 r413 33 33 } 34 34 35 string format(string f ormat, ...) {35 string format(string fmt, ...) { 36 36 string result = ""; 37 37 va_list arguments; 38 va_start(arguments, f ormat);39 result = vformat(f ormat, arguments);38 va_start(arguments, fmt); 39 result = vformat(fmt, arguments); 40 40 va_end(arguments); 41 41 return result; 42 42 } 43 43 44 string vformat(string f ormat, va_list args) {44 string vformat(string fmt, va_list args) { 45 45 char *pBuffer = NULL; 46 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {46 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 47 47 assert(false); 48 48 return ""; … … 205 205 if (pHostEnt->h_length <= 0) 206 206 return ""; 207 string result = format("% u.%u.%u.%u",207 string result = format("%hhu.%hhu.%hhu.%hhu", 208 208 (uint8_t) pHostEnt->h_addr_list[0][0], 209 209 (uint8_t) pHostEnt->h_addr_list[0][1], … … 371 371 372 372 struct dirent *pDirent; 373 struct stat entryStat = {0}; 373 struct stat entryStat; 374 memset(&entryStat, 0, sizeof (entryStat)); 374 375 while ((pDirent = readdir(pDir)) != NULL) { 375 376 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/openbsd/openbsdplatform.cpp
r408 r413 31 31 } 32 32 33 string format(string f ormat, ...) {33 string format(string fmt, ...) { 34 34 string result = ""; 35 35 va_list arguments; 36 va_start(arguments, f ormat);37 result = vformat(f ormat, arguments);36 va_start(arguments, fmt); 37 result = vformat(fmt, arguments); 38 38 va_end(arguments); 39 39 return result; 40 40 } 41 41 42 string vformat(string f ormat, va_list args) {42 string vformat(string fmt, va_list args) { 43 43 char *pBuffer = NULL; 44 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {44 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 45 45 assert(false); 46 46 return ""; … … 207 207 if (pHostEnt->h_length <= 0) 208 208 return ""; 209 string result = format("% u.%u.%u.%u",209 string result = format("%hhu.%hhu.%hhu.%hhu", 210 210 (uint8_t) pHostEnt->h_addr_list[0][0], 211 211 (uint8_t) pHostEnt->h_addr_list[0][1], … … 373 373 374 374 struct dirent *pDirent; 375 struct stat entryStat = {0}; 375 struct stat entryStat; 376 memset(&entryStat, 0, sizeof (entryStat)); 376 377 while ((pDirent = readdir(pDir)) != NULL) { 377 378 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/osx/osxplatform.cpp
r408 r413 32 32 } 33 33 34 string format(string f ormat, ...) {34 string format(string fmt, ...) { 35 35 string result = ""; 36 36 va_list arguments; 37 va_start(arguments, f ormat);38 result = vformat(f ormat, arguments);37 va_start(arguments, fmt); 38 result = vformat(fmt, arguments); 39 39 va_end(arguments); 40 40 return result; 41 41 } 42 42 43 string vformat(string f ormat, va_list args) {43 string vformat(string fmt, va_list args) { 44 44 char *pBuffer = NULL; 45 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {45 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 46 46 assert(false); 47 47 return ""; … … 206 206 if (pHostEnt->h_length <= 0) 207 207 return ""; 208 string result = format("% u.%u.%u.%u",208 string result = format("%hhu.%hhu.%hhu.%hhu", 209 209 (uint8_t) pHostEnt->h_addr_list[0][0], 210 210 (uint8_t) pHostEnt->h_addr_list[0][1], … … 372 372 373 373 struct dirent *pDirent; 374 struct stat entryStat = {0}; 374 struct stat entryStat; 375 memset(&entryStat, 0, sizeof (entryStat)); 375 376 while ((pDirent = readdir(pDir)) != NULL) { 376 377 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/solaris/solarisplatform.cpp
r408 r413 38 38 } 39 39 40 string format(string f ormat, ...) {40 string format(string fmt, ...) { 41 41 string result = ""; 42 42 va_list arguments; 43 va_start(arguments, f ormat);44 result = vformat(f ormat, arguments);43 va_start(arguments, fmt); 44 result = vformat(fmt, arguments); 45 45 va_end(arguments); 46 46 return result; 47 47 } 48 48 49 string vformat(string f ormat, va_list args) {49 string vformat(string fmt, va_list args) { 50 50 char *pBuffer = NULL; 51 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {51 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 52 52 assert(false); 53 53 return ""; … … 203 203 if (pHostEnt->h_length <= 0) 204 204 return ""; 205 string result = format("% u.%u.%u.%u",205 string result = format("%hhu.%hhu.%hhu.%hhu", 206 206 (uint8_t) pHostEnt->h_addr_list[0][0], 207 207 (uint8_t) pHostEnt->h_addr_list[0][1], … … 369 369 370 370 struct dirent *pDirent; 371 struct stat entryStat = {0}; 371 struct stat entryStat; 372 memset(&entryStat, 0, sizeof (entryStat)); 372 373 while ((pDirent = readdir(pDir)) != NULL) { 373 374 string entry = pDirent->d_name; -
trunk/sources/common/src/platform/windows/strptime.cpp
r58 r413 203 203 204 204 char * 205 strptime (const char *buf, const char *f ormat, struct tm *timeptr)205 strptime (const char *buf, const char *fmt, struct tm *timeptr) 206 206 { 207 207 char c; 208 208 209 for (; (c = *f ormat) != '\0'; ++format) {209 for (; (c = *fmt) != '\0'; ++fmt) { 210 210 char *s; 211 211 int ret; … … 214 214 while (isspace (*buf)) 215 215 ++buf; 216 } else if (c == '%' && f ormat[1] != '\0') {217 c = *++f ormat;216 } else if (c == '%' && fmt[1] != '\0') { 217 c = *++fmt; 218 218 if (c == 'E' || c == 'O') 219 c = *++f ormat;219 c = *++fmt; 220 220 switch (c) { 221 221 case 'A' : … … 416 416 abort (); 417 417 case '\0' : 418 --f ormat;418 --fmt; 419 419 /* FALLTHROUGH */ 420 420 case '%' : -
trunk/sources/common/src/platform/windows/win32platform.cpp
r408 r413 27 27 static map<uint32_t, SignalFnc> _signalHandlers; 28 28 29 string format(string f ormat, ...) {29 string format(string fmt, ...) { 30 30 string result = ""; 31 31 va_list arguments; 32 va_start(arguments, f ormat);33 result = vformat(f ormat, arguments);32 va_start(arguments, fmt); 33 result = vformat(fmt, arguments); 34 34 va_end(arguments); 35 35 return result; 36 36 } 37 37 38 string vformat(string f ormat, va_list args) {38 string vformat(string fmt, va_list args) { 39 39 char *pBuffer = NULL; 40 if (vasprintf(&pBuffer, STR(f ormat), args) == -1) {40 if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 41 41 ASSERT("vasprintf failed"); 42 42 return ""; … … 229 229 230 230 void InitNetworking() { 231 WSADATA wsa = {0}; 231 WSADATA wsa; 232 memset(&wsa,0,sizeof(wsa)); 232 233 WSAStartup(0, &wsa); 233 234 WSAStartup(wsa.wHighVersion, &wsa); … … 280 281 BOOL value = TRUE; 281 282 if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 282 FATAL("Error #% d", WSAGetLastError());283 FATAL("Error #%u", WSAGetLastError()); 283 284 return false; 284 285 } … … 289 290 BOOL value = TRUE; 290 291 if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 291 FATAL("Error #% d", WSAGetLastError());292 FATAL("Error #%u", WSAGetLastError()); 292 293 return false; 293 294 } … … 298 299 BOOL value = TRUE; 299 300 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 300 FATAL("Error #% d", WSAGetLastError());301 FATAL("Error #%u", WSAGetLastError()); 301 302 return false; 302 303 } … … 348 349 if (pHostEnt->h_length <= 0) 349 350 return ""; 350 string result = format("% u.%u.%u.%u",351 string result = format("%hhu.%hhu.%hhu.%hhu", 351 352 (uint8_t) pHostEnt->h_addr_list[0][0], 352 353 (uint8_t) pHostEnt->h_addr_list[0][1], -
trunk/sources/common/src/utils/buffering/iobuffer.cpp
r408 r413 302 302 if (sentAmount < 0) { 303 303 if (err != SOCKERROR_SEND_IN_PROGRESS) { 304 FATAL("Unable to send % d bytes of data data. Size advertised by network layer was %d[%d: %s]",304 FATAL("Unable to send %u bytes of data data. Size advertised by network layer was %u [%d: %s]", 305 305 _published - _consumed, size, err, strerror(err)); 306 306 FATAL("Permanent error!"); … … 326 326 327 327 if (sent < 0) { 328 FATAL("Unable to send % d bytes of data data. Size advertised by network layer was %d[%d: %s]",328 FATAL("Unable to send %u bytes of data data. Size advertised by network layer was %u [%d: %s]", 329 329 _published - _consumed, size, err, strerror(err)); 330 330 FATAL("Permanent error!"); … … 451 451 ss << format("Address: %p", _pBuffer) << endl; 452 452 if (limit != 0) { 453 ss << format("Limited to % dbytes", limit) << endl;453 ss << format("Limited to %u bytes", limit) << endl; 454 454 } 455 455 string address = ""; … … 465 465 hr = ""; 466 466 } 467 address = format("%08 d", i - (i % 16));467 address = format("%08u", i - (i % 16)); 468 468 469 469 if ((i % 16) < 8) { 470 part1 += format("%02 x", _pBuffer[i]);470 part1 += format("%02hhx", _pBuffer[i]); 471 471 part1 += " "; 472 472 } else { 473 part2 += format("%02 x", _pBuffer[i]);473 part2 += format("%02hhx", _pBuffer[i]); 474 474 part2 += " "; 475 475 } -
trunk/sources/common/src/utils/logging/consoleloglocation.cpp
r58 r413 50 50 #ifdef ANDROID 51 51 if (_allowColors) { 52 printf("%s%s:% d%s%s\n",52 printf("%s%s:%u %s%s\n", 53 53 STR(_colors[level]), 54 54 STR(fileName), … … 57 57 STR(_colors[6])); 58 58 } else { 59 printf("%s:% d%s\n",59 printf("%s:%u %s\n", 60 60 STR(fileName), 61 61 lineNumber, -
trunk/sources/common/src/utils/logging/fileloglocation.cpp
r232 r413 46 46 return; 47 47 } 48 string logEntry = format("% d:%d:%s:%d:%s:%s\n",49 time(NULL), level, STR(fileName), lineNumber, STR(functionName),48 string logEntry = format("%"PRIu64":%d:%s:%u:%s:%s\n", 49 (uint64_t)time(NULL), level, STR(fileName), lineNumber, STR(functionName), 50 50 STR(message)); 51 51 _fileStream.write(STR(logEntry), logEntry.size()); -
trunk/sources/common/src/utils/logging/logcatloglocation.cpp
r58 r413 47 47 48 48 __android_log_write(_levelsMap[level], "rtmpd", 49 STR(format("%s:% d%s", STR(fileName), lineNumber, STR(message))));49 STR(format("%s:%u %s", STR(fileName), lineNumber, STR(message)))); 50 50 } 51 51 #endif /* ANDROID */ -
trunk/sources/common/src/utils/lua/luautils.cpp
r58 r413 97 97 bool isArray = true; 98 98 for (uint32_t i = 0; i < variant.MapSize(); i++) { 99 if (!variant.HasKey(format(VAR_INDEX_VALUE"% d", i))) {99 if (!variant.HasKey(format(VAR_INDEX_VALUE"%u", i))) { 100 100 isArray = false; 101 101 break; … … 115 115 default: 116 116 { 117 WARN("Element type not supported: %d (0x% 08x)", type, type);117 WARN("Element type not supported: %d (0x%x)", type, type); 118 118 return false; 119 119 break; … … 303 303 default: 304 304 { 305 FATAL("Unknown type % d", (VariantType) variant);305 FATAL("Unknown type %hhu", (VariantType) variant); 306 306 return false; 307 307 break; … … 322 322 bool LoadLuaScriptFromFile(string file, lua_State *pLuaState, bool pCall) { 323 323 if (luaL_loadfile(pLuaState, STR(file)) != 0) { 324 FATAL("Error parsing file %s: %s", STR(file), 324 FATAL("Error parsing file %s: %s", 325 STR(file), 325 326 lua_tostring(pLuaState, -1)); 326 327 return false; … … 329 330 if (pCall) { 330 331 if (lua_pcall(pLuaState, 0, 0, 0) != 0) { 331 FATAL("Error parsing file %s: %s", STR(file), 332 FATAL("Error parsing file %s: %s", 333 STR(file), 332 334 lua_tostring(pLuaState, -1)); 333 335 return false; … … 340 342 bool LoadLuaScriptFromString(string luaScript, lua_State *pLuaState, bool pCall) { 341 343 if (luaL_loadstring(pLuaState, STR(luaScript)) != 0) { 342 FATAL("Error parsing script %s: %s", STR(luaScript), 344 FATAL("Error parsing script %s: %s", 345 STR(luaScript), 343 346 lua_tostring(pLuaState, -1)); 344 347 return false; … … 347 350 if (pCall) { 348 351 if (lua_pcall(pLuaState, 0, 0, 0) != 0) { 349 FATAL("Error parsing script %s: %s", STR(luaScript), 352 FATAL("Error parsing script %s: %s", 353 STR(luaScript), 350 354 lua_tostring(pLuaState, -1)); 351 355 return false; -
trunk/sources/common/src/utils/misc/crypto.cpp
r408 r413 228 228 string result = ""; 229 229 for (uint32_t i = 0; i < md_len; i++) { 230 result += format("%02 x", md_value[i]);230 result += format("%02hhx", md_value[i]); 231 231 } 232 232 return result; -
trunk/sources/common/src/utils/misc/file.cpp
r408 r413 74 74 if (_file.fail()) { 75 75 FATAL("Unable to open file %s with mode 0x%x (%s)", 76 STR(_path), openMode, strerror(errno));76 STR(_path), (uint32_t) openMode, strerror(errno)); 77 77 return false; 78 78 } … … 149 149 _file.seekg(count, ios_base::cur); 150 150 if (_file.fail()) { 151 FATAL("Unable to seek ahead % dbytes", count);151 FATAL("Unable to seek ahead %"PRId64" bytes", count); 152 152 return false; 153 153 } … … 168 168 _file.seekg((-1) * count, ios_base::cur); 169 169 if (_file.fail()) { 170 FATAL("Unable to seek behind % dbytes", count);170 FATAL("Unable to seek behind %"PRId64" bytes", count); 171 171 return false; 172 172 } … … 182 182 _file.seekg(position, ios_base::beg); 183 183 if (_file.fail()) { 184 FATAL("Unable to seek to position % d", position);184 FATAL("Unable to seek to position %"PRIu64, position); 185 185 return false; 186 186 } … … 262 262 _file.read((char *) pBuffer, count); 263 263 if (_file.fail()) { 264 FATAL("Unable to read % llu bytes from the file. Cursor: %llu (0x%llx); %d (%s)",264 FATAL("Unable to read %"PRIu64" bytes from the file. Cursor: %"PRIu64" (0x%"PRIx64"); %d (%s)", 265 265 count, Cursor(), Cursor(), errno, strerror(errno)); 266 266 return false; … … 435 435 _file.write((char *) pBuffer, count); 436 436 if (_file.fail()) { 437 FATAL("Unable to write % dbytes to file", count);437 FATAL("Unable to write %"PRIu64" bytes to file", count); 438 438 return false; 439 439 } -
trunk/sources/common/src/utils/misc/mmapfile.cpp
r408 r413 39 39 if (_pageSize == 0) { 40 40 _pageSize = getpagesize(); 41 LOG_MMAP("_pageSize: % d", _pageSize);41 LOG_MMAP("_pageSize: %u", _pageSize); 42 42 } 43 43 _windowSize = 0; … … 72 72 73 73 if (size > windowSize) { 74 FATAL("size is greater than window size: % llu > %llu", size, windowSize);74 FATAL("size is greater than window size: %"PRIu64" > %u", size, windowSize); 75 75 return false; 76 76 } … … 83 83 _size = windowSize; 84 84 while (_cursor + _size < cursor + size) { 85 LOG_MMAP("We need to go a little bit further; Wanted: % llu; got: %llu",85 LOG_MMAP("We need to go a little bit further; Wanted: %"PRIu64"; got: %"PRIu64, 86 86 cursor + size, _cursor + _size); 87 87 _size += MmapFile::_pageSize; 88 88 } 89 89 90 LOG_MMAP("Reading % llubytes from disk", _size);90 LOG_MMAP("Reading %"PRIu64" bytes from disk", _size); 91 91 _pData = (uint8_t *) mmap(NULL, 92 92 _size, … … 149 149 if (_size == 0) 150 150 return "[N - N](0)"; 151 return format("[% llu - %llu](%u)", _cursor, _cursor + _size - 1, _size);151 return format("[%"PRIu64" - %"PRIu64"](%u)", _cursor, _cursor + _size - 1, _size); 152 152 } 153 153 154 154 bool MmapFile::Initialize(string path, uint32_t windowSize, bool exclusive) { 155 155 //1. Do we have this file open? 156 LOG_MMAP("Initial window size: % d", windowSize);156 LOG_MMAP("Initial window size: %u", windowSize); 157 157 uint32_t pagesCount = windowSize / _pageSize; 158 LOG_MMAP("pagesCount: % d", pagesCount);158 LOG_MMAP("pagesCount: %u", pagesCount); 159 159 _windowSize = (pagesCount * _pageSize) + 160 160 (((windowSize % _pageSize) != 0) ? _pageSize : 0); 161 161 _path = path; 162 LOG_MMAP("_windowSize: % d; file: `%s`", _windowSize, STR(_path));162 LOG_MMAP("_windowSize: %u; file: `%s`", _windowSize, STR(_path)); 163 163 if (!MAP_HAS1(_fds, _path)) { 164 __FileInfo__ fi = {0 };164 __FileInfo__ fi = {0, 0, 0}; 165 165 166 166 //2. Open the file … … 257 257 } 258 258 if (position > _size) { 259 FATAL("Invalid position: % llu. Must be at most: %llu", position, _size - 1);259 FATAL("Invalid position: %"PRIu64". Must be at most: %"PRIu64, position, _size - 1); 260 260 _failed = true; 261 261 return false; … … 404 404 //1. Sanity checks 405 405 if (_failed) { 406 DEBUG("_cursor: % llu; count: %u; %s", _cursor, count, STR(_path));406 DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); 407 407 FATAL("This mmap file is in inconsistent state"); 408 408 return false; … … 410 410 411 411 if (_windowSize < count) { 412 DEBUG("_cursor: % llu; count: %u; %s", _cursor, count, STR(_path));413 FATAL("Invalid window size: _windowSize < count % llu < %llu",412 DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); 413 FATAL("Invalid window size: _windowSize < count %u < %"PRIu64, 414 414 _windowSize, count); 415 415 _failed = true; … … 418 418 419 419 if (_cursor + count > _size) { 420 DEBUG("_cursor: % llu; count: %u; %s", _cursor, count, STR(_path));421 FATAL("EOF will be reached: cursor: % d; count: %d; size: %d",420 DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); 421 FATAL("EOF will be reached: cursor: %"PRIu64"; count: %"PRIu64"; size: %"PRIu64, 422 422 _cursor, count, _size); 423 423 _failed = true; … … 448 448 //3. Do the read 449 449 if (pPointer->Copy(pDestBuffer, _cursor, 0, count) != count) { 450 FATAL("Unable to copy % llubytes", count);450 FATAL("Unable to copy %"PRIu64" bytes", count); 451 451 _failed = true; 452 452 return false; -
trunk/sources/common/src/utils/misc/timersmanager.cpp
r408 r413 109 109 return 0; 110 110 uint32_t result = a * b / GCD(a, b); 111 FINEST("a: % d; b: %d; r: %d", a, b, result);111 FINEST("a: %u; b: %u; r: %u", a, b, result); 112 112 return result; 113 113 } -
trunk/sources/common/src/utils/misc/uri.cpp
r408 r413 46 46 split(stringUri, "/", components); 47 47 for (uint32_t i = 0; i < components.size(); i++) { 48 LOG_URI_SPLIT("% d: %s", i, STR(components[i]));48 LOG_URI_SPLIT("%u: %s", i, STR(components[i])); 49 49 } 50 50 … … 125 125 return false; 126 126 } 127 LOG_URI_SPLIT("uri.port: % d", uri.port);127 LOG_URI_SPLIT("uri.port: %u", uri.port); 128 128 129 129 for (uint32_t i = 3; i < components.size(); i++) { -
trunk/sources/common/src/utils/misc/variant.cpp
r408 r413 273 273 case V_INT8: 274 274 { 275 result += format("%s<INT8 name=\"%s\">% d</INT8>",275 result += format("%s<INT8 name=\"%s\">%hhd</INT8>", 276 276 STR(strIndent), STR(name), _value.i8); 277 277 break; … … 279 279 case V_INT16: 280 280 { 281 result += format("%s<INT16 name=\"%s\">% d</INT16>",281 result += format("%s<INT16 name=\"%s\">%hd</INT16>", 282 282 STR(strIndent), STR(name), _value.i16); 283 283 break; … … 291 291 case V_INT64: 292 292 { 293 result += format("%s<INT64 name=\"%s\">% lld</INT64>",293 result += format("%s<INT64 name=\"%s\">%"PRId64"</INT64>", 294 294 STR(strIndent), STR(name), _value.i64); 295 295 break; … … 297 297 case V_UINT8: 298 298 { 299 result += format("%s<UINT8 name=\"%s\">% u</UINT8>",299 result += format("%s<UINT8 name=\"%s\">%hhu</UINT8>", 300 300 STR(strIndent), STR(name), _value.ui8); 301 301 break; … … 303 303 case V_UINT16: 304 304 { 305 result += format("%s<UINT16 name=\"%s\">% u</UINT16>",305 result += format("%s<UINT16 name=\"%s\">%hu</UINT16>", 306 306 STR(strIndent), STR(name), _value.ui16); 307 307 break; … … 315 315 case V_UINT64: 316 316 { 317 result += format("%s<UINT64 name=\"%s\">% llu</UINT64>",317 result += format("%s<UINT64 name=\"%s\">%"PRIu64"</UINT64>", 318 318 STR(strIndent), STR(name), _value.ui64); 319 319 break; … … 351 351 case V_BYTEARRAY: 352 352 { 353 result += format("%s<BYTEARRAY name=\"%s\">% llu bytes</BYTEARRAY>",353 result += format("%s<BYTEARRAY name=\"%s\">%zu bytes</BYTEARRAY>", 354 354 STR(strIndent), STR(name), _value.s->length()); 355 355 break; … … 381 381 default: 382 382 { 383 FATAL("Invalid type: % d", _type);383 FATAL("Invalid type: %hhu", _type); 384 384 assert(false); 385 385 } … … 619 619 } else { 620 620 ASSERT("Cast to struct tm failed: %s", STR(ToString())); 621 Timestamp temp = {0 };621 Timestamp temp = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 622 622 return temp; 623 623 } … … 638 638 case V_INT64: 639 639 { 640 return format("% lld", this->operator int64_t());640 return format("%"PRId64, this->operator int64_t()); 641 641 } 642 642 case V_UINT8: … … 648 648 case V_UINT64: 649 649 { 650 return format("% llu", this->operator uint64_t());650 return format("%"PRIu64, this->operator uint64_t()); 651 651 } 652 652 case V_DOUBLE: … … 1040 1040 return false; 1041 1041 1042 Timestamp temp = {0 };1042 Timestamp temp = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 1043 1043 1044 1044 if (detectedType == V_DATE || detectedType == V_TIMESTAMP) { … … 1307 1307 { 1308 1308 result = ""; 1309 FATAL("Invalid variant type: % d", _type);1309 FATAL("Invalid variant type: %hhu", _type); 1310 1310 return false; 1311 1311 } … … 1581 1581 { 1582 1582 int64_t value = (int64_t) (*this); 1583 result += format("% lld", value);1583 result += format("%"PRId64, value); 1584 1584 break; 1585 1585 } … … 1590 1590 { 1591 1591 uint64_t value = (uint64_t) (*this); 1592 result += format("% llu", value);1592 result += format("%"PRIu64, value); 1593 1593 break; 1594 1594 } … … 1639 1639 default: 1640 1640 { 1641 ASSERT("Invalid type % d", _type);1641 ASSERT("Invalid type %hhu", _type); 1642 1642 break; 1643 1643 } … … 1692 1692 { 1693 1693 pResult = new TiXmlElement("INT8"); 1694 pResult->LinkEndChild(new TiXmlText(format("% d", _value.i8)));1694 pResult->LinkEndChild(new TiXmlText(format("%hhd", _value.i8))); 1695 1695 break; 1696 1696 } … … 1698 1698 { 1699 1699 pResult = new TiXmlElement("INT16"); 1700 pResult->LinkEndChild(new TiXmlText(format("% d", _value.i16)));1700 pResult->LinkEndChild(new TiXmlText(format("%hd", _value.i16))); 1701 1701 break; 1702 1702 } … … 1710 1710 { 1711 1711 pResult = new TiXmlElement("INT64"); 1712 pResult->LinkEndChild(new TiXmlText(format("% lld", _value.i64)));1712 pResult->LinkEndChild(new TiXmlText(format("%"PRId64, _value.i64))); 1713 1713 break; 1714 1714 } … … 1716 1716 { 1717 1717 pResult = new TiXmlElement("UINT8"); 1718 pResult->LinkEndChild(new TiXmlText(format("% u", _value.ui8)));1718 pResult->LinkEndChild(new TiXmlText(format("%hhu", _value.ui8))); 1719 1719 break; 1720 1720 } … … 1722 1722 { 1723 1723 pResult = new TiXmlElement("UINT16"); 1724 pResult->LinkEndChild(new TiXmlText(format("% u", _value.ui16)));1724 pResult->LinkEndChild(new TiXmlText(format("%hu", _value.ui16))); 1725 1725 break; 1726 1726 } … … 1734 1734 { 1735 1735 pResult = new TiXmlElement("UINT64"); 1736 pResult->LinkEndChild(new TiXmlText(format("% llu", _value.ui64)));1736 pResult->LinkEndChild(new TiXmlText(format("%"PRIu64, _value.ui64))); 1737 1737 break; 1738 1738 } … … 1799 1799 default: 1800 1800 { 1801 ASSERT("Invalid type: % d", _type);1801 ASSERT("Invalid type: %hhu", _type); 1802 1802 return NULL; 1803 1803 } … … 1813 1813 if(s>bufferSize-cursor) \ 1814 1814 { \ 1815 FATAL("Not enough data. Wanted: %u; Got: %u", s,bufferSize-cursor);\1815 FATAL("Not enough data. Wanted: %u; Got: %u",(uint32_t)s,bufferSize-cursor);\ 1816 1816 return false; \ 1817 1817 } \ … … 1996 1996 default: 1997 1997 { 1998 FATAL("Invalid variant type: % d", type);1998 FATAL("Invalid variant type: %hhu", type); 1999 1999 return false; 2000 2000 } … … 2025 2025 return true; 2026 2026 } else if (nodeName == "int8") { 2027 if (sscanf(STR(text), "% lld", (long long int *) & val.i64) != 1) {2027 if (sscanf(STR(text), "%"PRId64, (long long int *) & val.i64) != 1) { 2028 2028 FATAL("Invalid number"); 2029 2029 return false; … … 2032 2032 return true; 2033 2033 } else if (nodeName == "int16") { 2034 if (sscanf(STR(text), "% lld", (long long int *) & val.i64) != 1) {2034 if (sscanf(STR(text), "%"PRId64, (long long int *) & val.i64) != 1) { 2035 2035 FATAL("Invalid number"); 2036 2036 return false; … … 2039 2039 return true; 2040 2040 } else if (nodeName == "int32") { 2041 if (sscanf(STR(text), "% lld", (long long int *) & val.i64) != 1) {2041 if (sscanf(STR(text), "%"PRId64, (long long int *) & val.i64) != 1) { 2042 2042 FATAL("Invalid number"); 2043 2043 return false; … … 2046 2046 return true; 2047 2047 } else if (nodeName == "int64") { 2048 if (sscanf(STR(text), "% lld", (long long int *) & val.i64) != 1) {2048 if (sscanf(STR(text), "%"PRId64, (long long int *) & val.i64) != 1) { 2049 2049 FATAL("Invalid number"); 2050 2050 return false; … … 2053 2053 return true; 2054 2054 } else if (nodeName == "uint8") { 2055 if (sscanf(STR(text), "% llu", (long long unsigned int *) & val.ui64) != 1) {2055 if (sscanf(STR(text), "%"PRIu64, (long long unsigned int *) & val.ui64) != 1) { 2056 2056 FATAL("Invalid number"); 2057 2057 return false; … … 2060 2060 return true; 2061 2061 } else if (nodeName == "uint16") { 2062 if (sscanf(STR(text), "% llu", (long long unsigned int *) & val.ui64) != 1) {2062 if (sscanf(STR(text), "%"PRIu64, (long long unsigned int *) & val.ui64) != 1) { 2063 2063 FATAL("Invalid number"); 2064 2064 return false; … … 2067 2067 return true; 2068 2068 } else if (nodeName == "uint32") { 2069 if (sscanf(STR(text), "% llu", (long long unsigned int *) & val.ui64) != 1) {2069 if (sscanf(STR(text), "%"PRIu64, (long long unsigned int *) & val.ui64) != 1) { 2070 2070 FATAL("Invalid number"); 2071 2071 return false; … … 2074 2074 return true; 2075 2075 } else if (nodeName == "uint64") { 2076 if (sscanf(STR(text), "% llu", (long long unsigned int *) & val.ui64) != 1) {2076 if (sscanf(STR(text), "%"PRIu64, (long long unsigned int *) & val.ui64) != 1) { 2077 2077 FATAL("Invalid number"); 2078 2078 return false; … … 2096 2096 return true; 2097 2097 } else if (nodeName == "date") { 2098 if (strptime(STR(text), "%Y-%m-% d", &val.t) == NULL) {2098 if (strptime(STR(text), "%Y-%m-%u", &val.t) == NULL) { 2099 2099 FATAL("Invalid timestamp (date, time or timestamp)"); 2100 2100 return false; … … 2252 2252 } 2253 2253 if (raw[start] != '\"') { 2254 FATAL("Invalid JSON string: % d", start);2254 FATAL("Invalid JSON string: %u", start); 2255 2255 return false; 2256 2256 } -
trunk/sources/common/src/utils/tinyxml/tinyxml.cpp
r58 r413 527 527 void TiXmlElement::SetAttribute(const char * name, int val) { 528 528 char buf[64]; 529 sprintf(buf, "% d", val);529 sprintf(buf, "%u", val); 530 530 SetAttribute(name, buf); 531 531 } … … 986 986 987 987 int TiXmlAttribute::QueryIntValue(int* ival) const { 988 if (sscanf(value.c_str(), "% d", ival) == 1)988 if (sscanf(value.c_str(), "%u", ival) == 1) 989 989 return TIXML_SUCCESS; 990 990 return TIXML_WRONG_TYPE; … … 999 999 void TiXmlAttribute::SetIntValue(int _value) { 1000 1000 char buf [64]; 1001 sprintf(buf, "% d", _value);1001 sprintf(buf, "%u", _value); 1002 1002 SetValue(buf); 1003 1003 } -
trunk/sources/crtmpserver/src/crtmpserver.cpp
r402 r413 229 229 } 230 230 INFO("\n%s", STR(gRs.pConfigFile->GetServicesInfo())); 231 INFO("GO! GO! GO! (% d)",getpid());231 INFO("GO! GO! GO! (%u)", (uint32_t) getpid()); 232 232 while (IOHandlerManager::Pulse()) { 233 233 IOHandlerManager::DeleteDeadHandlers(); -
trunk/sources/tests/include/basetestssuite.h
r56 r413 24 24 #include <assert.h> 25 25 26 #define TS_PRINT(...) printf(__VA_ARGS__) 26 27 #define __TESTS_VALIDATE_FROMAT_SPECIFIERS(...) \ 28 do { \ 29 char ___tempLocation[1024]; \ 30 snprintf(___tempLocation,1023,__VA_ARGS__); \ 31 }while (0) 32 33 #define TS_PRINT(...) do{__TESTS_VALIDATE_FROMAT_SPECIFIERS(__VA_ARGS__);printf(__VA_ARGS__);}while(0) 27 34 28 35 #define TS_ASSERT_NO_INCREMENT(x) \ 29 36 do { \ 30 37 if(!(x)) { \ 31 TS_PRINT("Test failed. %s:% d\n",__FILE__,__LINE__); \38 TS_PRINT("Test failed. %s:%u\n",__FILE__,__LINE__); \ 32 39 exit(-1); \ 33 40 } \ … … 37 44 do { \ 38 45 if(!(x)) { \ 39 TS_PRINT("Test %s failed. %s:% d\n",#x,__FILE__,__LINE__); \46 TS_PRINT("Test %s failed. %s:%u\n",#x,__FILE__,__LINE__); \ 40 47 exit(-1); \ 41 48 } else { \ … … 50 57 x().Run(); \ 51 58 int testsCount = BaseTestsSuite::_testsCount - before; \ 52 TS_PRINT("% dtests completed successfuly\n", testsCount); \59 TS_PRINT("%u tests completed successfuly\n", testsCount); \ 53 60 } while(0) 54 61 -
trunk/sources/tests/src/main.cpp
r110 r413 28 28 EXECUTE_SUITE(VariantTestsSuite); 29 29 EXECUTE_SUITE(TheLibTestsSuite); 30 TS_PRINT("A total of % dtests completed successfuly\n", BaseTestsSuite::_testsCount);30 TS_PRINT("A total of %u tests completed successfuly\n", BaseTestsSuite::_testsCount); 31 31 return 0; 32 32 } -
trunk/sources/tests/src/thelibtestssuite.cpp
r278 r413 90 90 uint8_t sstl_big_extended[] = {0x81, 0x01, 0x00, 0xff, 0xff, 0xff, 0x51, 0x52, 0x53, 0x54}; 91 91 92 Header header = {0}; 92 Header header; 93 memset(&header, 0, sizeof (header)); 93 94 94 95 #define HEADER_READ_TEST(h,ciSize, ci, buff, type, ia, ts) \ -
trunk/sources/thelib/include/mediaformats/mediaframe.h
r58 r413 38 38 39 39 operator string() { 40 return format("s: % llx; l: %llx; t: %d; dt: %.2f; kf: %d; at: %.2f; bh: %d",40 return format("s: %"PRIx64"; l: %"PRIx64"; t: %hhu; dt: %.2f; kf: %hhu; at: %.2f; bh: %hhu", 41 41 start, length, type, deltaTime, isKeyFrame, absoluteTime, isBinaryHeader); 42 42 }; -
trunk/sources/thelib/include/mediaformats/mp4/atomesds.h
r10 r413 23 23 24 24 #include "mediaformats/mp4/versionedatom.h" 25 26 //#define DEBUG_ESDS_ATOM27 28 #ifdef DEBUG_ESDS_ATOM29 #define FINEST_ESDS_ATOM(...) FINEST(__VA_ARGS__)30 #else31 #define FINEST_ESDS_ATOM(...)32 #endif33 25 34 26 class AtomESDS -
trunk/sources/thelib/include/netio/epoll/tcpconnector.h
r410 r413 64 64 65 65 if ((event.events & EPOLLERR) != 0) { 66 DEBUG("***CONNECT ERROR: Unable to connect to: %s:% d",66 DEBUG("***CONNECT ERROR: Unable to connect to: %s:%hu", 67 67 STR(_ip), 68 68 _port); … … 143 143 int err = errno; 144 144 if (err != EINPROGRESS) { 145 FATAL("Unable to connect to %s:% d(%d) (%s)", STR(_ip), _port, err,145 FATAL("Unable to connect to %s:%hu (%d) (%s)", STR(_ip), _port, err, 146 146 strerror(err)); 147 147 T::SignalProtocolCreated(NULL, _customParameters); -
trunk/sources/thelib/include/netio/kqueue/tcpconnector.h
r410 r413 66 66 if (((event.flags & EV_ERROR) != 0) || 67 67 ((event.flags & EV_EOF) != 0)) { 68 DEBUG("***CONNECT ERROR: Unable to connect to: %s:% d",68 DEBUG("***CONNECT ERROR: Unable to connect to: %s:%hu", 69 69 STR(_ip), 70 70 _port); … … 145 145 int err = errno; 146 146 if (err != EINPROGRESS) { 147 FATAL("Unable to connect to %s:% d(%d) (%s)", STR(_ip), _port, err,147 FATAL("Unable to connect to %s:%hu (%d) (%s)", STR(_ip), _port, err, 148 148 strerror(err)); 149 149 T::SignalProtocolCreated(NULL, _customParameters); -
trunk/sources/thelib/include/netio/select/tcpconnector.h
r410 r413 136 136 int err = LASTSOCKETERROR; 137 137 if (err != SOCKERROR_CONNECT_IN_PROGRESS) { 138 FATAL("Unable to connect to %s:% d(%d) (%s)", STR(_ip), _port, err,138 FATAL("Unable to connect to %s:%hu (%d) (%s)", STR(_ip), _port, err, 139 139 strerror(err)); 140 140 T::SignalProtocolCreated(NULL, _customParameters); -
trunk/sources/thelib/include/protocols/rtmp/amftypes.h
r148 r413 76 76 if(GETAVAILABLEBYTESCOUNT(x)<(y)) { \ 77 77 FATAL("Not enough data. Wanted: %u; Got: %u", \ 78 ( y),GETAVAILABLEBYTESCOUNT(x)); \78 (uint32_t)(y),GETAVAILABLEBYTESCOUNT(x)); \ 79 79 return false; \ 80 80 } \ -
trunk/sources/thelib/include/protocols/rtp/rtpheader.h
r410 r413 39 39 40 40 operator string() { 41 return format("f: % 08x; V: %u; P: %u; X: %u; CC: %u; M: %d; PT: %u; SEQ: %u; TS: %u; SSRC: %08x",41 return format("f: %hhx; V: %hhu; P: %hhu; X: %hhu; CC: %hhu; M: %hhu; PT: %hhu; SEQ: %hu; TS: %u; SSRC: %x", 42 42 _flags, 43 43 GET_RTP_V(*this), -
trunk/sources/thelib/include/protocols/ts/streamdescriptors.h
r410 r413 70 70 71 71 operator string() { 72 return format("type: % d; length: %d", type, length);72 return format("type: %hhu; length: %hhu", type, length); 73 73 }; 74 74 } StreamDescriptor; -
trunk/sources/thelib/include/protocols/ts/tsboundscheck.h
r2 r413 23 23 #define _TSBOUNDSCHECK_H 24 24 25 #define CHECK_BOUNDS(size) if((cursor+(size))>(maxCursor)){ FATAL("Bounds error: cursor: % d; size: %d; maxCursor: %d",cursor,(size),maxCursor);return false;}25 #define CHECK_BOUNDS(size) if((cursor+(size))>(maxCursor)){ FATAL("Bounds error: cursor: %u; size: %u; maxCursor: %u",(uint32_t)cursor,(uint32_t)(size),(uint32_t)maxCursor);return false;} 26 26 27 27 #endif /* _TSBOUNDSCHECK_H */ -
trunk/sources/thelib/include/protocols/ts/tspacketpmt.h
r317 r413 50 50 vector<StreamDescriptor> esDescriptors; 51 51 52 _TSStreamInfo() { 53 streamType = 0; 54 elementaryPID = 0; 55 esInfoLength = 0; 56 } 57 52 58 string toString(int32_t indent) { 53 string result = format("%sstreamType: % 02x; elementaryPID: %d; esInfoLength: %d; descriptors count: %d\n",59 string result = format("%sstreamType: %hhx; elementaryPID: %hu; esInfoLength: %hu; descriptors count: %zu\n", 54 60 STR(string(indent, '\t')), 55 61 streamType, elementaryPID, esInfoLength, esDescriptors.size()); … … 64 70 65 71 //iso13818-1.pdf page 64/174 66 //Table 2-28 â Transport Stream program map section72 //Table 2-28 âÃöâÃâš Transport Stream program map section 67 73 68 74 class TSPacketPMT { -
trunk/sources/thelib/src/application/baseclientapplication.cpp
r222 r413 97 97 BaseAppProtocolHandler *BaseClientApplication::GetProtocolHandler(uint64_t protocolType) { 98 98 if (!MAP_HAS1(_protocolsHandlers, protocolType)) { 99 FINEST("protocolType: %llu", protocolType); 100 101 FOR_MAP(_protocolsHandlers, uint64_t, BaseAppProtocolHandler *, i) { 102 FINEST("%llu: %p", MAP_KEY(i), MAP_VAL(i)); 103 } 104 ASSERT("Protocol handler not activated for protocol type %d in application %s", 105 protocolType, STR(_name)); 99 ASSERT("Protocol handler not activated for protocol type %s in application %s", 100 STR(tagToString(protocolType)), STR(_name)); 106 101 } 107 102 return _protocolsHandlers[protocolType]; … … 146 141 void BaseClientApplication::UnRegisterProtocol(BaseProtocol *pProtocol) { 147 142 if (!MAP_HAS1(_protocolsHandlers, pProtocol->GetType())) 148 ASSERT("Protocol handler not activated for protocol type % din application %s",149 pProtocol->GetType(), STR(_name));143 ASSERT("Protocol handler not activated for protocol type %s in application %s", 144 STR(tagToString(pProtocol->GetType())), STR(_name)); 150 145 _streamsManager.UnRegisterStreams(pProtocol->GetId()); 151 146 _protocolsHandlers[pProtocol->GetType()]->UnRegisterProtocol(pProtocol); … … 154 149 155 150 void BaseClientApplication::SignalStreamRegistered(BaseStream *pStream) { 156 INFO("Stream % dof type %s with name `%s` registered to application `%s`",151 INFO("Stream %u of type %s with name `%s` registered to application `%s`", 157 152 pStream->GetUniqueId(), 158 153 STR(tagToString(pStream->GetType())), … … 162 157 163 158 void BaseClientApplication::SignalStreamUnRegistered(BaseStream *pStream) { 164 INFO("Stream % dof type %s with name `%s` unregistered from application `%s`",159 INFO("Stream %u of type %s with name `%s` unregistered from application `%s`", 165 160 pStream->GetUniqueId(), 166 161 STR(tagToString(pStream->GetType())), -
trunk/sources/thelib/src/application/clientapplicationmanager.cpp
r410 r413 38 38 bool ClientApplicationManager::RegisterApplication(BaseClientApplication* pClientApplication) { 39 39 if (MAP_HAS1(_applicationsById, pClientApplication->GetId())) { 40 FATAL("Client application with id % dalready registered",40 FATAL("Client application with id %u already registered", 41 41 pClientApplication->GetId()); 42 42 return false; … … 88 88 } 89 89 90 FINEST("Application `%s` (% d) unregistered", STR(pClientApplication->GetName()),90 FINEST("Application `%s` (%u) unregistered", STR(pClientApplication->GetName()), 91 91 pClientApplication->GetId()); 92 92 } -
trunk/sources/thelib/src/configuration/configfile.cpp
r410 r413 190 190 191 191 if (temp.length() < minLength || temp.length() > maxLength) { 192 FATAL("Invalid %s. It must be present, must be string and have length between % d and %d",192 FATAL("Invalid %s. It must be present, must be string and have length between %u and %u", 193 193 STR(name), minLength, maxLength); 194 194 return false; … … 241 241 uint32_t minLength, uint32_t maxLength) { 242 242 if (!ValidateMap(node[name], notNull, minLength, maxLength)) { 243 FATAL("Invalid %s. Rules: NotNull: % d; MinSize: %d; MaxSize: %d",243 FATAL("Invalid %s. Rules: NotNull: %hhu; MinSize: %u; MaxSize: %u", 244 244 STR(name), 245 245 notNull, minLength, maxLength); … … 265 265 266 266 if (node.MapSize() < minLength || node.MapSize() > maxLength) { 267 FATAL("Invalid array size: % d. Must be between %d and %d",267 FATAL("Invalid array size: %u. Must be between %u and %u", 268 268 node.MapSize(), minLength, maxLength); 269 269 return false; … … 658 658 //5. Create the carrier and bind it 659 659 if (UDPCarrier::Create(node[CONF_IP], node[CONF_PORT], pProtocol) == NULL) { 660 FATAL("Unable to instantiate UDP carrier on %s:% d",660 FATAL("Unable to instantiate UDP carrier on %s:%hu", 661 661 STR(node[CONF_IP]), (uint16_t) node[CONF_PORT]); 662 662 pProtocol->EnqueueForDelete(); -
trunk/sources/thelib/src/mediaformats/basemediadocument.cpp
r410 r413 81 81 GETCLOCKS(endTime); 82 82 83 INFO("% dframes computed in %.2f seconds at a speed of %.2f FPS",83 INFO("%zu frames computed in %.2f seconds at a speed of %.2f FPS", 84 84 _frames.size(), 85 85 (endTime - startTime) / (double) CLOCKS_PER_SECOND, … … 90 90 uint32_t minutes = (totalSeconds - hours * 3600) / 60; 91 91 uint32_t seconds = (totalSeconds - hours * 3600 - minutes * 60); 92 INFO("File size: % llu bytes; Duration: %d:%d:%d(%u sec); Optimal bandwidth: %.2f kb/s",92 INFO("File size: %"PRIu64" bytes; Duration: %u:%u:%u (%u sec); Optimal bandwidth: %.2f kb/s", 93 93 _mediaFile.Size(), 94 94 hours, minutes, seconds, … … 148 148 MediaFrame frame = _frames[i]; 149 149 if (maxFrameSize < frame.length) { 150 WARN("maxFrameSize bumped up: % llu -> %llu", maxFrameSize, frame.length);150 WARN("maxFrameSize bumped up: %"PRIu64" -> %"PRIu64, maxFrameSize, frame.length); 151 151 maxFrameSize = frame.length; 152 152 } -
trunk/sources/thelib/src/mediaformats/flv/flvdocument.cpp
r410 r413 56 56 57 57 //4. Build the frames 58 MediaFrame frame = {0 };58 MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 59 59 uint8_t tagType = 0; 60 60 uint32_t timestamp; … … 82 82 break; 83 83 default: 84 WARN("Invalid tag type: % d at cursor %llu", tagType, _mediaFile.Cursor());84 WARN("Invalid tag type: %hhu at cursor %"PRIu64, tagType, _mediaFile.Cursor()); 85 85 mustBreak = true; 86 86 break; -
trunk/sources/thelib/src/mediaformats/mp3/id3parser.cpp
r410 r413 78 78 default: 79 79 { 80 WARN("Invalid version: ID3v% d.%d", _majorVersion, _minorVersion);80 WARN("Invalid version: ID3v%u.%u", _majorVersion, _minorVersion); 81 81 return false; 82 82 } … … 98 98 //After that we go back to where we left (end of the header, offset 10) 99 99 if (!file.SeekTo(totalSize + 10)) { 100 WARN("Unable to seek to 0x% 08x offset", totalSize);100 WARN("Unable to seek to 0x%x offset", totalSize); 101 101 return false; 102 102 } … … 123 123 IOBuffer buffer; 124 124 if (!buffer.ReadFromFs(file, totalSize)) { 125 WARN("Unable to read % dbytes", totalSize);125 WARN("Unable to read %u bytes", totalSize); 126 126 return false; 127 127 } … … 136 136 #define CHECK_BUFFER_SIZE(x,y) \ 137 137 if (GETAVAILABLEBYTESCOUNT((x)) < (y)){ \ 138 WARN("Not enough data (% d - %d)", \139 GETAVAILABLEBYTESCOUNT((x)),( y)); \138 WARN("Not enough data (%u - %u)", \ 139 GETAVAILABLEBYTESCOUNT((x)),(uint32_t)(y)); \ 140 140 return false; \ 141 141 } … … 158 158 return true; 159 159 } else { 160 WARN("Invalid tag name: % d %d %d %d",160 WARN("Invalid tag name: %hhu %hhu %hhu %hhu", 161 161 name[0], name[1], name[2], name[3]); 162 162 return false; -
trunk/sources/thelib/src/mediaformats/mp3/mp3document.cpp
r410 r413 147 147 148 148 double totalDuration = 0; 149 MediaFrame frame = {0 };149 MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 150 150 frame.type = MEDIAFRAME_TYPE_AUDIO; 151 151 frame.isKeyFrame = true; … … 174 174 [sampleRateIndex][paddingBit]; 175 175 if (frame.length == 0) { 176 FATAL("Invalid frame length: % d:%d:%d:%d:%d; Cusror: %llx",176 FATAL("Invalid frame length: %hhu:%hhu:%hhu:%hhu:%hhu; Cusror: %"PRIx64, 177 177 version, layer, bitRateIndex, sampleRateIndex, 178 178 paddingBit, _mediaFile.Cursor()); … … 192 192 //7. Seek to the next frame 193 193 if (!_mediaFile.SeekTo(frame.start + frame.length)) { 194 WARN("Unable to seek to % llx", frame.start + frame.length);194 WARN("Unable to seek to %"PRIx64, frame.start + frame.length); 195 195 break; 196 196 } -
trunk/sources/thelib/src/mediaformats/mp4/atomavcc.cpp
r410 r413 114 114 115 115 for (uint8_t i = 0; i < _picCount; i++) { 116 AVCCParameter parameter = {0 };116 AVCCParameter parameter = {0, 0}; 117 117 118 118 if (!ReadUInt16(parameter.size)) { -
trunk/sources/thelib/src/mediaformats/mp4/atomdata.cpp
r410 r413 69 69 default: 70 70 { 71 FATAL("Type % dnot yet implemented", _type);71 FATAL("Type %u not yet implemented", _type); 72 72 return false; 73 73 } … … 137 137 default: 138 138 { 139 FATAL("Type % dnot yet implemented", _type);139 FATAL("Type %u not yet implemented", _type); 140 140 return false; 141 141 } -
trunk/sources/thelib/src/mediaformats/mp4/atomesds.cpp
r410 r413 78 78 if (!ReadTagLength(length)) 79 79 return false; 80 FINEST_ESDS_ATOM("tagType: %d; length: %x; currentPos: %llx",81 tagType, length, CurrentPosition());82 80 return true; 83 81 } … … 87 85 uint32_t length = 0; 88 86 89 FINEST_ESDS_ATOM("Position: %llx", CurrentPosition());90 87 if (!ReadTagAndLength(tagType, length)) { 91 88 FATAL("Unable to read tag type and length"); … … 98 95 return false; 99 96 } 100 FINEST_ESDS_ATOM("_MP4ESDescrTag_ID: %u", _MP4ESDescrTag_ID);101 97 102 98 if (!ReadUInt8(_MP4ESDescrTag_Priority)) { … … 104 100 return false; 105 101 } 106 FINEST_ESDS_ATOM("_MP4ESDescrTag_Priority: %u", _MP4ESDescrTag_Priority);107 102 } else { 108 103 if (!ReadUInt16(_MP4ESDescrTag_ID)) { … … 110 105 return false; 111 106 } 112 FINEST_ESDS_ATOM("_MP4ESDescrTag_ID: %u", _MP4ESDescrTag_ID);113 107 } 114 108 115 FINEST_ESDS_ATOM("Position: %llx", CurrentPosition());116 109 if (!ReadTagAndLength(tagType, length)) { 117 110 FATAL("Unable to read tag type and length"); … … 124 117 return false; 125 118 } 126 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_ObjectTypeID: %u",127 _MP4DecConfigDescrTag_ObjectTypeID);128 119 129 120 if (!ReadUInt8(_MP4DecConfigDescrTag_StreamType)) { … … 131 122 return false; 132 123 } 133 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_StreamType: %u",134 _MP4DecConfigDescrTag_StreamType);135 124 136 125 if (!ReadUInt24(_MP4DecConfigDescrTag_BufferSizeDB)) { … … 138 127 return false; 139 128 } 140 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_BufferSizeDB: %u",141 _MP4DecConfigDescrTag_BufferSizeDB);142 129 143 130 if (!ReadUInt32(_MP4DecConfigDescrTag_MaxBitRate)) { … … 145 132 return false; 146 133 } 147 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_MaxBitRate: %u",148 _MP4DecConfigDescrTag_MaxBitRate);149 134 150 135 if (!ReadUInt32(_MP4DecConfigDescrTag_AvgBitRate)) { … … 152 137 return false; 153 138 } 154 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_AvgBitRate: %u",155 _MP4DecConfigDescrTag_AvgBitRate);156 139 157 FINEST_ESDS_ATOM("Position: %llx", CurrentPosition());158 140 if (!ReadTagAndLength(tagType, length)) { 159 141 FATAL("Unable to read tag type and length"); … … 167 149 return false; 168 150 } 169 FINEST_ESDS_ATOM("unknownValue: %u", unknownValue); 170 171 FINEST_ESDS_ATOM("Position: %llx", CurrentPosition()); 151 172 152 if (!ReadTagAndLength(tagType, length)) { 173 153 FATAL("Unable to read tag type and length"); … … 181 161 _extraDataStart = CurrentPosition(); 182 162 _extraDataLength = length; 183 #ifdef DEBUG_ESDS_ATOM184 vector<string> sampleRates;185 ADD_VECTOR_END(sampleRates, "96000");186 ADD_VECTOR_END(sampleRates, "88200");187 ADD_VECTOR_END(sampleRates, "64000");188 ADD_VECTOR_END(sampleRates, "48000");189 ADD_VECTOR_END(sampleRates, "44100");190 ADD_VECTOR_END(sampleRates, "32000");191 ADD_VECTOR_END(sampleRates, "24000");192 ADD_VECTOR_END(sampleRates, "22050");193 ADD_VECTOR_END(sampleRates, "16000");194 ADD_VECTOR_END(sampleRates, "12000");195 ADD_VECTOR_END(sampleRates, "11025");196 ADD_VECTOR_END(sampleRates, "8000");197 ADD_VECTOR_END(sampleRates, "7350");198 199 uint8_t *pBuffer = new uint8_t[length];200 if (!ReadArray(pBuffer, length)) {201 FATAL("Unable to read the extra data buffer");202 return false;203 }204 205 BitArray ba;206 ba.Put(pBuffer, length);207 FINEST_ESDS_ATOM("ba:\n%s", STR(ba));208 delete [] pBuffer;209 210 _objectType = ba.ReadBits<uint8_t > (5);211 FINEST_ESDS_ATOM("_objectType: %d", _objectType);212 213 _sampleRate = ba.ReadBits<uint8_t > (4);214 FINEST_ESDS_ATOM("_sampleRate: %d; %s", _sampleRate, STR(sampleRates[_sampleRate]));215 216 _channels = ba.ReadBits<uint8_t > (4);217 FINEST_ESDS_ATOM("_channels: %d", _channels);218 219 while (ba.AvailableBits() >= 11) {220 if (ba.PeekBits<uint16_t > (11) == 0x2b7) {221 ba.IgnoreBits(11);222 223 _extObjectType = ba.ReadBits<uint8_t > (5);224 FINEST_ESDS_ATOM("_extObjectType: %d", _extObjectType);225 226 _sbr = ba.ReadBits<uint8_t > (1);227 FINEST_ESDS_ATOM("_sbr: %d", _sbr);228 229 _extSampleRate = ba.ReadBits<uint8_t > (4);230 FINEST_ESDS_ATOM("_extSampleRate: %d; %s", _extSampleRate, STR(sampleRates[_extSampleRate]));231 232 FINEST_ESDS_ATOM("leftovers bits count: %d", ba.AvailableBits());233 234 break;235 } else {236 ba.IgnoreBits(1);237 }238 }239 #endif /* DEBUG_ESDS_ATOM */240 241 163 return SkipRead(false); 242 164 } -
trunk/sources/thelib/src/mediaformats/mp4/baseatom.cpp
r410 r413 61 61 62 62 BaseAtom::operator string() { 63 return format("S: % llu(0x%llx); L: %llu(0x%llx); T: %d(%s)",63 return format("S: %"PRIu64"(0x%"PRIx64"); L: %"PRIu64"(0x%"PRIx64"); T: %u(%s)", 64 64 _start, _start, _size, _size, GetTypeNumeric(), STR(GetTypeString())); 65 65 } … … 84 84 bool BaseAtom::SkipRead(bool issueWarn) { 85 85 if (issueWarn) 86 WARN("Atom type %s skipped. Position 0x% llx(%llu); Size: 0x%llx(%llu)",86 WARN("Atom type %s skipped. Position 0x%"PRIx64"(%"PRIu64"); Size: 0x%"PRIx64"(%"PRIu64")", 87 87 STR(GetTypeString()), _start, _start, _size, _size); 88 88 return _pDoc->GetMediaFile().SeekTo(_start + _size); … … 95 95 bool BaseAtom::CheckBounds(uint64_t size) { 96 96 if (CurrentPosition() + size > _start + _size) { 97 FATAL("Reached the end of the atom: Current pos: % llu; Wanted size: %d; atom start: %d; atom size: %d",97 FATAL("Reached the end of the atom: Current pos: %"PRIu64"; Wanted size: %"PRIu64"; atom start: %"PRIu64"; atom size: %"PRIu64, 98 98 CurrentPosition(), size, _start, _size); 99 99 return false; -
trunk/sources/thelib/src/mediaformats/mp4/boxatom.cpp
r410 r413 41 41 if (!pAtom->IsIgnored()) { 42 42 if (!AtomCreated(pAtom)) { 43 FATAL("Unable to signal AtomCreated for atom %s (% x)",43 FATAL("Unable to signal AtomCreated for atom %s (%"PRIx64")", 44 44 STR(GetTypeString()), _start); 45 45 return false; -
trunk/sources/thelib/src/mediaformats/mp4/mp4document.cpp
r410 r413 261 261 262 262 if (currentPos + pAtom->GetSize() != _mediaFile.Cursor()) { 263 FATAL("atom start: % llu; Atom size: %llu; currentPos: %llu",263 FATAL("atom start: %"PRIu64"; Atom size: %"PRIu64"; currentPos: %"PRIu64, 264 264 currentPos, pAtom->GetSize(), _mediaFile.Cursor()); 265 265 return NULL; … … 348 348 349 349 //add binary audio header 350 MediaFrame audioHeader = {0 };350 MediaFrame audioHeader = {0, 0, 0, 0, 0, 0, 0, 0}; 351 351 if (pESDS != NULL) { 352 352 audioHeader.type = MEDIAFRAME_TYPE_AUDIO; … … 358 358 audioHeader.deltaTime = 0; 359 359 audioHeader.compositionOffset = 0; 360 FINEST("Start: %llu (%llx); Length: %llu (%llx);", audioHeader.start, 361 audioHeader.start, audioHeader.length, audioHeader.length); 360 FINEST("Start: %"PRIu64" (%"PRIx64"); Length: %"PRIu64" (%"PRIx64");", 361 audioHeader.start, audioHeader.start, audioHeader.length, 362 audioHeader.length); 362 363 } 363 364 364 365 //add binary video header 365 MediaFrame videoHeader = {0 };366 MediaFrame videoHeader = {0, 0, 0, 0, 0, 0, 0, 0}; 366 367 if (pAVCC != NULL) { 367 368 videoHeader.type = MEDIAFRAME_TYPE_VIDEO; … … 471 472 compositionOffsets = pCTSS->GetEntries(); 472 473 if (sampleSize.size() != compositionOffsets.size()) { 473 WARN("composition offsets count != samples count; compositionOffsets: % d; sampleSize.size: %d",474 WARN("composition offsets count != samples count; compositionOffsets: %zu; sampleSize.size: %zu", 474 475 compositionOffsets.size(), 475 476 sampleSize.size()); 476 477 for (uint32_t i = compositionOffsets.size(); i < sampleSize.size(); i++) 477 478 ADD_VECTOR_END(compositionOffsets, 0); 478 WARN("composition offsets padded with 0. Now size is % d",479 WARN("composition offsets padded with 0. Now size is %zu", 479 480 compositionOffsets.size()); 480 481 } 481 482 } 482 INFO("audio: % d; keyFrames: %u; frames: %u; compositionOffsets: %u",483 INFO("audio: %hhu; keyFrames: %zu; frames: %zu; compositionOffsets: %zu", 483 484 audio, keyFrames.size(), sampleSize.size(), compositionOffsets.size()); 484 485 485 486 uint32_t timeScale = pMDHD->GetTimeScale(); 486 487 uint32_t totalTime = 0; … … 489 490 490 491 for (uint32_t i = 0; i < sampleSize.size(); i++) { 491 MediaFrame frame = {0 };492 MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 492 493 frame.start = chunckOffsets[sample2Chunk[i]] + localOffset; 493 494 if (pCTSS != NULL) { -
trunk/sources/thelib/src/mediaformats/nsv/mp3media.cpp
r410 r413 180 180 181 181 if (mediaFrame.length == 0) { 182 FATAL("Invalid frame length: % d:%d:%d:%d:%d;",182 FATAL("Invalid frame length: %hhu:%hhu:%hhu:%hhu:%hhu;", 183 183 version, layer, bitRateIndex, sampleRateIndex, 184 184 paddingBit); //, _mediaFile.Cursor()); 185 185 return false; 186 186 } 187 /*188 FINEST("Bytes: %02x %02x %02x %02x; frameStart: 0x%x; frameLength: 0x%x; Layer: %s",189 firstBytes[0], firstBytes[1], firstBytes[2], firstBytes[3],190 mediaFrame.start, mediaFrame.length, STR(_layerNames[layer]));191 */192 187 193 188 //6. Compute the frame duration and save the frame start -
trunk/sources/thelib/src/mediaformats/nsv/nsvdocument.cpp
r410 r413 106 106 } 107 107 108 FINEST("audcount: %d vidcount: %d ", _audioSamplesCount, _videoSamplesCount);109 110 108 return true; 111 109 } … … 196 194 197 195 if (aux_plus_vidlen > 0) { 198 MediaFrame video_frame = {0 };196 MediaFrame video_frame = {0, 0, 0, 0, 0, 0, 0, 0}; 199 197 video_frame.type = MEDIAFRAME_TYPE_VIDEO; 200 198 if (aux_plus_vidlen > 5) { … … 209 207 if (NALU_TYPE_SEI == NALU_TYPE(nt)) { 210 208 // get binary header from payload data 211 FINEST("video data offset % llx", _mediaFile.Cursor());209 FINEST("video data offset %"PRIx64, _mediaFile.Cursor()); 212 210 uint64_t currentCursor = _mediaFile.Cursor(); 213 211 _buffer.IgnoreAll(); … … 306 304 } 307 305 308 /* 309 // audio frame 310 FINEST("audio data offset %x", _mediaFile.Cursor()); 311 _audioSamplesCount+=samplesCount; //382 or 1152 312 audio_frame.absoluteTime = 0; //(double)_audioSamplesCount / (double)_framerate*1000.0; 313 */ 314 MediaFrame audio_frame = {0}; 306 MediaFrame audio_frame = {0, 0, 0, 0, 0, 0, 0, 0}; 315 307 audio_frame.start = _mediaFile.Cursor(); 316 308 _buffer.IgnoreAll(); … … 336 328 int nal_end = 0; 337 329 uint8_t nal_type = 0; 338 MediaFrame video_frame = {0 };330 MediaFrame video_frame = {0, 0, 0, 0, 0, 0, 0, 0}; 339 331 while (length != 0) { 340 332 find_nal_unit(pBuffer, length, &nal_start, &nal_end); -
trunk/sources/thelib/src/netio/epoll/inboundnamedpipecarrier.cpp
r193 r413 37 37 if (mkfifo(STR(path), mode) != 0) { 38 38 int err = errno; 39 FATAL("Unable to create named pipe %s with mode % d: %s (%d)",40 STR(path), mode, strerror(err), err);39 FATAL("Unable to create named pipe %s with mode %u: %s (%d)", 40 STR(path), (uint32_t) mode, strerror(err), err); 41 41 return NULL; 42 42 } … … 90 90 return false; 91 91 } else { 92 ASSERT("Invalid state: % 04x", event.events);92 ASSERT("Invalid state: %x", event.events); 93 93 94 94 return false; -
trunk/sources/thelib/src/netio/epoll/iohandler.cpp
r188 r413 91 91 return "IOHT_INBOUNDNAMEDPIPE_CARRIER"; 92 92 default: 93 return format("#unknown: % d#", type);93 return format("#unknown: %hhu#", type); 94 94 } 95 95 } -
trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp
r410 r413 31 31 vector<IOHandlerManagerToken *> *IOHandlerManager::_pRecycledTokens; 32 32 TimersManager *IOHandlerManager::_pTimersManager = NULL; 33 struct epoll_event IOHandlerManager::_dummy = {0}; 33 struct epoll_event IOHandlerManager::_dummy = {0, 34 {0}}; 34 35 35 36 map<uint32_t, IOHandler *> & IOHandlerManager::GetActiveHandlers() { … … 49 50 _pRecycledTokens = &_tokensVector2; 50 51 _pTimersManager = new TimersManager(ProcessTimer); 52 memset(&_dummy, 0, sizeof (_dummy)); 51 53 } 52 54 … … 91 93 } 92 94 SetupToken(pIOHandler); 93 uint32_t before = (uint32_t)_activeIOHandlers.size();95 size_t before = _activeIOHandlers.size(); 94 96 _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; 95 DEBUG("Handlers count changed: % d->%d%s", before, before + 1,97 DEBUG("Handlers count changed: %zu->%zu %s", before, before + 1, 96 98 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 97 99 } … … 100 102 if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 101 103 FreeToken(pIOHandler); 102 uint32_t before = (uint32_t)_activeIOHandlers.size();104 size_t before = _activeIOHandlers.size(); 103 105 _activeIOHandlers.erase(pIOHandler->GetId()); 104 DEBUG("Handlers count changed: % d->%d%s", before, before - 1,106 DEBUG("Handlers count changed: %zu->%zu %s", before, before - 1, 105 107 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 106 108 } … … 108 110 109 111 bool IOHandlerManager::EnableReadData(IOHandler *pIOHandler) { 110 struct epoll_event evt = {0}; 112 struct epoll_event evt = {0, 113 {0}}; 111 114 evt.events = EPOLLIN; 112 115 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 120 123 121 124 bool IOHandlerManager::DisableReadData(IOHandler *pIOHandler, bool ignoreError) { 122 struct epoll_event evt = {0}; 125 struct epoll_event evt = {0, 126 {0}}; 123 127 evt.events = EPOLLIN; 124 128 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 134 138 135 139 bool IOHandlerManager::EnableWriteData(IOHandler *pIOHandler) { 136 struct epoll_event evt = {0}; 140 struct epoll_event evt = {0, 141 {0}}; 137 142 evt.events = EPOLLIN | EPOLLOUT; 138 143 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 155 160 156 161 bool IOHandlerManager::DisableWriteData(IOHandler *pIOHandler, bool ignoreError) { 157 struct epoll_event evt = {0}; 162 struct epoll_event evt = {0, 163 {0}}; 158 164 evt.events = EPOLLIN; 159 165 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 169 175 170 176 bool IOHandlerManager::EnableAcceptConnections(IOHandler *pIOHandler) { 171 struct epoll_event evt = {0}; 177 struct epoll_event evt = {0, 178 {0}}; 172 179 evt.events = EPOLLIN; 173 180 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 181 188 182 189 bool IOHandlerManager::DisableAcceptConnections(IOHandler *pIOHandler, bool ignoreError) { 183 struct epoll_event evt = {0}; 190 struct epoll_event evt = {0, 191 {0}}; 184 192 evt.events = EPOLLIN; 185 193 evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); … … 195 203 196 204 bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 197 TimerEvent event = {0 };205 TimerEvent event = {0, 0, 0}; 198 206 event.id = pIOHandler->GetId(); 199 207 event.period = seconds; -
trunk/sources/thelib/src/netio/epoll/tcpacceptor.cpp
r410 r413 70 70 if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 71 71 int error = errno; 72 FATAL("Unable to bind on address: tcp://%s:% d; Error was: %s (%d)",72 FATAL("Unable to bind on address: tcp://%s:%hu; Error was: %s (%d)", 73 73 inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 74 74 ENTOHS(((sockaddr_in *) & _address)->sin_port), … … 120 120 CLOSE_SOCKET(fd); 121 121 _droppedCount++; 122 WARN("Acceptor is not enabled. Client dropped: %s:% d -> %s:%d",122 WARN("Acceptor is not enabled. Client dropped: %s:%hu -> %s:%hu", 123 123 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 124 124 ENTOHS(((sockaddr_in *) & address)->sin_port), … … 127 127 return true; 128 128 } 129 INFO("Client connected: %s:% d -> %s:%d",129 INFO("Client connected: %s:%hu -> %s:%hu", 130 130 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 131 131 ENTOHS(((sockaddr_in *) & address)->sin_port), -
trunk/sources/thelib/src/netio/epoll/tcpcarrier.cpp
r410 r413 74 74 assert(pInputBuffer != NULL); 75 75 if (!pInputBuffer->ReadFromTCPFd(_inboundFd, _recvBufferSize, readAmount)) { 76 FATAL("Unable to read data. %s:% d -> %s:%d",76 FATAL("Unable to read data. %s:%hu -> %s:%hu", 77 77 STR(_farIp), _farPort, 78 78 STR(_nearIp), _nearPort); … … 97 97 if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 98 98 if (!pOutputBuffer->WriteToTCPFd(_inboundFd, _sendBufferSize, writeAmount)) { 99 FATAL("Unable to send data. %s:% d -> %s:%d",99 FATAL("Unable to send data. %s:%hu -> %s:%hu", 100 100 STR(_farIp), _farPort, 101 101 STR(_nearIp), _nearPort); -
trunk/sources/thelib/src/netio/epoll/udpcarrier.cpp
r410 r413 136 136 137 137 //3. bind if necessary 138 sockaddr_in bindAddress = {0}; 138 sockaddr_in bindAddress; 139 memset(&bindAddress, 0, sizeof (bindAddress)); 139 140 if (bindIp != "") { 140 141 bindAddress.sin_family = PF_INET; … … 142 143 bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 143 144 if (bindAddress.sin_addr.s_addr == INADDR_NONE) { 144 FATAL("Unable to bind on address %s:% d", STR(bindIp), bindPort);145 FATAL("Unable to bind on address %s:%hu", STR(bindIp), bindPort); 145 146 close(sock); 146 147 return NULL; … … 148 149 if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 149 150 int error = errno; 150 FATAL("Unable to bind on address: udp://%s:% d; Error was: %s (%d)",151 FATAL("Unable to bind on address: udp://%s:%hu; Error was: %s (%d)", 151 152 STR(bindIp), bindPort, strerror(error), error); 152 153 close(sock); -
trunk/sources/thelib/src/netio/kqueue/inboundnamedpipecarrier.cpp
r193 r413 37 37 if (mkfifo(STR(path), mode) != 0) { 38 38 int err = errno; 39 FATAL("Unable to create named pipe %s with mode % d: %s (%d)",40 STR(path), mode, strerror(err), err);39 FATAL("Unable to create named pipe %s with mode %u: %s (%d)", 40 STR(path), (uint32_t) mode, strerror(err), err); 41 41 return NULL; 42 42 } … … 88 88 default: 89 89 { 90 ASSERT("Invalid state: %d", event.filter); 91 90 ASSERT("Invalid state: %hu", event.filter); 92 91 return false; 93 92 } -
trunk/sources/thelib/src/netio/kqueue/iohandler.cpp
r410 r413 93 93 return "IOHT_STDIO"; 94 94 default: 95 return format("#unknown: % d#", type);95 return format("#unknown: %hhu#", type); 96 96 } 97 97 } -
trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp
r410 r413 142 142 ASSERT("IOHandler already registered"); 143 143 } 144 uint32_t before = (uint32_t)_activeIOHandlers.size();144 size_t before = _activeIOHandlers.size(); 145 145 _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; 146 146 SetupToken(pIOHandler); 147 DEBUG("Handlers count changed: % d->%d%s", before, before + 1,147 DEBUG("Handlers count changed: %zu->%zu %s", before, before + 1, 148 148 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 149 149 } … … 152 152 if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 153 153 FreeToken(pIOHandler); 154 uint32_t before = (uint32_t)_activeIOHandlers.size();154 size_t before = _activeIOHandlers.size(); 155 155 _activeIOHandlers.erase(pIOHandler->GetId()); 156 DEBUG("Handlers count changed: % d->%d%s", before, before - 1,156 DEBUG("Handlers count changed: %zu->%zu %s", before, before - 1, 157 157 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 158 158 } … … 201 201 seconds*KQUEUE_TIMER_MULTIPLIER, pIOHandler->GetIOHandlerManagerToken()); 202 202 #else 203 TimerEvent event = {0 };203 TimerEvent event = {0, 0, 0}; 204 204 event.id = pIOHandler->GetId(); 205 205 event.period = seconds; -
trunk/sources/thelib/src/netio/kqueue/iotimer.cpp
r410 r413 54 54 default: 55 55 { 56 ASSERT("Invalid state: % d", event.filter);56 ASSERT("Invalid state: %hu", event.filter); 57 57 58 58 return false; -
trunk/sources/thelib/src/netio/kqueue/stdiocarrier.cpp
r410 r413 110 110 default: 111 111 { 112 ASSERT("Invalid state: % d", event.filter);112 ASSERT("Invalid state: %hu", event.filter); 113 113 114 114 return false; -
trunk/sources/thelib/src/netio/kqueue/tcpacceptor.cpp
r410 r413 67 67 if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 68 68 int error = errno; 69 FATAL("Unable to bind on address: tcp://%s:% d; Error was: %s (%d)",69 FATAL("Unable to bind on address: tcp://%s:%hu; Error was: %s (%d)", 70 70 inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 71 71 ENTOHS(((sockaddr_in *) & _address)->sin_port), … … 114 114 CLOSE_SOCKET(fd); 115 115 _droppedCount++; 116 WARN("Acceptor is not enabled. Client dropped: %s:% d -> %s:%d",116 WARN("Acceptor is not enabled. Client dropped: %s:%hu -> %s:%hu", 117 117 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 118 118 ENTOHS(((sockaddr_in *) & address)->sin_port), … … 121 121 return true; 122 122 } 123 INFO("Client connected: %s:% d -> %s:%d",123 INFO("Client connected: %s:%hu -> %s:%hu", 124 124 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 125 125 ENTOHS(((sockaddr_in *) & address)->sin_port), -
trunk/sources/thelib/src/netio/kqueue/tcpcarrier.cpp
r410 r413 74 74 assert(pInputBuffer != NULL); 75 75 if (!pInputBuffer->ReadFromTCPFd(event.ident, event.data, readAmount)) { 76 FATAL("Unable to read data. %s:% d -> %s:%d",76 FATAL("Unable to read data. %s:%hu -> %s:%hu", 77 77 STR(_farIp), _farPort, 78 78 STR(_nearIp), _nearPort); … … 88 88 if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 89 89 if (!pOutputBuffer->WriteToTCPFd(event.ident, event.data, writeAmount)) { 90 FATAL("Unable to send data. %s:% d -> %s:%d",90 FATAL("Unable to send data. %s:%hu -> %s:%hu", 91 91 STR(_farIp), _farPort, 92 92 STR(_nearIp), _nearPort); … … 105 105 default: 106 106 { 107 ASSERT("Invalid state: %d", event.filter); 108 107 ASSERT("Invalid state: %hd", event.filter); 109 108 return false; 110 109 } -
trunk/sources/thelib/src/netio/kqueue/udpcarrier.cpp
r410 r413 62 62 default: 63 63 { 64 ASSERT("Invalid state: % d", event.filter);64 ASSERT("Invalid state: %hu", event.filter); 65 65 return false; 66 66 } … … 131 131 132 132 //3. bind if necessary 133 sockaddr_in bindAddress = {0}; 133 sockaddr_in bindAddress; 134 memset(&bindAddress, 0, sizeof (bindAddress)); 134 135 if (bindIp != "") { 135 136 bindAddress.sin_family = PF_INET; … … 137 138 bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 138 139 if (bindAddress.sin_addr.s_addr == INADDR_NONE) { 139 FATAL("Unable to bind on address %s:% d", STR(bindIp), bindPort);140 FATAL("Unable to bind on address %s:%hu", STR(bindIp), bindPort); 140 141 close(sock); 141 142 return NULL; … … 143 144 if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 144 145 int error = errno; 145 FATAL("Unable to bind on address: udp://%s:% d; Error was: %s (%d)",146 FATAL("Unable to bind on address: udp://%s:%hu; Error was: %s (%d)", 146 147 STR(bindIp), bindPort, strerror(error), error); 147 148 close(sock); -
trunk/sources/thelib/src/netio/select/inboundnamedpipecarrier.cpp
r275 r413 36 36 InboundNamedPipeCarrier *InboundNamedPipeCarrier::Create(string path, 37 37 uint16_t mode) { 38 /*if (mkfifo(STR(path), mode) != 0) {39 int err = errno;40 FATAL("Unable to create named pipe %s with mode %d: %s (%d)",41 STR(path), mode, strerror(err), err);42 return NULL;43 }*/44 45 38 int32_t fd = open(STR(path), O_RDONLY/* | O_NONBLOCK*/); 46 39 if (fd < 0) { … … 90 83 default: 91 84 { 92 ASSERT("Invalid state: % d", event.type);85 ASSERT("Invalid state: %hhu", event.type); 93 86 return false; 94 87 } -
trunk/sources/thelib/src/netio/select/iohandler.cpp
r410 r413 84 84 return "IOHT_STDIO"; 85 85 default: 86 return format("#unknown: % d#", type);86 return format("#unknown: %hhu#", type); 87 87 } 88 88 } -
trunk/sources/thelib/src/netio/select/iohandlermanager.cpp
r410 r413 79 79 ASSERT("IOHandler already registered"); 80 80 } 81 uint32_t before = (uint32_t)_activeIOHandlers.size();81 size_t before = _activeIOHandlers.size(); 82 82 _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; 83 DEBUG("Handlers count changed: % d->%d%s", before, before + 1,83 DEBUG("Handlers count changed: %zu->%zu %s", before, before + 1, 84 84 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 85 85 } … … 91 91 DisableTimer(pIOHandler); 92 92 if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 93 uint32_t before = (uint32_t)_activeIOHandlers.size();93 size_t before = _activeIOHandlers.size(); 94 94 _activeIOHandlers.erase(pIOHandler->GetId()); 95 DEBUG("Handlers count changed: % d->%d%s", before, before - 1,95 DEBUG("Handlers count changed: %zu->%zu %s", before, before - 1, 96 96 STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 97 97 } … … 129 129 130 130 bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 131 TimerEvent event = {0 };131 TimerEvent event = {0, 0, 0}; 132 132 event.id = pIOHandler->GetId(); 133 133 event.period = seconds; … … 180 180 int32_t count = select(MAP_KEY(--_fdState.end()) + 1, &_readFdsCopy, &_writeFdsCopy, NULL, &_timeout); 181 181 if (count < 0) { 182 FATAL("Unable to do select: % d",LASTSOCKETERROR);182 FATAL("Unable to do select: %u", (uint32_t) LASTSOCKETERROR); 183 183 return false; 184 184 } -
trunk/sources/thelib/src/netio/select/stdiocarrier.cpp
r410 r413 111 111 default: 112 112 { 113 ASSERT("Invalid state: % d", event.type);113 ASSERT("Invalid state: %hhu", event.type); 114 114 return false; 115 115 } -
trunk/sources/thelib/src/netio/select/tcpacceptor.cpp
r410 r413 68 68 if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 69 69 int error = LASTSOCKETERROR; 70 FATAL("Unable to bind on address: tcp://%s:% d; Error was: %s (%d)",70 FATAL("Unable to bind on address: tcp://%s:%hu; Error was: %s (%d)", 71 71 inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 72 72 ENTOHS(((sockaddr_in *) & _address)->sin_port), … … 115 115 CLOSE_SOCKET(fd); 116 116 _droppedCount++; 117 WARN("Acceptor is not enabled. Client dropped: %s:% d -> %s:%d",117 WARN("Acceptor is not enabled. Client dropped: %s:%hu -> %s:%hu", 118 118 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 119 119 ENTOHS(((sockaddr_in *) & address)->sin_port), … … 122 122 return true; 123 123 } 124 INFO("Client connected: %s:% d -> %s:%d",124 INFO("Client connected: %s:%hu -> %s:%hu", 125 125 inet_ntoa(((sockaddr_in *) & address)->sin_addr), 126 126 ENTOHS(((sockaddr_in *) & address)->sin_port), -
trunk/sources/thelib/src/netio/select/tcpcarrier.cpp
r410 r413 84 84 if (!pInputBuffer->ReadFromTCPFd(_inboundFd, 85 85 _recvBufferSize, readAmount)) { 86 FATAL("Unable to read data. %s:% d -> %s:%d",86 FATAL("Unable to read data. %s:%hu -> %s:%hu", 87 87 STR(_farIp), _farPort, 88 88 STR(_nearIp), _nearPort); … … 99 99 if (!pOutputBuffer->WriteToTCPFd(_outboundFd, 100 100 _sendBufferSize, writeAmount)) { 101 FATAL("Unable to send data. %s:% d -> %s:%d",101 FATAL("Unable to send data. %s:%hu -> %s:%hu", 102 102 STR(_farIp), _farPort, 103 103 STR(_nearIp), _nearPort); … … 118 118 default: 119 119 { 120 ASSERT("Invalid state: % d", event.type);120 ASSERT("Invalid state: %hhu", event.type); 121 121 return false; 122 122 } -
trunk/sources/thelib/src/netio/select/udpcarrier.cpp
r410 r413 62 62 default: 63 63 { 64 ASSERT("Invalid state: % d", event.type);64 ASSERT("Invalid state: %hhu", event.type); 65 65 return false; 66 66 } … … 132 132 133 133 //3. bind if necessary 134 sockaddr_in bindAddress = {0}; 134 sockaddr_in bindAddress; 135 memset(&bindAddress, 0, sizeof (bindAddress)); 135 136 if (bindIp != "") { 136 137 bindAddress.sin_family = PF_INET; … … 138 139 bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 139 140 if (bindAddress.sin_addr.s_addr == INADDR_NONE) { 140 FATAL("Unable to bind on address %s:% d", STR(bindIp), bindPort);141 FATAL("Unable to bind on address %s:%hu", STR(bindIp), bindPort); 141 142 CLOSE_SOCKET(sock); 142 143 return NULL; … … 144 145 if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 145 146 int error = LASTSOCKETERROR; 146 FATAL("Unable to bind on address: udp://%s:% d; Error was: %s (%d)",147 FATAL("Unable to bind on address: udp://%s:%hu; Error was: %s (%d)", 147 148 STR(bindIp), bindPort, strerror(error), error); 148 149 CLOSE_SOCKET(sock); -
trunk/sources/thelib/src/protocols/baseprotocol.cpp
r410 r413 40 40 _pApplication = NULL; 41 41 #ifdef LOG_CONSTRUCTOR_DESTRUCTOR 42 FINEST("Protocol with id % d of type %s created; F: %p,N: %p, DF: %d, DN: %d",42 FINEST("Protocol with id %u of type %s created; F: %p,N: %p, DF: %hhu, DN: %hhu", 43 43 _id, STR(tagToString(_type)), 44 44 _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); … … 52 52 BaseProtocol::~BaseProtocol() { 53 53 #ifdef LOG_CONSTRUCTOR_DESTRUCTOR 54 FINEST("Protocol with id % d of type %s going to be deleted; F: %p,N: %p, DF: %d, DN: %d",54 FINEST("Protocol with id %u of type %s going to be deleted; F: %p,N: %p, DF: %hhu, DN: %hhu", 55 55 _id, STR(tagToString(_type)), 56 56 _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); … … 74 74 } 75 75 #ifdef LOG_CONSTRUCTOR_DESTRUCTOR 76 FINEST("Protocol with id % d of type %s deleted; F: %p,N: %p, DF: %d, DN: %d",76 FINEST("Protocol with id %u of type %s deleted; F: %p,N: %p, DF: %hhu, DN: %hhu", 77 77 _id, STR(tagToString(_type)), 78 78 _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); … … 112 112 pProtocol->SetNearProtocol(this); 113 113 #ifdef LOG_CONSTRUCTOR_DESTRUCTOR 114 FINEST("Protocol with id % d of type %s setted up; F: %p,N: %p, DF: %d, DN: %d",114 FINEST("Protocol with id %u of type %s setted up; F: %p,N: %p, DF: %hhu, DN: %hhu", 115 115 _id, STR(tagToString(_type)), 116 116 _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); … … 149 149 pProtocol->SetFarProtocol(this); 150 150 #ifdef LOG_CONSTRUCTOR_DESTRUCTOR 151 FINEST("Protocol with id % d of type %s setted up; F: %p,N: %p, DF: %d, DN: %d",151 FINEST("Protocol with id %u of type %s setted up; F: %p,N: %p, DF: %hhu, DN: %hhu", 152 152 _id, STR(tagToString(_type)), 153 153 _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); … … 263 263 break; 264 264 default: 265 result = format("#unknown % d#(%d,%d) <-> ",265 result = format("#unknown %hhu#(%d,%d) <-> ", 266 266 GetIOHandler()->GetType(), 267 267 GetIOHandler()->GetInboundFd(), … … 409 409 string result = ""; 410 410 if (_id == currentId) 411 result = format("[%s(% d)]", STR(tagToString(_type)), _id);411 result = format("[%s(%u)]", STR(tagToString(_type)), _id); 412 412 else 413 result = format("%s(% d)", STR(tagToString(_type)), _id);413 result = format("%s(%u)", STR(tagToString(_type)), _id); 414 414 return result; 415 415 } -
trunk/sources/thelib/src/protocols/dns/inbounddnsresolverprotocol.cpp
r410 r413 37 37 if (type == PT_TCP) 38 38 return true; 39 FATAL("Far protocol %d not accepted", type);40 39 return false; 41 40 } … … 75 74 } 76 75 if (!buffer.Ignore(4 + size)) { 77 FATAL("Unable to ignore % dbytes", 4 + size);76 FATAL("Unable to ignore %u bytes", 4 + size); 78 77 return false; 79 78 } -
trunk/sources/thelib/src/protocols/dns/outbounddnsresolverprotocol.cpp
r410 r413 49 49 if (!TCPConnector<OutboundDNSResolverProtocol>::Connect(ip, port, chain, 50 50 customParameters)) { 51 FATAL("Unable to connect to %s:% d", STR(ip), port);51 FATAL("Unable to connect to %s:%hu", STR(ip), port); 52 52 return false; 53 53 } … … 123 123 if (type == PT_TCP) 124 124 return true; 125 FATAL("Far protocol %d not accepted", type);126 125 return false; 127 126 } … … 161 160 } 162 161 if (!buffer.Ignore(4 + size)) { 163 FATAL("Unable to ignore % dbytes", 4 + size);162 FATAL("Unable to ignore %u bytes", 4 + size); 164 163 return false; 165 164 } -
trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp
r410 r413 101 101 _outboundHeaders.RemoveKey(HTTP_HEADERS_CONTENT_LENGTH); 102 102 if (bufferLength > 0) { 103 _outboundHeaders[HTTP_HEADERS_CONTENT_LENGTH] = format("% d", bufferLength);103 _outboundHeaders[HTTP_HEADERS_CONTENT_LENGTH] = format("%u", bufferLength); 104 104 } 105 105 … … 230 230 231 231 result += _state == HTTP_STATE_HEADERS ? "HTTP_STATE_HEADERS\n" : "HTTP_STATE_PAYLOAD\n"; 232 result += format("_chunkedContent: % d\n", _chunkedContent);233 result += format("_lastChunk: % d\n", _lastChunk);234 result += format("_contentLength: % d\n", _contentLength);235 result += format("_sessionDecodedBytesCount: % d\n", _sessionDecodedBytesCount);236 result += format("_decodedBytesCount: % d\n", _decodedBytesCount);237 result += format("_disconnectAfterTransfer: % d\n", _disconnectAfterTransfer);238 result += format("TransferCompleted(): % d\n", TransferCompleted());232 result += format("_chunkedContent: %hhu\n", _chunkedContent); 233 result += format("_lastChunk: %hhu\n", _lastChunk); 234 result += format("_contentLength: %u\n", _contentLength); 235 result += format("_sessionDecodedBytesCount: %u\n", _sessionDecodedBytesCount); 236 result += format("_decodedBytesCount: %u\n", _decodedBytesCount); 237 result += format("_disconnectAfterTransfer: %hhu\n", _disconnectAfterTransfer); 238 result += format("TransferCompleted(): %hhu\n", TransferCompleted()); 239 239 result += format("_headers:\n%s\n", STR(_headers.ToString())); 240 240 result += format("_outputBuffer:\n%s\n", STR(_outputBuffer)); … … 331 331 if (lowercase(_headers[HTTP_HEADERS].GetValue(HTTP_HEADERS_TRANSFER_ENCODING, false)) != 332 332 lowercase(HTTP_HEADERS_TRANSFER_ENCODING_CHUNKED)) { 333 FATAL("The only supported %s is %s", HTTP_HEADERS_TRANSFER_ENCODING, 333 FATAL("The only supported %s is %s", 334 HTTP_HEADERS_TRANSFER_ENCODING, 334 335 HTTP_HEADERS_TRANSFER_ENCODING_CHUNKED); 335 336 return false; … … 388 389 chunkSize = strtol(STR(chunkSizeString), NULL, 16); 389 390 if (chunkSize > HTTP_MAX_CHUNK_SIZE) { 390 FATAL("Chunk size too large. Maximum allowed is % d and we got %d",391 HTTP_MAX_CHUNK_SIZE, chunkSize);391 FATAL("Chunk size too large. Maximum allowed is %u and we got %u", 392 (uint32_t) HTTP_MAX_CHUNK_SIZE, chunkSize); 392 393 return false; 393 394 } -
trunk/sources/thelib/src/protocols/http/inboundhttpprotocol.cpp
r410 r413 123 123 return "HTTP/1.1 401 Unauthorized"; 124 124 default: 125 return format("HTTP/1.1 % dUnknwon", _statusCode);125 return format("HTTP/1.1 %hu Unknwon", _statusCode); 126 126 } 127 127 } -
trunk/sources/thelib/src/protocols/liveflv/baseliveflvappprotocolhandler.cpp
r56 r413 35 35 void BaseLiveFLVAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 36 36 if (MAP_HAS1(_protocols, pProtocol->GetId())) { 37 ASSERT("Protocol ID % dalready registered", pProtocol->GetId());37 ASSERT("Protocol ID %u already registered", pProtocol->GetId()); 38 38 return; 39 39 } … … 48 48 void BaseLiveFLVAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 49 49 if (!MAP_HAS1(_protocols, pProtocol->GetId())) { 50 ASSERT("Protocol ID % dnot registered", pProtocol->GetId());50 ASSERT("Protocol ID %u not registered", pProtocol->GetId()); 51 51 return; 52 52 } -
trunk/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp
r410 r413 49 49 else 50 50 _waitForMetadata = false; 51 FINEST("_waitForMetadata: % d", _waitForMetadata);51 FINEST("_waitForMetadata: %hhu", _waitForMetadata); 52 52 return true; 53 53 } … … 100 100 length = ENTOHLP((GETIBPOINTER(buffer) + 1)) >> 8; //----MARKED-LONG--- 101 101 if (length >= 1024 * 1024) { 102 FATAL("Frame too large: % d", length);102 FATAL("Frame too large: %u", length); 103 103 return false; 104 104 } … … 196 196 default: 197 197 { 198 FATAL("Invalid frame type: % d", type);198 FATAL("Invalid frame type: %hhu", type); 199 199 return false; 200 200 } … … 216 216 if (GetIOHandler()->GetType() == IOHT_TCP_CARRIER) { 217 217 //this is a tcp carrier 218 streamName = format("%s_% d",218 streamName = format("%s_%hu", 219 219 STR(((TCPCarrier *) GetIOHandler())->GetFarEndpointAddressIp()), 220 220 ((TCPCarrier *) GetIOHandler())->GetFarEndpointPort()); 221 221 } else { 222 222 //this is not a TCP carrier 223 streamName = format("flv_% d", GetId());223 streamName = format("flv_%u", GetId()); 224 224 } 225 225 } else { 226 226 //we don't have a carrier. This protocl might be artificially fed 227 streamName = format("flv_% d", GetId());227 streamName = format("flv_%u", GetId()); 228 228 } 229 229 } … … 237 237 GetApplication()->GetStreamsManager()->GetWaitingSubscribers( 238 238 streamName, _pStream->GetType()); 239 FINEST("subscribedOutStreams count: % d", subscribedOutStreams.size());239 FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 240 240 241 241 -
trunk/sources/thelib/src/protocols/liveflv/innetliveflvstream.cpp
r314 r413 100 100 GETAVAILABLEBYTESCOUNT(_videoCodecInit), 101 101 _lastVideoTime, false)) { 102 FINEST("Unable to feed OS: % d", pOutStream->GetUniqueId());102 FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 103 103 pOutStream->EnqueueForDelete(); 104 104 } … … 110 110 GETAVAILABLEBYTESCOUNT(_audioCodecInit), 111 111 _lastAudioTime, true)) { 112 FINEST("Unable to feed OS: % d", pOutStream->GetUniqueId());112 FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 113 113 pOutStream->EnqueueForDelete(); 114 114 } … … 201 201 return false; 202 202 } 203 FINEST("Cached the AAC audio codec initialization: % d",203 FINEST("Cached the AAC audio codec initialization: %u", 204 204 GETAVAILABLEBYTESCOUNT(_audioCodecInit)); 205 205 return true; … … 222 222 } 223 223 224 FINEST("Cached the h264 video codec initialization: % d",224 FINEST("Cached the h264 video codec initialization: %u", 225 225 GETAVAILABLEBYTESCOUNT(_videoCodecInit)); 226 226 -
trunk/sources/thelib/src/protocols/protocolfactorymanager.cpp
r410 r413 33 33 //1. Test to see if this factory is already registered 34 34 if (MAP_HAS1(_factoriesById, pFactory->GetId())) { 35 FATAL("Factory id % dalready registered", pFactory->GetId());35 FATAL("Factory id %u already registered", pFactory->GetId()); 36 36 return false; 37 37 } … … 42 42 FOR_VECTOR(protocolChains, i) { 43 43 if (MAP_HAS1(_factoriesByChainName, protocolChains[i])) { 44 FATAL("protocol chain %s already handled by factory % d",44 FATAL("protocol chain %s already handled by factory %u", 45 45 STR(protocolChains[i]), 46 46 _factoriesByChainName[protocolChains[i]]->GetId()); … … 54 54 FOR_VECTOR(protocols, i) { 55 55 if (MAP_HAS1(_factoriesByProtocolId, protocols[i])) { 56 FATAL("protocol % 08x already handled by factory %d", protocols[i],56 FATAL("protocol %"PRIx64" already handled by factory %u", protocols[i], 57 57 _factoriesByProtocolId[protocols[i]]->GetId()); 58 58 return false; … … 77 77 bool ProtocolFactoryManager::UnRegisterProtocolFactory(uint32_t factoryId) { 78 78 if (!MAP_HAS1(_factoriesById, factoryId)) { 79 WARN("Factory id not found: % d", factoryId);79 WARN("Factory id not found: %u", factoryId); 80 80 return true; 81 81 } … … 90 90 91 91 if (!MAP_HAS1(_factoriesById, pFactory->GetId())) { 92 WARN("Factory id not found: % d", pFactory->GetId());92 WARN("Factory id not found: %u", pFactory->GetId()); 93 93 return true; 94 94 } … … 138 138 FOR_VECTOR(chain, i) { 139 139 if (!MAP_HAS1(_factoriesByProtocolId, chain[i])) { 140 FATAL("protocol % 08xnot handled by anyone", chain[i]);140 FATAL("protocol %"PRIx64" not handled by anyone", chain[i]); 141 141 return NULL; 142 142 } … … 151 151 chain[i], parameters); 152 152 if (pProtocol == NULL) { 153 FATAL("Unable to spawn protocol %s handled by factory % d",153 FATAL("Unable to spawn protocol %s handled by factory %u", 154 154 STR(tagToString(chain[i])), 155 155 _factoriesByProtocolId[chain[i]]->GetId()); -
trunk/sources/thelib/src/protocols/rtmfp/basertmfpprotocol.cpp
r410 r413 83 83 if (sessionId == 0) { 84 84 if (MAP_HAS2(_initSessions, pPeerAddress->sin_addr.s_addr, pPeerAddress->sin_port)) { 85 WARN("Session in hndshake mode: %s:% d",85 WARN("Session in hndshake mode: %s:%hu", 86 86 inet_ntoa(pPeerAddress->sin_addr), 87 87 ENTOHS(pPeerAddress->sin_port)); 88 88 pSession = _initSessions[pPeerAddress->sin_addr.s_addr][pPeerAddress->sin_port]; 89 89 } else { 90 WARN("Brand new session: %s:% d",90 WARN("Brand new session: %s:%hu", 91 91 inet_ntoa(pPeerAddress->sin_addr), 92 92 ENTOHS(pPeerAddress->sin_port)); … … 96 96 } else { 97 97 if (MAP_HAS1(_sessions, sessionId)) { 98 WARN("Active session: %08x - %s:% d",98 WARN("Active session: %08x - %s:%hu", 99 99 sessionId, 100 100 inet_ntoa(pPeerAddress->sin_addr), … … 102 102 pSession = _sessions[sessionId]; 103 103 } else { 104 WARN("Bogus session: %08x - %s:% d",104 WARN("Bogus session: %08x - %s:%hu", 105 105 sessionId, 106 106 inet_ntoa(pPeerAddress->sin_addr), … … 245 245 bool t = (type & 0x02) != 0; 246 246 bool T = (type & 0x01) != 0; 247 FINEST("BITS: % d %d %d %d %d %d %d %d",247 FINEST("BITS: %hhu %hhu %hhu %hhu %hhu %hhu %hhu %hhu", 248 248 E, S, r1, r2, I, R, t, T); 249 FINEST("E Timestamp Echo Valid: % d", E);250 FINEST("S Startup: % d", S);251 FINEST("R1 Reserved1: % d", r1);252 FINEST("R2 Reserved2: % d", r2);253 FINEST("I Initiator Mark: % d", I);254 FINEST("R Responder Mark: % d", R);255 FINEST("t Time Critical Reverse Notification: % d", t);256 FINEST("T Time Critical Forward Notification: % d", T);257 FINEST("type: % 02x E: %d; S: %d; b1: %d; b2: %d; I: %d; R: %d; t: %d; T: %d",249 FINEST("E Timestamp Echo Valid: %hhu", E); 250 FINEST("S Startup: %hhu", S); 251 FINEST("R1 Reserved1: %hhu", r1); 252 FINEST("R2 Reserved2: %hhu", r2); 253 FINEST("I Initiator Mark: %hhu", I); 254 FINEST("R Responder Mark: %hhu", R); 255 FINEST("t Time Critical Reverse Notification: %hhu", t); 256 FINEST("T Time Critical Forward Notification: %hhu", T); 257 FINEST("type: %hhx E: %hhu; S: %hhu; b1: %hhu; b2: %hhu; I: %hhu; R: %hhu; t: %hhu; T: %hhu", 258 258 type, E, S, r1, r2, I, R, t, T); 259 259 … … 285 285 uint8_t chunkType, 286 286 uint16_t chunkLength) { 287 FINEST("type: % 02x; timestamp: %04x; chunkType: %02x; chunkLength: %04x",287 FINEST("type: %hhx; timestamp: %hx; chunkType: %hhx; chunkLength: %hx", 288 288 type, timestamp, chunkType, chunkLength); 289 289 switch (type) { … … 292 292 break; 293 293 default: 294 FATAL("Invalid message type: % 02x", type);294 FATAL("Invalid message type: %hhx", type); 295 295 break; 296 296 } … … 311 311 break; 312 312 default: 313 FATAL("Invalid chunk type: % 02x", chunkType);313 FATAL("Invalid chunk type: %hhx", chunkType); 314 314 break; 315 315 } … … 325 325 #define __CHECK_SIZE(size) \ 326 326 if(GETAVAILABLEBYTESCOUNT(buffer)<(size)) {\ 327 FATAL("Invalid buffer size. Wanted: %u; got: %u",( size),GETAVAILABLEBYTESCOUNT(buffer)); \327 FATAL("Invalid buffer size. Wanted: %u; got: %u",(uint32_t)(size),GETAVAILABLEBYTESCOUNT(buffer)); \ 328 328 return; \ 329 329 } \ … … 336 336 string __tempString__; \ 337 337 for(uint32_t i=0;i<(size);i++) { \ 338 __tempString__+=format("%02 x",(value)[i]); \338 __tempString__+=format("%02hhx",(value)[i]); \ 339 339 } \ 340 FINEST(#value"[% d]: %s",(size), STR(__tempString__)); \340 FINEST(#value"[%u]: %s",(uint32_t)(size), STR(__tempString__)); \ 341 341 } 342 342 … … 345 345 value=string((char *)GETIBPOINTER(buffer),(size)); \ 346 346 buffer.Ignore((size)); \ 347 FINEST(#value"[% d]: `%s`",(size),STR(value));347 FINEST(#value"[%u]: `%s`",(uint32_t)(size),STR(value)); 348 348 349 349 void BaseRTMFPProtocol::ProcessSessionMessage_0b_30( … … 497 497 string temp = ""; 498 498 for (uint32_t i = 0; i < 32; i++) { 499 temp += format("%02 x", pSession->client.id[i]);499 temp += format("%02hhx", pSession->client.id[i]); 500 500 } 501 501 FINEST("farId: %s", STR(temp)); … … 505 505 temp = ""; 506 506 for (uint32_t i = 0; i < 32; i++) { 507 temp += format("%02 x", pSession->server.id[i]);507 temp += format("%02hhx", pSession->server.id[i]); 508 508 } 509 509 FINEST("nearId: %s", STR(temp)); -
trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp
r410 r413 70 70 AMF_CHECK_BOUNDARIES(buffer, 1); 71 71 if (GETIBPOINTER(buffer)[0] != AMF0_SHORT_STRING) { 72 FATAL("AMF type not valid: want: % d; got: %d",72 FATAL("AMF type not valid: want: %hhu; got: %hhu", 73 73 AMF0_SHORT_STRING, GETIBPOINTER(buffer)[0]); 74 74 return false; … … 90 90 variant = string((char *) (GETIBPOINTER(buffer)), length); 91 91 if (!buffer.Ignore(length)) { 92 FATAL("Unable to ignore % dbytes", length);92 FATAL("Unable to ignore %hu bytes", length); 93 93 return false; 94 94 } … … 112 112 AMF_CHECK_BOUNDARIES(buffer, 1); 113 113 if (GETIBPOINTER(buffer)[0] != AMF0_LONG_STRING) { 114 FATAL("AMF type not valid: want: % d; got: %d",114 FATAL("AMF type not valid: want: %hhu; got: %hhu", 115 115 AMF0_LONG_STRING, GETIBPOINTER(buffer)[0]); 116 116 return false; … … 133 133 variant = string((char *) (GETIBPOINTER(buffer)), length); 134 134 if (!buffer.Ignore(length)) { 135 FATAL("Unable to ignore % dbytes", length);135 FATAL("Unable to ignore %u bytes", length); 136 136 return false; 137 137 } … … 156 156 AMF_CHECK_BOUNDARIES(buffer, 1); 157 157 if (GETIBPOINTER(buffer)[0] != AMF0_NUMBER) { 158 FATAL("AMF type not valid: want: % d; got: %d",158 FATAL("AMF type not valid: want: %hhu; got: %hhu", 159 159 AMF0_NUMBER, GETIBPOINTER(buffer)[0]); 160 160 return false; … … 195 195 AMF_CHECK_BOUNDARIES(buffer, 1); 196 196 if (GETIBPOINTER(buffer)[0] != AMF0_OBJECT) { 197 FATAL("AMF type not valid: want: % d; got: %d",197 FATAL("AMF type not valid: want: %hhu; got: %hhu", 198 198 AMF0_OBJECT, GETIBPOINTER(buffer)[0]); 199 199 return false; … … 289 289 AMF_CHECK_BOUNDARIES(buffer, 1); 290 290 if (GETIBPOINTER(buffer)[0] != AMF0_MIXED_ARRAY) { 291 FATAL("AMF type not valid: want: % d; got: %d",291 FATAL("AMF type not valid: want: %hhu; got: %hhu", 292 292 AMF0_MIXED_ARRAY, GETIBPOINTER(buffer)[0]); 293 293 return false; … … 403 403 AMF_CHECK_BOUNDARIES(buffer, 1); 404 404 if (GETIBPOINTER(buffer)[0] != AMF0_ARRAY) { 405 FATAL("AMF type not valid: want: % d; got: %d",405 FATAL("AMF type not valid: want: %hhu; got: %hhu", 406 406 AMF0_ARRAY, GETIBPOINTER(buffer)[0]); 407 407 return false; … … 445 445 AMF_CHECK_BOUNDARIES(buffer, 1); 446 446 if (GETIBPOINTER(buffer)[0] != AMF0_AMF3_OBJECT) { 447 FATAL("AMF type not valid: want: % d; got: %d",447 FATAL("AMF type not valid: want: %hhu; got: %hhu", 448 448 AMF0_AMF3_OBJECT, GETIBPOINTER(buffer)[0]); 449 449 return false; … … 481 481 AMF_CHECK_BOUNDARIES(buffer, 1); 482 482 if (GETIBPOINTER(buffer)[0] != AMF0_BOOLEAN) { 483 FATAL("AMF type not valid: want: % d; got: %d",483 FATAL("AMF type not valid: want: %hhu; got: %hhu", 484 484 AMF0_BOOLEAN, GETIBPOINTER(buffer)[0]); 485 485 return false; … … 519 519 AMF_CHECK_BOUNDARIES(buffer, 1); 520 520 if (GETIBPOINTER(buffer)[0] != AMF0_TIMESTAMP) { 521 FATAL("AMF type not valid: want: % d; got: %d",521 FATAL("AMF type not valid: want: %hhu; got: %hhu", 522 522 AMF0_TIMESTAMP, GETIBPOINTER(buffer)[0]); 523 523 return false; … … 564 564 AMF_CHECK_BOUNDARIES(buffer, 1); 565 565 if (GETIBPOINTER(buffer)[0] != AMF0_NULL) { 566 FATAL("AMF type not valid: want: % d; got: %d",566 FATAL("AMF type not valid: want: %hhu; got: %hhu", 567 567 AMF0_NULL, GETIBPOINTER(buffer)[0]); 568 568 return false; … … 587 587 AMF_CHECK_BOUNDARIES(buffer, 1); 588 588 if (GETIBPOINTER(buffer)[0] != AMF0_UNDEFINED) { 589 FATAL("AMF type not valid: want: % d; got: %d",589 FATAL("AMF type not valid: want: %hhu; got: %hhu", 590 590 AMF0_UNDEFINED, GETIBPOINTER(buffer)[0]); 591 591 return false; … … 723 723 default: 724 724 { 725 FATAL("Unable to de serialize type %d; Buffer: %s",725 FATAL("Unable to de-serialize type %hhu; Buffer: %s", 726 726 GETIBPOINTER(buffer)[0], STR(buffer)); 727 727 return false; -
trunk/sources/thelib/src/protocols/rtmp/amf3serializer.cpp
r410 r413 27 27 AMF_CHECK_BOUNDARIES(buffer, 1); \ 28 28 if (GETIBPOINTER(buffer)[0] != wanted) { \ 29 FATAL("AMF type not valid: want: % d; got: %d", \30 wanted, GETIBPOINTER(buffer)[0]); \29 FATAL("AMF type not valid: want: %hhu; got: %hhu", \ 30 (uint8_t)wanted, GETIBPOINTER(buffer)[0]); \ 31 31 return false; \ 32 32 } \ … … 107 107 default: 108 108 { 109 FATAL("Unable to deserialize type % d; Buffer is:\n%s",109 FATAL("Unable to deserialize type %hhu; Buffer is:\n%s", 110 110 GETIBPOINTER(buffer)[0], STR(buffer)); 111 111 return false; … … 165 165 default: 166 166 { 167 FATAL("Unable to serialize type % d; variant is:\n%s",167 FATAL("Unable to serialize type %hhu; variant is:\n%s", 168 168 (VariantType) variant, STR(variant.ToString())); 169 169 return false; … … 280 280 string result = string((char *) GETIBPOINTER(buffer), length); 281 281 if (!buffer.Ignore(length)) { 282 FATAL("Unable to ignore % dbytes", length);282 FATAL("Unable to ignore %u bytes", length); 283 283 return false; 284 284 } … … 374 374 375 375 if ((temp & 0x01) == 0) { 376 WARN("Array reference: % d", temp >> 1);376 WARN("Array reference: %u", temp >> 1); 377 377 variant = _objects[temp >> 1]; 378 378 return true; … … 419 419 420 420 uint32_t denseSize = v.MapDenseSize(); 421 FINEST("denseSize: %d", denseSize);422 421 423 422 for (uint32_t i = 0; i < denseSize; i++) { … … 463 462 READ_AMF3_TYPE(AMF3_OBJECT); 464 463 465 uint32_t objectStart = buffer._consumed;466 464 uint32_t temp; 467 465 if (!ReadU29(buffer, temp)) { … … 482 480 483 481 484 485 string info = format("OS: %d; flags: %x; TE: %d; ", objectStart, temp, traitsExtended);486 if (objectReference)487 info += format("ORI: %d; ", objectReferenceIndex);488 489 if (traitsReference)490 info += format("TRI: %d; ", traitsReferenceIndex);491 else492 info += format("TC: %d; Dynamic: %d", traitsCount, isDynamic);493 WARN("%s", STR(info));494 495 482 if (objectReference) { 496 WARN("Object reference: %d", objectReferenceIndex);497 483 variant = _objects[objectReferenceIndex]; 498 484 return true; … … 521 507 522 508 uint32_t objectIndex = _objects.size(); 523 WARN("Begin reading object %d", objectIndex);524 509 Variant tempVariant = Variant(); 525 510 ADD_VECTOR_END(_objects, tempVariant); … … 528 513 529 514 if (traitsReference) { 530 FATAL("Traits reference: %d", traitsReferenceIndex);531 515 traits = _traits[traitsReferenceIndex]; 532 516 FINEST("Traits:\n%s", STR(traits.ToString())); 533 517 } else { 534 518 uint32_t traitsIndex = _traits.size(); 535 INFO("Begin reading traits names %d", traitsIndex);536 519 537 520 tempVariant = Variant(); … … 556 539 557 540 _traits[traitsIndex] = traits; 558 559 INFO("End reading traits names %d", traitsIndex);560 541 } 561 542 … … 581 562 readDynamicPoperties = isDynamic; 582 563 } 583 584 /*if (isDynamic) {585 readDynamicPoperties = true;586 } else {587 if (traitsReference) {588 readDynamicPoperties = (bool)traits[AMF3_TRAITS_DYNAMIC];589 } else {590 readDynamicPoperties = false;591 }592 }*/593 594 FINEST("readDynamicPoperties: %d", readDynamicPoperties);595 564 596 565 if (readDynamicPoperties) { … … 613 582 614 583 _objects[objectIndex] = variant; 615 WARN("End reading object %d", objectIndex);616 617 584 return true; 618 585 } … … 681 648 string result = string((char *) GETIBPOINTER(buffer), length); 682 649 if (!buffer.Ignore(length)) { 683 FATAL("Unable to ignore % dbytes", length);650 FATAL("Unable to ignore %u bytes", length); 684 651 return false; 685 652 } … … 758 725 } 759 726 760 FATAL("Invalid range: %08x", value);761 727 return false; 762 728 } -
trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp
r410 r413 443 443 } 444 444 if (pInNetRTMPStream == NULL) { 445 WARN("No stream found. Searched for %d:%d. Message was:\n%s", pFrom->GetId(), 445 WARN("No stream found. Searched for %u:%u. Message was:\n%s", 446 pFrom->GetId(), 446 447 (uint32_t) VH_SI(request), 447 448 STR(request.ToString())); … … 484 485 } 485 486 if (pInNetRTMPStream == NULL) { 486 WARN("No stream found. Searched for %d:%d", pFrom->GetId(), 487 WARN("No stream found. Searched for %u:%u", 488 pFrom->GetId(), 487 489 (uint32_t) VH_SI(request)); 488 490 return true; … … 644 646 InNetRTMPStream *pTempStream = (InNetRTMPStream *) MAP_VAL(i); 645 647 if (pTempStream->GetProtocol() != NULL) { 646 WARN("Overriding stream R% d:U%d with name %s from connection %d",648 WARN("Overriding stream R%u:U%u with name %s from connection %u", 647 649 pTempStream->GetRTMPStreamId(), 648 650 pTempStream->GetUniqueId(), … … 668 670 GetApplication()->GetStreamsManager()->GetWaitingSubscribers( 669 671 streamName, pInNetRTMPStream->GetType()); 670 FINEST("subscribedOutStreams count: % d", subscribedOutStreams.size());672 FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 671 673 672 674 … … 743 745 //2. Close any streams left open 744 746 if (!pFrom->CloseStream(VH_SI(request), true)) { 745 FATAL("Unable to close stream %d:%d", pFrom->GetId(), 747 FATAL("Unable to close stream %u:%u", 748 pFrom->GetId(), 746 749 (uint32_t) VH_SI(request)); 747 750 return false; … … 1093 1096 Variant & result) { 1094 1097 if (!MAP_HAS2(_resultMessageTracking, pFrom->GetId(), M_INVOKE_ID(result))) { 1095 WARN("Unable to track response from PID % d:\n%s",1098 WARN("Unable to track response from PID %u:\n%s", 1096 1099 pFrom->GetId(), STR(result.ToString())); 1097 1100 … … 1537 1540 } 1538 1541 } else { 1539 FATAL("User `%s` not present in users file: `%s`", STR(user), 1542 FATAL("User `%s` not present in users file: `%s`", 1543 STR(user), 1540 1544 STR(usersFile)); 1541 1545 return ""; … … 1852 1856 STR(uri.scheme), 1853 1857 STR(uri.host), 1854 STR(uri.port == 1935 ? "" : format(":% d", uri.port)),1858 STR(uri.port == 1935 ? "" : format(":%hu", uri.port)), 1855 1859 STR(appName)); 1856 1860 -
trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp
r410 r413 117 117 || type == PT_INBOUND_HTTP_FOR_RTMP) 118 118 return true; 119 FATAL("Far protocol %d not accepted", type);120 119 return false; 121 120 } … … 254 253 255 254 bool BaseRTMPProtocol::SetInboundChunkSize(uint32_t chunkSize) { 256 WARN("Chunk size changed for RTMP connection %p: % d->%d", this,255 WARN("Chunk size changed for RTMP connection %p: %u->%u", this, 257 256 _inboundChunkSize, chunkSize); 258 257 _inboundChunkSize = chunkSize; … … 283 282 BaseStream * BaseRTMPProtocol::GetRTMPStream(uint32_t rtmpStreamId) { 284 283 if (rtmpStreamId == 0 || rtmpStreamId >= MAX_STREAMS_COUNT) { 285 FATAL("Invalid stream id: % d", rtmpStreamId);284 FATAL("Invalid stream id: %u", rtmpStreamId); 286 285 return false; 287 286 } … … 292 291 //1. Validate request 293 292 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 294 FATAL("Invalid stream id: % d", streamId);293 FATAL("Invalid stream id: %u", streamId); 295 294 return false; 296 295 } … … 353 352 } else { 354 353 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 355 FATAL("Invalid stream id: % d", streamId);354 FATAL("Invalid stream id: %u", streamId); 356 355 return NULL; 357 356 } … … 372 371 uint32_t streamId, string streamName) { 373 372 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 374 FATAL("Invalid stream id: % d", streamId);373 FATAL("Invalid stream id: %u", streamId); 375 374 return NULL; 376 375 } … … 401 400 string streamName, uint64_t inStreamType) { 402 401 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 403 FATAL("Invalid stream id: % d", streamId);402 FATAL("Invalid stream id: %u", streamId); 404 403 return NULL; 405 404 } … … 411 410 412 411 if (_streams[streamId]->GetType() != ST_NEUTRAL_RTMP) { 413 FATAL("Try to play a stream over a non neutral stream: id: % d; type: %d",412 FATAL("Try to play a stream over a non neutral stream: id: %u; type: %"PRIu64, 414 413 streamId, _streams[streamId]->GetType()); 415 414 return NULL; … … 504 503 default: 505 504 { 506 WARN("Invalid scheme number: % d. Defaulting to 0", schemeNumber);505 WARN("Invalid scheme number: %hhu. Defaulting to 0", schemeNumber); 507 506 return GetDHOffset0(pBuffer); 508 507 } … … 522 521 default: 523 522 { 524 WARN("Invalid scheme number: % d. Defaulting to 0", schemeNumber);523 WARN("Invalid scheme number: %hhu. Defaulting to 0", schemeNumber); 525 524 return GetDigestOffset0(pBuffer); 526 525 } … … 682 681 } 683 682 if (!buffer.Ignore(tempSize)) { 684 FATAL("V: Unable to ignore % dbytes", tempSize);683 FATAL("V: Unable to ignore %u bytes", tempSize); 685 684 return false; 686 685 } … … 722 721 } 723 722 if (!buffer.Ignore(tempSize)) { 724 FATAL("A: Unable to ignore % dbytes", tempSize);723 FATAL("A: Unable to ignore %u bytes", tempSize); 725 724 return false; 726 725 } … … 738 737 channel.lastInProcBytes += tempSize; 739 738 if (!buffer.Ignore(tempSize)) { 740 FATAL("Unable to ignore % dbytes", tempSize);739 FATAL("Unable to ignore %u bytes", tempSize); 741 740 return false; 742 741 } … … 754 753 755 754 if (GETAVAILABLEBYTESCOUNT(channel.inputData) != 0) { 756 FATAL("Invalid message!!! We have leftovers: % dbytes",755 FATAL("Invalid message!!! We have leftovers: %u bytes", 757 756 GETAVAILABLEBYTESCOUNT(channel.inputData)); 758 757 return false; -
trunk/sources/thelib/src/protocols/rtmp/header_be_ba.cpp
r410 r413 132 132 default: 133 133 { 134 FATAL("Invalid header type: % d", ht);134 FATAL("Invalid header type: %hhu", ht); 135 135 return false; 136 136 } … … 311 311 default: 312 312 { 313 FATAL("Invalid header size: % d", ht);313 FATAL("Invalid header size: %hhu", ht); 314 314 return false; 315 315 } … … 318 318 319 319 Header::operator string() { 320 return format("(RC: %d; HT: %d; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %d)", 321 readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 320 // return format("(RC: %u; HT: %u; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %u)", 321 // readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 322 return "not yet implemented"; 322 323 } 323 324 -
trunk/sources/thelib/src/protocols/rtmp/header_le_ba.cpp
r410 r413 124 124 default: 125 125 { 126 FATAL("Invalid header type: % d", ht);126 FATAL("Invalid header type: %hhu", ht); 127 127 return false; 128 128 } … … 299 299 default: 300 300 { 301 FATAL("Invalid header size: % d", ht);301 FATAL("Invalid header size: %hhu", ht); 302 302 return false; 303 303 } … … 306 306 307 307 Header::operator string() { 308 return format("(RC: %d; HT: %d; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %d)", 309 readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 308 // return format("(RC: %u; HT: %u; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %u)", 309 // readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 310 return "not yet implemented"; 310 311 } 311 312 -
trunk/sources/thelib/src/protocols/rtmp/header_le_sa.cpp
r410 r413 124 124 default: 125 125 { 126 FATAL("Invalid header type: % d", ht);126 FATAL("Invalid header type: %hhu", ht); 127 127 return false; 128 128 } … … 299 299 default: 300 300 { 301 FATAL("Invalid header size: % d", ht);301 FATAL("Invalid header size: %hhu", ht); 302 302 return false; 303 303 } … … 306 306 307 307 Header::operator string() { 308 return format("(RC: %d; HT: %d; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %d)", 309 readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 308 // return format("(RC: %hhu; HT: %hhu; CI: %02u; T: % 9u; L: % 6u; MT: % 2u; SI: % 2u; IA: %u)", 309 // readCompleted, ht, ci, hf.s.ts, hf.s.ml, hf.s.mt, hf.s.si, isAbsolute); 310 return "Not yet implemented"; 310 311 } 311 312 -
trunk/sources/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp
r410 r413 178 178 179 179 //2. create a SID, save it, and send it after that 180 string sid = md5(format("% d", GetId()), true).substr(0, 16);180 string sid = md5(format("%u", GetId()), true).substr(0, 16); 181 181 _generatedSids[sid] = sid; 182 182 _outputBuffer.ReadFromString(sid + "\n"); -
trunk/sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp
r410 r413 75 75 default: 76 76 { 77 FATAL("Handshake type not implemented: % d", handshakeType);77 FATAL("Handshake type not implemented: %hhu", handshakeType); 78 78 return false; 79 79 } … … 113 113 default: 114 114 { 115 FATAL("Invalid RTMP state: % d", _rtmpState);115 FATAL("Invalid RTMP state: %hhu", _rtmpState); 116 116 return false; 117 117 } -
trunk/sources/thelib/src/protocols/rtmp/outboundrtmpprotocol.cpp
r410 r413 123 123 default: 124 124 { 125 FATAL("Invalid RTMP state: % d", _rtmpState);125 FATAL("Invalid RTMP state: %hhu", _rtmpState); 126 126 return false; 127 127 } … … 141 141 if (!TCPConnector<OutboundRTMPProtocol>::Connect(ip, port, chain, 142 142 customParameters)) { 143 FATAL("Unable to connect to %s:% d", STR(ip), port);143 FATAL("Unable to connect to %s:%hu", STR(ip), port); 144 144 return false; 145 145 } … … 205 205 206 206 uint32_t clientDHOffset = GetDHOffset(_pOutputBuffer, _usedScheme); 207 DEBUG_HANDSHAKE("PHS1: 6. Get the DH public key position: % d", clientDHOffset);207 DEBUG_HANDSHAKE("PHS1: 6. Get the DH public key position: %u", clientDHOffset); 208 208 209 209 DEBUG_HANDSHAKE("PHS1: 7. Generate the DH public/private key"); … … 214 214 } 215 215 216 DEBUG_HANDSHAKE("PHS1: 8. Get the public key and store it in the buffer at % dand _pClientPublicKey for later use", clientDHOffset);216 DEBUG_HANDSHAKE("PHS1: 8. Get the public key and store it in the buffer at %u and _pClientPublicKey for later use", clientDHOffset); 217 217 if (!_pDHWrapper->CopyPublicKey(_pOutputBuffer + clientDHOffset, 128)) { 218 218 FATAL("Couldn't write public key!"); … … 224 224 225 225 uint32_t clientDigestOffset = GetDigestOffset(_pOutputBuffer, _usedScheme); 226 DEBUG_HANDSHAKE("PHS1: 9. Compute the final digest offset: % d", clientDigestOffset);226 DEBUG_HANDSHAKE("PHS1: 9. Compute the final digest offset: %u", clientDigestOffset); 227 227 228 228 DEBUG_HANDSHAKE("PHS1: 10. Generate the digest from pBuffer EXCLUDING the digest portion."); … … 236 236 HMACsha256(pTempBuffer, 1536 - 32, genuineFPKey, 30, pTempHash); 237 237 238 DEBUG_HANDSHAKE("PHS1: 12. put the bytes at % doffset. Also save them for later use", clientDigestOffset);238 DEBUG_HANDSHAKE("PHS1: 12. put the bytes at %u offset. Also save them for later use", clientDigestOffset); 239 239 memcpy(_pOutputBuffer + clientDigestOffset, pTempHash, 32); 240 240 _pClientDigest = new uint8_t[32]; … … 272 272 273 273 uint32_t serverDigestPos = GetDigestOffset(pBuffer, _usedScheme); 274 DEBUG_HANDSHAKE("VS: 1. Compute server digest offset: % d", serverDigestPos);274 DEBUG_HANDSHAKE("VS: 1. Compute server digest offset: %u", serverDigestPos); 275 275 276 276 DEBUG_HANDSHAKE("VS: 2. Prepare the buffer"); … … 336 336 337 337 uint32_t serverDHOffset = GetDHOffset(pBuffer, _usedScheme); 338 DEBUG_HANDSHAKE("PHS2: 1. get the serverDHOffset: % d", serverDHOffset);338 DEBUG_HANDSHAKE("PHS2: 1. get the serverDHOffset: %u", serverDHOffset); 339 339 340 340 DEBUG_HANDSHAKE("PHS2: 2. compute the secret key"); -
trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp
r410 r413 52 52 return "RM_USRCTRL_TYPE_UNKNOWN2"; 53 53 default: 54 return format("#unknownUCT(% d)", type);54 return format("#unknownUCT(%hu)", type); 55 55 } 56 56 } … … 81 81 return "SOT_SC_INITIAL_DATA"; 82 82 default: 83 return format("#unknownSOP(% d)", type);83 return format("#unknownSOP(%hhu)", type); 84 84 } 85 85 } … … 142 142 default: 143 143 { 144 FATAL("Invalid message type: % d%s", H_MT(header), STR(buffer));144 FATAL("Invalid message type: %u %s", H_MT(header), STR(buffer)); 145 145 return false; 146 146 } … … 265 265 FOR_MAP(message[RM_INVOKE_PARAMS], string, Variant, i) { 266 266 if (!_amf0.Write(buffer, MAP_VAL(i))) { 267 FATAL("Unable to serialize invoke parameter %s: %s", STR(MAP_KEY(i)), 267 FATAL("Unable to serialize invoke parameter %s: %s", 268 STR(MAP_KEY(i)), 268 269 STR(message.ToString())); 269 270 return false; … … 278 279 FOR_MAP(message[RM_NOTIFY_PARAMS], string, Variant, i) { 279 280 if (!_amf0.Write(buffer, MAP_VAL(i))) { 280 FATAL("Unable to serialize invoke parameter %s: %s", STR(MAP_KEY(i)), 281 FATAL("Unable to serialize invoke parameter %s: %s", 282 STR(MAP_KEY(i)), 281 283 STR(message.ToString())); 282 284 return false; … … 291 293 FOR_MAP(message[RM_FLEXSTREAMSEND_PARAMS], string, Variant, i) { 292 294 if (!_amf0.Write(buffer, MAP_VAL(i))) { 293 FATAL("Unable to serialize invoke parameter %s: %s", STR(MAP_KEY(i)), 295 FATAL("Unable to serialize invoke parameter %s: %s", 296 STR(MAP_KEY(i)), 294 297 STR(message.ToString())); 295 298 return false; … … 301 304 bool RTMPProtocolSerializer::SerializeAck(IOBuffer &buffer, uint32_t value) { 302 305 if (!_amf0.WriteUInt32(buffer, value, false)) { 303 FATAL("Unable to write int32_t value: %d", value);306 FATAL("Unable to write uint32_t value: %u", value); 304 307 return false; 305 308 } … … 343 346 bool RTMPProtocolSerializer::SerializeChunkSize(IOBuffer &buffer, uint32_t value) { 344 347 if (!_amf0.WriteUInt32(buffer, value, false)) { 345 FATAL("Unable to write int32_t value: %d", value);348 FATAL("Unable to write uint32_t value: %u", value); 346 349 return false; 347 350 } … … 351 354 bool RTMPProtocolSerializer::SerializeWinAckSize(IOBuffer &buffer, uint32_t value) { 352 355 if (!_amf0.WriteUInt32(buffer, value, false)) { 353 FATAL("Unable to write int32_t value: %d", value);356 FATAL("Unable to write uint32_t value: %u", value); 354 357 return false; 355 358 } … … 359 362 bool RTMPProtocolSerializer::SerializeAbortMessage(IOBuffer &buffer, uint32_t value) { 360 363 if (!_amf0.WriteUInt32(buffer, value, false)) { 361 FATAL("Unable to write int32_t value: %d", value);364 FATAL("Unable to write uint32_t value: %u", value); 362 365 return false; 363 366 } … … 367 370 bool RTMPProtocolSerializer::SerializeClientBW(IOBuffer &buffer, Variant value) { 368 371 if (!_amf0.WriteUInt32(buffer, value[RM_PEERBW_VALUE], false)) { 369 FATAL("Unable to write int32_t value: %d",372 FATAL("Unable to write uint32_t value: %u", 370 373 (uint32_t) value[RM_PEERBW_VALUE]); 371 374 return false; 372 375 } 373 376 if (!_amf0.WriteUInt8(buffer, value[RM_PEERBW_TYPE], false)) { 374 FATAL("Unable to write int32_t value: %d",377 FATAL("Unable to write uint8_t value: %hhu", 375 378 (uint8_t) value[RM_PEERBW_TYPE]); 376 379 return false; … … 500 503 for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 501 504 if (!_amf0.Read(buffer, message[RM_NOTIFY_PARAMS][i])) { 502 FATAL("Unable to de serialize invoke parameter %d", i);505 FATAL("Unable to de-serialize invoke parameter %u", i); 503 506 return false; 504 507 } … … 522 525 for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 523 526 if (!_amf0.Read(buffer, message[RM_FLEXSTREAMSEND_PARAMS][i])) { 524 FATAL("Unable to de serialize invoke parameter %d", i);527 FATAL("Unable to de-serialize invoke parameter %u", i); 525 528 return false; 526 529 } … … 550 553 for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 551 554 if (!_amf0.Read(buffer, message[RM_INVOKE_PARAMS][i])) { 552 FATAL("Unable to de serialize invoke parameter %d", i);555 FATAL("Unable to de-serialize invoke parameter %u", i); 553 556 return false; 554 557 } … … 669 672 Variant &message) { 670 673 if (GETIBPOINTER(buffer)[0] != 0) { 671 FATAL("Encoding % dnot supported yet", GETIBPOINTER(buffer)[0]);674 FATAL("Encoding %hhu not supported yet", GETIBPOINTER(buffer)[0]); 672 675 return false; 673 676 } -
trunk/sources/thelib/src/protocols/rtmp/sharedobjects/so.cpp
r410 r413 66 66 67 67 //1. Clear 68 di.propertyName = format("SOT_SC_CLEAR_DATA_% d", protocolId);68 di.propertyName = format("SOT_SC_CLEAR_DATA_%u", protocolId); 69 69 di.type = SOT_SC_CLEAR_DATA; 70 70 ADD_VECTOR_END(_dirtyPropsByProtocol[protocolId], di); … … 72 72 73 73 //2. Initial 74 di.propertyName = format("SOT_SC_INITIAL_DATA_% d", protocolId);74 di.propertyName = format("SOT_SC_INITIAL_DATA_%u", protocolId); 75 75 di.type = SOT_SC_INITIAL_DATA; 76 76 ADD_VECTOR_END(_dirtyPropsByProtocol[protocolId], di); … … 118 118 119 119 string SO::DumpTrack() { 120 string result = format("SO: %s; Ver: % d\n", STR(_name), _version);120 string result = format("SO: %s; Ver: %u\n", STR(_name), _version); 121 121 122 122 FOR_MAP(_dirtyPropsByProtocol, uint32_t, Dirtyness, i) { 123 123 uint32_t protocolId = MAP_KEY(i); 124 124 Dirtyness dirtyness = MAP_VAL(i); 125 result += format("Protocol: % d\n", protocolId);125 result += format("Protocol: %u\n", protocolId); 126 126 127 127 FOR_VECTOR_ITERATOR(DirtyInfo, dirtyness, j) { 128 128 DirtyInfo di = VECTOR_VAL(j); 129 result += format("\tKey: %s; Type: % d\n", STR(di.propertyName),129 result += format("\tKey: %s; Type: %hhu\n", STR(di.propertyName), 130 130 di.type); 131 131 } … … 162 162 break; 163 163 default: 164 ASSERT("Unable to handle primitive type: % d", type);164 ASSERT("Unable to handle primitive type: %hhu", type); 165 165 } 166 166 ADD_VECTOR_END(primitives, primitive); -
trunk/sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp
r410 r413 85 85 for (uint32_t i = 0; i < M_SO_PRIMITIVES(request).MapSize(); i++) { 86 86 if (!ProcessSharedObjectPrimitive(pFrom, pSO, name, request, i)) { 87 FATAL("Unable to process primitive % dfrom\n%s", i,87 FATAL("Unable to process primitive %u from\n%s", i, 88 88 STR(request.ToString())); 89 89 return false; -
trunk/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp
r410 r413 60 60 _maxBufferSize = 65536 * 2; 61 61 _attachedStreamType = 0; 62 _clientId = format("%d_%d_% d", _pProtocol->GetId(), _rtmpStreamId,this);62 _clientId = format("%d_%d_%zu", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); 63 63 64 64 _paused = false; -
trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpflvstream.cpp
r250 r413 38 38 //1. Seek into the data file at the correct position 39 39 if (!pFile->SeekTo(mediaFrame.start)) { 40 FATAL("Unable to seek to position % llu", mediaFrame.start);40 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 41 41 return false; 42 42 } … … 44 44 //2. Read the data 45 45 if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 46 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);46 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 47 47 return false; 48 48 } … … 55 55 //1. Seek into the data file at the correct position 56 56 if (!pFile->SeekTo(mediaFrame.start)) { 57 FATAL("Unable to seek to position % llu", mediaFrame.start);57 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 58 58 return false; 59 59 } … … 62 62 _metadataBuffer.IgnoreAll(); 63 63 if (!_metadataBuffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 64 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);64 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 65 65 return false; 66 66 } -
trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp3stream.cpp
r250 r413 35 35 //1. Seek into the data file at the correct position 36 36 if (!pFile->SeekTo(mediaFrame.start)) { 37 FATAL("Unable to seek to position % llu", mediaFrame.start);37 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 38 38 return false; 39 39 } … … 44 44 //3. Read the data 45 45 if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 46 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);46 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 47 47 return false; 48 48 } -
trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp4stream.cpp
r410 r413 78 78 //2. Seek into the data file at the correct position 79 79 if (!pFile->SeekTo(mediaFrame.start)) { 80 FATAL("Unable to seek to position % llu", mediaFrame.start);80 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 81 81 return false; 82 82 } … … 84 84 //3. Read the data 85 85 if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 86 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);86 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 87 87 return false; 88 88 } -
trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp
r399 r413 64 64 65 65 if (mediaFrame.type == MEDIAFRAME_TYPE_AUDIO) { 66 //FINEST("--- AUDIO DATA");67 68 66 // MP3 Audio 69 67 buffer.ReadFromRepeat(0x2f, 1); … … 71 69 //1. Seek into the data file at the correct position 72 70 if (!pFile->SeekTo(mediaFrame.start)) { 73 FATAL("Unable to seek to position % llu", mediaFrame.start);71 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 74 72 return false; 75 73 } … … 77 75 //3. Read the data 78 76 if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 79 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);77 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 80 78 return false; 81 79 } … … 83 81 } else { 84 82 if (mediaFrame.isBinaryHeader) { 85 //FINEST("--- VIDEO EXTRA DATA");86 87 83 if (!BuildFrameHeaders(pFile, mediaFrame, buffer)) { 88 84 FATAL("Unable to build frame header..."); 89 85 return false; 90 86 } 91 //FINEST("sizeof spspps:%d", sizeof (_pSPSPPS));92 //FINEST("frame Headers:\n%s", STR(buffer));93 87 } else { 94 88 if (mediaFrame.isKeyFrame) { 95 89 // video key frame 96 //FINEST("--- VIDEO KEY FRAME");97 90 buffer.ReadFromBuffer(_videoCodecHeaderKeyFrame, sizeof (_videoCodecHeaderKeyFrame)); 98 91 } else { 99 92 //video normal frame 100 // string str = format("%02x %02x %02x %02x %02x",101 // GETIBPOINTER(buffer)[0],102 //103 //FINEST("--- VIDEO NORMAL FRAME");104 93 buffer.ReadFromBuffer(_videoCodecHeader, sizeof (_videoCodecHeader)); 105 94 } … … 108 97 //composition timestamp is always 0 for NSV 109 98 buffer.ReadFromRepeat(0, 3); 110 //FINEST("length : %08x", mediaFrame.length);111 99 // need help here... 112 100 buffer.ReadFromRepeat(0, 4); … … 115 103 mediaFrame.length=frameLength; 116 104 117 //buffer.ReadFromBuffer((uint8_t *) &mediaFrame.length, 4);118 // string str = format("%02x %02x %02x %02x %02x",119 // GETIBPOINTER(buffer)[0],120 // GETIBPOINTER(buffer)[1],121 // GETIBPOINTER(buffer)[2],122 // GETIBPOINTER(buffer)[3],123 // GETIBPOINTER(buffer)[4]);124 // if (_currentFrame.isKeyFrame)125 // WARN("%s", STR(str));126 // else127 // FINEST("%s", STR(str));128 129 /*if (mediaFrame.type == MEDIAFRAME_TYPE_VIDEO) {130 FINEST("Media frame:\n%s", STR(mediaFrame));131 FINEST("Headers:\n%s", STR(buffer));132 }133 */134 135 105 //1. Seek into the data file at the correct position 136 106 if (!pFile->SeekTo(mediaFrame.start)) { 137 FATAL("Unable to seek to position % llu", mediaFrame.start);107 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 138 108 return false; 139 109 } … … 141 111 //3. Read the data 142 112 if (!buffer.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 143 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);113 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 144 114 return false; 145 115 } … … 164 134 //1. Seek into the data file at the correct position 165 135 if (!pFile->SeekTo(mediaFrame.start)) { 166 FATAL("Unable to seek to position % llu", mediaFrame.start);136 FATAL("Unable to seek to position %"PRIu64, mediaFrame.start); 167 137 return false; 168 138 } … … 170 140 IOBuffer pbuf; 171 141 if (!pbuf.ReadFromFs(*pFile, (uint32_t) mediaFrame.length)) { 172 FATAL("Unable to read % llu bytes from offset %llu", mediaFrame.length, mediaFrame.start);142 FATAL("Unable to read %"PRIu64" bytes from offset %"PRIu64, mediaFrame.length, mediaFrame.start); 173 143 return false; 174 144 } 175 //FINEST("video data offset %x", mediaFrame.start);176 //FINEST("data len %d", mediaFrame.length);177 //FINEST(" buffer: \n%s", STR(pbuf));178 145 179 146 uint8_t *pData = GETIBPOINTER(pbuf); … … 183 150 } 184 151 uint32_t dataLength = (uint32_t)mediaFrame.length; 185 //FINEST("%02x - %s", (uint8_t) NALU_TYPE(pData[0]), STR(NALUToString((uint8_t) pData[0])));186 152 187 153 switch (NALU_TYPE(pData[0])) { 188 154 case NALU_TYPE_SPS: 189 155 { 190 //FINEST("WE GOT SPS");191 156 //1. Prepare the SPS part from video codec 192 //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart);193 157 if (dataLength > 128) { 194 158 FATAL("SPS too big"); … … 201 165 _spsAvailable = true; 202 166 _SPSPPSLength = _PPSStart; 203 //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart);204 167 205 168 return true; … … 208 171 case NALU_TYPE_PPS: 209 172 { 210 //FINEST("WE GOT PPS");211 173 //2. Prepare the PPS part from video codec 212 174 if (dataLength > 128) { … … 218 180 return true; 219 181 } 220 //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart);221 182 _pSPSPPS[_PPSStart] = 1; 222 183 EHTONSP(_pSPSPPS + _PPSStart + 1, (uint16_t) dataLength); … … 225 186 _spsAvailable = false; 226 187 227 //FINEST("spspps length: %d", _SPSPPSLength);228 188 buffer.ReadFromBuffer(_pSPSPPS, _SPSPPSLength); //sizeof (_pSPSPPS)); 229 189 -
trunk/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp
r361 r413 34 34 _chunkSize = chunkSize; 35 35 _channelId = channelId; 36 _clientId = format("%d_%d_% d", _pProtocol->GetId(), _rtmpStreamId,this);36 _clientId = format("%d_%d_%z", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); 37 37 _lastVideoTime = 0; 38 38 _lastAudioTime = 0; … … 192 192 GETAVAILABLEBYTESCOUNT(_videoCodecInit), 193 193 _lastAudioTime, false)) { 194 FINEST("Unable to feed OS: % d", pOutStream->GetUniqueId());194 FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 195 195 pOutStream->EnqueueForDelete(); 196 196 } … … 202 202 GETAVAILABLEBYTESCOUNT(_audioCodecInit), 203 203 _lastAudioTime, true)) { 204 FINEST("Unable to feed OS: % d", pOutStream->GetUniqueId());204 FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 205 205 pOutStream->EnqueueForDelete(); 206 206 } … … 306 306 return false; 307 307 } 308 FINEST("Cached the AAC audio codec initialization: % d",308 FINEST("Cached the AAC audio codec initialization: %u", 309 309 GETAVAILABLEBYTESCOUNT(_audioCodecInit)); 310 310 return true; … … 327 327 } 328 328 329 FINEST("Cached the h264 video codec initialization: % d",329 FINEST("Cached the h264 video codec initialization: %u", 330 330 GETAVAILABLEBYTESCOUNT(_videoCodecInit)); 331 331 -
trunk/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
r410 r413 102 102 uri.port, 103 103 chain, customParameters)) { 104 FATAL("Unable to connect to %s:% d",104 FATAL("Unable to connect to %s:%hu", 105 105 STR(customParameters["uri"]["ip"]), 106 106 (uint16_t) customParameters["uri"]["port"]); … … 348 348 349 349 dataPortNumber = atoi(STR(ports[0])); 350 if (format("% u", dataPortNumber) != ports[0]) {350 if (format("%hu", dataPortNumber) != ports[0]) { 351 351 WARN("Invalid client_port transport part: %s", STR(parts[i])); 352 352 continue; 353 353 } 354 354 rtcpPortNumber = atoi(STR(ports[1])); 355 if (format("% u", rtcpPortNumber) != ports[1]) {355 if (format("%hu", rtcpPortNumber) != ports[1]) { 356 356 WARN("Invalid client_port transport part: %s", STR(parts[i])); 357 357 continue; … … 680 680 string streamName = pFrom->GetCustomParameters()["sdpStreamName"]; 681 681 if (streamName == "") { 682 streamName = format("rtsp_stream_% d", pFrom->GetId());682 streamName = format("rtsp_stream_%u", pFrom->GetId()); 683 683 } 684 684 … … 740 740 responseHeaders, responseContent); 741 741 } else { 742 FATAL("Response for method not implemented yet", STR(method)); 743 742 FATAL("Response for method %s not implemented yet", STR(method)); 744 743 return false; 745 744 } … … 757 756 responseHeaders, responseContent); 758 757 } else { 759 FATAL("Response for method not implemented yet", STR(method)); 760 758 FATAL("Response for method %s not implemented yet", STR(method)); 761 759 return false; 762 760 } … … 927 925 pFrom->GetCustomParameters()["streamId"]); 928 926 if (pInNetStream == NULL) { 929 FATAL("Inbound stream % dnot found",927 FATAL("Inbound stream %u not found", 930 928 (uint32_t) pFrom->GetCustomParameters()["streamId"]); 931 929 return NULL; … … 978 976 string BaseRTSPAppProtocolHandler::GetAudioTrack(RTSPProtocol *pFrom, 979 977 StreamCapabilities *pCapabilities) { 980 pFrom->GetCustomParameters()["audioTrackId"] = md5(format("A% d%s",978 pFrom->GetCustomParameters()["audioTrackId"] = md5(format("A%u%s", 981 979 pFrom->GetId(), STR(generateRandomString(4))), true); 982 980 string result = ""; … … 984 982 result += "m=audio 0 RTP/AVP 96\r\n"; 985 983 result += "a=recvonly\r\n"; 986 result += format("a=rtpmap:96 mpeg4-generic/% d/2\r\n",984 result += format("a=rtpmap:96 mpeg4-generic/%u/2\r\n", 987 985 pCapabilities->aac._sampleRate); 988 986 FINEST("result: %s", STR(result)); … … 1000 998 string BaseRTSPAppProtocolHandler::GetVideoTrack(RTSPProtocol *pFrom, 1001 999 StreamCapabilities *pCapabilities) { 1002 pFrom->GetCustomParameters()["videoTrackId"] = md5(format("V% d%s",1000 pFrom->GetCustomParameters()["videoTrackId"] = md5(format("V%u%s", 1003 1001 pFrom->GetId(), STR(generateRandomString(4))), true); 1004 1002 string result = ""; … … 1010 1008 result += "a=rtpmap:97 H264/90000\r\n"; 1011 1009 result += "a=fmtp:97 profile-level-id="; 1012 result += format("%02 X%02X%02X",1010 result += format("%02hhX%02hhX%02hhX", 1013 1011 pCapabilities->avc._pSPS[1], 1014 1012 pCapabilities->avc._pSPS[2], -
trunk/sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp
r410 r413 131 131 //5. Create the in stream 132 132 if (streamName == "") 133 streamName = format("rtsp_% d", _pRTSP->GetId());133 streamName = format("rtsp_%u", _pRTSP->GetId()); 134 134 _pInStream = new InNetRTPStream(_pRTSP, pApplication->GetStreamsManager(), 135 135 streamName, … … 153 153 pApplication->GetStreamsManager()->GetWaitingSubscribers( 154 154 streamName, _pInStream->GetType()); 155 FINEST("subscribedOutStreams count: % d", subscribedOutStreams.size());155 FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 156 156 157 157 … … 172 172 for (uint32_t i = 0; i < 255; i++) { 173 173 if ((_pProtocols[i] != NULL) && (_pProtocols[i]->GetId() == pProtocol->GetId())) { 174 string result = format("RTP/AVP/TCP;unicast;interleaved=% d-%d", i, i + 1);174 string result = format("RTP/AVP/TCP;unicast;interleaved=%u-%u", i, i + 1); 175 175 return result; 176 176 } … … 189 189 //1. Is the chanel number a valid chanel? 190 190 if (channelId >= 4) { 191 FATAL("Invalid chanel number: % d", channelId);191 FATAL("Invalid chanel number: %u", channelId); 192 192 return false; 193 193 } … … 196 196 BaseProtocol *pProtocol = _pProtocols[channelId]; 197 197 if (pProtocol == NULL) { 198 FATAL("Invalid chanel number: % d", channelId);198 FATAL("Invalid chanel number: %u", channelId); 199 199 return false; 200 200 } … … 209 209 210 210 string InboundConnectivity::GetAudioClientPorts() { 211 return format("% d-%d",211 return format("%hu-%hu", 212 212 ((UDPCarrier *) _pRTPAudio->GetIOHandler())->GetNearEndpointPort(), 213 213 ((UDPCarrier *) _pRTCPAudio->GetIOHandler())->GetNearEndpointPort()); … … 215 215 216 216 string InboundConnectivity::GetVideoClientPorts() { 217 return format("% d-%d",217 return format("%hu-%hu", 218 218 ((UDPCarrier *) _pRTPVideo->GetIOHandler())->GetNearEndpointPort(), 219 219 ((UDPCarrier *) _pRTCPVideo->GetIOHandler())->GetNearEndpointPort()); -
trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp
r410 r413 27 27 #ifdef RTP_DEBUG 28 28 #define RTP_DEBUG_MESSAGE(sent) \ 29 string message = format("% d %02x-%02x-%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x", \29 string message = format("%zu %02hhx-%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx", \ 30 30 _videoData.msg_iov[0].iov_len, \ 31 31 ((uint8_t *) _videoData.msg_iov[0].iov_base)[0], \ … … 42 42 ((uint8_t *) _videoData.msg_iov[0].iov_base)[11]); \ 43 43 if (_videoData.msg_iov[0].iov_len == 12) { \ 44 message += format(" %02 x%02x %s", \44 message += format(" %02hhx%02hhx %s", \ 45 45 ((uint8_t *) _videoData.msg_iov[1].iov_base)[0], \ 46 46 ((uint8_t *) _videoData.msg_iov[1].iov_base)[1], \ 47 47 STR(NALUToString(((uint8_t *) _videoData.msg_iov[1].iov_base)[0]))); \ 48 48 } else { \ 49 message += format(" %02 x%02x %s %s", \49 message += format(" %02hhx%02hhx %s %s", \ 50 50 ((uint8_t *) _videoData.msg_iov[0].iov_base)[12], \ 51 51 ((uint8_t *) _videoData.msg_iov[0].iov_base)[13], \ … … 53 53 STR(NALUToString(((uint8_t *) _videoData.msg_iov[0].iov_base)[12]))); \ 54 54 } \ 55 message += format(" s: % d; dl: %d; pl: %d; tl: %d;", sent, dataLength, processedLength,totalLength); \55 message += format(" s: %u; dl: %u; pl: %u; tl: %u;", (uint32_t)sent, (uint32_t)dataLength, (uint32_t)processedLength, (uint32_t)totalLength); \ 56 56 if(processedLength+sentAmount+chunkSize==totalLength) \ 57 57 WARN("%s", STR(message)); \ … … 69 69 sent = sendmsg(fd, &vd, 0); \ 70 70 } \ 71 /*FATAL("TS: %02x%02x%02x%02x", \72 ((uint8_t *)vd.msg_iov[0].iov_base)[4], \73 ((uint8_t *)vd.msg_iov[0].iov_base)[5], \74 ((uint8_t *)vd.msg_iov[0].iov_base)[6], \75 ((uint8_t *)vd.msg_iov[0].iov_base)[7]); */\76 71 RTP_DEBUG_MESSAGE(sent); \ 77 72 } \ … … 119 114 CLOSE_SOCKET(_videoDataFd); 120 115 CLOSE_SOCKET(_audioDataFd); 121 WARN("OC deleted: %p", this);122 116 } 123 117 … … 143 137 144 138 string OutboundConnectivity::GetVideoServerPorts() { 145 return format("% d-%d", _videoDataPort, _videoRTCPPort);139 return format("%hu-%hu", _videoDataPort, _videoRTCPPort); 146 140 } 147 141 148 142 string OutboundConnectivity::GetAudioServerPorts() { 149 return format("% d-%d", _audioDataPort, _audioRTCPPort);143 return format("%hu-%hu", _audioDataPort, _audioRTCPPort); 150 144 } 151 145 … … 296 290 RTCPFd = socket(AF_INET, SOCK_DGRAM, 0); 297 291 298 sockaddr_in address = {0}; 292 sockaddr_in address; 293 memset(&address, 0, sizeof (address)); 299 294 address.sin_family = AF_INET; 300 295 address.sin_port = 0; -
trunk/sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp
r410 r413 113 113 _timestampRollover++; 114 114 _lastTimestamp = _rtpHeader._timestamp; 115 WARN("Roll over on %d; _timestampRollover: %d", GetId(), _timestampRollover);116 115 } 117 116 } else { -
trunk/sources/thelib/src/protocols/rtp/rtcpprotocol.cpp
r410 r413 78 78 len = (len + 1)*4; 79 79 if (len > bufferLength) { 80 WARN("Invalid RTCP packet length: len % d; bufferLength: %d", len, bufferLength);80 WARN("Invalid RTCP packet length: len %hu; bufferLength: %u", len, bufferLength); 81 81 buffer.IgnoreAll(); 82 82 return true; … … 87 87 { 88 88 if (len < 28) { 89 WARN("Invalid RTCP packet length: % d", len);89 WARN("Invalid RTCP packet length: %hu", len); 90 90 buffer.IgnoreAll(); 91 91 return true; … … 101 101 default: 102 102 { 103 WARN("Unknown packet type: % d", PT);103 WARN("Unknown packet type: %hhu", PT); 104 104 buffer.IgnoreAll(); 105 105 return true; -
trunk/sources/thelib/src/protocols/rtp/rtspprotocol.cpp
r410 r413 235 235 bool RTSPProtocol::SendResponseMessage() { 236 236 //1. Put the first line 237 _outputBuffer.ReadFromString(format("%s % d%s\r\n",237 _outputBuffer.ReadFromString(format("%s %u %s\r\n", 238 238 STR(_responseHeaders[RTSP_FIRST_LINE][RTSP_VERSION]), 239 239 (uint32_t) _responseHeaders[RTSP_FIRST_LINE][RTSP_STATUS_CODE], … … 340 340 //2. Add the content length if required 341 341 if (content.size() > 0) { 342 headers[RTSP_HEADERS][RTSP_HEADERS_CONTENT_LENGTH] = format("% d", content.size());342 headers[RTSP_HEADERS][RTSP_HEADERS_CONTENT_LENGTH] = format("%zu", content.size()); 343 343 } 344 344 … … 567 567 buffer.Ignore(chunkLength); 568 568 if (_inboundContent.size() < _contentLength) { 569 FINEST("Not enough data. Wanted: %u; got: % u", _contentLength, _inboundContent.size());569 FINEST("Not enough data. Wanted: %u; got: %zu", _contentLength, _inboundContent.size()); 570 570 return true; 571 571 } -
trunk/sources/thelib/src/protocols/rtp/sdp.cpp
r410 r413 91 91 Variant track = GetTrack(index, "video"); 92 92 if (track == V_NULL) { 93 FATAL("Video track index % dnot found", index);93 FATAL("Video track index %u not found", index); 94 94 return Variant(); 95 95 } … … 125 125 Variant track = GetTrack(index, "audio"); 126 126 if (track == V_NULL) { 127 FATAL("Audio track index % dnot found", index);127 FATAL("Audio track index %u not found", index); 128 128 return Variant(); 129 129 } … … 465 465 bool SDP::ParseSDPLineP(Variant &result, string line) { 466 466 result.Reset(); 467 result = line;468 return true;467 result = line; 468 return true; 469 469 } 470 470 -
trunk/sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp
r410 r413 156 156 157 157 if (lastTs * 100.00 > absoluteTimestamp * 100.00) { 158 WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f; isAudio: % d",158 WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f; isAudio: %hhu", 159 159 STR(GetName()), 160 160 absoluteTimestamp, … … 209 209 } else { 210 210 if ((uint16_t) (_videoSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { 211 WARN("Missing video packet. Wanted: % d; got: %don stream: %s",211 WARN("Missing video packet. Wanted: %hu; got: %hu on stream: %s", 212 212 (uint16_t) (_videoSequence + 1), 213 213 (uint16_t) GET_RTP_SEQ(rtpHeader), … … 301 301 } else { 302 302 if ((uint16_t) (_audioSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { 303 WARN("Missing audio packet. Wanted: % d; got: %don stream: %s",303 WARN("Missing audio packet. Wanted: %hu; got: %hu on stream: %s", 304 304 (uint16_t) (_audioSequence + 1), 305 305 (uint16_t) GET_RTP_SEQ(rtpHeader), … … 316 316 uint16_t chunksCount = ENTOHSP(pData); 317 317 if ((chunksCount % 16) != 0) { 318 FATAL("Invalid AU headers length: % 04x", chunksCount);318 FATAL("Invalid AU headers length: %hx", chunksCount); 319 319 return false; 320 320 } … … 333 333 ts = (double) (rtpHeader._timestamp + i * 1024) / (double) _capabilities.aac._sampleRate * 1000.00; 334 334 if ((cursor + chunkSize) > dataLength) { 335 FATAL("Unable to feed data: cursor: % d; chunkSize: %d; dataLength: %d; chunksCount: %d",335 FATAL("Unable to feed data: cursor: %u; chunkSize: %hu; dataLength: %u; chunksCount: %hu", 336 336 cursor, chunkSize, dataLength, chunksCount); 337 337 return false; -
trunk/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
r410 r413 84 84 if (type == PT_TCP) 85 85 return true; 86 FATAL("Far protocol %d not accepted", type);87 86 return false; 88 87 } … … 106 105 if (SSL_write(_pSSL, GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)) 107 106 != (int32_t) GETAVAILABLEBYTESCOUNT(*pBuffer)) { 108 FATAL("Unable to write % dbytes", GETAVAILABLEBYTESCOUNT(*pBuffer));107 FATAL("Unable to write %u bytes", GETAVAILABLEBYTESCOUNT(*pBuffer)); 109 108 return false; 110 109 } … … 225 224 formatString += "prev_bio: %p\n"; 226 225 formatString += "references: %d\n"; 227 formatString += "num_read: % u\n";228 formatString += "num_write: % u";226 formatString += "num_read: %"PRId64"\n"; 227 formatString += "num_write: %"PRId64; 229 228 return format(formatString, 230 229 pBIO->method, … … 240 239 pBIO->prev_bio, 241 240 pBIO->references, 242 pBIO->num_read,243 pBIO->num_write);241 (int64_t) pBIO->num_read, 242 (int64_t) pBIO->num_write); 244 243 } 245 244 -
trunk/sources/thelib/src/protocols/ts/basetsappprotocolhandler.cpp
r410 r413 44 44 45 45 void BaseTSAppProtocolHandler::ProgramSetupCompleted(InNetTSStream *pInNetTSStream) { 46 INFO("Stream available (% d): %s", pInNetTSStream->GetUniqueId(),46 INFO("Stream available (%u): %s", pInNetTSStream->GetUniqueId(), 47 47 STR(pInNetTSStream->GetName())); 48 48 } -
trunk/sources/thelib/src/protocols/ts/inboundtsprotocol.cpp
r410 r413 142 142 143 143 if (!buffer.Ignore(_chunkSize)) { 144 FATAL("Unable to ignore % dbytes", _chunkSize);144 FATAL("Unable to ignore %u bytes", _chunkSize); 145 145 } 146 146 … … 268 268 case PID_TYPE_RESERVED: 269 269 { 270 WARN("This PID should not be used because is reserved according to iso13818-1.pdf", pPIDDescriptor->pid);270 WARN("This PID %hu should not be used because is reserved according to iso13818-1.pdf", pPIDDescriptor->pid); 271 271 return true; 272 272 } 273 273 case PID_TYPE_UNKNOWN: 274 274 { 275 WARN("PID % dnot known yet", pPIDDescriptor->pid);275 WARN("PID %hu not known yet", pPIDDescriptor->pid); 276 276 return true; 277 277 } … … 283 283 default: 284 284 { 285 WARN("PID type not implemented: % d. Pid number: %d",285 WARN("PID type not implemented: %hhu. Pid number: %hu", 286 286 pPIDDescriptor->type, pPIDDescriptor->pid); 287 287 return false; … … 413 413 { 414 414 unknownPids[MAP_KEY(i)] = MAP_KEY(i); 415 WARN("stream type % u not supported yet", MAP_VAL(i).streamType);415 WARN("stream type %hhu not supported yet", MAP_VAL(i).streamType); 416 416 break; 417 417 } … … 423 423 if ((videoPid != 0) || (audioPid != 0)) { 424 424 pStream = new InNetTSStream(this, GetApplication()->GetStreamsManager(), 425 format("ts_% d_%d_%d", GetId(), audioPid, videoPid));425 format("ts_%u_%hu_%hu", GetId(), audioPid, videoPid)); 426 426 } 427 427 -
trunk/sources/thelib/src/protocols/ts/innettsstream.cpp
r410 r413 255 255 uint32_t frameLength = ((((pBuffer[3]&0x03) << 8) | pBuffer[4]) << 3) | (pBuffer[5] >> 5); 256 256 if (frameLength < 8) { 257 WARN("Bogus frame length %d. Skip one byte", frameLength);257 WARN("Bogus frameLength %u. Skip one byte", frameLength); 258 258 FINEST("_audioBuffer:\n%s", STR(_audioBuffer)); 259 259 _audioBuffer.Ignore(1); -
trunk/sources/thelib/src/protocols/ts/tspacketpat.cpp
r317 r413 49 49 TSPacketPAT::operator string() { 50 50 string result = ""; 51 result += format("tableId: % d\n", _tableId);52 result += format("sectionSyntaxIndicator: % d\n", _sectionSyntaxIndicator);53 result += format("reserved1: % d\n", _reserved1);54 result += format("reserved2: % d\n", _reserved2);55 result += format("sectionLength: % d\n", _sectionLength);56 result += format("transportStreamId: % d\n", _transportStreamId);57 result += format("reserved3: % d\n", _reserved3);58 result += format("versionNumber: % d\n", _versionNumber);59 result += format("currentNextIndicator: % d\n", _currentNextIndicator);60 result += format("sectionNumber: % d\n", _sectionNumber);61 result += format("lastSectionNumber: % d\n", _lastSectionNumber);62 result += format("crc: % 08x\n", _crc);63 result += format("entriesCount: % d\n", _entriesCount);64 result += format("NIT count: % d\n", _networkPids.size());51 result += format("tableId: %hhu\n", _tableId); 52 result += format("sectionSyntaxIndicator: %hhu\n", _sectionSyntaxIndicator); 53 result += format("reserved1: %hhu\n", _reserved1); 54 result += format("reserved2: %hhu\n", _reserved2); 55 result += format("sectionLength: %hu\n", _sectionLength); 56 result += format("transportStreamId: %hu\n", _transportStreamId); 57 result += format("reserved3: %hhu\n", _reserved3); 58 result += format("versionNumber: %hhu\n", _versionNumber); 59 result += format("currentNextIndicator: %hhu\n", _currentNextIndicator); 60 result += format("sectionNumber: %hhu\n", _sectionNumber); 61 result += format("lastSectionNumber: %hhu\n", _lastSectionNumber); 62 result += format("crc: %x\n", _crc); 63 result += format("entriesCount: %u\n", _entriesCount); 64 result += format("NIT count: %zu\n", _networkPids.size()); 65 65 if (_networkPids.size() > 0) { 66 66 67 67 FOR_MAP(_networkPids, uint16_t, uint16_t, i) { 68 result += format("\tNIT % d: %d\n", MAP_KEY(i), MAP_VAL(i));68 result += format("\tNIT %hu: %hu\n", MAP_KEY(i), MAP_VAL(i)); 69 69 } 70 70 } 71 result += format("PMT count: % d\n", _programPids.size());71 result += format("PMT count: %zu\n", _programPids.size()); 72 72 if (_programPids.size() > 0) { 73 73 74 74 FOR_MAP(_programPids, uint16_t, uint16_t, i) { 75 result += format("\tPMT % d: %d\n", MAP_KEY(i), MAP_VAL(i));75 result += format("\tPMT %hu: %hu\n", MAP_KEY(i), MAP_VAL(i)); 76 76 } 77 77 } -
trunk/sources/thelib/src/protocols/ts/tspacketpmt.cpp
r317 r413 33 33 TSPacketPMT::operator string() { 34 34 string result = ""; 35 result += format("tableId: % d\n", _tableId);36 result += format("sectionSyntaxIndicator: % d\n", _sectionSyntaxIndicator);37 result += format("reserved1: % d\n", _reserved1);38 result += format("reserved2: % d\n", _reserved2);39 result += format("sectionLength: % d\n", _sectionLength);40 result += format("programNumber: % d\n", _programNumber);41 result += format("reserved3: % d\n", _reserved3);42 result += format("versionNumber: % d\n", _versionNumber);43 result += format("currentNextIndicator: % d\n", _currentNextIndicator);44 result += format("sectionNumber: % d\n", _sectionNumber);45 result += format("lastSectionNumber: % d\n", _lastSectionNumber);46 result += format("reserved4: % d\n", _reserved4);47 result += format("pcrPid: % d\n", _pcrPid);48 result += format("reserved5: % d\n", _reserved5);49 result += format("programInfoLength: % d\n", _programInfoLength);50 result += format("crc: % 08x\n", _crc);51 result += format("descriptors count: % d\n", _programInfoDescriptors.size());35 result += format("tableId: %hhu\n", _tableId); 36 result += format("sectionSyntaxIndicator: %hhu\n", _sectionSyntaxIndicator); 37 result += format("reserved1: %hhu\n", _reserved1); 38 result += format("reserved2: %hhu\n", _reserved2); 39 result += format("sectionLength: %hu\n", _sectionLength); 40 result += format("programNumber: %hu\n", _programNumber); 41 result += format("reserved3: %hhu\n", _reserved3); 42 result += format("versionNumber: %hhu\n", _versionNumber); 43 result += format("currentNextIndicator: %hhu\n", _currentNextIndicator); 44 result += format("sectionNumber: %hhu\n", _sectionNumber); 45 result += format("lastSectionNumber: %hhu\n", _lastSectionNumber); 46 result += format("reserved4: %hhu\n", _reserved4); 47 result += format("pcrPid: %hu\n", _pcrPid); 48 result += format("reserved5: %hhu\n", _reserved5); 49 result += format("programInfoLength: %hu\n", _programInfoLength); 50 result += format("crc: %x\n", _crc); 51 result += format("descriptors count: %zu\n", _programInfoDescriptors.size()); 52 52 for (uint32_t i = 0; i < _programInfoDescriptors.size(); i++) { 53 53 result += format("\t%s", STR(_programInfoDescriptors[i])); … … 55 55 result += "\n"; 56 56 } 57 result += format("streams count: % d\n", _streams.size());57 result += format("streams count: %zu\n", _streams.size()); 58 58 59 59 FOR_MAP(_streams, uint16_t, TSStreamInfo, i) { 60 result += format("\t% d: %s\n", MAP_KEY(i), STR(MAP_VAL(i).toString(1)));60 result += format("\t%hu: %s\n", MAP_KEY(i), STR(MAP_VAL(i).toString(1))); 61 61 } 62 62 return result; … … 142 142 //14. Read the streams info 143 143 while (streamsInfoCursor < streamsInfoLength) { 144 TSStreamInfo streamInfo = {0};144 TSStreamInfo streamInfo; 145 145 146 146 //14.1. read the stream type -
trunk/sources/thelib/src/streaming/baseinfilestream.cpp
r410 r413 183 183 //from the seek file. 184 184 if (!_pSeekFile->SeekTo(_pSeekFile->Size() - 8)) { 185 FATAL("Unable to seek to % lldposition", _pSeekFile->Cursor() - 8);185 FATAL("Unable to seek to %"PRIu64" position", _pSeekFile->Cursor() - 8); 186 186 return false; 187 187 } -
trunk/sources/thelib/src/streaming/streamcapabilities.cpp
r410 r413 39 39 #define CHECK_BA_LIMITS(name,length) \ 40 40 if(ba.AvailableBits()<length) { \ 41 FATAL("Unable to read `"name"` value. Not enough bits. Wanted: %d; Have: %d", length,ba.AvailableBits()); \ 41 FATAL("Unable to read `"name"` value. Not enough bits. Wanted: %u; Have: %u", \ 42 (uint32_t)length, ba.AvailableBits()); \ 42 43 return false; \ 43 44 } … … 337 338 _VIDEO_AVC::operator string() { 338 339 string result; 339 result += format("_spsLength: % d\n", _spsLength);340 result += format("_ppsLength: % d\n", _ppsLength);341 result += format("_rate: % d\n", _rate);340 result += format("_spsLength: %hu\n", _spsLength); 341 result += format("_ppsLength: %hu\n", _ppsLength); 342 result += format("_rate: %u\n", _rate); 342 343 result += format("WxH: %ux%u", _width, _height); 343 344 return result; … … 362 363 363 364 if (length < 2) { 364 FATAL("Invalid length: % d", length);365 FATAL("Invalid length: %u", length); 365 366 return false; 366 367 } … … 382 383 && (_audioObjectType != 23) 383 384 && (_audioObjectType != 39)) { 384 FATAL("Invalid _audioObjectType: % d", _audioObjectType);385 FATAL("Invalid _audioObjectType: %hhu", _audioObjectType); 385 386 return false; 386 387 } … … 390 391 if ((_sampleRateIndex == 13) 391 392 || (_sampleRateIndex == 14)) { 392 FATAL("Invalid sample rate: % d", _sampleRateIndex);393 FATAL("Invalid sample rate: %hhu", _sampleRateIndex); 393 394 return false; 394 395 } 395 396 if (_sampleRateIndex == 15) { 396 397 if (length < 5) { 397 FATAL("Invalid length: % d", length);398 FATAL("Invalid length: %u", length); 398 399 return false; 399 400 } … … 411 412 if ((_channelConfigurationIndex == 0) 412 413 || (_channelConfigurationIndex >= 8)) { 413 FATAL("Invalid _channelConfigurationIndex: % d", _channelConfigurationIndex);414 FATAL("Invalid _channelConfigurationIndex: %hhu", _channelConfigurationIndex); 414 415 return false; 415 416 } … … 438 439 string result; 439 440 for (uint32_t i = 0; i < _aacLength; i++) { 440 result += format("%02 x", _pAAC[i]);441 result += format("%02hhx", _pAAC[i]); 441 442 } 442 443 return "config=" + result; … … 445 446 _AUDIO_AAC::operator string() { 446 447 string result; 447 result += format("_aacLength: % d\n", _aacLength);448 result += format("_audioObjectType: % d\n", _audioObjectType);449 result += format("_sampleRateIndex: % d\n", _sampleRateIndex);450 result += format("_sampleRate: % d\n", _sampleRate);451 result += format("_channelConfigurationIndex: % d", _channelConfigurationIndex);448 result += format("_aacLength: %u\n", _aacLength); 449 result += format("_audioObjectType: %hhu\n", _audioObjectType); 450 result += format("_sampleRateIndex: %hhu\n", _sampleRateIndex); 451 result += format("_sampleRate: %u\n", _sampleRate); 452 result += format("_channelConfigurationIndex: %hhu", _channelConfigurationIndex); 452 453 return result; 453 454 } -
trunk/sources/thelib/src/streaming/streamsmanager.cpp
r410 r413 40 40 //1. Test to see if we had registered this stream before 41 41 if (MAP_HAS1(_streamsByUniqueId, pStream->GetUniqueId())) { 42 FATAL("Stream with unique ID % lu already registered", pStream->GetUniqueId());42 FATAL("Stream with unique ID %u already registered", pStream->GetUniqueId()); 43 43 return false; 44 44 } … … 97 97 longSubscribers = FindByTypeByName(ST_OUT, streamName, true, false); 98 98 99 FINEST("short count: %d; long count: %d", shortSubscribers.size(), longSubscribers.size()); 99 FINEST("short count: %zu; long count: %zu", 100 shortSubscribers.size(), longSubscribers.size()); 100 101 101 102 //3. merge them -
trunk/sources/trafficdissector/src/basefeeder.cpp
r411 r413 67 67 { 68 68 if (!_client2ServerBuffer.ReadFromBuffer(pBuffer, length)) { 69 FATAL("Unable to put % d bytes to _client2ServerBuffer buffer");69 FATAL("Unable to put %u bytes to _client2ServerBuffer buffer", length); 70 70 return false; 71 71 } … … 76 76 { 77 77 if (!_server2ClientBuffer.ReadFromBuffer(pBuffer, length)) { 78 FATAL("Unable to put % d bytes to _server2ClientBuffer buffer");78 FATAL("Unable to put %u bytes to _server2ClientBuffer buffer", length); 79 79 return false; 80 80 } … … 84 84 default: 85 85 { 86 FATAL("Invalid data type: % d", type);86 FATAL("Invalid data type: %hhu", type); 87 87 return false; 88 88 } -
trunk/sources/trafficdissector/src/main.cpp
r137 r413 30 30 pLogLocation->SetLevel(_FINEST_); 31 31 Logger::AddLogLocation(pLogLocation); 32 INFO("Traffic dissector started (% d)",getpid());32 INFO("Traffic dissector started (%u)", (uint32_t)getpid()); 33 33 34 34 //2. Parse the parameters -
trunk/sources/trafficdissector/src/monitorrtmpprotocol.cpp
r411 r413 43 43 for (uint32_t i = 0; i < MAX_STREAMS_COUNT; i++) { 44 44 _streams[i] = new MonitorStream(this, 45 GetApplication()->GetStreamsManager(), format("stream_% d", i));45 GetApplication()->GetStreamsManager(), format("stream_%u", i)); 46 46 } 47 47 return true; … … 95 95 default: 96 96 { 97 LOG(GetLogLevel(), "Invalid handshake stage: % d", _handshakeStage);97 LOG(GetLogLevel(), "Invalid handshake stage: %u", _handshakeStage); 98 98 return false; 99 99 } … … 118 118 default: 119 119 { 120 LOG(GetLogLevel(), "Invalid handshake stage: % d", _handshakeStage);120 LOG(GetLogLevel(), "Invalid handshake stage: %u", _handshakeStage); 121 121 return false; 122 122 } -
trunk/sources/vmtests/src/main.cpp
r128 r413 185 185 for (uint32_t i = 0; i < GETAVAILABLEBYTESCOUNT(wantedBuffer) && i < GETAVAILABLEBYTESCOUNT(gotBuffer); i++) { 186 186 if (GETIBPOINTER(wantedBuffer)[i] != GETIBPOINTER(gotBuffer)[i]) { 187 FATAL("w: % 02x; g: %02x; i: %d",187 FATAL("w: %hhx; g: %hhx; i: %u", 188 188 GETIBPOINTER(wantedBuffer)[i], 189 189 GETIBPOINTER(gotBuffer)[i],
Note: See TracChangeset
for help on using the changeset viewer.
