Skip to content

Commit

Permalink
Merge pull request #188 from david-antliff-imgtec/cppcheck-fixes
Browse files Browse the repository at this point in the history
Fix cppcheck-1.72 issues.
  • Loading branch information
Sean Kelly authored Jun 14, 2016
2 parents 05ba925 + 047ba9b commit f351317
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
10 changes: 5 additions & 5 deletions api/tests/server/test_observe_operation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ TEST_F(TestObserveWithConnectedSession, AwaServerObserveOperation_Perform_handle
{
int count;

CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};
explicit CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};

void callbackHandler(const AwaChangeSet * changeSet)
{
Expand Down Expand Up @@ -418,7 +418,7 @@ TEST_F(TestObserveWithConnectedSession, AwaServerObserveOperation_Perform_handle
{
int count;

CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};
explicit CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};

void callbackHandler(const AwaChangeSet * changeSet)
{
Expand Down Expand Up @@ -586,7 +586,7 @@ TEST_F(TestObserveWithConnectedSession, AwaServerObserveOperation_Perform_handle
{
int count;

CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};
explicit CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};

void callbackHandler(const AwaChangeSet * changeSet)
{
Expand Down Expand Up @@ -905,7 +905,7 @@ TEST_F(TestObserveWithConnectedSession, AwaServerObserveOperation_Perform_honour
{
int count;

CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};
explicit CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};

void callbackHandler(const AwaChangeSet * changeSet)
{
Expand Down Expand Up @@ -954,7 +954,7 @@ TEST_F(TestObserveWithConnectedSession, AwaServerObserveOperation_Perform_cancel
{
int count;

CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};
explicit CallbackHandler1(AwaServerSession * session) : ObserveWaitCondition(session), count(0) {};

virtual void callbackHandler(const AwaChangeSet * changeSet)
{
Expand Down
1 change: 0 additions & 1 deletion api/tests/support/process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ int WaitForIpc(int ipcPort, int timeout /*seconds*/, const char * request, size_
socklen_t fromAddrLen = sizeof(fromAddr);

fromAddr.sin_family = AF_INET;
fromAddr.sin_family = SOCK_DGRAM;
fromAddr.sin_port = htons(ipcPort);

if (inet_aton("127.0.0.1", &fromAddr.sin_addr) == 0)
Expand Down
10 changes: 10 additions & 0 deletions ci/cppcheck.suppress
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Suppress all warnings about unmatched suppressions!
unmatchedSuppression:*

// Suppress all warnings from gengetopt-generated files:
*:*/*cmdline.c

Expand All @@ -8,3 +11,10 @@ unusedFunction:api/src/unsupported.c
// Suppress all unused function warnings for now.
unusedFunction:*

// False positives

// "Member variable 'CallbackHandler1::count' is not initialized in the constructor."
uninitMemberVar:api/tests/client/test_subscribe_operation.cc
uninitMemberVar:api/tests/server/test_observe_operation.cc
uninitMemberVar:api/tests/server/test_server_events.cc

2 changes: 1 addition & 1 deletion core/src/common/lwm2m_plaintext.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static int PTDeserialiseResource(SerdesContext * serdesContext, Lwm2mTreeNode **
case AwaResourceType_Boolean:
if (bufferLen == 1)
{
bool temp;
bool temp = false;

if (buffer[0] == '0')
{
Expand Down

0 comments on commit f351317

Please sign in to comment.