diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2012-02-27 17:45:43 +0100 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2012-02-27 17:45:43 +0100 |
commit | 3fd93495abeb9dff92a303588a0ec50ab44d0b95 (patch) | |
tree | ac659df5fa6b6a5cfaf05bffe25faa367fd1fa30 | |
parent | 13ff1e4149e28582d8da41d068eb1bbd0d9108db (diff) |
logging: fixed CONSOLEPRINTF format conversion issuesconsole-logging
Compiling on 64 bit Linux with CONSOLEPRINTF mapped to printf()
revealed some 32/64 bit mistmatches. Fixed by casting to long, as
defined by the format string.
-rwxr-xr-x | src/syncml_tk/src/sml/xlt/all/xltdec.c | 8 | ||||
-rw-r--r-- | src/sysync/localengineds.cpp | 16 | ||||
-rw-r--r-- | src/sysync/stdlogicds.cpp | 4 | ||||
-rwxr-xr-x | src/sysync/syncagent.cpp | 2 | ||||
-rw-r--r-- | src/sysync/syncsession.cpp | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/src/syncml_tk/src/sml/xlt/all/xltdec.c b/src/syncml_tk/src/sml/xlt/all/xltdec.c index abf0dca..a07f24c 100755 --- a/src/syncml_tk/src/sml/xlt/all/xltdec.c +++ b/src/syncml_tk/src/sml/xlt/all/xltdec.c @@ -252,8 +252,8 @@ Ret_t show_decode_error(Ret_t aRc, XltDecScannerPtr_t aScanner, char *aRoutineNa b = aScanner->getPos(aScanner); SMLERRPRINTFX(DBG_ERROR,( "- Tag start at 0x%lX, scanner pos at 0x%lX%s, data:", - aScanner->curtok->start, - b, + (unsigned long)aScanner->curtok->start, + (unsigned long)b, aScanner->finished ? " (finished)" : "" )); if (b!=NULL) { @@ -265,14 +265,14 @@ Ret_t show_decode_error(Ret_t aRc, XltDecScannerPtr_t aScanner, char *aRoutineNa } *p=0; b-=numBytesShow; // rewind - SMLERRPRINTFX(DBG_ERROR,(hexshow)); + SMLERRPRINTFX(DBG_ERROR,("%s", hexshow)); p=hexshow; for (i=0; i<numBytesShow; i++) { *p++ = (*b>=0x20) && (*b<0x7F) ? *b : '_'; b++; } *p=0; - SMLERRPRINTFX(DBG_ERROR,(hexshow)); + SMLERRPRINTFX(DBG_ERROR,("%s", hexshow)); } } else { diff --git a/src/sysync/localengineds.cpp b/src/sysync/localengineds.cpp index 0e269bd..c4657bb 100644 --- a/src/sysync/localengineds.cpp +++ b/src/sysync/localengineds.cpp @@ -4545,16 +4545,16 @@ void TLocalEngineDS::showStatistics(void) else { CONSOLEPRINTF((" on Client on Server")); } - CONSOLEPRINTF((" Added: %9ld %9ld",fLocalItemsAdded,fRemoteItemsAdded)); - CONSOLEPRINTF((" Deleted: %9ld %9ld",fLocalItemsDeleted,fRemoteItemsDeleted)); - CONSOLEPRINTF((" Updated: %9ld %9ld",fLocalItemsUpdated,fRemoteItemsUpdated)); - CONSOLEPRINTF((" Rejected with error: %9ld %9ld",fLocalItemsError,fRemoteItemsError)); + CONSOLEPRINTF((" Added: %9ld %9ld",(long)fLocalItemsAdded,(long)fRemoteItemsAdded)); + CONSOLEPRINTF((" Deleted: %9ld %9ld",(long)fLocalItemsDeleted,(long)fRemoteItemsDeleted)); + CONSOLEPRINTF((" Updated: %9ld %9ld",(long)fLocalItemsUpdated,(long)fRemoteItemsUpdated)); + CONSOLEPRINTF((" Rejected with error: %9ld %9ld",(long)fLocalItemsError,(long)fRemoteItemsError)); #ifdef SYSYNC_SERVER if (IS_SERVER) { - CONSOLEPRINTF((" SlowSync Matches: %9ld",fSlowSyncMatches)); - CONSOLEPRINTF((" Server won Conflicts: %9ld",fConflictsServerWins)); - CONSOLEPRINTF((" Client won Conflicts: %9ld",fConflictsClientWins)); - CONSOLEPRINTF((" Conflicts with Duplication: %9ld",fConflictsDuplicated)); + CONSOLEPRINTF((" SlowSync Matches: %9ld",(long)fSlowSyncMatches)); + CONSOLEPRINTF((" Server won Conflicts: %9ld",(long)fConflictsServerWins)); + CONSOLEPRINTF((" Client won Conflicts: %9ld",(long)fConflictsClientWins)); + CONSOLEPRINTF((" Conflicts with Duplication: %9ld",(long)fConflictsDuplicated)); } #endif } diff --git a/src/sysync/stdlogicds.cpp b/src/sysync/stdlogicds.cpp index 2a41ad1..da181a5 100644 --- a/src/sysync/stdlogicds.cpp +++ b/src/sysync/stdlogicds.cpp @@ -587,8 +587,8 @@ localstatus TStdLogicDS::startDataAccessForServer(void) // this will not work, warn (but no longer abort session, as Siemens S55 guys don't like that) CONSOLEPRINTF(( "Warning: Synchronisation involves more items (%ld) than client can possibly manage (%ld", - (sInt32)fItems.size(), - (sInt32)getRemoteDatastore()->getMaxID() + (long)fItems.size(), + (long)getRemoteDatastore()->getMaxID() )); PDEBUGPRINTFX(DBG_ERROR,( "Warning: Synchronisation involves more items (%ld) than client can possibly manage (%ld)", diff --git a/src/sysync/syncagent.cpp b/src/sysync/syncagent.cpp index fd61ea4..b551493 100755 --- a/src/sysync/syncagent.cpp +++ b/src/sysync/syncagent.cpp @@ -2305,7 +2305,7 @@ bool TSyncAgent::EndRequest(bool &aHasData, string &aRespURI, uInt32 aReqBytes) (long)t, (long)fRequestMinTime-t )); - CONSOLEPRINTF((" ...delaying response by %ld seconds because requestmintime is set to %ld",fRequestMinTime,fRequestMinTime-t)); + CONSOLEPRINTF((" ...delaying response by %ld seconds because requestmintime is set to %ld",(long)fRequestMinTime,(long)(fRequestMinTime-t))); sleepLineartime((lineartime_t)(fRequestMinTime-t)*secondToLinearTimeFactor); } } diff --git a/src/sysync/syncsession.cpp b/src/sysync/syncsession.cpp index 9accd9d..8d3c916 100644 --- a/src/sysync/syncsession.cpp +++ b/src/sysync/syncsession.cpp @@ -2634,7 +2634,7 @@ Ret_t TSyncSession::processHeader(TSyncHeader *aSyncHdrP) PDEBUGPRINTFX(DBG_HOT,("- Response to be sent to URI='%s'",fRespondURI.empty() ? "[none specified, back to source]" : fRespondURI.c_str())); PDEBUGPRINTFX(DBG_HOT,("- Target (Local party) : URI='%s' DisplayName='%s'",fLocalURI.c_str(),fLocalName.c_str())); #endif - CONSOLEPRINTF(("> SyncML message #%ld received from '%s'",fIncomingMsgID,fRemoteURI.c_str())); + CONSOLEPRINTF(("> SyncML message #%ld received from '%s'",(long)fIncomingMsgID,fRemoteURI.c_str())); // - UTC support is implied for SyncML 1.0 (as most devices support it, and // there is was no way to signal it in 1.0). if (!fRemoteDevInfKnown && fSyncMLVersion==syncml_vers_1_0) fRemoteCanHandleUTC=true; |