From 34a692f488c04e6014b0bbdc7c9adec31d69a409 Mon Sep 17 00:00:00 2001 From: KIM JungYong Date: Mon, 17 Oct 2016 08:13:26 +0900 Subject: [PATCH] Fix bug for invalid return variable. Invalid return variable is fixed. 1. invalid boolean -> pointer 2. invalid pointer -> boolean Change-Id: I16cb2338b28ba5bb725ed6eb8d640f04216f7933 Signed-off-by: KIM JungYong Reviewed-on: https://gerrit.iotivity.org/gerrit/13317 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- .../src/consumer/NSConsumerInternalTaskController.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/service/notification/src/consumer/NSConsumerInternalTaskController.c b/service/notification/src/consumer/NSConsumerInternalTaskController.c index fafe0c6..3156979 100644 --- a/service/notification/src/consumer/NSConsumerInternalTaskController.c +++ b/service/notification/src/consumer/NSConsumerInternalTaskController.c @@ -571,14 +571,17 @@ NSMessageStateList * NSGetMessageStateList() NSMessageStateLL * NSFindMessageState(uint64_t msgId) { NS_LOG_V(DEBUG, "%s", __func__); - if (msgId <= NS_RESERVED_MESSAGEID) return NULL; + if (msgId <= NS_RESERVED_MESSAGEID) + { + return NULL; + } NSMessageStateLL * iter = NULL; NSLockMessageListMutex(); if (NSGetMessageStateList()->head == NULL) { NSUnlockMessageListMutex(); - return false; + return NULL; } for (iter = NSGetMessageStateList()->head; iter; iter = iter->next) @@ -597,7 +600,10 @@ NSMessageStateLL * NSFindMessageState(uint64_t msgId) bool NSUpdateMessageState(uint64_t msgId, NSSyncType state) { NS_LOG_V(DEBUG, "%s", __func__); - if (msgId <= NS_RESERVED_MESSAGEID) return NULL; + if (msgId <= NS_RESERVED_MESSAGEID) + { + return false; + } NSMessageStateLL * iter = NULL; NSLockMessageListMutex(); @@ -618,7 +624,11 @@ bool NSUpdateMessageState(uint64_t msgId, NSSyncType state) bool NSDeleteMessageState(uint64_t msgId) { NS_LOG_V(DEBUG, "%s", __func__); - if (msgId <= NS_RESERVED_MESSAGEID) return NULL; + if (msgId <= NS_RESERVED_MESSAGEID) + { + return false; + } + NSMessageStateLL * iter = NULL; NSMessageStateLL * prev = NULL; -- 2.7.4