summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-12-13 00:31:42 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2017-12-13 00:31:42 -0800
commit341c43c61e7c91e4a6f03c06572c923a5d96a0dd (patch)
tree75f36a34d759cb0986beaa31626cd19cf3b95950
parent0951984691b422b289676b03c563c7ec22ed4e02 (diff)
sysync: clean up cppcheck warnings
More recent cppcheck warns about uninitialized members and vars. In some cases that's correct (but harmless?), in others it isn't. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rwxr-xr-xsrc/sysync/binfileimplclient.cpp2
-rwxr-xr-xsrc/sysync/customimplds.cpp3
-rw-r--r--src/sysync/localengineds.cpp1
-rwxr-xr-xsrc/sysync_SDK/Sources/generic_types.h1
4 files changed, 6 insertions, 1 deletions
diff --git a/src/sysync/binfileimplclient.cpp b/src/sysync/binfileimplclient.cpp
index 5d9c7d3..6e53869 100755
--- a/src/sysync/binfileimplclient.cpp
+++ b/src/sysync/binfileimplclient.cpp
@@ -1709,6 +1709,8 @@ sInt32 TBinfileClientConfig::newProfile(const char *aProfileName, bool aSetDefau
target.limit1=templatetarget.limit1;
target.limit2=templatetarget.limit2;
target.extras=templatetarget.extras;
+ target.enabled=false;
+ target.forceSlowSync=false;
}
}
// save target record
diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp
index c8540d6..b14c941 100755
--- a/src/sysync/customimplds.cpp
+++ b/src/sysync/customimplds.cpp
@@ -1298,6 +1298,7 @@ void TCustomImplDS::modifyMap(TMapEntryType aEntryType, const char *aLocalID, co
entry.entrytype=aEntryType;
entry.added=true;
entry.changed=true;
+ entry.deleted=false;
entry.localid=aLocalID;
AssignString(entry.remoteid,aRemoteID); // if NULL, remoteID will be empty
entry.savedmark=false;
@@ -2770,7 +2771,7 @@ bool TCustomImplDS::implProcessItem(
bool ok=true;
localstatus sta=LOCERR_OK;
string localID;
- const char *remoteID;
+ const char *remoteID = NULL;
// %%% bool RemoteIDKnown=false;
TMapContainer::iterator mappos;
TSyncOperation sop=sop_none;
diff --git a/src/sysync/localengineds.cpp b/src/sysync/localengineds.cpp
index acbec1e..bd8cd32 100644
--- a/src/sysync/localengineds.cpp
+++ b/src/sysync/localengineds.cpp
@@ -5252,6 +5252,7 @@ bool TLocalEngineDS::engProcessSyncOpItem(
// the block because of the try/catch, so some checks
// for resuming are necessary.
process:
+ // cppcheck-suppress uninitvar
if (localTypeP && remoteTypeP) {
// create the item (might have empty data in case of delete)
if (!syncitemP)
diff --git a/src/sysync_SDK/Sources/generic_types.h b/src/sysync_SDK/Sources/generic_types.h
index 4223e48..e6eeb0e 100755
--- a/src/sysync_SDK/Sources/generic_types.h
+++ b/src/sysync_SDK/Sources/generic_types.h
@@ -26,6 +26,7 @@
#ifdef __cplusplus
+ // cppcheck-suppress syntaxError
namespace sysync {
#endif