Changeset 413


Ignore:
Timestamp:
03/31/11 15:00:26 (14 months ago)
Author:
shiretu
Message:

-- fixed a lot of stuff related to printf-style format specifiers
-- properly initialize POD structures

Location:
trunk
Files:
144 edited

Legend:

Unmodified
Added
Removed
  • trunk/builders/cmake/CMakeLists.txt

    r405 r413  
    139139SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERIC_FLAGS}") 
    140140SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERIC_FLAGS}") 
    141 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DWITH_SANITY_INPUT_BUFFER") 
     141SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DWITH_SANITY_INPUT_BUFFER -DVALIDATE_FROMAT_SPECIFIERS -Wformat=2") 
    142142SET(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing") 
    143143#SET(CMAKE_VERBOSE_MAKEFILE TRUE) 
  • trunk/sources/androidapplestreaming/src/api.cpp

    r207 r413  
    2929using namespace app_applestreamingclient; 
    3030 
    31 static sockaddr_in gAddress = {0}; 
     31static sockaddr_in gAddress; 
    3232 
    3333#define SEND_VARIANT_REQUEST(request,response) \ 
     
    9292        configuration[CONF_APPLICATION_MEDIAFOLDER] = "./"; 
    9393        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); 
    9595        AppleStreamingClientApplication *pApp = new AppleStreamingClientApplication( 
    9696                        configuration); 
     
    175175        UDPCarrier *pUDPCarrier = UDPCarrier::Create(acceptorConfig[CONF_IP], (uint16_t) acceptorConfig[CONF_PORT]); 
    176176        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]); 
    178178        } 
    179179        BaseProtocol *pTimer = ProtocolFactoryManager::CreateProtocolChain(chain, acceptorConfig); 
     
    184184 
    185185        inet_aton("127.0.0.1", &gAddress.sin_addr); 
     186        memset(&gAddress, 0, sizeof (gAddress)); 
    186187        gAddress.sin_family = AF_INET; 
    187188        gAddress.sin_port = EHTONS(port + 1); 
     
    311312                httpSessionId = parts[2]; 
    312313        } 
    313         FINEST("uri: `%s`\nkeyPassword: `%s`\nhttpSessionId: `%s`", STR(uri), 
     314        FINEST("uri: `%s`\nkeyPassword: `%s`\nhttpSessionId: `%s`", 
     315                        STR(uri), 
    314316                        STR(keyPassword), STR(httpSessionId)); 
    315317        if (uri == "") { 
  • trunk/sources/applications/applestreamingclient/include/protocols/variant/messagestructure.h

    r399 r413  
    226226                default: \ 
    227227                { \ 
    228                         ASSERT("Unknown status code: %d",(status)); \ 
     228                        ASSERT("Unknown status code: %u",(uint32_t)(status)); \ 
    229229                        ASC_RES_STATUS_DESC(r)=ASC_RES_STATUS_UNKNOWN; \ 
    230230                        break;\ 
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r411 r413  
    5858        _avData.EnsureSize(_maxAVBufferSize * 3); 
    5959        _firstFeedTime = 0; 
    60         INFO("Context created: %d (%p)", _id, this); 
    6160} 
    6261 
    6362ClientContext::~ClientContext() { 
    64         INFO("Context destroyed: %d (%p)", _id, this); 
    6563        if (_pMasterPlaylist != NULL) { 
    6664                delete _pMasterPlaylist; 
     
    160158Playlist *ClientContext::ChildPlaylist(uint32_t bw) { 
    161159        if (!MAP_HAS1(_childPlaylists, bw)) { 
    162                 FATAL("Playlist for bandwidth %d not found", bw); 
     160                FATAL("Playlist for bandwidth %u not found", bw); 
    163161                return NULL; 
    164162        } 
     
    465463                        parameters["applicationId"]); 
    466464        if (pApp == NULL) { 
    467                 FATAL("Application id %d not found", (uint32_t) parameters["applicationId"]); 
     465                FATAL("Application id %u not found", (uint32_t) parameters["applicationId"]); 
    468466                return false; 
    469467        } 
     
    485483                if (_allowedBitrates.size() > 0) { 
    486484                        if (!MAP_HAS1(_allowedBitrates, bw)) { 
    487                                 WARN("Skipping bitrate %d", bw); 
     485                                WARN("Skipping bitrate %u", bw); 
    488486                                continue; 
    489487                        } 
     
    492490 
    493491                if (MAP_HAS1(_childPlaylists, bw)) { 
    494                         FATAL("Duplicate bandwidth detected: %d", bw); 
     492                        FATAL("Duplicate bandwidth detected: %u", bw); 
    495493                        return false; 
    496494                } 
     
    522520        delete pPl; 
    523521        _childPlaylists.erase(bw); 
    524         WARN("bw %d removed", bw); 
     522        WARN("bw %u removed", bw); 
    525523        return StartFeeding(); 
    526524} 
  • trunk/sources/applications/applestreamingclient/src/jnihelpers.cpp

    r170 r413  
    123123                default: 
    124124                { 
    125                         FATAL("Invalid variant type: %d", (VariantType) value); 
     125                        FATAL("Invalid variant type: %hhu", (VariantType) value); 
    126126                        pEnv->PopLocalFrame(NULL); 
    127127                        return NULL; 
  • trunk/sources/applications/applestreamingclient/src/playlist.cpp

    r411 r413  
    155155                } 
    156156                if (!bandwidthFound) { 
    157                         FATAL("Item number %u dowsn't have bandwidth info", MAP_KEY(i)); 
     157                        FATAL("Item number %u doesn't have bandwidth info", MAP_KEY(i)); 
    158158                        return false; 
    159159                } 
     
    213213uint32_t Playlist::GetIndex(uint32_t &sequence) { 
    214214        FINEST("---------------------"); 
    215         FINEST("sequence requested: %d", sequence); 
     215        FINEST("sequence requested: %u", sequence); 
    216216        //1. We have it, we return it 
    217217        if (MAP_HAS1(_itemMediaSequences, sequence)) { 
     
    224224        if (sequence == 0) { 
    225225                FINEST("sequence is 0"); 
    226                 FINEST("_itemMediaSequences.size(): %d", _itemMediaSequences.size()); 
     226                FINEST("_itemMediaSequences.size(): %zu", _itemMediaSequences.size()); 
    227227                if (_itemMediaSequences.size() != 0) { 
    228228                        //3. We have stuff. Init and return 
     
    248248 
    249249                        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)); 
    251251                                if (MAP_KEY(i) >= sequence) { 
    252252                                        sequence = MAP_KEY(i); 
  • trunk/sources/applications/applestreamingclient/src/protocols/aes/aesappprotocolhandler.cpp

    r160 r413  
    3939        BaseProtocol *pTSProtocol = ProtocolManager::GetProtocol(tsId); 
    4040        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); 
    4242                pProtocol->EnqueueForDelete(); 
    4343                return; 
  • trunk/sources/applications/applestreamingclient/src/protocols/httpbuff/httpbuffappprotocolhandler.cpp

    r160 r413  
    3939        BaseProtocol *pTSProtocol = ProtocolManager::GetProtocol(tsId); 
    4040        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); 
    4242                pProtocol->EnqueueForDelete(); 
    4343                return; 
  • trunk/sources/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp

    r411 r413  
    7575        string encryptedKey = unb64(temp); 
    7676        if (encryptedKey.size() != 16) { 
    77                 FATAL("Invalid key length: %d", encryptedKey.size()); 
     77                FATAL("Invalid key length: %zu", encryptedKey.size()); 
    7878                return false; 
    7979        } 
  • trunk/sources/applications/applestreamingclient/src/protocols/m3u8/childm3u8protocol.cpp

    r160 r413  
    3737        _bw = parameters["payload"]["bw"]; 
    3838        if (_bw == 0) { 
    39                 FATAL("Invalid bandwidth: %d", _bw); 
     39                FATAL("Invalid bandwidth: %u", _bw); 
    4040                return false; 
    4141        } 
  • trunk/sources/applications/applestreamingclient/src/protocols/timer/finetimer.cpp

    r411 r413  
    6969                ClientContext *pContext = ClientContext::GetContext(MAP_VAL(i), 0, 0); 
    7070                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)); 
    7272                        continue; 
    7373                } 
  • trunk/sources/applications/applestreamingclient/src/protocols/timer/scheduletimerprotocol.cpp

    r411 r413  
    4343        ClientContext *pContext = ClientContext::GetContext(_contextId, 0, 0); 
    4444        if (pContext == NULL) { 
    45                 FATAL("Unable to get context with id %d", _contextId); 
     45                FATAL("Unable to get context with id %u", _contextId); 
    4646                return false; 
    4747        } 
  • trunk/sources/applications/applestreamingclient/src/protocols/ts/tsappprotocolhandler.cpp

    r160 r413  
    4242        ClientContext *pContext = ClientContext::GetContext(contextId, 0, 0); 
    4343        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); 
    4545                pProtocol->EnqueueForDelete(); 
    4646                return; 
  • trunk/sources/applications/applestreamingclient/src/protocols/variant/variantappprotocolhandler.cpp

    r160 r413  
    130130 
    131131        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)); 
    133133                bws[(uint32_t) MAP_VAL(i)] = (uint32_t) MAP_VAL(i); 
    134134        } 
     
    184184        vector<string> allStreams; 
    185185        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]); 
    187187                ClientContext *pContext = GetContext(contextIds[i], 
    188188                                pProtocol->GetType()); 
    189189                if (pContext == NULL) { 
    190                         WARN("Context id %d is NULL", contextIds[i]); 
     190                        WARN("Context id %u is NULL", contextIds[i]); 
    191191                        continue; 
    192192                } 
    193193                if (pContext->EventSink()->GetType() != EVENT_SYNC_VARIANT) { 
    194                         WARN("Context id %d is not Variant friendly", contextIds[i]); 
     194                        WARN("Context id %u is not Variant friendly", contextIds[i]); 
    195195                        continue; 
    196196                } 
  • trunk/sources/applications/proxypublish/src/proxypublishapplication.cpp

    r411 r413  
    179179                Variant &target = MAP_VAL(i); 
    180180                if (!InitiateForwardingStream(pStream, target)) { 
    181                         WARN("Unable to forward stream %d of 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", 
    182182                                        pStream->GetUniqueId(), 
    183183                                        STR(tagToString(pStream->GetType())), 
     
    217217 
    218218        //3. Some nice info 
    219         INFO("Initiate forward stream %d of 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`", 
    220220                        pStream->GetUniqueId(), 
    221221                        STR(tagToString(pStream->GetType())), 
  • trunk/sources/common/include/platform/android/androidplatform.h

    r389 r413  
    2626 
    2727//platform includes 
     28#define __STDC_FORMAT_MACROS 
     29#include <inttypes.h> 
    2830#include <algorithm> 
    2931#include <arpa/inet.h> 
     
    130132} select_event; 
    131133 
    132 string format(string format, ...); 
    133 string vformat(string format, va_list args); 
     134string format(string fmt, ...); 
     135string vformat(string fmt, va_list args); 
    134136void replace(string &target, string search, string replacement); 
    135137bool fileExists(string path); 
  • trunk/sources/common/include/platform/freebsd/freebsdplatform.h

    r389 r413  
    2525 
    2626//platform includes 
     27#define __STDC_FORMAT_MACROS 
     28#include <inttypes.h> 
    2729#include <algorithm> 
    2830#include <arpa/inet.h> 
     
    135137 
    136138 
    137 string format(string format, ...); 
    138 string vformat(string format, va_list args); 
     139string format(string fmt, ...); 
     140string vformat(string fmt, va_list args); 
    139141void replace(string &target, string search, string replacement); 
    140142bool fileExists(string path); 
  • trunk/sources/common/include/platform/linux/linuxplatform.h

    r389 r413  
    2525 
    2626//platform includes 
     27#define __STDC_FORMAT_MACROS 
     28#include <inttypes.h> 
    2729#include <algorithm> 
    2830#include <arpa/inet.h> 
     
    138140} select_event; 
    139141 
    140 string format(string format, ...); 
    141 string vformat(string format, va_list args); 
     142string format(string fmt, ...); 
     143string vformat(string fmt, va_list args); 
    142144void replace(string &target, string search, string replacement); 
    143145bool fileExists(string path); 
  • trunk/sources/common/include/platform/openbsd/openbsdplatform.h

    r389 r413  
    2525 
    2626//platform includes 
     27#define __STDC_FORMAT_MACROS 
     28#include <inttypes.h> 
    2729#include <algorithm> 
    2830#include <arpa/inet.h> 
     
    137139 
    138140 
    139 string format(string format, ...); 
    140 string vformat(string format, va_list args); 
     141string format(string fmt, ...); 
     142string vformat(string fmt, va_list args); 
    141143void replace(string &target, string search, string replacement); 
    142144bool fileExists(string path); 
  • trunk/sources/common/include/platform/osx/osxplatform.h

    r389 r413  
    2525 
    2626//platform includes 
     27#define __STDC_FORMAT_MACROS 
     28#include <inttypes.h> 
    2729#include <AvailabilityMacros.h> 
    2830#include <algorithm> 
     
    133135} select_event; 
    134136 
    135 string format(string format, ...); 
    136 string vformat(string format, va_list args); 
     137string format(string fmt, ...); 
     138string vformat(string fmt, va_list args); 
    137139void replace(string &target, string search, string replacement); 
    138140bool fileExists(string path); 
  • trunk/sources/common/include/platform/solaris/solarisplatform.h

    r389 r413  
    2525 
    2626//platform includes 
     27#define __STDC_FORMAT_MACROS 
     28#include <inttypes.h> 
    2729#include <algorithm> 
    2830#include <arpa/inet.h> 
     
    135137} select_event; 
    136138 
    137 string format(string format, ...); 
    138 string vformat(string format, va_list args); 
     139string format(string fmt, ...); 
     140string vformat(string fmt, va_list args); 
    139141void replace(string &target, string search, string replacement); 
    140142bool fileExists(string path); 
  • trunk/sources/common/include/platform/windows/win32platform.h

    r399 r413  
    2424#include "platform/baseplatform.h" 
    2525 
     26#define __STDC_FORMAT_MACROS 
     27#include <inttypes.h> 
    2628#include <assert.h> 
    2729#include <time.h> 
     
    143145#define FD_COPY(f, t)   (void)(*(t) = *(f)) 
    144146 
    145 DLLEXP string format(string format, ...); 
    146 DLLEXP string vformat(string format, va_list args); 
     147DLLEXP string format(string fmt, ...); 
     148DLLEXP string vformat(string fmt, va_list args); 
    147149DLLEXP void replace(string &target, string search, string replacement); 
    148150DLLEXP bool fileExists(string path); 
     
    175177DLLEXP void InstallConfRereadSignal(SignalFnc pConfRereadSignalFnc); 
    176178DLLEXP time_t timegm(struct tm *tm); 
    177 DLLEXP char *strptime(const char *buf, const char *format, struct tm *timeptr); 
     179DLLEXP char *strptime(const char *buf, const char *fmt, struct tm *timeptr); 
    178180DLLEXP int strcasecmp(const char *s1, const char *s2); 
    179181DLLEXP int strncasecmp(const char *s1, const char *s2, size_t n); 
  • trunk/sources/common/include/utils/logging/logging.h

    r408 r413  
    2929#include "utils/logging/logger.h" 
    3030 
    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(...) \ 
     35do { \ 
     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) 
    3952#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) 
    4255 
    4356#endif /* _LOGGING_H */ 
  • trunk/sources/common/include/utils/misc/variant.h

    r295 r413  
    2828 
    2929#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--; 
    3434#else 
    3535#define CONSTRUCTOR 
  • trunk/sources/common/src/platform/android/androidplatform.cpp

    r408 r413  
    3434} 
    3535 
    36 string format(string format, ...) { 
     36string format(string fmt, ...) { 
    3737        string result = ""; 
    3838        va_list arguments; 
    39         va_start(arguments, format); 
    40         result = vformat(format, arguments); 
     39        va_start(arguments, fmt); 
     40        result = vformat(fmt, arguments); 
    4141        va_end(arguments); 
    4242        return result; 
    4343} 
    4444 
    45 string vformat(string format, va_list args) { 
     45string vformat(string fmt, va_list args) { 
    4646        char *pBuffer = NULL; 
    47         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     47        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4848                assert(false); 
    4949                return ""; 
     
    200200        if (pHostEnt->h_length <= 0) 
    201201                return ""; 
    202         string result = format("%u.%u.%u.%u", 
     202        string result = format("%hhu.%hhu.%hhu.%hhu", 
    203203                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    204204                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    366366 
    367367        struct dirent *pDirent; 
    368         struct stat entryStat = {0}; 
     368        struct stat entryStat; 
     369        memset(&entryStat, 0, sizeof (entryStat)); 
    369370        while ((pDirent = readdir(pDir)) != NULL) { 
    370371                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/freebsd/freebsdplatform.cpp

    r408 r413  
    3131} 
    3232 
    33 string format(string format, ...) { 
     33string format(string fmt, ...) { 
    3434        string result = ""; 
    3535        va_list arguments; 
    36         va_start(arguments, format); 
    37         result = vformat(format, arguments); 
     36        va_start(arguments, fmt); 
     37        result = vformat(fmt, arguments); 
    3838        va_end(arguments); 
    3939        return result; 
    4040} 
    4141 
    42 string vformat(string format, va_list args) { 
     42string vformat(string fmt, va_list args) { 
    4343        char *pBuffer = NULL; 
    44         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     44        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4545                assert(false); 
    4646                return ""; 
     
    205205        if (pHostEnt->h_length <= 0) 
    206206                return ""; 
    207         string result = format("%u.%u.%u.%u", 
     207        string result = format("%hhu.%hhu.%hhu.%hhu", 
    208208                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    209209                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    371371 
    372372        struct dirent *pDirent; 
    373         struct stat entryStat = {0}; 
     373        struct stat entryStat; 
     374        memset(&entryStat, 0, sizeof (entryStat)); 
    374375        while ((pDirent = readdir(pDir)) != NULL) { 
    375376                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/linux/linuxplatform.cpp

    r408 r413  
    3333} 
    3434 
    35 string format(string format, ...) { 
     35string format(string fmt, ...) { 
    3636        string result = ""; 
    3737        va_list arguments; 
    38         va_start(arguments, format); 
    39         result = vformat(format, arguments); 
     38        va_start(arguments, fmt); 
     39        result = vformat(fmt, arguments); 
    4040        va_end(arguments); 
    4141        return result; 
    4242} 
    4343 
    44 string vformat(string format, va_list args) { 
     44string vformat(string fmt, va_list args) { 
    4545        char *pBuffer = NULL; 
    46         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     46        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4747                assert(false); 
    4848                return ""; 
     
    205205        if (pHostEnt->h_length <= 0) 
    206206                return ""; 
    207         string result = format("%u.%u.%u.%u", 
     207        string result = format("%hhu.%hhu.%hhu.%hhu", 
    208208                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    209209                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    371371 
    372372        struct dirent *pDirent; 
    373         struct stat entryStat = {0}; 
     373        struct stat entryStat; 
     374        memset(&entryStat, 0, sizeof (entryStat)); 
    374375        while ((pDirent = readdir(pDir)) != NULL) { 
    375376                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/openbsd/openbsdplatform.cpp

    r408 r413  
    3131} 
    3232 
    33 string format(string format, ...) { 
     33string format(string fmt, ...) { 
    3434        string result = ""; 
    3535        va_list arguments; 
    36         va_start(arguments, format); 
    37         result = vformat(format, arguments); 
     36        va_start(arguments, fmt); 
     37        result = vformat(fmt, arguments); 
    3838        va_end(arguments); 
    3939        return result; 
    4040} 
    4141 
    42 string vformat(string format, va_list args) { 
     42string vformat(string fmt, va_list args) { 
    4343        char *pBuffer = NULL; 
    44         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     44        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4545                assert(false); 
    4646                return ""; 
     
    207207        if (pHostEnt->h_length <= 0) 
    208208                return ""; 
    209         string result = format("%u.%u.%u.%u", 
     209        string result = format("%hhu.%hhu.%hhu.%hhu", 
    210210                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    211211                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    373373 
    374374        struct dirent *pDirent; 
    375         struct stat entryStat = {0}; 
     375        struct stat entryStat; 
     376        memset(&entryStat, 0, sizeof (entryStat)); 
    376377        while ((pDirent = readdir(pDir)) != NULL) { 
    377378                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/osx/osxplatform.cpp

    r408 r413  
    3232} 
    3333 
    34 string format(string format, ...) { 
     34string format(string fmt, ...) { 
    3535        string result = ""; 
    3636        va_list arguments; 
    37         va_start(arguments, format); 
    38         result = vformat(format, arguments); 
     37        va_start(arguments, fmt); 
     38        result = vformat(fmt, arguments); 
    3939        va_end(arguments); 
    4040        return result; 
    4141} 
    4242 
    43 string vformat(string format, va_list args) { 
     43string vformat(string fmt, va_list args) { 
    4444        char *pBuffer = NULL; 
    45         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     45        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4646                assert(false); 
    4747                return ""; 
     
    206206        if (pHostEnt->h_length <= 0) 
    207207                return ""; 
    208         string result = format("%u.%u.%u.%u", 
     208        string result = format("%hhu.%hhu.%hhu.%hhu", 
    209209                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    210210                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    372372 
    373373        struct dirent *pDirent; 
    374         struct stat entryStat = {0}; 
     374        struct stat entryStat; 
     375        memset(&entryStat, 0, sizeof (entryStat)); 
    375376        while ((pDirent = readdir(pDir)) != NULL) { 
    376377                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/solaris/solarisplatform.cpp

    r408 r413  
    3838} 
    3939 
    40 string format(string format, ...) { 
     40string format(string fmt, ...) { 
    4141        string result = ""; 
    4242        va_list arguments; 
    43         va_start(arguments, format); 
    44         result = vformat(format, arguments); 
     43        va_start(arguments, fmt); 
     44        result = vformat(fmt, arguments); 
    4545        va_end(arguments); 
    4646        return result; 
    4747} 
    4848 
    49 string vformat(string format, va_list args) { 
     49string vformat(string fmt, va_list args) { 
    5050        char *pBuffer = NULL; 
    51         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     51        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    5252                assert(false); 
    5353                return ""; 
     
    203203        if (pHostEnt->h_length <= 0) 
    204204                return ""; 
    205         string result = format("%u.%u.%u.%u", 
     205        string result = format("%hhu.%hhu.%hhu.%hhu", 
    206206                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    207207                        (uint8_t) pHostEnt->h_addr_list[0][1], 
     
    369369 
    370370        struct dirent *pDirent; 
    371         struct stat entryStat = {0}; 
     371        struct stat entryStat; 
     372        memset(&entryStat, 0, sizeof (entryStat)); 
    372373        while ((pDirent = readdir(pDir)) != NULL) { 
    373374                string entry = pDirent->d_name; 
  • trunk/sources/common/src/platform/windows/strptime.cpp

    r58 r413  
    203203 
    204204char * 
    205 strptime (const char *buf, const char *format, struct tm *timeptr) 
     205strptime (const char *buf, const char *fmt, struct tm *timeptr) 
    206206{ 
    207207    char c; 
    208208 
    209     for (; (c = *format) != '\0'; ++format) { 
     209    for (; (c = *fmt) != '\0'; ++fmt) { 
    210210        char *s; 
    211211        int ret; 
     
    214214            while (isspace (*buf)) 
    215215                ++buf; 
    216         } else if (c == '%' && format[1] != '\0') { 
    217             c = *++format; 
     216        } else if (c == '%' && fmt[1] != '\0') { 
     217            c = *++fmt; 
    218218            if (c == 'E' || c == 'O') 
    219                 c = *++format; 
     219                c = *++fmt; 
    220220            switch (c) { 
    221221            case 'A' : 
     
    416416                abort (); 
    417417            case '\0' : 
    418                 --format; 
     418                --fmt; 
    419419                /* FALLTHROUGH */ 
    420420            case '%' : 
  • trunk/sources/common/src/platform/windows/win32platform.cpp

    r408 r413  
    2727static map<uint32_t, SignalFnc> _signalHandlers; 
    2828 
    29 string format(string format, ...) { 
     29string format(string fmt, ...) { 
    3030        string result = ""; 
    3131        va_list arguments; 
    32         va_start(arguments, format); 
    33         result = vformat(format, arguments); 
     32        va_start(arguments, fmt); 
     33        result = vformat(fmt, arguments); 
    3434        va_end(arguments); 
    3535        return result; 
    3636} 
    3737 
    38 string vformat(string format, va_list args) { 
     38string vformat(string fmt, va_list args) { 
    3939        char *pBuffer = NULL; 
    40         if (vasprintf(&pBuffer, STR(format), args) == -1) { 
     40        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    4141                ASSERT("vasprintf failed"); 
    4242                return ""; 
     
    229229 
    230230void InitNetworking() { 
    231         WSADATA wsa = {0}; 
     231        WSADATA wsa; 
     232        memset(&wsa,0,sizeof(wsa)); 
    232233        WSAStartup(0, &wsa); 
    233234        WSAStartup(wsa.wHighVersion, &wsa); 
     
    280281        BOOL value = TRUE; 
    281282        if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 
    282                 FATAL("Error #%d", WSAGetLastError()); 
     283                FATAL("Error #%u", WSAGetLastError()); 
    283284                return false; 
    284285        } 
     
    289290        BOOL value = TRUE; 
    290291        if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 
    291                 FATAL("Error #%d", WSAGetLastError()); 
     292                FATAL("Error #%u", WSAGetLastError()); 
    292293                return false; 
    293294        } 
     
    298299        BOOL value = TRUE; 
    299300        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&value, sizeof(BOOL)) == SOCKET_ERROR) { 
    300                 FATAL("Error #%d", WSAGetLastError()); 
     301                FATAL("Error #%u", WSAGetLastError()); 
    301302                return false; 
    302303        } 
     
    348349        if (pHostEnt->h_length <= 0) 
    349350                return ""; 
    350         string result = format("%u.%u.%u.%u", 
     351        string result = format("%hhu.%hhu.%hhu.%hhu", 
    351352                        (uint8_t) pHostEnt->h_addr_list[0][0], 
    352353                        (uint8_t) pHostEnt->h_addr_list[0][1], 
  • trunk/sources/common/src/utils/buffering/iobuffer.cpp

    r408 r413  
    302302        if (sentAmount < 0) { 
    303303                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]", 
    305305                                        _published - _consumed, size, err, strerror(err)); 
    306306                        FATAL("Permanent error!"); 
     
    326326 
    327327        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]", 
    329329                                _published - _consumed, size, err, strerror(err)); 
    330330                FATAL("Permanent error!"); 
     
    451451        ss << format("Address: %p", _pBuffer) << endl; 
    452452        if (limit != 0) { 
    453                 ss << format("Limited to %d bytes", limit) << endl; 
     453                ss << format("Limited to %u bytes", limit) << endl; 
    454454        } 
    455455        string address = ""; 
     
    465465                        hr = ""; 
    466466                } 
    467                 address = format("%08d", i - (i % 16)); 
     467                address = format("%08u", i - (i % 16)); 
    468468 
    469469                if ((i % 16) < 8) { 
    470                         part1 += format("%02x", _pBuffer[i]); 
     470                        part1 += format("%02hhx", _pBuffer[i]); 
    471471                        part1 += " "; 
    472472                } else { 
    473                         part2 += format("%02x", _pBuffer[i]); 
     473                        part2 += format("%02hhx", _pBuffer[i]); 
    474474                        part2 += " "; 
    475475                } 
  • trunk/sources/common/src/utils/logging/consoleloglocation.cpp

    r58 r413  
    5050#ifdef ANDROID 
    5151        if (_allowColors) { 
    52                 printf("%s%s:%d %s%s\n", 
     52                printf("%s%s:%u %s%s\n", 
    5353                                STR(_colors[level]), 
    5454                                STR(fileName), 
     
    5757                                STR(_colors[6])); 
    5858        } else { 
    59                 printf("%s:%d %s\n", 
     59                printf("%s:%u %s\n", 
    6060                                STR(fileName), 
    6161                                lineNumber, 
  • trunk/sources/common/src/utils/logging/fileloglocation.cpp

    r232 r413  
    4646                return; 
    4747        } 
    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), 
    5050                        STR(message)); 
    5151        _fileStream.write(STR(logEntry), logEntry.size()); 
  • trunk/sources/common/src/utils/logging/logcatloglocation.cpp

    r58 r413  
    4747 
    4848        __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)))); 
    5050} 
    5151#endif /* ANDROID */ 
  • trunk/sources/common/src/utils/lua/luautils.cpp

    r58 r413  
    9797                        bool isArray = true; 
    9898                        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))) { 
    100100                                        isArray = false; 
    101101                                        break; 
     
    115115                default: 
    116116                { 
    117                         WARN("Element type not supported: %d (0x%08x)", type, type); 
     117                        WARN("Element type not supported: %d (0x%x)", type, type); 
    118118                        return false; 
    119119                        break; 
     
    303303                default: 
    304304                { 
    305                         FATAL("Unknown type %d", (VariantType) variant); 
     305                        FATAL("Unknown type %hhu", (VariantType) variant); 
    306306                        return false; 
    307307                        break; 
     
    322322bool LoadLuaScriptFromFile(string file, lua_State *pLuaState, bool pCall) { 
    323323        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), 
    325326                                lua_tostring(pLuaState, -1)); 
    326327                return false; 
     
    329330        if (pCall) { 
    330331                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), 
    332334                                        lua_tostring(pLuaState, -1)); 
    333335                        return false; 
     
    340342bool LoadLuaScriptFromString(string luaScript, lua_State *pLuaState, bool pCall) { 
    341343        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), 
    343346                                lua_tostring(pLuaState, -1)); 
    344347                return false; 
     
    347350        if (pCall) { 
    348351                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), 
    350354                                        lua_tostring(pLuaState, -1)); 
    351355                        return false; 
  • trunk/sources/common/src/utils/misc/crypto.cpp

    r408 r413  
    228228                string result = ""; 
    229229                for (uint32_t i = 0; i < md_len; i++) { 
    230                         result += format("%02x", md_value[i]); 
     230                        result += format("%02hhx", md_value[i]); 
    231231                } 
    232232                return result; 
  • trunk/sources/common/src/utils/misc/file.cpp

    r408 r413  
    7474        if (_file.fail()) { 
    7575                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)); 
    7777                return false; 
    7878        } 
     
    149149        _file.seekg(count, ios_base::cur); 
    150150        if (_file.fail()) { 
    151                 FATAL("Unable to seek ahead %d bytes", count); 
     151                FATAL("Unable to seek ahead %"PRId64" bytes", count); 
    152152                return false; 
    153153        } 
     
    168168        _file.seekg((-1) * count, ios_base::cur); 
    169169        if (_file.fail()) { 
    170                 FATAL("Unable to seek behind %d bytes", count); 
     170                FATAL("Unable to seek behind %"PRId64" bytes", count); 
    171171                return false; 
    172172        } 
     
    182182        _file.seekg(position, ios_base::beg); 
    183183        if (_file.fail()) { 
    184                 FATAL("Unable to seek to position %d", position); 
     184                FATAL("Unable to seek to position %"PRIu64, position); 
    185185                return false; 
    186186        } 
     
    262262        _file.read((char *) pBuffer, count); 
    263263        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)", 
    265265                                count, Cursor(), Cursor(), errno, strerror(errno)); 
    266266                return false; 
     
    435435        _file.write((char *) pBuffer, count); 
    436436        if (_file.fail()) { 
    437                 FATAL("Unable to write %d bytes to file", count); 
     437                FATAL("Unable to write %"PRIu64" bytes to file", count); 
    438438                return false; 
    439439        } 
  • trunk/sources/common/src/utils/misc/mmapfile.cpp

    r408 r413  
    3939        if (_pageSize == 0) { 
    4040                _pageSize = getpagesize(); 
    41                 LOG_MMAP("_pageSize: %d", _pageSize); 
     41                LOG_MMAP("_pageSize: %u", _pageSize); 
    4242        } 
    4343        _windowSize = 0; 
     
    7272 
    7373        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); 
    7575                return false; 
    7676        } 
     
    8383        _size = windowSize; 
    8484        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, 
    8686                                cursor + size, _cursor + _size); 
    8787                _size += MmapFile::_pageSize; 
    8888        } 
    8989 
    90         LOG_MMAP("Reading %llu bytes from disk", _size); 
     90        LOG_MMAP("Reading %"PRIu64" bytes from disk", _size); 
    9191        _pData = (uint8_t *) mmap(NULL, 
    9292                        _size, 
     
    149149        if (_size == 0) 
    150150                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); 
    152152} 
    153153 
    154154bool MmapFile::Initialize(string path, uint32_t windowSize, bool exclusive) { 
    155155        //1. Do we have this file open? 
    156         LOG_MMAP("Initial window size: %d", windowSize); 
     156        LOG_MMAP("Initial window size: %u", windowSize); 
    157157        uint32_t pagesCount = windowSize / _pageSize; 
    158         LOG_MMAP("pagesCount: %d", pagesCount); 
     158        LOG_MMAP("pagesCount: %u", pagesCount); 
    159159        _windowSize = (pagesCount * _pageSize) + 
    160160                        (((windowSize % _pageSize) != 0) ? _pageSize : 0); 
    161161        _path = path; 
    162         LOG_MMAP("_windowSize: %d; file: `%s`", _windowSize, STR(_path)); 
     162        LOG_MMAP("_windowSize: %u; file: `%s`", _windowSize, STR(_path)); 
    163163        if (!MAP_HAS1(_fds, _path)) { 
    164                 __FileInfo__ fi = {0}; 
     164                __FileInfo__ fi = {0, 0, 0}; 
    165165 
    166166                //2. Open the file 
     
    257257        } 
    258258        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); 
    260260                _failed = true; 
    261261                return false; 
     
    404404        //1. Sanity checks 
    405405        if (_failed) { 
    406                 DEBUG("_cursor: %llu; count: %u; %s", _cursor, count, STR(_path)); 
     406                DEBUG("_cursor: %"PRIu64"; count: %"PRIu64"; %s", _cursor, count, STR(_path)); 
    407407                FATAL("This mmap file is in inconsistent state"); 
    408408                return false; 
     
    410410 
    411411        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, 
    414414                                _windowSize, count); 
    415415                _failed = true; 
     
    418418 
    419419        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, 
    422422                                _cursor, count, _size); 
    423423                _failed = true; 
     
    448448        //3. Do the read 
    449449        if (pPointer->Copy(pDestBuffer, _cursor, 0, count) != count) { 
    450                 FATAL("Unable to copy %llu bytes", count); 
     450                FATAL("Unable to copy %"PRIu64" bytes", count); 
    451451                _failed = true; 
    452452                return false; 
  • trunk/sources/common/src/utils/misc/timersmanager.cpp

    r408 r413  
    109109                return 0; 
    110110        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); 
    112112        return result; 
    113113} 
  • trunk/sources/common/src/utils/misc/uri.cpp

    r408 r413  
    4646        split(stringUri, "/", components); 
    4747        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])); 
    4949        } 
    5050 
     
    125125                        return false; 
    126126        } 
    127         LOG_URI_SPLIT("uri.port: %d", uri.port); 
     127        LOG_URI_SPLIT("uri.port: %u", uri.port); 
    128128 
    129129        for (uint32_t i = 3; i < components.size(); i++) { 
  • trunk/sources/common/src/utils/misc/variant.cpp

    r408 r413  
    273273                case V_INT8: 
    274274                { 
    275                         result += format("%s<INT8 name=\"%s\">%d</INT8>", 
     275                        result += format("%s<INT8 name=\"%s\">%hhd</INT8>", 
    276276                                        STR(strIndent), STR(name), _value.i8); 
    277277                        break; 
     
    279279                case V_INT16: 
    280280                { 
    281                         result += format("%s<INT16 name=\"%s\">%d</INT16>", 
     281                        result += format("%s<INT16 name=\"%s\">%hd</INT16>", 
    282282                                        STR(strIndent), STR(name), _value.i16); 
    283283                        break; 
     
    291291                case V_INT64: 
    292292                { 
    293                         result += format("%s<INT64 name=\"%s\">%lld</INT64>", 
     293                        result += format("%s<INT64 name=\"%s\">%"PRId64"</INT64>", 
    294294                                        STR(strIndent), STR(name), _value.i64); 
    295295                        break; 
     
    297297                case V_UINT8: 
    298298                { 
    299                         result += format("%s<UINT8 name=\"%s\">%u</UINT8>", 
     299                        result += format("%s<UINT8 name=\"%s\">%hhu</UINT8>", 
    300300                                        STR(strIndent), STR(name), _value.ui8); 
    301301                        break; 
     
    303303                case V_UINT16: 
    304304                { 
    305                         result += format("%s<UINT16 name=\"%s\">%u</UINT16>", 
     305                        result += format("%s<UINT16 name=\"%s\">%hu</UINT16>", 
    306306                                        STR(strIndent), STR(name), _value.ui16); 
    307307                        break; 
     
    315315                case V_UINT64: 
    316316                { 
    317                         result += format("%s<UINT64 name=\"%s\">%llu</UINT64>", 
     317                        result += format("%s<UINT64 name=\"%s\">%"PRIu64"</UINT64>", 
    318318                                        STR(strIndent), STR(name), _value.ui64); 
    319319                        break; 
     
    351351                case V_BYTEARRAY: 
    352352                { 
    353                         result += format("%s<BYTEARRAY name=\"%s\">%llu bytes</BYTEARRAY>", 
     353                        result += format("%s<BYTEARRAY name=\"%s\">%zu bytes</BYTEARRAY>", 
    354354                                        STR(strIndent), STR(name), _value.s->length()); 
    355355                        break; 
     
    381381                default: 
    382382                { 
    383                         FATAL("Invalid type: %d", _type); 
     383                        FATAL("Invalid type: %hhu", _type); 
    384384                        assert(false); 
    385385                } 
     
    619619        } else { 
    620620                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}; 
    622622                return temp; 
    623623        } 
     
    638638                case V_INT64: 
    639639                { 
    640                         return format("%lld", this->operator int64_t()); 
     640                        return format("%"PRId64, this->operator int64_t()); 
    641641                } 
    642642                case V_UINT8: 
     
    648648                case V_UINT64: 
    649649                { 
    650                         return format("%llu", this->operator uint64_t()); 
     650                        return format("%"PRIu64, this->operator uint64_t()); 
    651651                } 
    652652                case V_DOUBLE: 
     
    10401040                return false; 
    10411041 
    1042         Timestamp temp = {0}; 
     1042        Timestamp temp = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 
    10431043 
    10441044        if (detectedType == V_DATE || detectedType == V_TIMESTAMP) { 
     
    13071307                { 
    13081308                        result = ""; 
    1309                         FATAL("Invalid variant type: %d", _type); 
     1309                        FATAL("Invalid variant type: %hhu", _type); 
    13101310                        return false; 
    13111311                } 
     
    15811581                { 
    15821582                        int64_t value = (int64_t) (*this); 
    1583                         result += format("%lld", value); 
     1583                        result += format("%"PRId64, value); 
    15841584                        break; 
    15851585                } 
     
    15901590                { 
    15911591                        uint64_t value = (uint64_t) (*this); 
    1592                         result += format("%llu", value); 
     1592                        result += format("%"PRIu64, value); 
    15931593                        break; 
    15941594                } 
     
    16391639                default: 
    16401640                { 
    1641                         ASSERT("Invalid type %d", _type); 
     1641                        ASSERT("Invalid type %hhu", _type); 
    16421642                        break; 
    16431643                } 
     
    16921692                { 
    16931693                        pResult = new TiXmlElement("INT8"); 
    1694                         pResult->LinkEndChild(new TiXmlText(format("%d", _value.i8))); 
     1694                        pResult->LinkEndChild(new TiXmlText(format("%hhd", _value.i8))); 
    16951695                        break; 
    16961696                } 
     
    16981698                { 
    16991699                        pResult = new TiXmlElement("INT16"); 
    1700                         pResult->LinkEndChild(new TiXmlText(format("%d", _value.i16))); 
     1700                        pResult->LinkEndChild(new TiXmlText(format("%hd", _value.i16))); 
    17011701                        break; 
    17021702                } 
     
    17101710                { 
    17111711                        pResult = new TiXmlElement("INT64"); 
    1712                         pResult->LinkEndChild(new TiXmlText(format("%lld", _value.i64))); 
     1712                        pResult->LinkEndChild(new TiXmlText(format("%"PRId64, _value.i64))); 
    17131713                        break; 
    17141714                } 
     
    17161716                { 
    17171717                        pResult = new TiXmlElement("UINT8"); 
    1718                         pResult->LinkEndChild(new TiXmlText(format("%u", _value.ui8))); 
     1718                        pResult->LinkEndChild(new TiXmlText(format("%hhu", _value.ui8))); 
    17191719                        break; 
    17201720                } 
     
    17221722                { 
    17231723                        pResult = new TiXmlElement("UINT16"); 
    1724                         pResult->LinkEndChild(new TiXmlText(format("%u", _value.ui16))); 
     1724                        pResult->LinkEndChild(new TiXmlText(format("%hu", _value.ui16))); 
    17251725                        break; 
    17261726                } 
     
    17341734                { 
    17351735                        pResult = new TiXmlElement("UINT64"); 
    1736                         pResult->LinkEndChild(new TiXmlText(format("%llu", _value.ui64))); 
     1736                        pResult->LinkEndChild(new TiXmlText(format("%"PRIu64, _value.ui64))); 
    17371737                        break; 
    17381738                } 
     
    17991799                default: 
    18001800                { 
    1801                         ASSERT("Invalid type: %d", _type); 
     1801                        ASSERT("Invalid type: %hhu", _type); 
    18021802                        return NULL; 
    18031803                } 
     
    18131813        if(s>bufferSize-cursor) \ 
    18141814        { \ 
    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);\ 
    18161816                return false; \ 
    18171817        } \ 
     
    19961996                default: 
    19971997                { 
    1998                         FATAL("Invalid variant type: %d", type); 
     1998                        FATAL("Invalid variant type: %hhu", type); 
    19991999                        return false; 
    20002000                } 
     
    20252025                return true; 
    20262026        } 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) { 
    20282028                        FATAL("Invalid number"); 
    20292029                        return false; 
     
    20322032                return true; 
    20332033        } 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) { 
    20352035                        FATAL("Invalid number"); 
    20362036                        return false; 
     
    20392039                return true; 
    20402040        } 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) { 
    20422042                        FATAL("Invalid number"); 
    20432043                        return false; 
     
    20462046                return true; 
    20472047        } 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) { 
    20492049                        FATAL("Invalid number"); 
    20502050                        return false; 
     
    20532053                return true; 
    20542054        } 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) { 
    20562056                        FATAL("Invalid number"); 
    20572057                        return false; 
     
    20602060                return true; 
    20612061        } 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) { 
    20632063                        FATAL("Invalid number"); 
    20642064                        return false; 
     
    20672067                return true; 
    20682068        } 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) { 
    20702070                        FATAL("Invalid number"); 
    20712071                        return false; 
     
    20742074                return true; 
    20752075        } 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) { 
    20772077                        FATAL("Invalid number"); 
    20782078                        return false; 
     
    20962096                return true; 
    20972097        } 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) { 
    20992099                        FATAL("Invalid timestamp (date, time or timestamp)"); 
    21002100                        return false; 
     
    22522252        } 
    22532253        if (raw[start] != '\"') { 
    2254                 FATAL("Invalid JSON string: %d", start); 
     2254                FATAL("Invalid JSON string: %u", start); 
    22552255                return false; 
    22562256        } 
  • trunk/sources/common/src/utils/tinyxml/tinyxml.cpp

    r58 r413  
    527527void TiXmlElement::SetAttribute(const char * name, int val) { 
    528528        char buf[64]; 
    529         sprintf(buf, "%d", val); 
     529        sprintf(buf, "%u", val); 
    530530        SetAttribute(name, buf); 
    531531} 
     
    986986 
    987987int TiXmlAttribute::QueryIntValue(int* ival) const { 
    988         if (sscanf(value.c_str(), "%d", ival) == 1) 
     988        if (sscanf(value.c_str(), "%u", ival) == 1) 
    989989                return TIXML_SUCCESS; 
    990990        return TIXML_WRONG_TYPE; 
     
    999999void TiXmlAttribute::SetIntValue(int _value) { 
    10001000        char buf [64]; 
    1001         sprintf(buf, "%d", _value); 
     1001        sprintf(buf, "%u", _value); 
    10021002        SetValue(buf); 
    10031003} 
  • trunk/sources/crtmpserver/src/crtmpserver.cpp

    r402 r413  
    229229        } 
    230230        INFO("\n%s", STR(gRs.pConfigFile->GetServicesInfo())); 
    231         INFO("GO! GO! GO! (%d)", getpid()); 
     231        INFO("GO! GO! GO! (%u)", (uint32_t) getpid()); 
    232232        while (IOHandlerManager::Pulse()) { 
    233233                IOHandlerManager::DeleteDeadHandlers(); 
  • trunk/sources/tests/include/basetestssuite.h

    r56 r413  
    2424#include <assert.h> 
    2525 
    26 #define TS_PRINT(...) printf(__VA_ARGS__) 
     26 
     27#define __TESTS_VALIDATE_FROMAT_SPECIFIERS(...) \ 
     28do { \ 
     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) 
    2734 
    2835#define TS_ASSERT_NO_INCREMENT(x) \ 
    2936do { \ 
    3037    if(!(x)) { \ 
    31         TS_PRINT("Test failed. %s:%d\n",__FILE__,__LINE__); \ 
     38        TS_PRINT("Test failed. %s:%u\n",__FILE__,__LINE__); \ 
    3239        exit(-1); \ 
    3340    } \ 
     
    3744do { \ 
    3845    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__); \ 
    4047        exit(-1); \ 
    4148    } else { \ 
     
    5057        x().Run(); \ 
    5158        int testsCount = BaseTestsSuite::_testsCount - before; \ 
    52         TS_PRINT("%d tests completed successfuly\n", testsCount); \ 
     59        TS_PRINT("%u tests completed successfuly\n", testsCount); \ 
    5360} while(0) 
    5461 
  • trunk/sources/tests/src/main.cpp

    r110 r413  
    2828        EXECUTE_SUITE(VariantTestsSuite); 
    2929        EXECUTE_SUITE(TheLibTestsSuite); 
    30         TS_PRINT("A total of %d tests completed successfuly\n", BaseTestsSuite::_testsCount); 
     30        TS_PRINT("A total of %u tests completed successfuly\n", BaseTestsSuite::_testsCount); 
    3131        return 0; 
    3232} 
  • trunk/sources/tests/src/thelibtestssuite.cpp

    r278 r413  
    9090        uint8_t sstl_big_extended[] = {0x81, 0x01, 0x00, 0xff, 0xff, 0xff, 0x51, 0x52, 0x53, 0x54}; 
    9191 
    92         Header header = {0}; 
     92        Header header; 
     93        memset(&header, 0, sizeof (header)); 
    9394 
    9495#define HEADER_READ_TEST(h,ciSize, ci, buff, type, ia, ts) \ 
  • trunk/sources/thelib/include/mediaformats/mediaframe.h

    r58 r413  
    3838 
    3939        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", 
    4141                                start, length, type, deltaTime, isKeyFrame, absoluteTime, isBinaryHeader); 
    4242        }; 
  • trunk/sources/thelib/include/mediaformats/mp4/atomesds.h

    r10 r413  
    2323 
    2424#include "mediaformats/mp4/versionedatom.h" 
    25  
    26 //#define DEBUG_ESDS_ATOM 
    27  
    28 #ifdef DEBUG_ESDS_ATOM 
    29 #define FINEST_ESDS_ATOM(...) FINEST(__VA_ARGS__) 
    30 #else 
    31 #define FINEST_ESDS_ATOM(...) 
    32 #endif 
    3325 
    3426class AtomESDS 
  • trunk/sources/thelib/include/netio/epoll/tcpconnector.h

    r410 r413  
    6464 
    6565                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", 
    6767                                        STR(_ip), 
    6868                                        _port); 
     
    143143                        int err = errno; 
    144144                        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, 
    146146                                                strerror(err)); 
    147147                                T::SignalProtocolCreated(NULL, _customParameters); 
  • trunk/sources/thelib/include/netio/kqueue/tcpconnector.h

    r410 r413  
    6666                if (((event.flags & EV_ERROR) != 0) || 
    6767                                ((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", 
    6969                                        STR(_ip), 
    7070                                        _port); 
     
    145145                        int err = errno; 
    146146                        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, 
    148148                                                strerror(err)); 
    149149                                T::SignalProtocolCreated(NULL, _customParameters); 
  • trunk/sources/thelib/include/netio/select/tcpconnector.h

    r410 r413  
    136136                        int err = LASTSOCKETERROR; 
    137137                        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, 
    139139                                                strerror(err)); 
    140140                                T::SignalProtocolCreated(NULL, _customParameters); 
  • trunk/sources/thelib/include/protocols/rtmp/amftypes.h

    r148 r413  
    7676    if(GETAVAILABLEBYTESCOUNT(x)<(y)) { \ 
    7777        FATAL("Not enough data. Wanted: %u; Got: %u", \ 
    78             (y),GETAVAILABLEBYTESCOUNT(x)); \ 
     78            (uint32_t)(y),GETAVAILABLEBYTESCOUNT(x)); \ 
    7979        return false; \ 
    8080    } \ 
  • trunk/sources/thelib/include/protocols/rtp/rtpheader.h

    r410 r413  
    3939 
    4040        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", 
    4242                                _flags, 
    4343                                GET_RTP_V(*this), 
  • trunk/sources/thelib/include/protocols/ts/streamdescriptors.h

    r410 r413  
    7070 
    7171        operator string() { 
    72                 return format("type: %d; length: %d", type, length); 
     72                return format("type: %hhu; length: %hhu", type, length); 
    7373        }; 
    7474} StreamDescriptor; 
  • trunk/sources/thelib/include/protocols/ts/tsboundscheck.h

    r2 r413  
    2323#define _TSBOUNDSCHECK_H 
    2424 
    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;} 
    2626 
    2727#endif  /* _TSBOUNDSCHECK_H */ 
  • trunk/sources/thelib/include/protocols/ts/tspacketpmt.h

    r317 r413  
    5050        vector<StreamDescriptor> esDescriptors; 
    5151 
     52        _TSStreamInfo() { 
     53                streamType = 0; 
     54                elementaryPID = 0; 
     55                esInfoLength = 0; 
     56        } 
     57 
    5258        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", 
    5460                                STR(string(indent, '\t')), 
    5561                                streamType, elementaryPID, esInfoLength, esDescriptors.size()); 
     
    6470 
    6571//iso13818-1.pdf page 64/174 
    66 //Table 2-28 – Transport Stream program map section 
     72//Table 2-28 ‚Äö√Ñ√š Transport Stream program map section 
    6773 
    6874class TSPacketPMT { 
  • trunk/sources/thelib/src/application/baseclientapplication.cpp

    r222 r413  
    9797BaseAppProtocolHandler *BaseClientApplication::GetProtocolHandler(uint64_t protocolType) { 
    9898        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)); 
    106101        } 
    107102        return _protocolsHandlers[protocolType]; 
     
    146141void BaseClientApplication::UnRegisterProtocol(BaseProtocol *pProtocol) { 
    147142        if (!MAP_HAS1(_protocolsHandlers, pProtocol->GetType())) 
    148                 ASSERT("Protocol handler not activated for protocol type %d in 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)); 
    150145        _streamsManager.UnRegisterStreams(pProtocol->GetId()); 
    151146        _protocolsHandlers[pProtocol->GetType()]->UnRegisterProtocol(pProtocol); 
     
    154149 
    155150void BaseClientApplication::SignalStreamRegistered(BaseStream *pStream) { 
    156         INFO("Stream %d of type %s with name `%s` registered to application `%s`", 
     151        INFO("Stream %u of type %s with name `%s` registered to application `%s`", 
    157152                        pStream->GetUniqueId(), 
    158153                        STR(tagToString(pStream->GetType())), 
     
    162157 
    163158void BaseClientApplication::SignalStreamUnRegistered(BaseStream *pStream) { 
    164         INFO("Stream %d of type %s with name `%s` unregistered from application `%s`", 
     159        INFO("Stream %u of type %s with name `%s` unregistered from application `%s`", 
    165160                        pStream->GetUniqueId(), 
    166161                        STR(tagToString(pStream->GetType())), 
  • trunk/sources/thelib/src/application/clientapplicationmanager.cpp

    r410 r413  
    3838bool ClientApplicationManager::RegisterApplication(BaseClientApplication* pClientApplication) { 
    3939        if (MAP_HAS1(_applicationsById, pClientApplication->GetId())) { 
    40                 FATAL("Client application with id %d already registered", 
     40                FATAL("Client application with id %u already registered", 
    4141                                pClientApplication->GetId()); 
    4242                return false; 
     
    8888        } 
    8989 
    90         FINEST("Application `%s` (%d) unregistered", STR(pClientApplication->GetName()), 
     90        FINEST("Application `%s` (%u) unregistered", STR(pClientApplication->GetName()), 
    9191                        pClientApplication->GetId()); 
    9292} 
  • trunk/sources/thelib/src/configuration/configfile.cpp

    r410 r413  
    190190 
    191191        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", 
    193193                                STR(name), minLength, maxLength); 
    194194                return false; 
     
    241241                uint32_t minLength, uint32_t maxLength) { 
    242242        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", 
    244244                                STR(name), 
    245245                                notNull, minLength, maxLength); 
     
    265265 
    266266        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", 
    268268                                node.MapSize(), minLength, maxLength); 
    269269                return false; 
     
    658658                //5. Create the carrier and bind it 
    659659                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", 
    661661                                        STR(node[CONF_IP]), (uint16_t) node[CONF_PORT]); 
    662662                        pProtocol->EnqueueForDelete(); 
  • trunk/sources/thelib/src/mediaformats/basemediadocument.cpp

    r410 r413  
    8181        GETCLOCKS(endTime); 
    8282 
    83         INFO("%d frames computed in %.2f seconds at a speed of %.2f FPS", 
     83        INFO("%zu frames computed in %.2f seconds at a speed of %.2f FPS", 
    8484                        _frames.size(), 
    8585                        (endTime - startTime) / (double) CLOCKS_PER_SECOND, 
     
    9090                uint32_t minutes = (totalSeconds - hours * 3600) / 60; 
    9191                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", 
    9393                                _mediaFile.Size(), 
    9494                                hours, minutes, seconds, 
     
    148148                MediaFrame frame = _frames[i]; 
    149149                if (maxFrameSize < frame.length) { 
    150                         WARN("maxFrameSize bumped up: %llu -> %llu", maxFrameSize, frame.length); 
     150                        WARN("maxFrameSize bumped up: %"PRIu64" -> %"PRIu64, maxFrameSize, frame.length); 
    151151                        maxFrameSize = frame.length; 
    152152                } 
  • trunk/sources/thelib/src/mediaformats/flv/flvdocument.cpp

    r410 r413  
    5656 
    5757        //4. Build the frames 
    58         MediaFrame frame = {0}; 
     58        MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 
    5959        uint8_t tagType = 0; 
    6060        uint32_t timestamp; 
     
    8282                                break; 
    8383                        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()); 
    8585                                mustBreak = true; 
    8686                                break; 
  • trunk/sources/thelib/src/mediaformats/mp3/id3parser.cpp

    r410 r413  
    7878                default: 
    7979                { 
    80                         WARN("Invalid version: ID3v%d.%d", _majorVersion, _minorVersion); 
     80                        WARN("Invalid version: ID3v%u.%u", _majorVersion, _minorVersion); 
    8181                        return false; 
    8282                } 
     
    9898        //After that we go back to where we left (end of the header, offset 10) 
    9999        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); 
    101101                return false; 
    102102        } 
     
    123123        IOBuffer buffer; 
    124124        if (!buffer.ReadFromFs(file, totalSize)) { 
    125                 WARN("Unable to read %d bytes", totalSize); 
     125                WARN("Unable to read %u bytes", totalSize); 
    126126                return false; 
    127127        } 
     
    136136#define CHECK_BUFFER_SIZE(x,y) \ 
    137137if (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)); \ 
    140140    return false; \ 
    141141}  
     
    158158                                return true; 
    159159                        } else { 
    160                                 WARN("Invalid tag name: %d %d %d %d", 
     160                                WARN("Invalid tag name: %hhu %hhu %hhu %hhu", 
    161161                                                name[0], name[1], name[2], name[3]); 
    162162                                return false; 
  • trunk/sources/thelib/src/mediaformats/mp3/mp3document.cpp

    r410 r413  
    147147 
    148148        double totalDuration = 0; 
    149         MediaFrame frame = {0}; 
     149        MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 
    150150        frame.type = MEDIAFRAME_TYPE_AUDIO; 
    151151        frame.isKeyFrame = true; 
     
    174174                                        [sampleRateIndex][paddingBit]; 
    175175                        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, 
    177177                                                version, layer, bitRateIndex, sampleRateIndex, 
    178178                                                paddingBit, _mediaFile.Cursor()); 
     
    192192                        //7. Seek to the next frame 
    193193                        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); 
    195195                                break; 
    196196                        } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomavcc.cpp

    r410 r413  
    114114 
    115115        for (uint8_t i = 0; i < _picCount; i++) { 
    116                 AVCCParameter parameter = {0}; 
     116                AVCCParameter parameter = {0, 0}; 
    117117 
    118118                if (!ReadUInt16(parameter.size)) { 
  • trunk/sources/thelib/src/mediaformats/mp4/atomdata.cpp

    r410 r413  
    6969                default: 
    7070                { 
    71                         FATAL("Type %d not yet implemented", _type); 
     71                        FATAL("Type %u not yet implemented", _type); 
    7272                        return false; 
    7373                } 
     
    137137                default: 
    138138                { 
    139                         FATAL("Type %d not yet implemented", _type); 
     139                        FATAL("Type %u not yet implemented", _type); 
    140140                        return false; 
    141141                } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomesds.cpp

    r410 r413  
    7878        if (!ReadTagLength(length)) 
    7979                return false; 
    80         FINEST_ESDS_ATOM("tagType: %d; length: %x; currentPos: %llx", 
    81                         tagType, length, CurrentPosition()); 
    8280        return true; 
    8381} 
     
    8785        uint32_t length = 0; 
    8886 
    89         FINEST_ESDS_ATOM("Position: %llx", CurrentPosition()); 
    9087        if (!ReadTagAndLength(tagType, length)) { 
    9188                FATAL("Unable to read tag type and length"); 
     
    9895                        return false; 
    9996                } 
    100                 FINEST_ESDS_ATOM("_MP4ESDescrTag_ID: %u", _MP4ESDescrTag_ID); 
    10197 
    10298                if (!ReadUInt8(_MP4ESDescrTag_Priority)) { 
     
    104100                        return false; 
    105101                } 
    106                 FINEST_ESDS_ATOM("_MP4ESDescrTag_Priority: %u", _MP4ESDescrTag_Priority); 
    107102        } else { 
    108103                if (!ReadUInt16(_MP4ESDescrTag_ID)) { 
     
    110105                        return false; 
    111106                } 
    112                 FINEST_ESDS_ATOM("_MP4ESDescrTag_ID: %u", _MP4ESDescrTag_ID); 
    113107        } 
    114108 
    115         FINEST_ESDS_ATOM("Position: %llx", CurrentPosition()); 
    116109        if (!ReadTagAndLength(tagType, length)) { 
    117110                FATAL("Unable to read tag type and length"); 
     
    124117                        return false; 
    125118                } 
    126                 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_ObjectTypeID: %u", 
    127                                 _MP4DecConfigDescrTag_ObjectTypeID); 
    128119 
    129120                if (!ReadUInt8(_MP4DecConfigDescrTag_StreamType)) { 
     
    131122                        return false; 
    132123                } 
    133                 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_StreamType: %u", 
    134                                 _MP4DecConfigDescrTag_StreamType); 
    135124 
    136125                if (!ReadUInt24(_MP4DecConfigDescrTag_BufferSizeDB)) { 
     
    138127                        return false; 
    139128                } 
    140                 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_BufferSizeDB: %u", 
    141                                 _MP4DecConfigDescrTag_BufferSizeDB); 
    142129 
    143130                if (!ReadUInt32(_MP4DecConfigDescrTag_MaxBitRate)) { 
     
    145132                        return false; 
    146133                } 
    147                 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_MaxBitRate: %u", 
    148                                 _MP4DecConfigDescrTag_MaxBitRate); 
    149134 
    150135                if (!ReadUInt32(_MP4DecConfigDescrTag_AvgBitRate)) { 
     
    152137                        return false; 
    153138                } 
    154                 FINEST_ESDS_ATOM("_MP4DecConfigDescrTag_AvgBitRate: %u", 
    155                                 _MP4DecConfigDescrTag_AvgBitRate); 
    156139 
    157                 FINEST_ESDS_ATOM("Position: %llx", CurrentPosition()); 
    158140                if (!ReadTagAndLength(tagType, length)) { 
    159141                        FATAL("Unable to read tag type and length"); 
     
    167149                                return false; 
    168150                        } 
    169                         FINEST_ESDS_ATOM("unknownValue: %u", unknownValue); 
    170  
    171                         FINEST_ESDS_ATOM("Position: %llx", CurrentPosition()); 
     151                         
    172152                        if (!ReadTagAndLength(tagType, length)) { 
    173153                                FATAL("Unable to read tag type and length"); 
     
    181161                        _extraDataStart = CurrentPosition(); 
    182162                        _extraDataLength = length; 
    183 #ifdef DEBUG_ESDS_ATOM 
    184                         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  
    241163                        return SkipRead(false); 
    242164                } 
  • trunk/sources/thelib/src/mediaformats/mp4/baseatom.cpp

    r410 r413  
    6161 
    6262BaseAtom::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)", 
    6464                        _start, _start, _size, _size, GetTypeNumeric(), STR(GetTypeString())); 
    6565} 
     
    8484bool BaseAtom::SkipRead(bool issueWarn) { 
    8585        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")", 
    8787                        STR(GetTypeString()), _start, _start, _size, _size); 
    8888        return _pDoc->GetMediaFile().SeekTo(_start + _size); 
     
    9595bool BaseAtom::CheckBounds(uint64_t size) { 
    9696        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, 
    9898                                CurrentPosition(), size, _start, _size); 
    9999                return false; 
  • trunk/sources/thelib/src/mediaformats/mp4/boxatom.cpp

    r410 r413  
    4141                if (!pAtom->IsIgnored()) { 
    4242                        if (!AtomCreated(pAtom)) { 
    43                                 FATAL("Unable to signal AtomCreated for atom %s (%x)", 
     43                                FATAL("Unable to signal AtomCreated for atom %s (%"PRIx64")", 
    4444                                                STR(GetTypeString()), _start); 
    4545                                return false; 
  • trunk/sources/thelib/src/mediaformats/mp4/mp4document.cpp

    r410 r413  
    261261 
    262262        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, 
    264264                                currentPos, pAtom->GetSize(), _mediaFile.Cursor()); 
    265265                return NULL; 
     
    348348 
    349349        //add binary audio header 
    350         MediaFrame audioHeader = {0}; 
     350        MediaFrame audioHeader = {0, 0, 0, 0, 0, 0, 0, 0}; 
    351351        if (pESDS != NULL) { 
    352352                audioHeader.type = MEDIAFRAME_TYPE_AUDIO; 
     
    358358                audioHeader.deltaTime = 0; 
    359359                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); 
    362363        } 
    363364 
    364365        //add binary video header 
    365         MediaFrame videoHeader = {0}; 
     366        MediaFrame videoHeader = {0, 0, 0, 0, 0, 0, 0, 0}; 
    366367        if (pAVCC != NULL) { 
    367368                videoHeader.type = MEDIAFRAME_TYPE_VIDEO; 
     
    471472                compositionOffsets = pCTSS->GetEntries(); 
    472473                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", 
    474475                                        compositionOffsets.size(), 
    475476                                        sampleSize.size()); 
    476477                        for (uint32_t i = compositionOffsets.size(); i < sampleSize.size(); i++) 
    477478                                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", 
    479480                                        compositionOffsets.size()); 
    480481                } 
    481482        } 
    482         INFO("audio: %d; keyFrames: %u; frames: %u; compositionOffsets: %u", 
     483        INFO("audio: %hhu; keyFrames: %zu; frames: %zu; compositionOffsets: %zu", 
    483484                        audio, keyFrames.size(), sampleSize.size(), compositionOffsets.size()); 
    484          
     485 
    485486        uint32_t timeScale = pMDHD->GetTimeScale(); 
    486487        uint32_t totalTime = 0; 
     
    489490 
    490491        for (uint32_t i = 0; i < sampleSize.size(); i++) { 
    491                 MediaFrame frame = {0}; 
     492                MediaFrame frame = {0, 0, 0, 0, 0, 0, 0, 0}; 
    492493                frame.start = chunckOffsets[sample2Chunk[i]] + localOffset; 
    493494                if (pCTSS != NULL) { 
  • trunk/sources/thelib/src/mediaformats/nsv/mp3media.cpp

    r410 r413  
    180180 
    181181                if (mediaFrame.length == 0) { 
    182                         FATAL("Invalid frame length: %d:%d:%d:%d:%d;", 
     182                        FATAL("Invalid frame length: %hhu:%hhu:%hhu:%hhu:%hhu;", 
    183183                                        version, layer, bitRateIndex, sampleRateIndex, 
    184184                                        paddingBit); //, _mediaFile.Cursor()); 
    185185                        return false; 
    186186                } 
    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                  */ 
    192187 
    193188                //6. Compute the frame duration and save the frame start 
  • trunk/sources/thelib/src/mediaformats/nsv/nsvdocument.cpp

    r410 r413  
    106106        } 
    107107 
    108         FINEST("audcount: %d vidcount: %d ", _audioSamplesCount, _videoSamplesCount); 
    109  
    110108        return true; 
    111109} 
     
    196194 
    197195        if (aux_plus_vidlen > 0) { 
    198                 MediaFrame video_frame = {0}; 
     196                MediaFrame video_frame = {0, 0, 0, 0, 0, 0, 0, 0}; 
    199197                video_frame.type = MEDIAFRAME_TYPE_VIDEO; 
    200198                if (aux_plus_vidlen > 5) { 
     
    209207                        if (NALU_TYPE_SEI == NALU_TYPE(nt)) { 
    210208                                // get binary header from payload data 
    211                                 FINEST("video data offset %llx", _mediaFile.Cursor()); 
     209                                FINEST("video data offset %"PRIx64, _mediaFile.Cursor()); 
    212210                                uint64_t currentCursor = _mediaFile.Cursor(); 
    213211                                _buffer.IgnoreAll(); 
     
    306304        } 
    307305 
    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}; 
    315307        audio_frame.start = _mediaFile.Cursor(); 
    316308        _buffer.IgnoreAll(); 
     
    336328        int nal_end = 0; 
    337329        uint8_t nal_type = 0; 
    338         MediaFrame video_frame = {0}; 
     330        MediaFrame video_frame = {0, 0, 0, 0, 0, 0, 0, 0}; 
    339331        while (length != 0) { 
    340332                find_nal_unit(pBuffer, length, &nal_start, &nal_end); 
  • trunk/sources/thelib/src/netio/epoll/inboundnamedpipecarrier.cpp

    r193 r413  
    3737        if (mkfifo(STR(path), mode) != 0) { 
    3838                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); 
    4141                return NULL; 
    4242        } 
     
    9090                return false; 
    9191        } else { 
    92                 ASSERT("Invalid state: %04x", event.events); 
     92                ASSERT("Invalid state: %x", event.events); 
    9393 
    9494                return false; 
  • trunk/sources/thelib/src/netio/epoll/iohandler.cpp

    r188 r413  
    9191                        return "IOHT_INBOUNDNAMEDPIPE_CARRIER"; 
    9292                default: 
    93                         return format("#unknown: %d#", type); 
     93                        return format("#unknown: %hhu#", type); 
    9494        } 
    9595} 
  • trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp

    r410 r413  
    3131vector<IOHandlerManagerToken *> *IOHandlerManager::_pRecycledTokens; 
    3232TimersManager *IOHandlerManager::_pTimersManager = NULL; 
    33 struct epoll_event IOHandlerManager::_dummy = {0}; 
     33struct epoll_event IOHandlerManager::_dummy = {0, 
     34        {0}}; 
    3435 
    3536map<uint32_t, IOHandler *> & IOHandlerManager::GetActiveHandlers() { 
     
    4950        _pRecycledTokens = &_tokensVector2; 
    5051        _pTimersManager = new TimersManager(ProcessTimer); 
     52        memset(&_dummy, 0, sizeof (_dummy)); 
    5153} 
    5254 
     
    9193        } 
    9294        SetupToken(pIOHandler); 
    93         uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     95        size_t before = _activeIOHandlers.size(); 
    9496        _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, 
    9698                        STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    9799} 
     
    100102        if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 
    101103                FreeToken(pIOHandler); 
    102                 uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     104                size_t before = _activeIOHandlers.size(); 
    103105                _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, 
    105107                                STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    106108        } 
     
    108110 
    109111bool IOHandlerManager::EnableReadData(IOHandler *pIOHandler) { 
    110         struct epoll_event evt = {0}; 
     112        struct epoll_event evt = {0, 
     113                {0}}; 
    111114        evt.events = EPOLLIN; 
    112115        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    120123 
    121124bool IOHandlerManager::DisableReadData(IOHandler *pIOHandler, bool ignoreError) { 
    122         struct epoll_event evt = {0}; 
     125        struct epoll_event evt = {0, 
     126                {0}}; 
    123127        evt.events = EPOLLIN; 
    124128        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    134138 
    135139bool IOHandlerManager::EnableWriteData(IOHandler *pIOHandler) { 
    136         struct epoll_event evt = {0}; 
     140        struct epoll_event evt = {0, 
     141                {0}}; 
    137142        evt.events = EPOLLIN | EPOLLOUT; 
    138143        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    155160 
    156161bool IOHandlerManager::DisableWriteData(IOHandler *pIOHandler, bool ignoreError) { 
    157         struct epoll_event evt = {0}; 
     162        struct epoll_event evt = {0, 
     163                {0}}; 
    158164        evt.events = EPOLLIN; 
    159165        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    169175 
    170176bool IOHandlerManager::EnableAcceptConnections(IOHandler *pIOHandler) { 
    171         struct epoll_event evt = {0}; 
     177        struct epoll_event evt = {0, 
     178                {0}}; 
    172179        evt.events = EPOLLIN; 
    173180        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    181188 
    182189bool IOHandlerManager::DisableAcceptConnections(IOHandler *pIOHandler, bool ignoreError) { 
    183         struct epoll_event evt = {0}; 
     190        struct epoll_event evt = {0, 
     191                {0}}; 
    184192        evt.events = EPOLLIN; 
    185193        evt.data.ptr = pIOHandler->GetIOHandlerManagerToken(); 
     
    195203 
    196204bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 
    197         TimerEvent event = {0}; 
     205        TimerEvent event = {0, 0, 0}; 
    198206        event.id = pIOHandler->GetId(); 
    199207        event.period = seconds; 
  • trunk/sources/thelib/src/netio/epoll/tcpacceptor.cpp

    r410 r413  
    7070        if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 
    7171                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)", 
    7373                                inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 
    7474                                ENTOHS(((sockaddr_in *) & _address)->sin_port), 
     
    120120                CLOSE_SOCKET(fd); 
    121121                _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", 
    123123                                inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    124124                                ENTOHS(((sockaddr_in *) & address)->sin_port), 
     
    127127                return true; 
    128128        } 
    129         INFO("Client connected: %s:%d -> %s:%d", 
     129        INFO("Client connected: %s:%hu -> %s:%hu", 
    130130                        inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    131131                        ENTOHS(((sockaddr_in *) & address)->sin_port), 
  • trunk/sources/thelib/src/netio/epoll/tcpcarrier.cpp

    r410 r413  
    7474                assert(pInputBuffer != NULL); 
    7575                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", 
    7777                                        STR(_farIp), _farPort, 
    7878                                        STR(_nearIp), _nearPort); 
     
    9797                if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    9898                        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", 
    100100                                                STR(_farIp), _farPort, 
    101101                                                STR(_nearIp), _nearPort); 
  • trunk/sources/thelib/src/netio/epoll/udpcarrier.cpp

    r410 r413  
    136136 
    137137        //3. bind if necessary 
    138         sockaddr_in bindAddress = {0}; 
     138        sockaddr_in bindAddress; 
     139        memset(&bindAddress, 0, sizeof (bindAddress)); 
    139140        if (bindIp != "") { 
    140141                bindAddress.sin_family = PF_INET; 
     
    142143                bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 
    143144                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); 
    145146                        close(sock); 
    146147                        return NULL; 
     
    148149                if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 
    149150                        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)", 
    151152                                        STR(bindIp), bindPort, strerror(error), error); 
    152153                        close(sock); 
  • trunk/sources/thelib/src/netio/kqueue/inboundnamedpipecarrier.cpp

    r193 r413  
    3737        if (mkfifo(STR(path), mode) != 0) { 
    3838                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); 
    4141                return NULL; 
    4242        } 
     
    8888                default: 
    8989                { 
    90                         ASSERT("Invalid state: %d", event.filter); 
    91  
     90                        ASSERT("Invalid state: %hu", event.filter); 
    9291                        return false; 
    9392                } 
  • trunk/sources/thelib/src/netio/kqueue/iohandler.cpp

    r410 r413  
    9393                        return "IOHT_STDIO"; 
    9494                default: 
    95                         return format("#unknown: %d#", type); 
     95                        return format("#unknown: %hhu#", type); 
    9696        } 
    9797} 
  • trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp

    r410 r413  
    142142                ASSERT("IOHandler already registered"); 
    143143        } 
    144         uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     144        size_t before = _activeIOHandlers.size(); 
    145145        _activeIOHandlers[pIOHandler->GetId()] = pIOHandler; 
    146146        SetupToken(pIOHandler); 
    147         DEBUG("Handlers count changed: %d->%d %s", before, before + 1, 
     147        DEBUG("Handlers count changed: %zu->%zu %s", before, before + 1, 
    148148                        STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    149149} 
     
    152152        if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 
    153153                FreeToken(pIOHandler); 
    154                 uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     154                size_t before = _activeIOHandlers.size(); 
    155155                _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, 
    157157                                STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    158158        } 
     
    201201                        seconds*KQUEUE_TIMER_MULTIPLIER, pIOHandler->GetIOHandlerManagerToken()); 
    202202#else 
    203         TimerEvent event = {0}; 
     203        TimerEvent event = {0, 0, 0}; 
    204204        event.id = pIOHandler->GetId(); 
    205205        event.period = seconds; 
  • trunk/sources/thelib/src/netio/kqueue/iotimer.cpp

    r410 r413  
    5454                default: 
    5555                { 
    56                         ASSERT("Invalid state: %d", event.filter); 
     56                        ASSERT("Invalid state: %hu", event.filter); 
    5757 
    5858                        return false; 
  • trunk/sources/thelib/src/netio/kqueue/stdiocarrier.cpp

    r410 r413  
    110110                default: 
    111111                { 
    112                         ASSERT("Invalid state: %d", event.filter); 
     112                        ASSERT("Invalid state: %hu", event.filter); 
    113113 
    114114                        return false; 
  • trunk/sources/thelib/src/netio/kqueue/tcpacceptor.cpp

    r410 r413  
    6767        if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 
    6868                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)", 
    7070                                inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 
    7171                                ENTOHS(((sockaddr_in *) & _address)->sin_port), 
     
    114114                CLOSE_SOCKET(fd); 
    115115                _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", 
    117117                                inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    118118                                ENTOHS(((sockaddr_in *) & address)->sin_port), 
     
    121121                return true; 
    122122        } 
    123         INFO("Client connected: %s:%d -> %s:%d", 
     123        INFO("Client connected: %s:%hu -> %s:%hu", 
    124124                        inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    125125                        ENTOHS(((sockaddr_in *) & address)->sin_port), 
  • trunk/sources/thelib/src/netio/kqueue/tcpcarrier.cpp

    r410 r413  
    7474                        assert(pInputBuffer != NULL); 
    7575                        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", 
    7777                                                STR(_farIp), _farPort, 
    7878                                                STR(_nearIp), _nearPort); 
     
    8888                        if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    8989                                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", 
    9191                                                        STR(_farIp), _farPort, 
    9292                                                        STR(_nearIp), _nearPort); 
     
    105105                default: 
    106106                { 
    107                         ASSERT("Invalid state: %d", event.filter); 
    108  
     107                        ASSERT("Invalid state: %hd", event.filter); 
    109108                        return false; 
    110109                } 
  • trunk/sources/thelib/src/netio/kqueue/udpcarrier.cpp

    r410 r413  
    6262                default: 
    6363                { 
    64                         ASSERT("Invalid state: %d", event.filter); 
     64                        ASSERT("Invalid state: %hu", event.filter); 
    6565                        return false; 
    6666                } 
     
    131131 
    132132        //3. bind if necessary 
    133         sockaddr_in bindAddress = {0}; 
     133        sockaddr_in bindAddress; 
     134        memset(&bindAddress, 0, sizeof (bindAddress)); 
    134135        if (bindIp != "") { 
    135136                bindAddress.sin_family = PF_INET; 
     
    137138                bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 
    138139                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); 
    140141                        close(sock); 
    141142                        return NULL; 
     
    143144                if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 
    144145                        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)", 
    146147                                        STR(bindIp), bindPort, strerror(error), error); 
    147148                        close(sock); 
  • trunk/sources/thelib/src/netio/select/inboundnamedpipecarrier.cpp

    r275 r413  
    3636InboundNamedPipeCarrier *InboundNamedPipeCarrier::Create(string path, 
    3737                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  
    4538        int32_t fd = open(STR(path), O_RDONLY/* | O_NONBLOCK*/); 
    4639        if (fd < 0) { 
     
    9083                default: 
    9184                { 
    92                         ASSERT("Invalid state: %d", event.type); 
     85                        ASSERT("Invalid state: %hhu", event.type); 
    9386                        return false; 
    9487                } 
  • trunk/sources/thelib/src/netio/select/iohandler.cpp

    r410 r413  
    8484                        return "IOHT_STDIO"; 
    8585                default: 
    86                         return format("#unknown: %d#", type); 
     86                        return format("#unknown: %hhu#", type); 
    8787        } 
    8888} 
  • trunk/sources/thelib/src/netio/select/iohandlermanager.cpp

    r410 r413  
    7979                ASSERT("IOHandler already registered"); 
    8080        } 
    81         uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     81        size_t before = _activeIOHandlers.size(); 
    8282        _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, 
    8484                        STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    8585} 
     
    9191        DisableTimer(pIOHandler); 
    9292        if (MAP_HAS1(_activeIOHandlers, pIOHandler->GetId())) { 
    93                 uint32_t before = (uint32_t) _activeIOHandlers.size(); 
     93                size_t before = _activeIOHandlers.size(); 
    9494                _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, 
    9696                                STR(IOHandler::IOHTToString(pIOHandler->GetType()))); 
    9797        } 
     
    129129 
    130130bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 
    131         TimerEvent event = {0}; 
     131        TimerEvent event = {0, 0, 0}; 
    132132        event.id = pIOHandler->GetId(); 
    133133        event.period = seconds; 
     
    180180        int32_t count = select(MAP_KEY(--_fdState.end()) + 1, &_readFdsCopy, &_writeFdsCopy, NULL, &_timeout); 
    181181        if (count < 0) { 
    182                 FATAL("Unable to do select: %d", LASTSOCKETERROR); 
     182                FATAL("Unable to do select: %u", (uint32_t) LASTSOCKETERROR); 
    183183                return false; 
    184184        } 
  • trunk/sources/thelib/src/netio/select/stdiocarrier.cpp

    r410 r413  
    111111                default: 
    112112                { 
    113                         ASSERT("Invalid state: %d", event.type); 
     113                        ASSERT("Invalid state: %hhu", event.type); 
    114114                        return false; 
    115115                } 
  • trunk/sources/thelib/src/netio/select/tcpacceptor.cpp

    r410 r413  
    6868        if (bind(_inboundFd, (sockaddr *) & _address, sizeof (sockaddr)) != 0) { 
    6969                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)", 
    7171                                inet_ntoa(((sockaddr_in *) & _address)->sin_addr), 
    7272                                ENTOHS(((sockaddr_in *) & _address)->sin_port), 
     
    115115                CLOSE_SOCKET(fd); 
    116116                _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", 
    118118                                inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    119119                                ENTOHS(((sockaddr_in *) & address)->sin_port), 
     
    122122                return true; 
    123123        } 
    124         INFO("Client connected: %s:%d -> %s:%d", 
     124        INFO("Client connected: %s:%hu -> %s:%hu", 
    125125                        inet_ntoa(((sockaddr_in *) & address)->sin_addr), 
    126126                        ENTOHS(((sockaddr_in *) & address)->sin_port), 
  • trunk/sources/thelib/src/netio/select/tcpcarrier.cpp

    r410 r413  
    8484                        if (!pInputBuffer->ReadFromTCPFd(_inboundFd, 
    8585                                        _recvBufferSize, readAmount)) { 
    86                                 FATAL("Unable to read data. %s:%d -> %s:%d", 
     86                                FATAL("Unable to read data. %s:%hu -> %s:%hu", 
    8787                                                STR(_farIp), _farPort, 
    8888                                                STR(_nearIp), _nearPort); 
     
    9999                                if (!pOutputBuffer->WriteToTCPFd(_outboundFd, 
    100100                                                _sendBufferSize, writeAmount)) { 
    101                                         FATAL("Unable to send data. %s:%d -> %s:%d", 
     101                                        FATAL("Unable to send data. %s:%hu -> %s:%hu", 
    102102                                                        STR(_farIp), _farPort, 
    103103                                                        STR(_nearIp), _nearPort); 
     
    118118                default: 
    119119                { 
    120                         ASSERT("Invalid state: %d", event.type); 
     120                        ASSERT("Invalid state: %hhu", event.type); 
    121121                        return false; 
    122122                } 
  • trunk/sources/thelib/src/netio/select/udpcarrier.cpp

    r410 r413  
    6262                default: 
    6363                { 
    64                         ASSERT("Invalid state: %d", event.type); 
     64                        ASSERT("Invalid state: %hhu", event.type); 
    6565                        return false; 
    6666                } 
     
    132132 
    133133        //3. bind if necessary 
    134         sockaddr_in bindAddress = {0}; 
     134        sockaddr_in bindAddress; 
     135        memset(&bindAddress, 0, sizeof (bindAddress)); 
    135136        if (bindIp != "") { 
    136137                bindAddress.sin_family = PF_INET; 
     
    138139                bindAddress.sin_port = EHTONS(bindPort); //----MARKED-SHORT---- 
    139140                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); 
    141142                        CLOSE_SOCKET(sock); 
    142143                        return NULL; 
     
    144145                if (bind(sock, (sockaddr *) & bindAddress, sizeof (sockaddr)) != 0) { 
    145146                        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)", 
    147148                                        STR(bindIp), bindPort, strerror(error), error); 
    148149                        CLOSE_SOCKET(sock); 
  • trunk/sources/thelib/src/protocols/baseprotocol.cpp

    r410 r413  
    4040        _pApplication = NULL; 
    4141#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", 
    4343                        _id, STR(tagToString(_type)), 
    4444                        _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); 
     
    5252BaseProtocol::~BaseProtocol() { 
    5353#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", 
    5555                        _id, STR(tagToString(_type)), 
    5656                        _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); 
     
    7474        } 
    7575#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", 
    7777                        _id, STR(tagToString(_type)), 
    7878                        _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); 
     
    112112                pProtocol->SetNearProtocol(this); 
    113113#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", 
    115115                                _id, STR(tagToString(_type)), 
    116116                                _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); 
     
    149149                pProtocol->SetFarProtocol(this); 
    150150#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", 
    152152                                _id, STR(tagToString(_type)), 
    153153                                _pFarProtocol, _pNearProtocol, _deleteFar, _deleteNear); 
     
    263263                                break; 
    264264                        default: 
    265                                 result = format("#unknown %d#(%d,%d) <-> ", 
     265                                result = format("#unknown %hhu#(%d,%d) <-> ", 
    266266                                                GetIOHandler()->GetType(), 
    267267                                                GetIOHandler()->GetInboundFd(), 
     
    409409        string result = ""; 
    410410        if (_id == currentId) 
    411                 result = format("[%s(%d)]", STR(tagToString(_type)), _id); 
     411                result = format("[%s(%u)]", STR(tagToString(_type)), _id); 
    412412        else 
    413                 result = format("%s(%d)", STR(tagToString(_type)), _id); 
     413                result = format("%s(%u)", STR(tagToString(_type)), _id); 
    414414        return result; 
    415415} 
  • trunk/sources/thelib/src/protocols/dns/inbounddnsresolverprotocol.cpp

    r410 r413  
    3737        if (type == PT_TCP) 
    3838                return true; 
    39         FATAL("Far protocol %d not accepted", type); 
    4039        return false; 
    4140} 
     
    7574                } 
    7675                if (!buffer.Ignore(4 + size)) { 
    77                         FATAL("Unable to ignore %d bytes", 4 + size); 
     76                        FATAL("Unable to ignore %u bytes", 4 + size); 
    7877                        return false; 
    7978                } 
  • trunk/sources/thelib/src/protocols/dns/outbounddnsresolverprotocol.cpp

    r410 r413  
    4949        if (!TCPConnector<OutboundDNSResolverProtocol>::Connect(ip, port, chain, 
    5050                        customParameters)) { 
    51                 FATAL("Unable to connect to %s:%d", STR(ip), port); 
     51                FATAL("Unable to connect to %s:%hu", STR(ip), port); 
    5252                return false; 
    5353        } 
     
    123123        if (type == PT_TCP) 
    124124                return true; 
    125         FATAL("Far protocol %d not accepted", type); 
    126125        return false; 
    127126} 
     
    161160                } 
    162161                if (!buffer.Ignore(4 + size)) { 
    163                         FATAL("Unable to ignore %d bytes", 4 + size); 
     162                        FATAL("Unable to ignore %u bytes", 4 + size); 
    164163                        return false; 
    165164                } 
  • trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp

    r410 r413  
    101101        _outboundHeaders.RemoveKey(HTTP_HEADERS_CONTENT_LENGTH); 
    102102        if (bufferLength > 0) { 
    103                 _outboundHeaders[HTTP_HEADERS_CONTENT_LENGTH] = format("%d", bufferLength); 
     103                _outboundHeaders[HTTP_HEADERS_CONTENT_LENGTH] = format("%u", bufferLength); 
    104104        } 
    105105 
     
    230230 
    231231        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()); 
    239239        result += format("_headers:\n%s\n", STR(_headers.ToString())); 
    240240        result += format("_outputBuffer:\n%s\n", STR(_outputBuffer)); 
     
    331331                if (lowercase(_headers[HTTP_HEADERS].GetValue(HTTP_HEADERS_TRANSFER_ENCODING, false)) != 
    332332                                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, 
    334335                                        HTTP_HEADERS_TRANSFER_ENCODING_CHUNKED); 
    335336                        return false; 
     
    388389                chunkSize = strtol(STR(chunkSizeString), NULL, 16); 
    389390                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); 
    392393                        return false; 
    393394                } 
  • trunk/sources/thelib/src/protocols/http/inboundhttpprotocol.cpp

    r410 r413  
    123123                        return "HTTP/1.1 401 Unauthorized"; 
    124124                default: 
    125                         return format("HTTP/1.1 %d Unknwon", _statusCode); 
     125                        return format("HTTP/1.1 %hu Unknwon", _statusCode); 
    126126        } 
    127127} 
  • trunk/sources/thelib/src/protocols/liveflv/baseliveflvappprotocolhandler.cpp

    r56 r413  
    3535void BaseLiveFLVAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 
    3636        if (MAP_HAS1(_protocols, pProtocol->GetId())) { 
    37                 ASSERT("Protocol ID %d already registered", pProtocol->GetId()); 
     37                ASSERT("Protocol ID %u already registered", pProtocol->GetId()); 
    3838                return; 
    3939        } 
     
    4848void BaseLiveFLVAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 
    4949        if (!MAP_HAS1(_protocols, pProtocol->GetId())) { 
    50                 ASSERT("Protocol ID %d not registered", pProtocol->GetId()); 
     50                ASSERT("Protocol ID %u not registered", pProtocol->GetId()); 
    5151                return; 
    5252        } 
  • trunk/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp

    r410 r413  
    4949        else 
    5050                _waitForMetadata = false; 
    51         FINEST("_waitForMetadata: %d", _waitForMetadata); 
     51        FINEST("_waitForMetadata: %hhu", _waitForMetadata); 
    5252        return true; 
    5353} 
     
    100100                length = ENTOHLP((GETIBPOINTER(buffer) + 1)) >> 8; //----MARKED-LONG--- 
    101101                if (length >= 1024 * 1024) { 
    102                         FATAL("Frame too large: %d", length); 
     102                        FATAL("Frame too large: %u", length); 
    103103                        return false; 
    104104                } 
     
    196196                        default: 
    197197                        { 
    198                                 FATAL("Invalid frame type: %d", type); 
     198                                FATAL("Invalid frame type: %hhu", type); 
    199199                                return false; 
    200200                        } 
     
    216216                        if (GetIOHandler()->GetType() == IOHT_TCP_CARRIER) { 
    217217                                //this is a tcp carrier 
    218                                 streamName = format("%s_%d", 
     218                                streamName = format("%s_%hu", 
    219219                                                STR(((TCPCarrier *) GetIOHandler())->GetFarEndpointAddressIp()), 
    220220                                                ((TCPCarrier *) GetIOHandler())->GetFarEndpointPort()); 
    221221                        } else { 
    222222                                //this is not a TCP carrier 
    223                                 streamName = format("flv_%d", GetId()); 
     223                                streamName = format("flv_%u", GetId()); 
    224224                        } 
    225225                } else { 
    226226                        //we don't have a carrier. This protocl might be artificially fed 
    227                         streamName = format("flv_%d", GetId()); 
     227                        streamName = format("flv_%u", GetId()); 
    228228                } 
    229229        } 
     
    237237                        GetApplication()->GetStreamsManager()->GetWaitingSubscribers( 
    238238                        streamName, _pStream->GetType()); 
    239         FINEST("subscribedOutStreams count: %d", subscribedOutStreams.size()); 
     239        FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 
    240240 
    241241 
  • trunk/sources/thelib/src/protocols/liveflv/innetliveflvstream.cpp

    r314 r413  
    100100                                GETAVAILABLEBYTESCOUNT(_videoCodecInit), 
    101101                                _lastVideoTime, false)) { 
    102                         FINEST("Unable to feed OS: %d", pOutStream->GetUniqueId()); 
     102                        FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 
    103103                        pOutStream->EnqueueForDelete(); 
    104104                } 
     
    110110                                GETAVAILABLEBYTESCOUNT(_audioCodecInit), 
    111111                                _lastAudioTime, true)) { 
    112                         FINEST("Unable to feed OS: %d", pOutStream->GetUniqueId()); 
     112                        FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 
    113113                        pOutStream->EnqueueForDelete(); 
    114114                } 
     
    201201                return false; 
    202202        } 
    203         FINEST("Cached the AAC audio codec initialization: %d", 
     203        FINEST("Cached the AAC audio codec initialization: %u", 
    204204                        GETAVAILABLEBYTESCOUNT(_audioCodecInit)); 
    205205        return true; 
     
    222222        } 
    223223 
    224         FINEST("Cached the h264 video codec initialization: %d", 
     224        FINEST("Cached the h264 video codec initialization: %u", 
    225225                        GETAVAILABLEBYTESCOUNT(_videoCodecInit)); 
    226226 
  • trunk/sources/thelib/src/protocols/protocolfactorymanager.cpp

    r410 r413  
    3333        //1. Test to see if this factory is already registered 
    3434        if (MAP_HAS1(_factoriesById, pFactory->GetId())) { 
    35                 FATAL("Factory id %d already registered", pFactory->GetId()); 
     35                FATAL("Factory id %u already registered", pFactory->GetId()); 
    3636                return false; 
    3737        } 
     
    4242        FOR_VECTOR(protocolChains, i) { 
    4343                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", 
    4545                                        STR(protocolChains[i]), 
    4646                                        _factoriesByChainName[protocolChains[i]]->GetId()); 
     
    5454        FOR_VECTOR(protocols, i) { 
    5555                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], 
    5757                                        _factoriesByProtocolId[protocols[i]]->GetId()); 
    5858                        return false; 
     
    7777bool ProtocolFactoryManager::UnRegisterProtocolFactory(uint32_t factoryId) { 
    7878        if (!MAP_HAS1(_factoriesById, factoryId)) { 
    79                 WARN("Factory id not found: %d", factoryId); 
     79                WARN("Factory id not found: %u", factoryId); 
    8080                return true; 
    8181        } 
     
    9090 
    9191        if (!MAP_HAS1(_factoriesById, pFactory->GetId())) { 
    92                 WARN("Factory id not found: %d", pFactory->GetId()); 
     92                WARN("Factory id not found: %u", pFactory->GetId()); 
    9393                return true; 
    9494        } 
     
    138138        FOR_VECTOR(chain, i) { 
    139139                if (!MAP_HAS1(_factoriesByProtocolId, chain[i])) { 
    140                         FATAL("protocol %08x not handled by anyone", chain[i]); 
     140                        FATAL("protocol %"PRIx64" not handled by anyone", chain[i]); 
    141141                        return NULL; 
    142142                } 
     
    151151                                chain[i], parameters); 
    152152                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", 
    154154                                        STR(tagToString(chain[i])), 
    155155                                        _factoriesByProtocolId[chain[i]]->GetId()); 
  • trunk/sources/thelib/src/protocols/rtmfp/basertmfpprotocol.cpp

    r410 r413  
    8383        if (sessionId == 0) { 
    8484                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", 
    8686                                        inet_ntoa(pPeerAddress->sin_addr), 
    8787                                        ENTOHS(pPeerAddress->sin_port)); 
    8888                        pSession = _initSessions[pPeerAddress->sin_addr.s_addr][pPeerAddress->sin_port]; 
    8989                } else { 
    90                         WARN("Brand new session: %s:%d", 
     90                        WARN("Brand new session: %s:%hu", 
    9191                                        inet_ntoa(pPeerAddress->sin_addr), 
    9292                                        ENTOHS(pPeerAddress->sin_port)); 
     
    9696        } else { 
    9797                if (MAP_HAS1(_sessions, sessionId)) { 
    98                         WARN("Active session: %08x - %s:%d", 
     98                        WARN("Active session: %08x - %s:%hu", 
    9999                                        sessionId, 
    100100                                        inet_ntoa(pPeerAddress->sin_addr), 
     
    102102                        pSession = _sessions[sessionId]; 
    103103                } else { 
    104                         WARN("Bogus session: %08x - %s:%d", 
     104                        WARN("Bogus session: %08x - %s:%hu", 
    105105                                        sessionId, 
    106106                                        inet_ntoa(pPeerAddress->sin_addr), 
     
    245245        bool t = (type & 0x02) != 0; 
    246246        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", 
    248248                        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", 
    258258                        type, E, S, r1, r2, I, R, t, T); 
    259259 
     
    285285                uint8_t chunkType, 
    286286                uint16_t chunkLength) { 
    287         FINEST("type: %02x; timestamp: %04x; chunkType: %02x; chunkLength: %04x", 
     287        FINEST("type: %hhx; timestamp: %hx; chunkType: %hhx; chunkLength: %hx", 
    288288                        type, timestamp, chunkType, chunkLength); 
    289289        switch (type) { 
     
    292292                        break; 
    293293                default: 
    294                         FATAL("Invalid message type: %02x", type); 
     294                        FATAL("Invalid message type: %hhx", type); 
    295295                        break; 
    296296        } 
     
    311311                        break; 
    312312                default: 
    313                         FATAL("Invalid chunk type: %02x", chunkType); 
     313                        FATAL("Invalid chunk type: %hhx", chunkType); 
    314314                        break; 
    315315        } 
     
    325325#define __CHECK_SIZE(size) \ 
    326326if(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)); \ 
    328328        return; \ 
    329329} \ 
     
    336336        string __tempString__; \ 
    337337        for(uint32_t i=0;i<(size);i++) { \ 
    338                 __tempString__+=format("%02x",(value)[i]); \ 
     338                __tempString__+=format("%02hhx",(value)[i]); \ 
    339339        } \ 
    340         FINEST(#value"[%d]: %s",(size), STR(__tempString__)); \ 
     340        FINEST(#value"[%u]: %s",(uint32_t)(size), STR(__tempString__)); \ 
    341341} 
    342342 
     
    345345value=string((char *)GETIBPOINTER(buffer),(size)); \ 
    346346buffer.Ignore((size)); \ 
    347 FINEST(#value"[%d]: `%s`",(size),STR(value)); 
     347FINEST(#value"[%u]: `%s`",(uint32_t)(size),STR(value)); 
    348348 
    349349void BaseRTMFPProtocol::ProcessSessionMessage_0b_30( 
     
    497497        string temp = ""; 
    498498        for (uint32_t i = 0; i < 32; i++) { 
    499                 temp += format("%02x", pSession->client.id[i]); 
     499                temp += format("%02hhx", pSession->client.id[i]); 
    500500        } 
    501501        FINEST("farId: %s", STR(temp)); 
     
    505505        temp = ""; 
    506506        for (uint32_t i = 0; i < 32; i++) { 
    507                 temp += format("%02x", pSession->server.id[i]); 
     507                temp += format("%02hhx", pSession->server.id[i]); 
    508508        } 
    509509        FINEST("nearId: %s", STR(temp)); 
  • trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp

    r410 r413  
    7070                AMF_CHECK_BOUNDARIES(buffer, 1); 
    7171                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", 
    7373                                        AMF0_SHORT_STRING, GETIBPOINTER(buffer)[0]); 
    7474                        return false; 
     
    9090        variant = string((char *) (GETIBPOINTER(buffer)), length); 
    9191        if (!buffer.Ignore(length)) { 
    92                 FATAL("Unable to ignore %d bytes", length); 
     92                FATAL("Unable to ignore %hu bytes", length); 
    9393                return false; 
    9494        } 
     
    112112                AMF_CHECK_BOUNDARIES(buffer, 1); 
    113113                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", 
    115115                                        AMF0_LONG_STRING, GETIBPOINTER(buffer)[0]); 
    116116                        return false; 
     
    133133        variant = string((char *) (GETIBPOINTER(buffer)), length); 
    134134        if (!buffer.Ignore(length)) { 
    135                 FATAL("Unable to ignore %d bytes", length); 
     135                FATAL("Unable to ignore %u bytes", length); 
    136136                return false; 
    137137        } 
     
    156156                AMF_CHECK_BOUNDARIES(buffer, 1); 
    157157                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", 
    159159                                        AMF0_NUMBER, GETIBPOINTER(buffer)[0]); 
    160160                        return false; 
     
    195195                AMF_CHECK_BOUNDARIES(buffer, 1); 
    196196                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", 
    198198                                        AMF0_OBJECT, GETIBPOINTER(buffer)[0]); 
    199199                        return false; 
     
    289289                AMF_CHECK_BOUNDARIES(buffer, 1); 
    290290                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", 
    292292                                        AMF0_MIXED_ARRAY, GETIBPOINTER(buffer)[0]); 
    293293                        return false; 
     
    403403                AMF_CHECK_BOUNDARIES(buffer, 1); 
    404404                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", 
    406406                                        AMF0_ARRAY, GETIBPOINTER(buffer)[0]); 
    407407                        return false; 
     
    445445                AMF_CHECK_BOUNDARIES(buffer, 1); 
    446446                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", 
    448448                                        AMF0_AMF3_OBJECT, GETIBPOINTER(buffer)[0]); 
    449449                        return false; 
     
    481481                AMF_CHECK_BOUNDARIES(buffer, 1); 
    482482                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", 
    484484                                        AMF0_BOOLEAN, GETIBPOINTER(buffer)[0]); 
    485485                        return false; 
     
    519519                AMF_CHECK_BOUNDARIES(buffer, 1); 
    520520                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", 
    522522                                        AMF0_TIMESTAMP, GETIBPOINTER(buffer)[0]); 
    523523                        return false; 
     
    564564        AMF_CHECK_BOUNDARIES(buffer, 1); 
    565565        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", 
    567567                                AMF0_NULL, GETIBPOINTER(buffer)[0]); 
    568568                return false; 
     
    587587        AMF_CHECK_BOUNDARIES(buffer, 1); 
    588588        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", 
    590590                                AMF0_UNDEFINED, GETIBPOINTER(buffer)[0]); 
    591591                return false; 
     
    723723                default: 
    724724                { 
    725                         FATAL("Unable to deserialize type %d; Buffer: %s", 
     725                        FATAL("Unable to de-serialize type %hhu; Buffer: %s", 
    726726                                        GETIBPOINTER(buffer)[0], STR(buffer)); 
    727727                        return false; 
  • trunk/sources/thelib/src/protocols/rtmp/amf3serializer.cpp

    r410 r413  
    2727    AMF_CHECK_BOUNDARIES(buffer, 1); \ 
    2828    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]); \ 
    3131        return false; \ 
    3232    } \ 
     
    107107                default: 
    108108                { 
    109                         FATAL("Unable to deserialize type %d; Buffer is:\n%s", 
     109                        FATAL("Unable to deserialize type %hhu; Buffer is:\n%s", 
    110110                                        GETIBPOINTER(buffer)[0], STR(buffer)); 
    111111                        return false; 
     
    165165                default: 
    166166                { 
    167                         FATAL("Unable to serialize type %d; variant is:\n%s", 
     167                        FATAL("Unable to serialize type %hhu; variant is:\n%s", 
    168168                                        (VariantType) variant, STR(variant.ToString())); 
    169169                        return false; 
     
    280280                        string result = string((char *) GETIBPOINTER(buffer), length); 
    281281                        if (!buffer.Ignore(length)) { 
    282                                 FATAL("Unable to ignore %d bytes", length); 
     282                                FATAL("Unable to ignore %u bytes", length); 
    283283                                return false; 
    284284                        } 
     
    374374 
    375375        if ((temp & 0x01) == 0) { 
    376                 WARN("Array reference: %d", temp >> 1); 
     376                WARN("Array reference: %u", temp >> 1); 
    377377                variant = _objects[temp >> 1]; 
    378378                return true; 
     
    419419 
    420420        uint32_t denseSize = v.MapDenseSize(); 
    421         FINEST("denseSize: %d", denseSize); 
    422421 
    423422        for (uint32_t i = 0; i < denseSize; i++) { 
     
    463462        READ_AMF3_TYPE(AMF3_OBJECT); 
    464463 
    465         uint32_t objectStart = buffer._consumed; 
    466464        uint32_t temp; 
    467465        if (!ReadU29(buffer, temp)) { 
     
    482480 
    483481 
    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         else 
    492                 info += format("TC: %d; Dynamic: %d", traitsCount, isDynamic); 
    493         WARN("%s", STR(info)); 
    494  
    495482        if (objectReference) { 
    496                 WARN("Object reference: %d", objectReferenceIndex); 
    497483                variant = _objects[objectReferenceIndex]; 
    498484                return true; 
     
    521507 
    522508        uint32_t objectIndex = _objects.size(); 
    523         WARN("Begin reading object %d", objectIndex); 
    524509        Variant tempVariant = Variant(); 
    525510        ADD_VECTOR_END(_objects, tempVariant); 
     
    528513 
    529514        if (traitsReference) { 
    530                 FATAL("Traits reference: %d", traitsReferenceIndex); 
    531515                traits = _traits[traitsReferenceIndex]; 
    532516                FINEST("Traits:\n%s", STR(traits.ToString())); 
    533517        } else { 
    534518                uint32_t traitsIndex = _traits.size(); 
    535                 INFO("Begin reading traits names %d", traitsIndex); 
    536519 
    537520                tempVariant = Variant(); 
     
    556539 
    557540                _traits[traitsIndex] = traits; 
    558  
    559                 INFO("End reading traits names %d", traitsIndex); 
    560541        } 
    561542 
     
    581562                readDynamicPoperties = isDynamic; 
    582563        } 
    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); 
    595564 
    596565        if (readDynamicPoperties) { 
     
    613582 
    614583        _objects[objectIndex] = variant; 
    615         WARN("End reading object %d", objectIndex); 
    616  
    617584        return true; 
    618585} 
     
    681648                        string result = string((char *) GETIBPOINTER(buffer), length); 
    682649                        if (!buffer.Ignore(length)) { 
    683                                 FATAL("Unable to ignore %d bytes", length); 
     650                                FATAL("Unable to ignore %u bytes", length); 
    684651                                return false; 
    685652                        } 
     
    758725        } 
    759726 
    760         FATAL("Invalid range: %08x", value); 
    761727        return false; 
    762728} 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp

    r410 r413  
    443443        } 
    444444        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(), 
    446447                                (uint32_t) VH_SI(request), 
    447448                                STR(request.ToString())); 
     
    484485        } 
    485486        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(), 
    487489                                (uint32_t) VH_SI(request)); 
    488490                return true; 
     
    644646                                InNetRTMPStream *pTempStream = (InNetRTMPStream *) MAP_VAL(i); 
    645647                                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", 
    647649                                                        pTempStream->GetRTMPStreamId(), 
    648650                                                        pTempStream->GetUniqueId(), 
     
    668670                        GetApplication()->GetStreamsManager()->GetWaitingSubscribers( 
    669671                        streamName, pInNetRTMPStream->GetType()); 
    670         FINEST("subscribedOutStreams count: %d", subscribedOutStreams.size()); 
     672        FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 
    671673 
    672674 
     
    743745        //2. Close any streams left open 
    744746        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(), 
    746749                                (uint32_t) VH_SI(request)); 
    747750                return false; 
     
    10931096                Variant & result) { 
    10941097        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", 
    10961099                                pFrom->GetId(), STR(result.ToString())); 
    10971100 
     
    15371540                } 
    15381541        } 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), 
    15401544                                STR(usersFile)); 
    15411545                return ""; 
     
    18521856                        STR(uri.scheme), 
    18531857                        STR(uri.host), 
    1854                         STR(uri.port == 1935 ? "" : format(":%d", uri.port)), 
     1858                        STR(uri.port == 1935 ? "" : format(":%hu", uri.port)), 
    18551859                        STR(appName)); 
    18561860 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp

    r410 r413  
    117117                        || type == PT_INBOUND_HTTP_FOR_RTMP) 
    118118                return true; 
    119         FATAL("Far protocol %d not accepted", type); 
    120119        return false; 
    121120} 
     
    254253 
    255254bool 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, 
    257256                        _inboundChunkSize, chunkSize); 
    258257        _inboundChunkSize = chunkSize; 
     
    283282BaseStream * BaseRTMPProtocol::GetRTMPStream(uint32_t rtmpStreamId) { 
    284283        if (rtmpStreamId == 0 || rtmpStreamId >= MAX_STREAMS_COUNT) { 
    285                 FATAL("Invalid stream id: %d", rtmpStreamId); 
     284                FATAL("Invalid stream id: %u", rtmpStreamId); 
    286285                return false; 
    287286        } 
     
    292291        //1. Validate request 
    293292        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    294                 FATAL("Invalid stream id: %d", streamId); 
     293                FATAL("Invalid stream id: %u", streamId); 
    295294                return false; 
    296295        } 
     
    353352        } else { 
    354353                if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    355                         FATAL("Invalid stream id: %d", streamId); 
     354                        FATAL("Invalid stream id: %u", streamId); 
    356355                        return NULL; 
    357356                } 
     
    372371                uint32_t streamId, string streamName) { 
    373372        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    374                 FATAL("Invalid stream id: %d", streamId); 
     373                FATAL("Invalid stream id: %u", streamId); 
    375374                return NULL; 
    376375        } 
     
    401400                string streamName, uint64_t inStreamType) { 
    402401        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    403                 FATAL("Invalid stream id: %d", streamId); 
     402                FATAL("Invalid stream id: %u", streamId); 
    404403                return NULL; 
    405404        } 
     
    411410 
    412411        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, 
    414413                                streamId, _streams[streamId]->GetType()); 
    415414                return NULL; 
     
    504503                default: 
    505504                { 
    506                         WARN("Invalid scheme number: %d. Defaulting to 0", schemeNumber); 
     505                        WARN("Invalid scheme number: %hhu. Defaulting to 0", schemeNumber); 
    507506                        return GetDHOffset0(pBuffer); 
    508507                } 
     
    522521                default: 
    523522                { 
    524                         WARN("Invalid scheme number: %d. Defaulting to 0", schemeNumber); 
     523                        WARN("Invalid scheme number: %hhu. Defaulting to 0", schemeNumber); 
    525524                        return GetDigestOffset0(pBuffer); 
    526525                } 
     
    682681                                                } 
    683682                                                if (!buffer.Ignore(tempSize)) { 
    684                                                         FATAL("V: Unable to ignore %d bytes", tempSize); 
     683                                                        FATAL("V: Unable to ignore %u bytes", tempSize); 
    685684                                                        return false; 
    686685                                                } 
     
    722721                                                } 
    723722                                                if (!buffer.Ignore(tempSize)) { 
    724                                                         FATAL("A: Unable to ignore %d bytes", tempSize); 
     723                                                        FATAL("A: Unable to ignore %u bytes", tempSize); 
    725724                                                        return false; 
    726725                                                } 
     
    738737                                                channel.lastInProcBytes += tempSize; 
    739738                                                if (!buffer.Ignore(tempSize)) { 
    740                                                         FATAL("Unable to ignore %d bytes", tempSize); 
     739                                                        FATAL("Unable to ignore %u bytes", tempSize); 
    741740                                                        return false; 
    742741                                                } 
     
    754753 
    755754                                                        if (GETAVAILABLEBYTESCOUNT(channel.inputData) != 0) { 
    756                                                                 FATAL("Invalid message!!! We have leftovers: %d bytes", 
     755                                                                FATAL("Invalid message!!! We have leftovers: %u bytes", 
    757756                                                                                GETAVAILABLEBYTESCOUNT(channel.inputData)); 
    758757                                                                return false; 
  • trunk/sources/thelib/src/protocols/rtmp/header_be_ba.cpp

    r410 r413  
    132132                default: 
    133133                { 
    134                         FATAL("Invalid header type: %d", ht); 
     134                        FATAL("Invalid header type: %hhu", ht); 
    135135                        return false; 
    136136                } 
     
    311311                default: 
    312312                { 
    313                         FATAL("Invalid header size: %d", ht); 
     313                        FATAL("Invalid header size: %hhu", ht); 
    314314                        return false; 
    315315                } 
     
    318318 
    319319Header::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"; 
    322323} 
    323324 
  • trunk/sources/thelib/src/protocols/rtmp/header_le_ba.cpp

    r410 r413  
    124124                default: 
    125125                { 
    126                         FATAL("Invalid header type: %d", ht); 
     126                        FATAL("Invalid header type: %hhu", ht); 
    127127                        return false; 
    128128                } 
     
    299299                default: 
    300300                { 
    301                         FATAL("Invalid header size: %d", ht); 
     301                        FATAL("Invalid header size: %hhu", ht); 
    302302                        return false; 
    303303                } 
     
    306306 
    307307Header::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"; 
    310311} 
    311312 
  • trunk/sources/thelib/src/protocols/rtmp/header_le_sa.cpp

    r410 r413  
    124124                default: 
    125125                { 
    126                         FATAL("Invalid header type: %d", ht); 
     126                        FATAL("Invalid header type: %hhu", ht); 
    127127                        return false; 
    128128                } 
     
    299299                default: 
    300300                { 
    301                         FATAL("Invalid header size: %d", ht); 
     301                        FATAL("Invalid header size: %hhu", ht); 
    302302                        return false; 
    303303                } 
     
    306306 
    307307Header::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"; 
    310311} 
    311312 
  • trunk/sources/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp

    r410 r413  
    178178 
    179179        //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); 
    181181        _generatedSids[sid] = sid; 
    182182        _outputBuffer.ReadFromString(sid + "\n"); 
  • trunk/sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp

    r410 r413  
    7575                                default: 
    7676                                { 
    77                                         FATAL("Handshake type not implemented: %d", handshakeType); 
     77                                        FATAL("Handshake type not implemented: %hhu", handshakeType); 
    7878                                        return false; 
    7979                                } 
     
    113113                default: 
    114114                { 
    115                         FATAL("Invalid RTMP state: %d", _rtmpState); 
     115                        FATAL("Invalid RTMP state: %hhu", _rtmpState); 
    116116                        return false; 
    117117                } 
  • trunk/sources/thelib/src/protocols/rtmp/outboundrtmpprotocol.cpp

    r410 r413  
    123123                default: 
    124124                { 
    125                         FATAL("Invalid RTMP state: %d", _rtmpState); 
     125                        FATAL("Invalid RTMP state: %hhu", _rtmpState); 
    126126                        return false; 
    127127                } 
     
    141141        if (!TCPConnector<OutboundRTMPProtocol>::Connect(ip, port, chain, 
    142142                        customParameters)) { 
    143                 FATAL("Unable to connect to %s:%d", STR(ip), port); 
     143                FATAL("Unable to connect to %s:%hu", STR(ip), port); 
    144144                return false; 
    145145        } 
     
    205205 
    206206        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); 
    208208 
    209209        DEBUG_HANDSHAKE("PHS1:  7. Generate the DH public/private key"); 
     
    214214        } 
    215215 
    216         DEBUG_HANDSHAKE("PHS1:  8. Get the public key and store it in the buffer at %d and _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); 
    217217        if (!_pDHWrapper->CopyPublicKey(_pOutputBuffer + clientDHOffset, 128)) { 
    218218                FATAL("Couldn't write public key!"); 
     
    224224 
    225225        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); 
    227227 
    228228        DEBUG_HANDSHAKE("PHS1: 10. Generate the digest from pBuffer EXCLUDING the digest portion."); 
     
    236236        HMACsha256(pTempBuffer, 1536 - 32, genuineFPKey, 30, pTempHash); 
    237237 
    238         DEBUG_HANDSHAKE("PHS1: 12. put the bytes at %d offset. 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); 
    239239        memcpy(_pOutputBuffer + clientDigestOffset, pTempHash, 32); 
    240240        _pClientDigest = new uint8_t[32]; 
     
    272272 
    273273        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); 
    275275 
    276276        DEBUG_HANDSHAKE("VS:  2. Prepare the buffer"); 
     
    336336 
    337337        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); 
    339339 
    340340        DEBUG_HANDSHAKE("PHS2:  2. compute the secret key"); 
  • trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp

    r410 r413  
    5252                        return "RM_USRCTRL_TYPE_UNKNOWN2"; 
    5353                default: 
    54                         return format("#unknownUCT(%d)", type); 
     54                        return format("#unknownUCT(%hu)", type); 
    5555        } 
    5656} 
     
    8181                        return "SOT_SC_INITIAL_DATA"; 
    8282                default: 
    83                         return format("#unknownSOP(%d)", type); 
     83                        return format("#unknownSOP(%hhu)", type); 
    8484        } 
    8585} 
     
    142142                default: 
    143143                { 
    144                         FATAL("Invalid message type: %d %s", H_MT(header), STR(buffer)); 
     144                        FATAL("Invalid message type: %u %s", H_MT(header), STR(buffer)); 
    145145                        return false; 
    146146                } 
     
    265265        FOR_MAP(message[RM_INVOKE_PARAMS], string, Variant, i) { 
    266266                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)), 
    268269                                        STR(message.ToString())); 
    269270                        return false; 
     
    278279        FOR_MAP(message[RM_NOTIFY_PARAMS], string, Variant, i) { 
    279280                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)), 
    281283                                        STR(message.ToString())); 
    282284                        return false; 
     
    291293        FOR_MAP(message[RM_FLEXSTREAMSEND_PARAMS], string, Variant, i) { 
    292294                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)), 
    294297                                        STR(message.ToString())); 
    295298                        return false; 
     
    301304bool RTMPProtocolSerializer::SerializeAck(IOBuffer &buffer, uint32_t value) { 
    302305        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); 
    304307                return false; 
    305308        } 
     
    343346bool RTMPProtocolSerializer::SerializeChunkSize(IOBuffer &buffer, uint32_t value) { 
    344347        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); 
    346349                return false; 
    347350        } 
     
    351354bool RTMPProtocolSerializer::SerializeWinAckSize(IOBuffer &buffer, uint32_t value) { 
    352355        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); 
    354357                return false; 
    355358        } 
     
    359362bool RTMPProtocolSerializer::SerializeAbortMessage(IOBuffer &buffer, uint32_t value) { 
    360363        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); 
    362365                return false; 
    363366        } 
     
    367370bool RTMPProtocolSerializer::SerializeClientBW(IOBuffer &buffer, Variant value) { 
    368371        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", 
    370373                                (uint32_t) value[RM_PEERBW_VALUE]); 
    371374                return false; 
    372375        } 
    373376        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", 
    375378                                (uint8_t) value[RM_PEERBW_TYPE]); 
    376379                return false; 
     
    500503        for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 
    501504                if (!_amf0.Read(buffer, message[RM_NOTIFY_PARAMS][i])) { 
    502                         FATAL("Unable to deserialize invoke parameter %d", i); 
     505                        FATAL("Unable to de-serialize invoke parameter %u", i); 
    503506                        return false; 
    504507                } 
     
    522525        for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 
    523526                if (!_amf0.Read(buffer, message[RM_FLEXSTREAMSEND_PARAMS][i])) { 
    524                         FATAL("Unable to deserialize invoke parameter %d", i); 
     527                        FATAL("Unable to de-serialize invoke parameter %u", i); 
    525528                        return false; 
    526529                } 
     
    550553        for (uint32_t i = 0; GETAVAILABLEBYTESCOUNT(buffer) > 0; i++) { 
    551554                if (!_amf0.Read(buffer, message[RM_INVOKE_PARAMS][i])) { 
    552                         FATAL("Unable to deserialize invoke parameter %d", i); 
     555                        FATAL("Unable to de-serialize invoke parameter %u", i); 
    553556                        return false; 
    554557                } 
     
    669672                Variant &message) { 
    670673        if (GETIBPOINTER(buffer)[0] != 0) { 
    671                 FATAL("Encoding %d not supported yet", GETIBPOINTER(buffer)[0]); 
     674                FATAL("Encoding %hhu not supported yet", GETIBPOINTER(buffer)[0]); 
    672675                return false; 
    673676        } 
  • trunk/sources/thelib/src/protocols/rtmp/sharedobjects/so.cpp

    r410 r413  
    6666 
    6767        //1. Clear 
    68         di.propertyName = format("SOT_SC_CLEAR_DATA_%d", protocolId); 
     68        di.propertyName = format("SOT_SC_CLEAR_DATA_%u", protocolId); 
    6969        di.type = SOT_SC_CLEAR_DATA; 
    7070        ADD_VECTOR_END(_dirtyPropsByProtocol[protocolId], di); 
     
    7272 
    7373        //2. Initial 
    74         di.propertyName = format("SOT_SC_INITIAL_DATA_%d", protocolId); 
     74        di.propertyName = format("SOT_SC_INITIAL_DATA_%u", protocolId); 
    7575        di.type = SOT_SC_INITIAL_DATA; 
    7676        ADD_VECTOR_END(_dirtyPropsByProtocol[protocolId], di); 
     
    118118 
    119119string 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); 
    121121 
    122122        FOR_MAP(_dirtyPropsByProtocol, uint32_t, Dirtyness, i) { 
    123123                uint32_t protocolId = MAP_KEY(i); 
    124124                Dirtyness dirtyness = MAP_VAL(i); 
    125                 result += format("Protocol: %d\n", protocolId); 
     125                result += format("Protocol: %u\n", protocolId); 
    126126 
    127127                FOR_VECTOR_ITERATOR(DirtyInfo, dirtyness, j) { 
    128128                        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), 
    130130                                        di.type); 
    131131                } 
     
    162162                                        break; 
    163163                                default: 
    164                                         ASSERT("Unable to handle primitive type: %d", type); 
     164                                        ASSERT("Unable to handle primitive type: %hhu", type); 
    165165                        } 
    166166                        ADD_VECTOR_END(primitives, primitive); 
  • trunk/sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp

    r410 r413  
    8585        for (uint32_t i = 0; i < M_SO_PRIMITIVES(request).MapSize(); i++) { 
    8686                if (!ProcessSharedObjectPrimitive(pFrom, pSO, name, request, i)) { 
    87                         FATAL("Unable to process primitive %d from\n%s", i, 
     87                        FATAL("Unable to process primitive %u from\n%s", i, 
    8888                                        STR(request.ToString())); 
    8989                        return false; 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp

    r410 r413  
    6060        _maxBufferSize = 65536 * 2; 
    6161        _attachedStreamType = 0; 
    62         _clientId = format("%d_%d_%d", _pProtocol->GetId(), _rtmpStreamId, this); 
     62        _clientId = format("%d_%d_%zu", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); 
    6363 
    6464        _paused = false; 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpflvstream.cpp

    r250 r413  
    3838        //1. Seek into the data file at the correct position 
    3939        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); 
    4141                return false; 
    4242        } 
     
    4444        //2. Read the data 
    4545        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); 
    4747                return false; 
    4848        } 
     
    5555        //1. Seek into the data file at the correct position 
    5656        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); 
    5858                return false; 
    5959        } 
     
    6262        _metadataBuffer.IgnoreAll(); 
    6363        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); 
    6565                return false; 
    6666        } 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp3stream.cpp

    r250 r413  
    3535        //1. Seek into the data file at the correct position 
    3636        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); 
    3838                return false; 
    3939        } 
     
    4444        //3. Read the data 
    4545        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); 
    4747                return false; 
    4848        } 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp4stream.cpp

    r410 r413  
    7878        //2. Seek into the data file at the correct position 
    7979        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); 
    8181                return false; 
    8282        } 
     
    8484        //3. Read the data 
    8585        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); 
    8787                return false; 
    8888        } 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpnsvstream.cpp

    r399 r413  
    6464 
    6565        if (mediaFrame.type == MEDIAFRAME_TYPE_AUDIO) { 
    66                 //FINEST("--- AUDIO DATA"); 
    67  
    6866                // MP3 Audio 
    6967                buffer.ReadFromRepeat(0x2f, 1); 
     
    7169                //1. Seek into the data file at the correct position 
    7270                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); 
    7472                        return false; 
    7573                } 
     
    7775                //3. Read the data 
    7876                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); 
    8078                        return false; 
    8179                } 
     
    8381        } else { 
    8482                if (mediaFrame.isBinaryHeader) { 
    85                         //FINEST("--- VIDEO EXTRA DATA"); 
    86  
    8783                        if (!BuildFrameHeaders(pFile, mediaFrame, buffer)) { 
    8884                                FATAL("Unable to build frame header..."); 
    8985                                return false; 
    9086                        } 
    91                         //FINEST("sizeof spspps:%d", sizeof (_pSPSPPS)); 
    92                         //FINEST("frame Headers:\n%s", STR(buffer)); 
    9387                } else { 
    9488                        if (mediaFrame.isKeyFrame) { 
    9589                                // video key frame 
    96                                 //FINEST("--- VIDEO KEY FRAME"); 
    9790                                buffer.ReadFromBuffer(_videoCodecHeaderKeyFrame, sizeof (_videoCodecHeaderKeyFrame)); 
    9891                        } else { 
    9992                                //video normal frame 
    100                                 //            string str = format("%02x %02x %02x %02x %02x", 
    101                                 //                    GETIBPOINTER(buffer)[0], 
    102                                 // 
    103                                 //FINEST("--- VIDEO NORMAL FRAME"); 
    10493                                buffer.ReadFromBuffer(_videoCodecHeader, sizeof (_videoCodecHeader)); 
    10594                        } 
     
    10897                        //composition timestamp is always 0 for NSV 
    10998                        buffer.ReadFromRepeat(0, 3); 
    110                         //FINEST("length : %08x", mediaFrame.length); 
    11199                        // need help here... 
    112100                        buffer.ReadFromRepeat(0, 4); 
     
    115103                        mediaFrame.length=frameLength; 
    116104 
    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                         //            else 
    127                         //                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  
    135105                        //1. Seek into the data file at the correct position 
    136106                        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); 
    138108                                return false; 
    139109                        } 
     
    141111                        //3. Read the data 
    142112                        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); 
    144114                                return false; 
    145115                        } 
     
    164134        //1. Seek into the data file at the correct position 
    165135        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); 
    167137                return false; 
    168138        } 
     
    170140        IOBuffer pbuf; 
    171141        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); 
    173143                return false; 
    174144        } 
    175         //FINEST("video data offset %x", mediaFrame.start); 
    176         //FINEST("data len %d", mediaFrame.length); 
    177         //FINEST(" buffer: \n%s", STR(pbuf)); 
    178145 
    179146        uint8_t *pData = GETIBPOINTER(pbuf); 
     
    183150        } 
    184151        uint32_t dataLength = (uint32_t)mediaFrame.length; 
    185         //FINEST("%02x - %s", (uint8_t) NALU_TYPE(pData[0]), STR(NALUToString((uint8_t) pData[0]))); 
    186152 
    187153        switch (NALU_TYPE(pData[0])) { 
    188154                case NALU_TYPE_SPS: 
    189155                { 
    190                         //FINEST("WE GOT SPS"); 
    191156                        //1. Prepare the SPS part from video codec 
    192                         //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart); 
    193157                        if (dataLength > 128) { 
    194158                                FATAL("SPS too big"); 
     
    201165                        _spsAvailable = true; 
    202166                        _SPSPPSLength = _PPSStart; 
    203                         //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart); 
    204167 
    205168                        return true; 
     
    208171                case NALU_TYPE_PPS: 
    209172                { 
    210                         //FINEST("WE GOT PPS"); 
    211173                        //2. Prepare the PPS part from video codec 
    212174                        if (dataLength > 128) { 
     
    218180                                return true; 
    219181                        } 
    220                         //FINEST("spspps length: %d ppsstrt:%d", _SPSPPSLength, _PPSStart); 
    221182                        _pSPSPPS[_PPSStart] = 1; 
    222183                        EHTONSP(_pSPSPPS + _PPSStart + 1, (uint16_t) dataLength); 
     
    225186                        _spsAvailable = false; 
    226187 
    227                         //FINEST("spspps length: %d", _SPSPPSLength); 
    228188                        buffer.ReadFromBuffer(_pSPSPPS, _SPSPPSLength); //sizeof (_pSPSPPS)); 
    229189 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp

    r361 r413  
    3434        _chunkSize = chunkSize; 
    3535        _channelId = channelId; 
    36         _clientId = format("%d_%d_%d", _pProtocol->GetId(), _rtmpStreamId, this); 
     36        _clientId = format("%d_%d_%z", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); 
    3737        _lastVideoTime = 0; 
    3838        _lastAudioTime = 0; 
     
    192192                                GETAVAILABLEBYTESCOUNT(_videoCodecInit), 
    193193                                _lastAudioTime, false)) { 
    194                         FINEST("Unable to feed OS: %d", pOutStream->GetUniqueId()); 
     194                        FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 
    195195                        pOutStream->EnqueueForDelete(); 
    196196                } 
     
    202202                                GETAVAILABLEBYTESCOUNT(_audioCodecInit), 
    203203                                _lastAudioTime, true)) { 
    204                         FINEST("Unable to feed OS: %d", pOutStream->GetUniqueId()); 
     204                        FINEST("Unable to feed OS: %u", pOutStream->GetUniqueId()); 
    205205                        pOutStream->EnqueueForDelete(); 
    206206                } 
     
    306306                return false; 
    307307        } 
    308         FINEST("Cached the AAC audio codec initialization: %d", 
     308        FINEST("Cached the AAC audio codec initialization: %u", 
    309309                        GETAVAILABLEBYTESCOUNT(_audioCodecInit)); 
    310310        return true; 
     
    327327        } 
    328328 
    329         FINEST("Cached the h264 video codec initialization: %d", 
     329        FINEST("Cached the h264 video codec initialization: %u", 
    330330                        GETAVAILABLEBYTESCOUNT(_videoCodecInit)); 
    331331 
  • trunk/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp

    r410 r413  
    102102                        uri.port, 
    103103                        chain, customParameters)) { 
    104                 FATAL("Unable to connect to %s:%d", 
     104                FATAL("Unable to connect to %s:%hu", 
    105105                                STR(customParameters["uri"]["ip"]), 
    106106                                (uint16_t) customParameters["uri"]["port"]); 
     
    348348 
    349349                        dataPortNumber = atoi(STR(ports[0])); 
    350                         if (format("%u", dataPortNumber) != ports[0]) { 
     350                        if (format("%hu", dataPortNumber) != ports[0]) { 
    351351                                WARN("Invalid client_port transport part: %s", STR(parts[i])); 
    352352                                continue; 
    353353                        } 
    354354                        rtcpPortNumber = atoi(STR(ports[1])); 
    355                         if (format("%u", rtcpPortNumber) != ports[1]) { 
     355                        if (format("%hu", rtcpPortNumber) != ports[1]) { 
    356356                                WARN("Invalid client_port transport part: %s", STR(parts[i])); 
    357357                                continue; 
     
    680680        string streamName = pFrom->GetCustomParameters()["sdpStreamName"]; 
    681681        if (streamName == "") { 
    682                 streamName = format("rtsp_stream_%d", pFrom->GetId()); 
     682                streamName = format("rtsp_stream_%u", pFrom->GetId()); 
    683683        } 
    684684 
     
    740740                                responseHeaders, responseContent); 
    741741        } else { 
    742                 FATAL("Response for method not implemented yet", STR(method)); 
    743  
     742                FATAL("Response for method %s not implemented yet", STR(method)); 
    744743                return false; 
    745744        } 
     
    757756                                responseHeaders, responseContent); 
    758757        } else { 
    759                 FATAL("Response for method not implemented yet", STR(method)); 
    760  
     758                FATAL("Response for method %s not implemented yet", STR(method)); 
    761759                return false; 
    762760        } 
     
    927925                        pFrom->GetCustomParameters()["streamId"]); 
    928926        if (pInNetStream == NULL) { 
    929                 FATAL("Inbound stream %d not found", 
     927                FATAL("Inbound stream %u not found", 
    930928                                (uint32_t) pFrom->GetCustomParameters()["streamId"]); 
    931929                return NULL; 
     
    978976string BaseRTSPAppProtocolHandler::GetAudioTrack(RTSPProtocol *pFrom, 
    979977                StreamCapabilities *pCapabilities) { 
    980         pFrom->GetCustomParameters()["audioTrackId"] = md5(format("A%d%s", 
     978        pFrom->GetCustomParameters()["audioTrackId"] = md5(format("A%u%s", 
    981979                        pFrom->GetId(), STR(generateRandomString(4))), true); 
    982980        string result = ""; 
     
    984982                result += "m=audio 0 RTP/AVP 96\r\n"; 
    985983                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", 
    987985                                pCapabilities->aac._sampleRate); 
    988986                FINEST("result: %s", STR(result)); 
     
    1000998string BaseRTSPAppProtocolHandler::GetVideoTrack(RTSPProtocol *pFrom, 
    1001999                StreamCapabilities *pCapabilities) { 
    1002         pFrom->GetCustomParameters()["videoTrackId"] = md5(format("V%d%s", 
     1000        pFrom->GetCustomParameters()["videoTrackId"] = md5(format("V%u%s", 
    10031001                        pFrom->GetId(), STR(generateRandomString(4))), true); 
    10041002        string result = ""; 
     
    10101008                result += "a=rtpmap:97 H264/90000\r\n"; 
    10111009                result += "a=fmtp:97 profile-level-id="; 
    1012                 result += format("%02X%02X%02X", 
     1010                result += format("%02hhX%02hhX%02hhX", 
    10131011                                pCapabilities->avc._pSPS[1], 
    10141012                                pCapabilities->avc._pSPS[2], 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp

    r410 r413  
    131131        //5. Create the in stream 
    132132        if (streamName == "") 
    133                 streamName = format("rtsp_%d", _pRTSP->GetId()); 
     133                streamName = format("rtsp_%u", _pRTSP->GetId()); 
    134134        _pInStream = new InNetRTPStream(_pRTSP, pApplication->GetStreamsManager(), 
    135135                        streamName, 
     
    153153                        pApplication->GetStreamsManager()->GetWaitingSubscribers( 
    154154                        streamName, _pInStream->GetType()); 
    155         FINEST("subscribedOutStreams count: %d", subscribedOutStreams.size()); 
     155        FINEST("subscribedOutStreams count: %zu", subscribedOutStreams.size()); 
    156156 
    157157 
     
    172172                for (uint32_t i = 0; i < 255; i++) { 
    173173                        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); 
    175175                                return result; 
    176176                        } 
     
    189189        //1. Is the chanel number a valid chanel? 
    190190        if (channelId >= 4) { 
    191                 FATAL("Invalid chanel number: %d", channelId); 
     191                FATAL("Invalid chanel number: %u", channelId); 
    192192                return false; 
    193193        } 
     
    196196        BaseProtocol *pProtocol = _pProtocols[channelId]; 
    197197        if (pProtocol == NULL) { 
    198                 FATAL("Invalid chanel number: %d", channelId); 
     198                FATAL("Invalid chanel number: %u", channelId); 
    199199                return false; 
    200200        } 
     
    209209 
    210210string InboundConnectivity::GetAudioClientPorts() { 
    211         return format("%d-%d", 
     211        return format("%hu-%hu", 
    212212                        ((UDPCarrier *) _pRTPAudio->GetIOHandler())->GetNearEndpointPort(), 
    213213                        ((UDPCarrier *) _pRTCPAudio->GetIOHandler())->GetNearEndpointPort()); 
     
    215215 
    216216string InboundConnectivity::GetVideoClientPorts() { 
    217         return format("%d-%d", 
     217        return format("%hu-%hu", 
    218218                        ((UDPCarrier *) _pRTPVideo->GetIOHandler())->GetNearEndpointPort(), 
    219219                        ((UDPCarrier *) _pRTCPVideo->GetIOHandler())->GetNearEndpointPort()); 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp

    r410 r413  
    2727#ifdef RTP_DEBUG 
    2828#define RTP_DEBUG_MESSAGE(sent) \ 
    29 string message = format("%d %02x-%02x-%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x", \ 
     29string message = format("%zu %02hhx-%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx", \ 
    3030    _videoData.msg_iov[0].iov_len, \ 
    3131    ((uint8_t *) _videoData.msg_iov[0].iov_base)[0], \ 
     
    4242    ((uint8_t *) _videoData.msg_iov[0].iov_base)[11]); \ 
    4343if (_videoData.msg_iov[0].iov_len == 12) { \ 
    44     message += format(" %02x%02x %s", \ 
     44    message += format(" %02hhx%02hhx %s", \ 
    4545        ((uint8_t *) _videoData.msg_iov[1].iov_base)[0], \ 
    4646        ((uint8_t *) _videoData.msg_iov[1].iov_base)[1], \ 
    4747        STR(NALUToString(((uint8_t *) _videoData.msg_iov[1].iov_base)[0]))); \ 
    4848} else { \ 
    49     message += format(" %02x%02x %s %s", \ 
     49    message += format(" %02hhx%02hhx %s %s", \ 
    5050        ((uint8_t *) _videoData.msg_iov[0].iov_base)[12], \ 
    5151        ((uint8_t *) _videoData.msg_iov[0].iov_base)[13], \ 
     
    5353        STR(NALUToString(((uint8_t *) _videoData.msg_iov[0].iov_base)[12]))); \ 
    5454} \ 
    55 message += format(" s: %d; dl: %d; pl: %d; tl: %d;", sent, dataLength, processedLength, totalLength); \ 
     55message += format(" s: %u; dl: %u; pl: %u; tl: %u;", (uint32_t)sent, (uint32_t)dataLength, (uint32_t)processedLength, (uint32_t)totalLength); \ 
    5656if(processedLength+sentAmount+chunkSize==totalLength) \ 
    5757    WARN("%s", STR(message)); \ 
     
    6969        sent = sendmsg(fd, &vd, 0); \ 
    7070    } \ 
    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]); */\ 
    7671        RTP_DEBUG_MESSAGE(sent); \ 
    7772} \ 
     
    119114        CLOSE_SOCKET(_videoDataFd); 
    120115        CLOSE_SOCKET(_audioDataFd); 
    121         WARN("OC deleted: %p", this); 
    122116} 
    123117 
     
    143137 
    144138string OutboundConnectivity::GetVideoServerPorts() { 
    145         return format("%d-%d", _videoDataPort, _videoRTCPPort); 
     139        return format("%hu-%hu", _videoDataPort, _videoRTCPPort); 
    146140} 
    147141 
    148142string OutboundConnectivity::GetAudioServerPorts() { 
    149         return format("%d-%d", _audioDataPort, _audioRTCPPort); 
     143        return format("%hu-%hu", _audioDataPort, _audioRTCPPort); 
    150144} 
    151145 
     
    296290                RTCPFd = socket(AF_INET, SOCK_DGRAM, 0); 
    297291 
    298                 sockaddr_in address = {0}; 
     292                sockaddr_in address; 
     293                memset(&address, 0, sizeof (address)); 
    299294                address.sin_family = AF_INET; 
    300295                address.sin_port = 0; 
  • trunk/sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp

    r410 r413  
    113113                        _timestampRollover++; 
    114114                        _lastTimestamp = _rtpHeader._timestamp; 
    115                         WARN("Roll over on %d; _timestampRollover: %d", GetId(), _timestampRollover); 
    116115                } 
    117116        } else { 
  • trunk/sources/thelib/src/protocols/rtp/rtcpprotocol.cpp

    r410 r413  
    7878        len = (len + 1)*4; 
    7979        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); 
    8181                buffer.IgnoreAll(); 
    8282                return true; 
     
    8787                { 
    8888                        if (len < 28) { 
    89                                 WARN("Invalid RTCP packet length: %d", len); 
     89                                WARN("Invalid RTCP packet length: %hu", len); 
    9090                                buffer.IgnoreAll(); 
    9191                                return true; 
     
    101101                default: 
    102102                { 
    103                         WARN("Unknown packet type: %d", PT); 
     103                        WARN("Unknown packet type: %hhu", PT); 
    104104                        buffer.IgnoreAll(); 
    105105                        return true; 
  • trunk/sources/thelib/src/protocols/rtp/rtspprotocol.cpp

    r410 r413  
    235235bool RTSPProtocol::SendResponseMessage() { 
    236236        //1. Put the first line 
    237         _outputBuffer.ReadFromString(format("%s %d %s\r\n", 
     237        _outputBuffer.ReadFromString(format("%s %u %s\r\n", 
    238238                        STR(_responseHeaders[RTSP_FIRST_LINE][RTSP_VERSION]), 
    239239                        (uint32_t) _responseHeaders[RTSP_FIRST_LINE][RTSP_STATUS_CODE], 
     
    340340        //2. Add the content length if required 
    341341        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()); 
    343343        } 
    344344 
     
    567567                buffer.Ignore(chunkLength); 
    568568                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()); 
    570570                        return true; 
    571571                } 
  • trunk/sources/thelib/src/protocols/rtp/sdp.cpp

    r410 r413  
    9191        Variant track = GetTrack(index, "video"); 
    9292        if (track == V_NULL) { 
    93                 FATAL("Video track index %d not found", index); 
     93                FATAL("Video track index %u not found", index); 
    9494                return Variant(); 
    9595        } 
     
    125125        Variant track = GetTrack(index, "audio"); 
    126126        if (track == V_NULL) { 
    127                 FATAL("Audio track index %d not found", index); 
     127                FATAL("Audio track index %u not found", index); 
    128128                return Variant(); 
    129129        } 
     
    465465bool SDP::ParseSDPLineP(Variant &result, string line) { 
    466466        result.Reset(); 
    467     result = line; 
    468     return true; 
     467        result = line; 
     468        return true; 
    469469} 
    470470 
  • trunk/sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp

    r410 r413  
    156156 
    157157        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", 
    159159                                STR(GetName()), 
    160160                                absoluteTimestamp, 
     
    209209        } else { 
    210210                if ((uint16_t) (_videoSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { 
    211                         WARN("Missing video packet. Wanted: %d; got: %d on stream: %s", 
     211                        WARN("Missing video packet. Wanted: %hu; got: %hu on stream: %s", 
    212212                                        (uint16_t) (_videoSequence + 1), 
    213213                                        (uint16_t) GET_RTP_SEQ(rtpHeader), 
     
    301301        } else { 
    302302                if ((uint16_t) (_audioSequence + 1) != (uint16_t) GET_RTP_SEQ(rtpHeader)) { 
    303                         WARN("Missing audio packet. Wanted: %d; got: %d on stream: %s", 
     303                        WARN("Missing audio packet. Wanted: %hu; got: %hu on stream: %s", 
    304304                                        (uint16_t) (_audioSequence + 1), 
    305305                                        (uint16_t) GET_RTP_SEQ(rtpHeader), 
     
    316316        uint16_t chunksCount = ENTOHSP(pData); 
    317317        if ((chunksCount % 16) != 0) { 
    318                 FATAL("Invalid AU headers length: %04x", chunksCount); 
     318                FATAL("Invalid AU headers length: %hx", chunksCount); 
    319319                return false; 
    320320        } 
     
    333333                ts = (double) (rtpHeader._timestamp + i * 1024) / (double) _capabilities.aac._sampleRate * 1000.00; 
    334334                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", 
    336336                                        cursor, chunkSize, dataLength, chunksCount); 
    337337                        return false; 
  • trunk/sources/thelib/src/protocols/ssl/basesslprotocol.cpp

    r410 r413  
    8484        if (type == PT_TCP) 
    8585                return true; 
    86         FATAL("Far protocol %d not accepted", type); 
    8786        return false; 
    8887} 
     
    106105        if (SSL_write(_pSSL, GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)) 
    107106                        != (int32_t) GETAVAILABLEBYTESCOUNT(*pBuffer)) { 
    108                 FATAL("Unable to write %d bytes", GETAVAILABLEBYTESCOUNT(*pBuffer)); 
     107                FATAL("Unable to write %u bytes", GETAVAILABLEBYTESCOUNT(*pBuffer)); 
    109108                return false; 
    110109        } 
     
    225224        formatString += "prev_bio: %p\n"; 
    226225        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; 
    229228        return format(formatString, 
    230229                        pBIO->method, 
     
    240239                        pBIO->prev_bio, 
    241240                        pBIO->references, 
    242                         pBIO->num_read, 
    243                         pBIO->num_write); 
     241                        (int64_t) pBIO->num_read, 
     242                        (int64_t) pBIO->num_write); 
    244243} 
    245244 
  • trunk/sources/thelib/src/protocols/ts/basetsappprotocolhandler.cpp

    r410 r413  
    4444 
    4545void BaseTSAppProtocolHandler::ProgramSetupCompleted(InNetTSStream *pInNetTSStream) { 
    46         INFO("Stream available (%d): %s", pInNetTSStream->GetUniqueId(), 
     46        INFO("Stream available (%u): %s", pInNetTSStream->GetUniqueId(), 
    4747                        STR(pInNetTSStream->GetName())); 
    4848} 
  • trunk/sources/thelib/src/protocols/ts/inboundtsprotocol.cpp

    r410 r413  
    142142 
    143143                if (!buffer.Ignore(_chunkSize)) { 
    144                         FATAL("Unable to ignore %d bytes", _chunkSize); 
     144                        FATAL("Unable to ignore %u bytes", _chunkSize); 
    145145                } 
    146146 
     
    268268                case PID_TYPE_RESERVED: 
    269269                { 
    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); 
    271271                        return true; 
    272272                } 
    273273                case PID_TYPE_UNKNOWN: 
    274274                { 
    275                         WARN("PID %d not known yet", pPIDDescriptor->pid); 
     275                        WARN("PID %hu not known yet", pPIDDescriptor->pid); 
    276276                        return true; 
    277277                } 
     
    283283                default: 
    284284                { 
    285                         WARN("PID type not implemented: %d. Pid number: %d", 
     285                        WARN("PID type not implemented: %hhu. Pid number: %hu", 
    286286                                        pPIDDescriptor->type, pPIDDescriptor->pid); 
    287287                        return false; 
     
    413413                        { 
    414414                                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); 
    416416                                break; 
    417417                        } 
     
    423423        if ((videoPid != 0) || (audioPid != 0)) { 
    424424                pStream = new InNetTSStream(this, GetApplication()->GetStreamsManager(), 
    425                                 format("ts_%d_%d_%d", GetId(), audioPid, videoPid)); 
     425                                format("ts_%u_%hu_%hu", GetId(), audioPid, videoPid)); 
    426426        } 
    427427 
  • trunk/sources/thelib/src/protocols/ts/innettsstream.cpp

    r410 r413  
    255255                uint32_t frameLength = ((((pBuffer[3]&0x03) << 8) | pBuffer[4]) << 3) | (pBuffer[5] >> 5); 
    256256                if (frameLength < 8) { 
    257                         WARN("Bogus framelength %d. Skip one byte", frameLength); 
     257                        WARN("Bogus frameLength %u. Skip one byte", frameLength); 
    258258                        FINEST("_audioBuffer:\n%s", STR(_audioBuffer)); 
    259259                        _audioBuffer.Ignore(1); 
  • trunk/sources/thelib/src/protocols/ts/tspacketpat.cpp

    r317 r413  
    4949TSPacketPAT::operator string() { 
    5050        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()); 
    6565        if (_networkPids.size() > 0) { 
    6666 
    6767                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)); 
    6969                } 
    7070        } 
    71         result += format("PMT count:              %d\n", _programPids.size()); 
     71        result += format("PMT count:              %zu\n", _programPids.size()); 
    7272        if (_programPids.size() > 0) { 
    7373 
    7474                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)); 
    7676                } 
    7777        } 
  • trunk/sources/thelib/src/protocols/ts/tspacketpmt.cpp

    r317 r413  
    3333TSPacketPMT::operator string() { 
    3434        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()); 
    5252        for (uint32_t i = 0; i < _programInfoDescriptors.size(); i++) { 
    5353                result += format("\t%s", STR(_programInfoDescriptors[i])); 
     
    5555                        result += "\n"; 
    5656        } 
    57         result += format("streams count:          %d\n", _streams.size()); 
     57        result += format("streams count:          %zu\n", _streams.size()); 
    5858 
    5959        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))); 
    6161        } 
    6262        return result; 
     
    142142        //14. Read the streams info 
    143143        while (streamsInfoCursor < streamsInfoLength) { 
    144                 TSStreamInfo streamInfo = {0}; 
     144                TSStreamInfo streamInfo; 
    145145 
    146146                //14.1. read the stream type 
  • trunk/sources/thelib/src/streaming/baseinfilestream.cpp

    r410 r413  
    183183        //from the seek file. 
    184184        if (!_pSeekFile->SeekTo(_pSeekFile->Size() - 8)) { 
    185                 FATAL("Unable to seek to %lld position", _pSeekFile->Cursor() - 8); 
     185                FATAL("Unable to seek to %"PRIu64" position", _pSeekFile->Cursor() - 8); 
    186186                return false; 
    187187        } 
  • trunk/sources/thelib/src/streaming/streamcapabilities.cpp

    r410 r413  
    3939#define CHECK_BA_LIMITS(name,length) \ 
    4040if(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()); \ 
    4243        return false; \ 
    4344} 
     
    337338_VIDEO_AVC::operator string() { 
    338339        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); 
    342343        result += format("WxH: %ux%u", _width, _height); 
    343344        return result; 
     
    362363 
    363364        if (length < 2) { 
    364                 FATAL("Invalid length: %d", length); 
     365                FATAL("Invalid length: %u", length); 
    365366                return false; 
    366367        } 
     
    382383                        && (_audioObjectType != 23) 
    383384                        && (_audioObjectType != 39)) { 
    384                 FATAL("Invalid _audioObjectType: %d", _audioObjectType); 
     385                FATAL("Invalid _audioObjectType: %hhu", _audioObjectType); 
    385386                return false; 
    386387        } 
     
    390391        if ((_sampleRateIndex == 13) 
    391392                        || (_sampleRateIndex == 14)) { 
    392                 FATAL("Invalid sample rate: %d", _sampleRateIndex); 
     393                FATAL("Invalid sample rate: %hhu", _sampleRateIndex); 
    393394                return false; 
    394395        } 
    395396        if (_sampleRateIndex == 15) { 
    396397                if (length < 5) { 
    397                         FATAL("Invalid length: %d", length); 
     398                        FATAL("Invalid length: %u", length); 
    398399                        return false; 
    399400                } 
     
    411412        if ((_channelConfigurationIndex == 0) 
    412413                        || (_channelConfigurationIndex >= 8)) { 
    413                 FATAL("Invalid _channelConfigurationIndex: %d", _channelConfigurationIndex); 
     414                FATAL("Invalid _channelConfigurationIndex: %hhu", _channelConfigurationIndex); 
    414415                return false; 
    415416        } 
     
    438439        string result; 
    439440        for (uint32_t i = 0; i < _aacLength; i++) { 
    440                 result += format("%02x", _pAAC[i]); 
     441                result += format("%02hhx", _pAAC[i]); 
    441442        } 
    442443        return "config=" + result; 
     
    445446_AUDIO_AAC::operator string() { 
    446447        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); 
    452453        return result; 
    453454} 
  • trunk/sources/thelib/src/streaming/streamsmanager.cpp

    r410 r413  
    4040        //1. Test to see if we had registered this stream before 
    4141        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()); 
    4343                return false; 
    4444        } 
     
    9797        longSubscribers = FindByTypeByName(ST_OUT, streamName, true, false); 
    9898 
    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()); 
    100101 
    101102        //3. merge them 
  • trunk/sources/trafficdissector/src/basefeeder.cpp

    r411 r413  
    6767                { 
    6868                        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); 
    7070                                return false; 
    7171                        } 
     
    7676                { 
    7777                        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); 
    7979                                return false; 
    8080                        } 
     
    8484                default: 
    8585                { 
    86                         FATAL("Invalid data type: %d", type); 
     86                        FATAL("Invalid data type: %hhu", type); 
    8787                        return false; 
    8888                } 
  • trunk/sources/trafficdissector/src/main.cpp

    r137 r413  
    3030        pLogLocation->SetLevel(_FINEST_); 
    3131        Logger::AddLogLocation(pLogLocation); 
    32         INFO("Traffic dissector started (%d)", getpid()); 
     32        INFO("Traffic dissector started (%u)", (uint32_t)getpid()); 
    3333 
    3434        //2. Parse the parameters 
  • trunk/sources/trafficdissector/src/monitorrtmpprotocol.cpp

    r411 r413  
    4343        for (uint32_t i = 0; i < MAX_STREAMS_COUNT; i++) { 
    4444                _streams[i] = new MonitorStream(this, 
    45                                 GetApplication()->GetStreamsManager(), format("stream_%d", i)); 
     45                                GetApplication()->GetStreamsManager(), format("stream_%u", i)); 
    4646        } 
    4747        return true; 
     
    9595                default: 
    9696                { 
    97                         LOG(GetLogLevel(), "Invalid handshake stage: %d", _handshakeStage); 
     97                        LOG(GetLogLevel(), "Invalid handshake stage: %u", _handshakeStage); 
    9898                        return false; 
    9999                } 
     
    118118                default: 
    119119                { 
    120                         LOG(GetLogLevel(), "Invalid handshake stage: %d", _handshakeStage); 
     120                        LOG(GetLogLevel(), "Invalid handshake stage: %u", _handshakeStage); 
    121121                        return false; 
    122122                } 
  • trunk/sources/vmtests/src/main.cpp

    r128 r413  
    185185                for (uint32_t i = 0; i < GETAVAILABLEBYTESCOUNT(wantedBuffer) && i < GETAVAILABLEBYTESCOUNT(gotBuffer); i++) { 
    186186                        if (GETIBPOINTER(wantedBuffer)[i] != GETIBPOINTER(gotBuffer)[i]) { 
    187                                 FATAL("w: %02x; g: %02x; i: %d", 
     187                                FATAL("w: %hhx; g: %hhx; i: %u", 
    188188                                                GETIBPOINTER(wantedBuffer)[i], 
    189189                                                GETIBPOINTER(gotBuffer)[i], 
Note: See TracChangeset for help on using the changeset viewer.