Fix build warnings 06/317506/2 accepted/tizen_unified_x_asan accepted/tizen/unified/20250113.094340 accepted/tizen/unified/x/20250113.143109 accepted/tizen/unified/x/asan/20250211.003550
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 2 Jan 2025 23:52:04 +0000 (08:52 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 3 Jan 2025 09:50:54 +0000 (18:50 +0900)
: -Wenum-conversion
: -Wsizeof-array-div

[Version] 1.1.3
[Issue Type] Clean up

Change-Id: I137d46a579b97b837bc195613f28d70040a41426
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/src/legacy_camera.c
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index 6ce78046e2de64e5c0b78771e23531835ea7fafc..9924bd7404a390eacd4480d1665312040c19d305 100644 (file)
@@ -194,7 +194,7 @@ static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamco
                        image.size = frame->length;
                        image.width = frame->width;
                        image.height = frame->height;
-                       image.format = frame->format;
+                       image.format = (camera_pixel_format_e)frame->format;
 
                        ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
                                "captured-exif-raw-data", &exif, &exif_size,
@@ -213,7 +213,7 @@ static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamco
                        thumb.size = thumbnail->length;
                        thumb.width = thumbnail->width;
                        thumb.height = thumbnail->height;
-                       thumb.format = thumbnail->format;
+                       thumb.format = (camera_pixel_format_e)thumbnail->format;
                }
 
                ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
@@ -224,7 +224,7 @@ static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamco
                        postview.size = scrnl->length;
                        postview.width = scrnl->width;
                        postview.height = scrnl->height;
-                       postview.format = scrnl->format;
+                       postview.format = (camera_pixel_format_e)scrnl->format;
                }
 
                if (handle->is_capture_completed) {
@@ -551,7 +551,7 @@ int _camera_create_private(camera_device_e device, bool is_network, camera_h *ca
 
        CAM_LOG_INFO("device[%d], is_network[%d]", device, is_network);
 
-       info.videodev_type = device;
+       info.videodev_type = (enum MMVideoDeviceType)device;
        info.reserved[0] = (int)is_network;
 
        handle = (camera_s *)g_malloc0(sizeof(camera_s));
index d784b5d4bb885a01ab98916111935df21264a0a1..2bf162fb0baf8d7040c4134ba5017ae55b42ccce 100644 (file)
@@ -4498,9 +4498,9 @@ int camera_dispatcher_attr_get_geotag(muse_module_h module)
        muse_camera_handle_s *muse_camera = NULL;
        muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
        muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
-       double get_value[3] = {0.0, 0.0, 0.0};
+       double get_value[] = {0.0, 0.0, 0.0};
        char *send_msg = NULL;
-       int msg_array_size = 0;
+       int array_length = (G_N_ELEMENTS(get_value) * sizeof(get_value[0])) / sizeof(int);
 
        MUSE_CAMERA_GET_AND_CHECK_HANDLE(module, MUSE_CAMERA_ERROR_NONE);
 
@@ -4508,13 +4508,11 @@ int camera_dispatcher_attr_get_geotag(muse_module_h module)
 
        ret = legacy_camera_attr_get_geotag(muse_camera->camera_handle, &get_value[0], &get_value[1], &get_value[2]);
        if (ret == CAMERA_ERROR_NONE) {
-               msg_array_size = sizeof(get_value) / sizeof(int) + (sizeof(get_value) % sizeof(int) ? 1 : 0);
-
                send_msg = muse_core_msg_new(api,
                        MUSE_TYPE_INT, PARAM_API_CLASS, class,
                        MUSE_TYPE_INT, PARAM_RET, ret,
                        MUSE_TYPE_INT, PARAM_GET_TYPE, MUSE_CAMERA_GET_TYPE_ARRAY,
-                       MUSE_TYPE_ARRAY, "get_value", msg_array_size, get_value,
+                       MUSE_TYPE_ARRAY, "get_value", array_length, get_value,
                        0);
 
                __camera_dispatcher_send_msg(module, send_msg, NULL);
index 89cbdf8738681d146ecb6b02ebf0d79e45b1b47d..2fe660e6b4b7fae02201e9f2c3d991557e95c734 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    1.1.2
+Version:    1.1.3
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0