From: KIM JungYong Date: Sun, 16 Oct 2016 23:13:26 +0000 (+0900) Subject: Fix bug for invalid return variable. X-Git-Tag: 1.2.0~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af0339a89a39e02da45e1135bd817f7f6bca07cb;p=platform%2Fupstream%2Fiotivity.git 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/13429 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/notification/src/consumer/NSConsumerInternalTaskController.c b/service/notification/src/consumer/NSConsumerInternalTaskController.c index fafe0c6b5..3156979be 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;