From: Jeongmo Yang Date: Wed, 17 Jun 2020 06:04:24 +0000 (+0900) Subject: Fix build warnings X-Git-Tag: accepted/tizen/unified/20200618.130012^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebae672a0e0d5dbd4c98f42874647df6f041c747;p=platform%2Fcore%2Fapi%2Frecorder.git Fix build warnings : -Wcast-function-type : -Wstringop-truncation : -Wdeprecated-declarations [Version] 0.3.22 [Profile] Common Change-Id: I712ecb53cca7cf16792ef29f79b5235ede95496c Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec index 9f5c439..3afbbf6 100644 --- a/packaging/capi-media-recorder.spec +++ b/packaging/capi-media-recorder.spec @@ -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 diff --git a/src/recorder.c b/src/recorder.c index 1f315cd..e240071 100644 --- a/src/recorder.c +++ b/src/recorder.c @@ -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; diff --git a/test/recorder_test.c b/test/recorder_test.c index c3d0bab..13cf565 100644 --- a/test/recorder_test.c +++ b/test/recorder_test.c @@ -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(¤t); + gettimeofday(¤t, NULL); timersub(¤t, &previous, &res); g_print("Recorder Preparing Time : %ld.%lds\n", res.tv_sec, res.tv_usec);