diff options
author | Lukas Zeller <luz@synthesis.ch> | 2009-10-13 20:11:19 +0200 |
---|---|---|
committer | Lukas Zeller <luz@synthesis.ch> | 2009-10-14 12:38:18 +0200 |
commit | 8cabfc28adc0583950008a94a66a62df32f849d5 (patch) | |
tree | 36e264203a490357715c4410f229dbdda235e983 | |
parent | 49bfe604849af9fdc5a625028766c55fdd00218b (diff) |
unilib: eliminated another bunch of printf argument warnings by casting all %ld arguments to (long)
Note: this makes such args 64bit compatible, as long becomes 64bit automatically on 64bit arch.
-rwxr-xr-x | src/DB_interfaces/api_db/pluginapids.cpp | 8 | ||||
-rw-r--r-- | src/sysync/localengineds.cpp | 10 | ||||
-rwxr-xr-x | src/sysync/multifielditem.cpp | 18 | ||||
-rwxr-xr-x | src/sysync/stdlogicds.cpp | 8 | ||||
-rwxr-xr-x | src/sysync/syncagent.cpp | 28 | ||||
-rw-r--r-- | src/sysync/syncsession.cpp | 3 |
6 files changed, 36 insertions, 39 deletions
diff --git a/src/DB_interfaces/api_db/pluginapids.cpp b/src/DB_interfaces/api_db/pluginapids.cpp index 627c623..2c00a21 100755 --- a/src/DB_interfaces/api_db/pluginapids.cpp +++ b/src/DB_interfaces/api_db/pluginapids.cpp @@ -2367,10 +2367,10 @@ void TPluginApiDS::dsLogSyncResult(void) logData+="\r\ndeviceupdated:"; StringObjAppendPrintf(logData,"%ld",(long)fRemoteItemsUpdated); #ifdef SYSYNC_SERVER if (IS_SERVER) { - logData+="\r\nslowsyncmatches:"; StringObjAppendPrintf(logData,"%ld",fSlowSyncMatches); - logData+="\r\nserverwins:"; StringObjAppendPrintf(logData,"%ld",fConflictsServerWins); - logData+="\r\nclientwins:"; StringObjAppendPrintf(logData,"%ld",fConflictsClientWins); - logData+="\r\nduplicated:"; StringObjAppendPrintf(logData,"%ld",fConflictsDuplicated); + logData+="\r\nslowsyncmatches:"; StringObjAppendPrintf(logData,"%ld",(long)fSlowSyncMatches); + logData+="\r\nserverwins:"; StringObjAppendPrintf(logData,"%ld",(long)fConflictsServerWins); + logData+="\r\nclientwins:"; StringObjAppendPrintf(logData,"%ld",(long)fConflictsClientWins); + logData+="\r\nduplicated:"; StringObjAppendPrintf(logData,"%ld",(long)fConflictsDuplicated); } // server #endif // SYSYNC_SERVER logData+="\r\nsessionbytesin:"; StringObjAppendPrintf(logData,"%ld",(long)fSessionP->getIncomingBytes()); diff --git a/src/sysync/localengineds.cpp b/src/sysync/localengineds.cpp index 04e8de8..19cde47 100644 --- a/src/sysync/localengineds.cpp +++ b/src/sysync/localengineds.cpp @@ -1890,7 +1890,6 @@ const char *TLocalEngineDS::parseOption( #ifdef OBJECT_FILTERING if (strucmp(aOptName,"fi")==0) { if (!aArguments) return NULL; - bool filterok=false; // assume invalid // make sync set filter expression string f; aArguments=parseFilterCGI(aArguments,fLocalSendToRemoteTypeP,f); // if type being used for sending to remote is known here, use it @@ -1904,7 +1903,6 @@ const char *TLocalEngineDS::parseOption( #ifdef SYNCML_TAF_SUPPORT else if (strucmp(aOptName,"tf")==0) { if (!aArguments) return NULL; - bool filterok=false; // assume invalid // make temporary filter (or TAF) expression aArguments=parseFilterCGI(aArguments,fLocalSendToRemoteTypeP,fTargetAddressFilter); // if type being used for sending to remote is known here, use it // Note: TAF filters are always evaluated internally as we need all SyncSet records @@ -4347,10 +4345,10 @@ void TLocalEngineDS::showStatistics(void) StringObjAppendPrintf(stats,"Rejected with error: %9ld %9ld\n\n",(long)fLocalItemsError,(long)fRemoteItemsError); #ifdef SYSYNC_SERVER if (IS_SERVER) { - StringObjAppendPrintf(stats,"SlowSync Matches: %9ld\n",fSlowSyncMatches); - StringObjAppendPrintf(stats,"Server won Conflicts: %9ld\n",fConflictsServerWins); - StringObjAppendPrintf(stats,"Client won Conflicts: %9ld\n",fConflictsClientWins); - StringObjAppendPrintf(stats,"Conflicts with Duplication: %9ld\n\n",fConflictsDuplicated); + StringObjAppendPrintf(stats,"SlowSync Matches: %9ld\n",(long)fSlowSyncMatches); + StringObjAppendPrintf(stats,"Server won Conflicts: %9ld\n",(long)fConflictsServerWins); + StringObjAppendPrintf(stats,"Client won Conflicts: %9ld\n",(long)fConflictsClientWins); + StringObjAppendPrintf(stats,"Conflicts with Duplication: %9ld\n\n",(long)fConflictsDuplicated); } #endif StringObjAppendPrintf(stats,"Content Data Bytes sent: %9ld\n",(long)fOutgoingDataBytes); diff --git a/src/sysync/multifielditem.cpp b/src/sysync/multifielditem.cpp index 88f4fe4..d180b6d 100755 --- a/src/sysync/multifielditem.cpp +++ b/src/sysync/multifielditem.cpp @@ -1168,11 +1168,11 @@ sInt16 TMultiFieldItem::standardCompareWith( PDEBUGPRINTFX(DBG_DATA+DBG_MATCH,("- not equal because fid=%hd not same in both items:",i)); getField(i)->getAsString(ds); PDEBUGPRINTFX(DBG_DATA+DBG_MATCH+DBG_USERDATA,( - "- this item : '%-0.1000s'",ds.c_str() + "- this item : '%-.1000s'",ds.c_str() )); aItem.getField(i)->getAsString(ds); PDEBUGPRINTFX(DBG_DATA+DBG_MATCH+DBG_USERDATA,( - "- other item : '%-0.1000s'",ds.c_str() + "- other item : '%-.1000s'",ds.c_str() )); PDEBUGPRINTFX(DBG_DATA+DBG_MATCH,( "- thisItem.CompareWith(otherItem) = %hd", @@ -1194,7 +1194,7 @@ sInt16 TMultiFieldItem::standardCompareWith( if (aDebugShow) { PDEBUGPRINTFX(DBG_DATA+DBG_MATCH,( "- Cutoff detected, field considered equal, maxsize(thisitem)=%ld, maxsize(otheritem)=%ld", - s1,s2 + (long)s1,(long)s2 )); } #endif @@ -1400,7 +1400,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh string ds; getFieldRef(i).getAsString(ds); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - "- assigned value '%" FMT_LENGTH("0.40") "s' to winning (which had nothing assigned here)", + "- assigned value '%" FMT_LENGTH(".40") "s' to winning (which had nothing assigned here)", FMT_LENGTH_LIMITED(40,ds.c_str()) )); #endif @@ -1420,7 +1420,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh string ds; winningField.getAsString(ds); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - "- copied value '%" FMT_LENGTH("0.40") "s' from loosing to empty winning", + "- copied value '%" FMT_LENGTH(".40") "s' from loosing to empty winning", FMT_LENGTH_LIMITED(40,ds.c_str()) )); #endif @@ -1434,7 +1434,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh winningField.getAsString(ds1); loosingField.getAsString(ds2); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - "- try merging winning value '%" FMT_LENGTH("0.40") "s' with loosing value '%" FMT_LENGTH("0.40") "s'", + "- try merging winning value '%" FMT_LENGTH(".40") "s' with loosing value '%" FMT_LENGTH(".40") "s'", FMT_LENGTH_LIMITED(40,ds1.c_str()), FMT_LENGTH_LIMITED(40,ds2.c_str()) )); @@ -1444,7 +1444,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh #ifdef SYDEBUG winningField.getAsString(ds1); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - " merged %sthing, winning value is '%" FMT_LENGTH("0.40") "s'", + " merged %sthing, winning value is '%" FMT_LENGTH(".40") "s'", aChangedThis ? "some" : "no", FMT_LENGTH_LIMITED(40,ds1.c_str()) )); @@ -1469,7 +1469,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh winningField.getAsString(wfv); loosingField.getAsString(lfv); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - "Winning and loosing Field '%s' not equal: '%" FMT_LENGTH("0.30") "s' <> '%" FMT_LENGTH("0.30") "s'", + "Winning and loosing Field '%s' not equal: '%" FMT_LENGTH(".30") "s' <> '%" FMT_LENGTH(".30") "s'", fFieldDefinitionsP->fFields[i].TCFG_CSTR(fieldname), FMT_LENGTH_LIMITED(30,wfv.c_str()),FMT_LENGTH_LIMITED(30,lfv.c_str()) )); @@ -1490,7 +1490,7 @@ void TMultiFieldItem::standardMergeWith(TMultiFieldItem &aItem, bool &aChangedTh string ds; winningField.getAsString(ds); PDEBUGPRINTFX(DBG_DATA+DBG_CONFLICT+DBG_USERDATA,( - "- updated fields such that both have same value '%" FMT_LENGTH("0.40") "s'", + "- updated fields such that both have same value '%" FMT_LENGTH(".40") "s'", FMT_LENGTH_LIMITED(40,ds.c_str()) )); #endif diff --git a/src/sysync/stdlogicds.cpp b/src/sysync/stdlogicds.cpp index 4e6cf60..be62456 100755 --- a/src/sysync/stdlogicds.cpp +++ b/src/sysync/stdlogicds.cpp @@ -548,8 +548,8 @@ localstatus TStdLogicDS::startDataAccessForServer(void) )); PDEBUGPRINTFX(DBG_ERROR,( "Warning: Synchronisation involves more items (%ld) than client can possibly manage (%ld)", - (sInt32)fItems.size(), - (sInt32)getRemoteDatastore()->getMaxID() + (long)fItems.size(), + (long)getRemoteDatastore()->getMaxID() )); } } @@ -732,8 +732,8 @@ bool TStdLogicDS::logicGenerateSyncCommandsAsServer( if (fMaxItemCount> 0) { PDEBUGPRINTFX(DBG_DATA+DBG_HOT,( "Info: Max number of items to be sent in this session is limited to %ld (already sent by now=%ld)", - fMaxItemCount, - fItemsSent + (long)fMaxItemCount, + (long)fItemsSent )); } #endif diff --git a/src/sysync/syncagent.cpp b/src/sysync/syncagent.cpp index 5d89c78..4d3b3b3 100755 --- a/src/sysync/syncagent.cpp +++ b/src/sysync/syncagent.cpp @@ -679,8 +679,8 @@ TSyncAgent::~TSyncAgent() // show session data transfer PDEBUGPRINTFX(DBG_HOT,( "Session data transfer statistics: incoming bytes=%ld, outgoing bytes=%ld", - fIncomingBytes, - fOutgoingBytes + (long)fIncomingBytes, + (long)fOutgoingBytes )); // DO NOT remove session from dispatcher here, // this is the task of the dispatcher itself! @@ -1716,8 +1716,6 @@ SmlPcdataPtr_t TSyncAgent::newResponseURIForRemote(void) // called after successful decoding of an incoming message bool TSyncAgent::ServerMessageStarted(SmlSyncHdrPtr_t aContentP, TStatusCommand &aStatusCommand, bool aBad) { - Ret_t err=SML_ERR_OK; - // message not authorized by default fMessageAuthorized=false; @@ -1744,7 +1742,7 @@ bool TSyncAgent::ServerMessageStarted(SmlSyncHdrPtr_t aContentP, TStatusCommand if (fIncomingMsgID>1) { PDEBUGPRINTFX(DBG_ERROR,( "New session gets first message with MsgID=%ld (should be 1). Might be due to retries, adjusting OutgoingID as well", - fIncomingMsgID + (long)fIncomingMsgID )); fOutgoingMsgID=fIncomingMsgID-1; // to make it match what client expects } @@ -2191,8 +2189,8 @@ void TSyncAgent::ServerMessageEnded(bool aIncomingFinal) // End of outgoing message PDEBUGPRINTFX(DBG_HOT,( "=================> Finished generating outgoing message #%ld, request=%ld", - fOutgoingMsgID, - getSyncAppBase()->requestCount() + (long)fOutgoingMsgID, + (long)getSyncAppBase()->requestCount() )); PDEBUGENDBLOCK("SyncML_Outgoing"); } // TSyncAgent::ServerMessageEnded @@ -2237,8 +2235,8 @@ bool TSyncAgent::EndRequest(bool &aHasData, string &aRespURI, uInt32 aReqBytes) PDEBUGPRINTFX(DBG_HOT,( "========= Finished retried request with re-sending buffered answer (session %sin progress), incoming bytes=%ld, outgoing bytes=%ld", fInProgress ? "" : "NOT ", - aReqBytes, - fBufferedAnswerSize + (long)aReqBytes, + (long)fBufferedAnswerSize )); aHasData=false; // we do not have data in the sml instance (but we have/had some in the retry re-send buffer) } @@ -2250,9 +2248,9 @@ bool TSyncAgent::EndRequest(bool &aHasData, string &aRespURI, uInt32 aReqBytes) PDEBUGPRINTFX(DBG_HOT,( "========= Finished request (session %sin progress), processing time=%ld msec, incoming bytes=%ld, outgoing bytes=%ld", fInProgress ? "" : "NOT ", - (sInt32)((getSystemNowAs(TCTX_UTC)-getLastRequestStarted()) * nanosecondsPerLinearTime / 1000000), - aReqBytes, - getOutgoingMessageSize() + (long)((getSystemNowAs(TCTX_UTC)-getLastRequestStarted()) * nanosecondsPerLinearTime / 1000000), + (long)aReqBytes, + (long)getOutgoingMessageSize() )); // return RespURI (is empty if none specified or equal to message source URI) aRespURI = fRespondURI; @@ -2277,9 +2275,9 @@ bool TSyncAgent::EndRequest(bool &aHasData, string &aRespURI, uInt32 aReqBytes) if (t<fRequestMinTime) { PDEBUGPRINTFX(DBG_HOT,( "requestmintime is set to %ld seconds, we have spent only %ld seconds so far -> sleeping %ld seconds", - fRequestMinTime, - t, - fRequestMinTime-t + (long)fRequestMinTime, + (long)t, + (long)fRequestMinTime-t )); CONSOLEPRINTF((" ...delaying response by %ld seconds because requestmintime is set to %ld",fRequestMinTime,fRequestMinTime-t)); sleepLineartime((lineartime_t)(fRequestMinTime-t)*secondToLinearTimeFactor); diff --git a/src/sysync/syncsession.cpp b/src/sysync/syncsession.cpp index a833e7c..904c855 100644 --- a/src/sysync/syncsession.cpp +++ b/src/sysync/syncsession.cpp @@ -2893,7 +2893,8 @@ void TSyncSession::nextMessageRequest(void) )); TStatusCommand *fakeStatusCmdP = new TStatusCommand(this); bool queueforlater=false; - bool ok=processSyncStart( + /* bool ok= */ + processSyncStart( fakeSyncCmdP, *fakeStatusCmdP, queueforlater // will be set if command must be queued for later re-execution |