From 18094fc7b5bfa8a00b1499cce38e362c734b9a8e Mon Sep 17 00:00:00 2001 From: Kim Youngjin Date: Tue, 21 Apr 2015 08:35:08 +0900 Subject: [PATCH] dbg.h file is removed. Change-Id: I937d7e4721f260d54655956757b3798d2a2c5eb8 Signed-off-by: Kim Youngjin --- include/common/dbg.h | 48 --------------------------------------------- include/util/util.h | 23 +--------------------- src/main.cpp | 4 ++-- src/mgr/SourceInfo.cpp | 1 - src/mgr/external.cpp | 1 - src/mgr/source_mgr.cpp | 1 - src/mgr/usb.cpp | 1 - src/util/util.cpp | 20 +++++++++++-------- src/view/allsource_view.cpp | 1 - src/view/menu_view.cpp | 12 ++++++------ src/view/plugged_layout.cpp | 1 - 11 files changed, 21 insertions(+), 92 deletions(-) delete mode 100644 include/common/dbg.h diff --git a/include/common/dbg.h b/include/common/dbg.h deleted file mode 100644 index 740d1c2..0000000 --- a/include/common/dbg.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __DBG_H__ -#define __DBG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "source-list" - -#include - -#ifndef _ERR -#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -#ifndef _DBG -#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -#ifndef _INFO -#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __DBG_H__ */ diff --git a/include/util/util.h b/include/util/util.h index 814e7ac..99f57a6 100644 --- a/include/util/util.h +++ b/include/util/util.h @@ -18,28 +18,7 @@ #define __UTIL_H__ #include -#include "dbg.h" - -#define UTIL_CHECK_RETURN_VAL(expr, val) { \ - if (expr == NULL) { \ - _ERR("Invalid data, Returning value"); \ - return val; \ - } \ - } - -#define UTIL_CHECK_RETURN_NULL(expr) { \ - if (expr == NULL) { \ - _ERR("Invalid data, Returning NULL"); \ - return NULL; \ - } \ - } - -#define UTIL_FREE(ptr) { \ - if (ptr != NULL) { \ - free(ptr); \ - ptr = NULL; \ - } \ - } +#include Evas_Object *util_add_layout(Evas_Object *parent, const char *group); Evas_Object *util_add_grid(Evas_Object *parent, int w, int h); diff --git a/src/main.cpp b/src/main.cpp index e88bf68..cfeac56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#include -#include "dbg.h" #include #include "def.h" #include "source_mgr.h" @@ -23,6 +21,8 @@ #include "menu_view.h" +SET_TAG("source-list"); + static Evas_Object *_add_win(const char *name) { Evas_Object *win; diff --git a/src/mgr/SourceInfo.cpp b/src/mgr/SourceInfo.cpp index 1a441d3..c44b799 100644 --- a/src/mgr/SourceInfo.cpp +++ b/src/mgr/SourceInfo.cpp @@ -16,7 +16,6 @@ #include #include -#include "dbg.h" #include #include "external.h" #include "SourceInfo.h" diff --git a/src/mgr/external.cpp b/src/mgr/external.cpp index e28d955..2772583 100644 --- a/src/mgr/external.cpp +++ b/src/mgr/external.cpp @@ -17,7 +17,6 @@ #include #include #include -#include "dbg.h" #include #include "external.h" diff --git a/src/mgr/source_mgr.cpp b/src/mgr/source_mgr.cpp index ef5002c..3120ffb 100644 --- a/src/mgr/source_mgr.cpp +++ b/src/mgr/source_mgr.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "dbg.h" #include #include "external.h" #include "source_mgr.h" diff --git a/src/mgr/usb.cpp b/src/mgr/usb.cpp index 969f94a..1b4e3fb 100644 --- a/src/mgr/usb.cpp +++ b/src/mgr/usb.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "dbg.h" #include #include "aul.h" #include "usb.h" diff --git a/src/util/util.cpp b/src/util/util.cpp index 20e4d5d..887f85d 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -25,11 +25,12 @@ Evas_Object *util_add_btn(Evas_Object *parent, const char *group) { Evas_Object *btn; - UTIL_CHECK_RETURN_NULL(parent); - UTIL_CHECK_RETURN_NULL(group); + if (!parent || !group) + return NULL; btn = elm_button_add(parent); - UTIL_CHECK_RETURN_NULL(btn); + if (!btn) + return NULL; elm_object_style_set(btn, group); @@ -43,11 +44,12 @@ Evas_Object *util_add_layout(Evas_Object *parent, const char *group) { Evas_Object *layout; - UTIL_CHECK_RETURN_NULL(parent); - UTIL_CHECK_RETURN_NULL(group); + if (!parent || !group) + return NULL; layout = elm_layout_add(parent); - UTIL_CHECK_RETURN_NULL(layout); + if (!layout) + return NULL; elm_layout_file_set(layout, EDJ_FILE, group); @@ -61,10 +63,12 @@ Evas_Object *util_add_grid(Evas_Object *parent, int w, int h) { Evas_Object *grid; - UTIL_CHECK_RETURN_NULL(parent); + if (!parent) + return NULL; grid = elm_gengrid_add(parent); - UTIL_CHECK_RETURN_NULL(grid); + if (!grid) + return NULL; elm_scroller_bounce_set(grid, EINA_FALSE, EINA_FALSE); elm_gengrid_horizontal_set(grid, EINA_FALSE); diff --git a/src/view/allsource_view.cpp b/src/view/allsource_view.cpp index b71edfe..85c0a7c 100644 --- a/src/view/allsource_view.cpp +++ b/src/view/allsource_view.cpp @@ -15,7 +15,6 @@ */ #include -#include "dbg.h" #include #include "source_mgr.h" #include "util.h" diff --git a/src/view/menu_view.cpp b/src/view/menu_view.cpp index 300f643..fadb81c 100644 --- a/src/view/menu_view.cpp +++ b/src/view/menu_view.cpp @@ -15,7 +15,6 @@ */ #include -#include "dbg.h" #include #include "source_mgr.h" #include "util.h" @@ -59,10 +58,12 @@ Evas_Object *CMenuView::m_AddLayout(Evas_Object *win) { Evas_Object *base; - UTIL_CHECK_RETURN_NULL(win); + if (!win) + return NULL; base = util_add_layout(win, GRP_MENU); - UTIL_CHECK_RETURN_NULL(base); + if (!base) + return NULL; evas_object_show(base); @@ -76,9 +77,8 @@ Evas_Object *CMenuView::m_AddBtn(Evas_Object *parent, { Evas_Object *btn; - UTIL_CHECK_RETURN_NULL(parent); - UTIL_CHECK_RETURN_NULL(style); - UTIL_CHECK_RETURN_NULL(str); + if (!parent || !style || !str) + return NULL; btn = elm_button_add(parent); if (!btn) { diff --git a/src/view/plugged_layout.cpp b/src/view/plugged_layout.cpp index e490e2d..191aa35 100644 --- a/src/view/plugged_layout.cpp +++ b/src/view/plugged_layout.cpp @@ -15,7 +15,6 @@ */ #include "def.h" -#include "dbg.h" #include #include "external.h" #include "source_mgr.h" -- 2.7.4