Fix build warnings 35/236435/2 accepted/tizen/unified/20200618.130010 submit/tizen/20200617.110900
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 17 Jun 2020 05:40:52 +0000 (14:40 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 17 Jun 2020 06:50:29 +0000 (15:50 +0900)
 : -Wsign-compare
 : -Wstringop-truncation
 : -Wdeprecated-declarations
 : -Wcast-function-type

[Version] 0.4.34
[Profile] Common

Change-Id: Ia0a211d69aef052b55208ba3f6fff05d5f0142ba
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/capi-media-camera.spec
src/camera.c
test/camera_test.c

index a7b2bba..a17a973 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.33
+Version:    0.4.34
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b958ac4..6878d5f 100644 (file)
@@ -1761,7 +1761,7 @@ static gpointer _camera_msg_handler_func(gpointer data)
                                cam_idle_event->event = cam_msg->event;
                                cam_idle_event->cb_info = cb_info;
 
-                               strncpy(cam_idle_event->recv_msg, cam_msg->recv_msg, sizeof(cam_idle_event->recv_msg) - 1);
+                               strncpy(cam_idle_event->recv_msg, cam_msg->recv_msg, sizeof(cam_idle_event->recv_msg));
                                memcpy(cam_idle_event->tfd, cam_msg->tfd, sizeof(cam_idle_event->tfd));
 
                                /*LOGD("t:%d add camera event[%d, %p] to IDLE", type, cam_msg->event, cam_idle_event);*/
@@ -3172,7 +3172,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
                }
 
                mm_ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &dp_info->parent_id);
-               if (mm_ret == MM_ERROR_NOT_SUPPORT_API) {
+               if (mm_ret == (int)MM_ERROR_NOT_SUPPORT_API) {
                        LOGE("[NOT_SUPPORTED] type %d", type);
                        return CAMERA_ERROR_NOT_SUPPORTED;
                } else if (mm_ret != MM_ERROR_NONE) {
index f92cdfa..3fe61eb 100644 (file)
@@ -65,9 +65,9 @@ camera_device_e cam_info;
 static GTimer *timer;
 static int g_camera_device_changed_cb_id;
 
-GTimeVal previous_time;
-GTimeVal current_time;
-GTimeVal result_time;
+static struct timeval previous_time;
+static struct timeval current_time;
+static struct timeval result_time;
 
 /*-----------------------------------------------------------------------
 |    GLOBAL CONSTANT DEFINITIONS:                                       |
@@ -382,7 +382,7 @@ const char *facing_direction[] = {
   |    LOCAL FUNCTION PROTOTYPES:                                             |
   ---------------------------------------------------------------------------*/
 static void print_menu();
-static gboolean cmd_input(GIOChannel *channel);
+static gboolean cmd_input(GIOChannel *channel, GIOCondition condition, gpointer data);
 static gboolean mode_change(gchar buf);
 int camcordertest_set_attr_int(const char* attr_subcategory, int value);
 
@@ -393,7 +393,7 @@ static inline void flush_stdin()
        while ((ch = getchar()) != EOF && ch != '\n');
 }
 
-static bool _release_idle_event_callback(void *data)
+static gboolean _release_idle_event_callback(void *data)
 {
        g_print("destroy camera handle\n\n");
 
@@ -1317,7 +1317,7 @@ static void setting_menu(gchar buf)
  * @remark
  * @see
  */
-static gboolean cmd_input(GIOChannel *channel)
+static gboolean cmd_input(GIOChannel *channel, GIOCondition condition, gpointer data)
 {
        gchar *buf = NULL;
        gsize read_size;
@@ -1442,7 +1442,7 @@ static gboolean mode_change(gchar buf)
 
        g_print("\n[camcorder_create - type %d]\n", cam_info);
 
-       g_get_current_time(&previous_time);
+       gettimeofday(&previous_time, NULL);
 
        g_timer_reset(timer);
 
@@ -1495,7 +1495,7 @@ static gboolean mode_change(gchar buf)
 
        camera_start_preview(hcamcorder->camera);
 
-       g_get_current_time(&current_time);
+       gettimeofday(&current_time, NULL);
        timersub(&current_time, &previous_time, &result_time);
 
        g_print("\n\tCamera Starting Time  : %ld.%lds\n", result_time.tv_sec, result_time.tv_usec);