Apply tizen coding rule 70/64370/1 accepted/tizen/common/20160405.132314 accepted/tizen/ivi/20160405.081650 accepted/tizen/mobile/20160405.081533 accepted/tizen/tv/20160405.081558 accepted/tizen/wearable/20160405.081631 submit/tizen/20160405.001445
authorMinje Ahn <minje.ahn@samsung.com>
Fri, 1 Apr 2016 00:53:39 +0000 (09:53 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Fri, 1 Apr 2016 00:53:39 +0000 (09:53 +0900)
Change-Id: I6be9e80ec3c4b84e678154c74f3b8344caf0e48f
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/thumbnail_util_private.h
include/thumbnail_util_type.h
src/thumbnail_util.c

index deacbad..ab80ae5 100755 (executable)
@@ -43,7 +43,7 @@ extern "C" {
 
 #define SAFE_STRLCPY(dst, src, n)      ((g_strlcpy(dst, src, n) < n) ? TRUE : FALSE)
 #define SAFE_STRLCAT(dst, src, n)      g_strlcat(dst, src, n);
-#define SAFE_FREE(src)         {if(src) {free(src); src = NULL;}}
+#define SAFE_FREE(src)         {if (src) {free(src); src = NULL; } }
 #define STRING_VALID(str)              ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
 
 typedef struct {
@@ -53,13 +53,13 @@ typedef struct {
        int dst_height;
        int thumb_size;
        unsigned char *thumb_data;
-}thumbnail_s;
+} thumbnail_s;
 
 typedef struct {
        thumbnail_s *handle;
        thumbnail_extracted_cb thumb_extract_cb;
        void *user_data;
-}thumbnail_extract_cb_s;
+} thumbnail_extract_cb_s;
 
 #define FONT_COLOR_RESET    "\033[0m"
 #define FONT_COLOR_RED      "\033[31m"
@@ -73,7 +73,7 @@ typedef struct {
 #define thumbnail_util_gettid() syscall(__NR_gettid)
 
 #define thumbnail_util_retv_if(expr, val) do { \
-               if(expr) { \
+               if (expr) { \
                        LOGE(FONT_COLOR_RED"[%d]", media_content_gettid());    \
                        return (val); \
                } \
@@ -84,11 +84,11 @@ typedef struct {
        } while (0)
 
 #define thumbnail_util_info(fmt, arg...) do { \
-               LOGI(FONT_COLOR_GREEN"[%d]"fmt"", thumbnail_util_gettid() ,##arg);     \
+               LOGI(FONT_COLOR_GREEN"[%d]"fmt"", thumbnail_util_gettid()##arg);     \
        } while (0)
 
 #define thumbnail_util_error(fmt, arg...) do { \
-               LOGE(FONT_COLOR_RED"[%d]"fmt"",thumbnail_util_gettid(), ##arg);     \
+               LOGE(FONT_COLOR_RED"[%d]"fmt"", thumbnail_util_gettid(), ##arg);     \
        } while (0)
 
 #define thumbnail_util_debug_func() do { \
@@ -100,11 +100,11 @@ typedef struct {
        } while (0)
 
 #define thumbnail_util_sec_warn(fmt, arg...) do { \
-               SECURE_LOGW(FONT_COLOR_GREEN"[%d]"fmt"",thumbnail_util_gettid(), ##arg);     \
+               SECURE_LOGW(FONT_COLOR_GREEN"[%d]"fmt"", thumbnail_util_gettid(), ##arg);     \
        } while (0)
 
 #define thumbnail_util_sec_error(fmt, arg...) do { \
-               SECURE_LOGE(FONT_COLOR_RED"[%d]"fmt"",thumbnail_util_gettid(), ##arg);     \
+               SECURE_LOGE(FONT_COLOR_RED"[%d]"fmt"", thumbnail_util_gettid(), ##arg);     \
        } while (0)
 
 #ifdef __cplusplus
index 269d652..8f78ded 100755 (executable)
@@ -46,14 +46,13 @@ extern "C" {
  * @brief Enumeration for a thumbnail util error.
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  */
- typedef enum
-{
-    THUMBNAIL_UTIL_ERROR_NONE                    = TIZEN_ERROR_NONE,                    /**< Successful */
-    THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER       = TIZEN_ERROR_INVALID_PARAMETER,       /**< Invalid parameter */
-    THUMBNAIL_UTIL_ERROR_OUT_OF_MEMORY           = TIZEN_ERROR_OUT_OF_MEMORY,           /**< Out of memory */
-    THUMBNAIL_UTIL_ERROR_INVALID_OPERATION       = TIZEN_ERROR_INVALID_OPERATION,       /**< Invalid Operation */
-    THUMBNAIL_UTIL_ERROR_FILE_NO_SPACE_ON_DEVICE       = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */
-    THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED             = TIZEN_ERROR_PERMISSION_DENIED,                  /**< Permission denied */
+typedef enum {
+       THUMBNAIL_UTIL_ERROR_NONE                    = TIZEN_ERROR_NONE,                    /**< Successful */
+       THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER       = TIZEN_ERROR_INVALID_PARAMETER,       /**< Invalid parameter */
+       THUMBNAIL_UTIL_ERROR_OUT_OF_MEMORY           = TIZEN_ERROR_OUT_OF_MEMORY,           /**< Out of memory */
+       THUMBNAIL_UTIL_ERROR_INVALID_OPERATION       = TIZEN_ERROR_INVALID_OPERATION,       /**< Invalid Operation */
+       THUMBNAIL_UTIL_ERROR_FILE_NO_SPACE_ON_DEVICE       = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */
+       THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED          = TIZEN_ERROR_PERMISSION_DENIED,                  /**< Permission denied */
 } thumbnail_util_error_e;
 
 
index 548f666..b009888 100755 (executable)
 int __thumbnail_util_error_capi(int content_error)
 {
        /*Error None*/
-       if(content_error == MS_MEDIA_ERR_NONE)
+       if (content_error == MS_MEDIA_ERR_NONE)
                return THUMBNAIL_UTIL_ERROR_NONE;
 
        /* Internal operation error*/
-       else if((content_error == MS_MEDIA_ERR_INVALID_PARAMETER) ||
+       else if ((content_error == MS_MEDIA_ERR_INVALID_PARAMETER) ||
                (content_error == MS_MEDIA_ERR_INVALID_PATH) ||
                (content_error == MS_MEDIA_ERR_THUMB_DUPLICATED_REQUEST))
                return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
 
-       else if(content_error == MS_MEDIA_ERR_OUT_OF_MEMORY)
+       else if (content_error == MS_MEDIA_ERR_OUT_OF_MEMORY)
                return THUMBNAIL_UTIL_ERROR_OUT_OF_MEMORY;
 
        /* IPC operation error*/
-       else if((content_error <= MS_MEDIA_ERR_SOCKET_CONN) && (content_error >= MS_MEDIA_ERR_SOCKET_INTERNAL))
+       else if ((content_error <= MS_MEDIA_ERR_SOCKET_CONN) && (content_error >= MS_MEDIA_ERR_SOCKET_INTERNAL))
                return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;
 
        /* MEDIA SERVER error*/
-       else if(content_error == MS_MEDIA_ERR_PERMISSION_DENIED)
+       else if (content_error == MS_MEDIA_ERR_PERMISSION_DENIED)
                return THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED;
 
        /*ETC*/