From 9d471c2496a87201e6f76790243daef8960c7261 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Fri, 1 Apr 2016 09:53:39 +0900 Subject: [PATCH] Apply tizen coding rule Change-Id: I6be9e80ec3c4b84e678154c74f3b8344caf0e48f Signed-off-by: Minje Ahn --- include/thumbnail_util_private.h | 16 ++++++++-------- include/thumbnail_util_type.h | 15 +++++++-------- src/thumbnail_util.c | 10 +++++----- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/include/thumbnail_util_private.h b/include/thumbnail_util_private.h index deacbad..ab80ae5 100755 --- a/include/thumbnail_util_private.h +++ b/include/thumbnail_util_private.h @@ -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 diff --git a/include/thumbnail_util_type.h b/include/thumbnail_util_type.h index 269d652..8f78ded 100755 --- a/include/thumbnail_util_type.h +++ b/include/thumbnail_util_type.h @@ -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; diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index 548f666..b009888 100755 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -24,24 +24,24 @@ 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*/ -- 2.7.4