Code cleanup 65/306065/4 accepted/tizen/unified/20240220.115633 accepted/tizen/unified/20240220.144638 accepted/tizen/unified/x/20240221.033421
authorminje.ahn <minje.ahn@samsung.com>
Fri, 16 Feb 2024 02:53:13 +0000 (11:53 +0900)
committerMinje ahn <minje.ahn@samsung.com>
Fri, 16 Feb 2024 08:26:59 +0000 (08:26 +0000)
Change-Id: I74d12651c6e92d9a788cfee8774563f7eb561ebd
Signed-off-by: minje.ahn <minje.ahn@samsung.com>
gif/unittest/FileInterface.cpp
imgp/mm_util_imgp.c
jpeg/mm_util_jpeg.c
jpeg/unittest/FileInterface.cpp

index b85607d..aad9430 100644 (file)
@@ -60,9 +60,9 @@ bool FileInterface::ReadData()
                return false;
 
        readData = (unsigned char *)calloc(1, fileSize);
-       if (fread(readData, 1, fileSize, fp) != fileSize) {
+       if (fread(readData, 1, fileSize, fp) != fileSize)
                return false;
-       }
+
        readDataSize = fileSize;
        return true;
 }
index af16cf9..5cb316b 100644 (file)
@@ -42,8 +42,6 @@ static int __check_valid_picture_size(unsigned int width, unsigned int height)
 
 static bool __mm_gst_can_resize_format(mm_util_color_format_e color_format)
 {
-       bool _bool = false;
-
        mm_util_debug("color_format [%d]", color_format);
 
        switch (color_format) {
@@ -58,19 +56,15 @@ static bool __mm_gst_can_resize_format(mm_util_color_format_e color_format)
        case MM_UTIL_COLOR_BGRA:
        case MM_UTIL_COLOR_RGBA:
        case MM_UTIL_COLOR_BGRX:
-               _bool = true;
-               break;
+               return true;
        default:
                mm_util_error("Not supported format");  //only not support NV12
+               return false;
        }
-
-       return _bool;
 }
 
 static bool __mm_gst_can_rotate_format(mm_util_color_format_e color_format)
 {
-       bool _bool = false;
-
        mm_util_debug("color_format [%d]", color_format);
 
        switch (color_format) {
@@ -80,13 +74,11 @@ static bool __mm_gst_can_rotate_format(mm_util_color_format_e color_format)
        case MM_UTIL_COLOR_ARGB:
        case MM_UTIL_COLOR_BGRA:
        case MM_UTIL_COLOR_RGBA:
-               _bool = true;
-               break;
+               return true;
        default:
                mm_util_error("Not supported format");
+               return false;
        }
-
-       return _bool;
 }
 
 static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, bool is_crop, size_t *imgsize)
@@ -415,7 +407,7 @@ int mm_util_resize_image(mm_util_image_h src, unsigned int width, unsigned int h
                goto ERROR;
        }
 
-       if (__mm_gst_can_resize_format(_imgp_info_s->src_format) == false) {
+       if (!__mm_gst_can_resize_format(_imgp_info_s->src_format)) {
                mm_util_error("Not supported format");
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                goto ERROR;
@@ -504,7 +496,7 @@ int mm_util_rotate_image(mm_util_image_h src, mm_util_rotate_type_e angle, mm_ut
                goto ERROR;
        }
 
-       if (__mm_gst_can_rotate_format(_imgp_info_s->src_format) == false) {
+       if (!__mm_gst_can_rotate_format(_imgp_info_s->src_format)) {
                mm_util_error("Not supported format");
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                goto ERROR;
index 3a659d6..579be03 100644 (file)
@@ -55,8 +55,6 @@ static void __my_error_exit(j_common_ptr cinfo)
 
 static bool __is_supported_color_format_with_libjpeg(mm_util_color_format_e color_format)
 {
-       bool _bool = false;
-
        if (color_format == MM_UTIL_COLOR_RGB24 ||
                color_format == MM_UTIL_COLOR_RGBA ||
                color_format == MM_UTIL_COLOR_BGRA ||
@@ -65,28 +63,22 @@ static bool __is_supported_color_format_with_libjpeg(mm_util_color_format_e colo
                color_format == MM_UTIL_COLOR_YUV422 ||
                color_format == MM_UTIL_COLOR_UYVY ||
                color_format == MM_UTIL_COLOR_GRAYSCALE) {
-               _bool = true;
+               return true;
        }
 
-       if (!_bool)
-               mm_util_error("not supported color format %d", color_format);
-
-       return _bool;
+       mm_util_error("not supported color format %d", color_format);
+       return false;
 }
 
 static bool __mm_util_is_supported_color_format(mm_util_color_format_e color_format)
 {
-       bool _bool = false;
-
        if (__is_supported_color_format_with_libjpeg(color_format) ||
                color_format == MM_UTIL_COLOR_NV12) {
-               _bool = true;
+               return true;
        }
 
-       if (!_bool)
-               mm_util_error("not supported color format %d", color_format);
-
-       return _bool;
+       mm_util_error("not supported color format %d", color_format);
+       return false;
 }
 
 static int __jpeg_set_error_handler(my_error_ptr jerr, jpeg_error_ptr *err)
index b85607d..aad9430 100644 (file)
@@ -60,9 +60,9 @@ bool FileInterface::ReadData()
                return false;
 
        readData = (unsigned char *)calloc(1, fileSize);
-       if (fread(readData, 1, fileSize, fp) != fileSize) {
+       if (fread(readData, 1, fileSize, fp) != fileSize)
                return false;
-       }
+
        readDataSize = fileSize;
        return true;
 }