From: hj kim Date: Tue, 14 Apr 2020 06:33:44 +0000 (+0900) Subject: Apply tizen coding rule X-Git-Tag: submit/tizen/20200506.063025~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F230783%2F1;p=platform%2Fcore%2Fapi%2Fimage-util.git Apply tizen coding rule Change-Id: I33e779102e87d347efeee43b6bb453fed67db915 --- diff --git a/src/image_util_decode.c b/src/image_util_decode.c index 3127b1e..7b04452 100644 --- a/src/image_util_decode.c +++ b/src/image_util_decode.c @@ -37,7 +37,7 @@ static int _convert_decode_scale_tbl[] = { #define _NOT_SUPPORTED_IMAGE_TYPE (-1) #define IMG_HEADER_LENGTH 8 -static int _image_util_decode_read_header(const char *path, unsigned char **buffer) +static int __image_util_decode_read_header(const char *path, unsigned char **buffer) { FILE *fp = NULL; unsigned char *read_buffer = NULL; @@ -80,7 +80,7 @@ static int _image_util_decode_read_header(const char *path, unsigned char **buff return IMAGE_UTIL_ERROR_NONE; } -static int _image_util_decode_check_image_type(const unsigned char *image_buffer, image_util_type_e *image_type) +static int __image_util_decode_check_image_type(const unsigned char *image_buffer, image_util_type_e *image_type) { static char _JPEG_HEADER[] = { 0xFF, 0xD8 }; static char _PNG_HEADER[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a }; @@ -147,12 +147,12 @@ int image_util_decode_set_input_path(image_util_decode_h handle, const char *pat image_util_retvm_if(_handle == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle"); image_util_retvm_if(!IMAGE_UTIL_STRING_VALID(path), IMAGE_UTIL_ERROR_NO_SUCH_FILE, "Invalid path"); - err = _image_util_decode_read_header(path, &image_header); - image_util_retvm_if((err != IMAGE_UTIL_ERROR_NONE), err, "_image_util_decode_read_header failed"); + err = __image_util_decode_read_header(path, &image_header); + image_util_retvm_if((err != IMAGE_UTIL_ERROR_NONE), err, "__image_util_decode_read_header failed"); - err = _image_util_decode_check_image_type(image_header, &_handle->image_type); + err = __image_util_decode_check_image_type(image_header, &_handle->image_type); if (err != IMAGE_UTIL_ERROR_NONE) { - image_util_error("_image_util_decode_check_image_type failed"); + image_util_error("__image_util_decode_check_image_type failed"); IMAGE_UTIL_SAFE_FREE(image_header); return err; } @@ -176,8 +176,8 @@ int image_util_decode_set_input_buffer(image_util_decode_h handle, const unsigne image_util_retvm_if(_handle == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle"); image_util_retvm_if((src_buffer == NULL || src_size < IMG_HEADER_LENGTH), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid input buffer"); - err = _image_util_decode_check_image_type(src_buffer, &_handle->image_type); - image_util_retvm_if(err != IMAGE_UTIL_ERROR_NONE, err, "_image_util_decode_check_image_type failed"); + err = __image_util_decode_check_image_type(src_buffer, &_handle->image_type); + image_util_retvm_if(err != IMAGE_UTIL_ERROR_NONE, err, "__image_util_decode_check_image_type failed"); IMAGE_UTIL_SAFE_FREE(_handle->src_buffer); @@ -343,12 +343,12 @@ static int __image_util_decode_run_from_file(image_util_decode_h handle, const c image_util_fenter(); - ret = _image_util_decode_read_header(file_path, &image_header); - image_util_retvm_if((ret != IMAGE_UTIL_ERROR_NONE), ret, "_image_util_decode_read_header failed"); + ret = __image_util_decode_read_header(file_path, &image_header); + image_util_retvm_if((ret != IMAGE_UTIL_ERROR_NONE), ret, "__image_util_decode_read_header failed"); - ret = _image_util_decode_check_image_type(image_header, &image_type); + ret = __image_util_decode_check_image_type(image_header, &image_type); IMAGE_UTIL_SAFE_FREE(image_header); - image_util_retvm_if((ret != IMAGE_UTIL_ERROR_NONE), ret, "_image_util_decode_check_image_type failed"); + image_util_retvm_if((ret != IMAGE_UTIL_ERROR_NONE), ret, "__image_util_decode_check_image_type failed"); switch (image_type) { case IMAGE_UTIL_JPEG: @@ -398,8 +398,8 @@ static int __image_util_decode_run_from_buffer(image_util_decode_h handle, const image_util_fenter(); - ret = _image_util_decode_check_image_type(buffer, &image_type); - image_util_retvm_if(ret != IMAGE_UTIL_ERROR_NONE, ret, "_image_util_decode_check_image_type failed"); + ret = __image_util_decode_check_image_type(buffer, &image_type); + image_util_retvm_if(ret != IMAGE_UTIL_ERROR_NONE, ret, "__image_util_decode_check_image_type failed"); switch (image_type) { case IMAGE_UTIL_JPEG: @@ -430,7 +430,7 @@ static int __image_util_decode_run_from_buffer(image_util_decode_h handle, const return _image_error_capi(ret); } -gpointer _image_util_decode_thread(gpointer data) +static gpointer __image_util_decode_thread(gpointer data) { decode_s *_handle = (decode_s *) data; int ret = IMAGE_UTIL_ERROR_NONE; @@ -486,13 +486,13 @@ gpointer _image_util_decode_thread(gpointer data) return NULL; } -static int _image_util_decode_create_thread(decode_s * handle) +static int __image_util_decode_create_thread(decode_s * handle) { image_util_retvm_if((handle == NULL), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle"); image_util_retvm_if((handle->thread != NULL), IMAGE_UTIL_ERROR_INVALID_OPERATION, "A thread is alread running"); /*create threads */ - handle->thread = g_thread_new("decode_thread", (GThreadFunc) _image_util_decode_thread, (gpointer) handle); + handle->thread = g_thread_new("decode_thread", (GThreadFunc) __image_util_decode_thread, (gpointer) handle); image_util_retvm_if((!handle->thread), IMAGE_UTIL_ERROR_INVALID_OPERATION, "ERROR - create thread"); return IMAGE_UTIL_ERROR_NONE; @@ -524,7 +524,7 @@ int image_util_decode_run_async(image_util_decode_h handle, image_util_decode_co _handle->_decode_cb->user_data = user_data; _handle->_decode_cb->image_decode_completed_cb = completed_cb; - err = _image_util_decode_create_thread(_handle); + err = __image_util_decode_create_thread(_handle); if (err != IMAGE_UTIL_ERROR_NONE) { IMAGE_UTIL_SAFE_FREE(_handle->_decode_cb); _handle->_decode_cb = NULL; @@ -567,7 +567,7 @@ int image_util_decode_run_async2(image_util_decode_h handle, image_util_decode_c _handle->decode2_cb->user_data = user_data; _handle->decode2_cb->image_decode_completed_cb = callback; - ret = _image_util_decode_create_thread(_handle); + ret = __image_util_decode_create_thread(_handle); if (ret != IMAGE_UTIL_ERROR_NONE) IMAGE_UTIL_SAFE_FREE(_handle->decode2_cb); diff --git a/src/image_util_encode.c b/src/image_util_encode.c index d1c4575..17cf675 100644 --- a/src/image_util_encode.c +++ b/src/image_util_encode.c @@ -435,7 +435,7 @@ static int __image_util_encode_run_to_buffer(image_util_encode_h handle, image_u return _image_error_capi(ret); } -gpointer _image_util_encode_thread(gpointer data) +static gpointer __image_util_encode_thread(gpointer data) { int ret = IMAGE_UTIL_ERROR_NONE; encode_s *_handle = (encode_s *) data; @@ -494,13 +494,13 @@ gpointer _image_util_encode_thread(gpointer data) return NULL; } -static int _image_util_encode_create_thread(encode_s * handle) +static int __image_util_encode_create_thread(encode_s * handle) { image_util_retvm_if((handle == NULL), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle"); image_util_retvm_if((handle->thread != NULL), IMAGE_UTIL_ERROR_INVALID_OPERATION, "The thread is alread running"); /*create threads */ - handle->thread = g_thread_new("encode_thread", (GThreadFunc) _image_util_encode_thread, (gpointer) handle); + handle->thread = g_thread_new("encode_thread", (GThreadFunc) __image_util_encode_thread, (gpointer) handle); image_util_retvm_if((handle->thread == NULL), IMAGE_UTIL_ERROR_INVALID_OPERATION, "ERROR - create thread"); return IMAGE_UTIL_ERROR_NONE; @@ -548,7 +548,7 @@ int image_util_encode_run_async(image_util_encode_h handle, image_util_encode_co _handle->_encode_cb->user_data = user_data; _handle->_encode_cb->image_encode_completed_cb = completed_cb; - err = _image_util_encode_create_thread(_handle); + err = __image_util_encode_create_thread(_handle); if (err != IMAGE_UTIL_ERROR_NONE) { IMAGE_UTIL_SAFE_FREE(_handle->_encode_cb); _handle->_encode_cb = NULL; @@ -596,7 +596,7 @@ int image_util_encode_run_async_to_file(image_util_encode_h handle, image_util_i _handle->encode_to_file_cb->user_data = user_data; _handle->encode_to_file_cb->image_encode_to_file_cb = completed_cb; - ret = _image_util_encode_create_thread(_handle); + ret = __image_util_encode_create_thread(_handle); if (ret != IMAGE_UTIL_ERROR_NONE) { mm_image_destroy_image(_handle->new_src); IMAGE_UTIL_SAFE_FREE(_handle->encode_to_file_cb); @@ -633,7 +633,7 @@ int image_util_encode_run_async_to_buffer(image_util_encode_h handle, image_util _handle->encode_to_buffer_cb->user_data = user_data; _handle->encode_to_buffer_cb->image_encode_to_buffer_cb = completed_cb; - ret = _image_util_encode_create_thread(_handle); + ret = __image_util_encode_create_thread(_handle); if (ret != IMAGE_UTIL_ERROR_NONE) { mm_image_destroy_image(_handle->new_src); IMAGE_UTIL_SAFE_FREE(_handle->encode_to_buffer_cb);