Fix build warnings 36/236436/2 accepted/tizen/unified/20200618.130012 submit/tizen/20200617.110900
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 17 Jun 2020 06:04:24 +0000 (15:04 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 17 Jun 2020 06:48:37 +0000 (15:48 +0900)
 : -Wcast-function-type
 : -Wstringop-truncation
 : -Wdeprecated-declarations

[Version] 0.3.22
[Profile] Common

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

index 9f5c439..3afbbf6 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-recorder
 Summary:    A Recorder API
-Version:    0.3.21
+Version:    0.3.22
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 1f315cd..e240071 100644 (file)
@@ -888,7 +888,7 @@ static void *_recorder_msg_handler_func(gpointer data)
                                rec_idle_event->event = rec_msg->event;
                                rec_idle_event->cb_info = cb_info;
 
-                               strncpy(rec_idle_event->recv_msg, rec_msg->recv_msg, sizeof(rec_idle_event->recv_msg) - 1);
+                               strncpy(rec_idle_event->recv_msg, rec_msg->recv_msg, sizeof(rec_idle_event->recv_msg));
 
                                /*LOGD("add recorder event[%d, %p] to IDLE", rec_msg->event, rec_idle_event);*/
 
@@ -1355,7 +1355,7 @@ static void _recorder_client_callback_destroy(recorder_cb_info_s *cb_info)
 }
 
 
-static int _recorder_storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
+static bool _recorder_storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
 {
        char **root_directory = (char **)user_data;
 
index c3d0bab..13cf565 100644 (file)
@@ -123,9 +123,9 @@ static int g_recorder_device_changed_cb_id;
 #endif
 
 
-GTimeVal previous;
-GTimeVal current;
-GTimeVal res;
+static struct timeval previous;
+static struct timeval current;
+static struct timeval res;
 
 
 /*-----------------------------------------------------------------------
@@ -223,7 +223,7 @@ const char *vs_mode[] = {
   |    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 init(int type);
 static gboolean mode_change(gchar buf);
 
@@ -360,7 +360,7 @@ static inline void flush_stdin()
        return;
 }
 
-static bool _release_idle_event_callback(void *data)
+static gboolean _release_idle_event_callback(void *data)
 {
        g_print("destroy recorder handle\n\n");
 
@@ -1137,7 +1137,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;
@@ -1323,7 +1323,7 @@ static gboolean mode_change(gchar buf)
        bool check = FALSE;
        recorder_device_state_e device_state = RECORDER_DEVICE_STATE_IDLE;
 
-       g_get_current_time(&previous);
+       gettimeofday(&previous, NULL);
        g_timer_reset(timer);
 
        if (hcamcorder->recorder) {
@@ -1482,7 +1482,7 @@ static gboolean mode_change(gchar buf)
                return FALSE;
        }
 
-       g_get_current_time(&current);
+       gettimeofday(&current, NULL);
        timersub(&current, &previous, &res);
 
        g_print("Recorder Preparing Time  : %ld.%lds\n", res.tv_sec, res.tv_usec);