From 1905077c95faafaa90b54bd85ed3408f0a3998e8 Mon Sep 17 00:00:00 2001 From: Seokpil Park Date: Tue, 16 Apr 2013 20:46:18 +0900 Subject: [PATCH] [content] Fix incorrect null check codes Change-Id: I71e51f2b96770efe4bfda63f9405043283d69a1d Signed-off-by: Seokpil Park --- src/FCnt_ContentDirectoryImpl.cpp | 4 ++-- src/FCnt_ContentSearchImpl.cpp | 4 ++-- src/FCnt_PlayListImpl.cpp | 10 +++++----- src/FCnt_PlayListManagerImpl.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/FCnt_ContentDirectoryImpl.cpp b/src/FCnt_ContentDirectoryImpl.cpp index dc1a499..be4b8ef 100644 --- a/src/FCnt_ContentDirectoryImpl.cpp +++ b/src/FCnt_ContentDirectoryImpl.cpp @@ -235,7 +235,7 @@ _ContentDirectoryImpl::CreateFolderFilter(bool isMultiContentType, const Tizen:: { //CopyToCharArrayN: utility function, converts a osp string to char* std::unique_ptr pInputCond(_StringConverter::CopyToCharArrayN(inputCondition)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0] != null, E_SYSTEM, "pInputCond is NULL."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "The memory is insufficient."); SysLog(NID_CNT, "pInputCond is [%s].", pInputCond.get()); @@ -537,7 +537,7 @@ _ContentDirectoryImpl::GetContentDirectoryItemListN(const Tizen::Base::String& c //CopyToCharArrayN: utility function, converts a osp string to char* std::unique_ptr pSortCol(_StringConverter::CopyToCharArrayN(slpColumn)); - SysTryReturn(NID_CNT, pSortCol.get() != null, null, E_SYSTEM, "[E_SYSTEM] pFolderId is NULL."); + SysTryReturn(NID_CNT, pSortCol, null, E_OUT_OF_MEMORY, "The memory is insufficient."); if (sortOrder == SORT_ORDER_ASCENDING) { diff --git a/src/FCnt_ContentSearchImpl.cpp b/src/FCnt_ContentSearchImpl.cpp index 8d6c8c7..ba9a5f3 100644 --- a/src/FCnt_ContentSearchImpl.cpp +++ b/src/FCnt_ContentSearchImpl.cpp @@ -172,7 +172,7 @@ _ContentSearchImpl::CreateQueryFilter(bool isAndAppendReq) const { //CopyToCharArrayN: utility function, converts a osp string to char* pInputCond = std::unique_ptr(_StringConverter::CopyToCharArrayN(inputCondition)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0], E_OUT_OF_MEMORY, "pInputCond is NULL."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "pInputCond is NULL."); SysLog(NID_CNT, "pInputCond = %s", pInputCond.get()); @@ -192,7 +192,7 @@ _ContentSearchImpl::CreateQueryFilter(bool isAndAppendReq) const //CopyToCharArrayN: utility function, converts a osp string to char* pSortCol = std::unique_ptr(_StringConverter::CopyToCharArrayN(slpColumn)); - SysTryReturnResult(NID_CNT, (pSortCol.get())[0], E_OUT_OF_MEMORY, "pSortCol is NULL."); + SysTryReturnResult(NID_CNT, pSortCol, E_OUT_OF_MEMORY, "pSortCol is NULL."); if (__inputSortOrder == SORT_ORDER_ASCENDING) { diff --git a/src/FCnt_PlayListImpl.cpp b/src/FCnt_PlayListImpl.cpp index 8ede769..4640a88 100644 --- a/src/FCnt_PlayListImpl.cpp +++ b/src/FCnt_PlayListImpl.cpp @@ -94,7 +94,7 @@ _PlayListImpl::Construct(const Tizen::Base::String& playListName, bool isAdd) std::unique_ptr pPlaylistHandle; std::unique_ptr pInputCond(_StringConverter::CopyToCharArrayN(playListName)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0], E_OUT_OF_MEMORY, "The memory is insufficient."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "The memory is insufficient."); media_playlist_h tempHandle = pPlaylistHandle.get(); ret = media_playlist_insert_to_db(pInputCond.get(), &tempHandle); @@ -146,7 +146,7 @@ _PlayListImpl::CreateFilterUsingContentId(const ContentId& contentId) const { //CopyToCharArrayN: utility function, converts a osp string to char* pInputCond = std::unique_ptr(_StringConverter::CopyToCharArrayN(inputCondition)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0], E_SYSTEM, "pInputCond is NULL."); + SysTryReturnResult(NID_CNT, pInputCond, E_SYSTEM, "pInputCond is NULL."); SysLog(NID_CNT, "pInputCond = %s", pInputCond.get()); @@ -195,7 +195,7 @@ _PlayListImpl::CreateFilter(const Tizen::Base::String& playListName)const { //CopyToCharArrayN: utility function, converts a osp string to char* pInputCond = std::unique_ptr(_StringConverter::CopyToCharArrayN(inputCondition)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0], E_SYSTEM, "pInputCond is NULL."); + SysTryReturnResult(NID_CNT, pInputCond, E_SYSTEM, "pInputCond is NULL."); SysLog(NID_CNT, "pInputCond is [%s]", pInputCond.get()); @@ -452,7 +452,7 @@ _PlayListImpl::AddItemInternal(media_playlist_h playListHandle, const ContentId& uuidStr = contentId.ToString(); std::unique_ptr pInputCond(_StringConverter::CopyToCharArrayN(uuidStr)); - SysTryReturnResult(NID_CNT, r == E_SUCCESS, E_SYSTEM, "Failed to perform CopyToCharArrayN operation."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "The memory is insufficient."); ret = media_playlist_add_media(playListHandle, pInputCond.get()); r = MapCoreErrorToNativeResult(ret); @@ -587,7 +587,7 @@ _PlayListImpl::SetPlayListName(const Tizen::Base::String& oldName, const Tizen:: SysTryReturnResult(NID_CNT, r == E_SUCCESS, E_DATABASE, "Failed to perform GetPlayListHandle operation."); std::unique_ptr pInputCond(_StringConverter::CopyToCharArrayN(newName)); - SysTryReturnResult(NID_CNT, r == E_SUCCESS, E_OUT_OF_MEMORY, "Failed to perform CopyToCharArrayN operation."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "The memory is insufficient."); ret = media_playlist_set_name(tempHandle, pInputCond.get()); r = MapCoreErrorToNativeResult(ret); diff --git a/src/FCnt_PlayListManagerImpl.cpp b/src/FCnt_PlayListManagerImpl.cpp index e505d4f..4f0ae05 100644 --- a/src/FCnt_PlayListManagerImpl.cpp +++ b/src/FCnt_PlayListManagerImpl.cpp @@ -120,7 +120,7 @@ _PlayListManagerImpl::CreateFilter(const Tizen::Base::String& playListName) cons { //CopyToCharArrayN: utility function, converts a osp string to char* pInputCond = std::unique_ptr(_StringConverter::CopyToCharArrayN(inputCondition)); - SysTryReturnResult(NID_CNT, (pInputCond.get())[0] != null, E_SYSTEM, "pInputCond is NULL."); + SysTryReturnResult(NID_CNT, pInputCond, E_OUT_OF_MEMORY, "The memory is insufficient."); SysLog(NID_CNT, "pInputCond is [%s]", pInputCond.get()); -- 2.7.4