Add macro for invalid parameter case 35/228835/3
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 26 Mar 2020 04:15:56 +0000 (13:15 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 26 Mar 2020 05:34:23 +0000 (14:34 +0900)
Change-Id: I28a8bac83c2603a404e4c5fb47261856241f2563
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media_info_private.h
include_product/media_info_private.h

index f999e0e..07b5a6f 100755 (executable)
@@ -566,6 +566,20 @@ int _media_filter_build_option(filter_h filter, char **result);
                        } \
                } while (0)
 
+#define content_retip_if_fail(expr) do { \
+                       if (!(expr)) { \
+                               LOGE(FONT_COLOR_RED"[%ld] Invalid [%s]"FONT_COLOR_RESET, media_content_gettid(), #expr);        \
+                               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \
+                       } \
+               } while (0)
+
+#define content_retipm_if_fail(expr, fmt, arg...) do { \
+                       if (!(expr)) { \
+                               LOGE(FONT_COLOR_RED"[%ld] Cond[%s] value["fmt"]"FONT_COLOR_RESET, media_content_gettid(), #expr, ##arg); \
+                               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \
+                       } \
+               } while (0)
+
 #define content_warn(fmt, arg...) do { \
                        LOGW(FONT_COLOR_GREEN"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg);     \
                } while (0)
index 22b91af..88bedc3 100755 (executable)
@@ -791,6 +791,20 @@ GMutex* _content_get_db_mutex(void);
                        } \
                } while (0)
 
+#define content_retip_if_fail(expr) do { \
+                       if (!(expr)) { \
+                               LOGE(FONT_COLOR_RED"[%ld] Invalid [%s]"FONT_COLOR_RESET, media_content_gettid(), #expr); \
+                               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \
+                       } \
+               } while (0)
+
+#define content_retipm_if_fail(expr, fmt, arg...) do { \
+                       if (!(expr)) { \
+                               LOGE(FONT_COLOR_RED"[%ld] Cond[%s] value["fmt"]"FONT_COLOR_RESET, media_content_gettid(), #expr, ##arg); \
+                               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; \
+                       } \
+               } while (0)
+
 #define content_warn(fmt, arg...) do { \
                        LOGW(FONT_COLOR_GREEN"[%ld]"fmt""FONT_COLOR_RESET, media_content_gettid(), ##arg);     \
                } while (0)