Fix build error due to toolchain upgrade (gcc6->gcc9) 57/220957/6
authorjiyong.min <jiyong.min@samsung.com>
Thu, 26 Dec 2019 05:23:16 +0000 (14:23 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 26 Dec 2019 08:38:34 +0000 (17:38 +0900)
  error: cast between incompatible function types
  error: '%s' directive argument is null [-Werror=format-overflow=]

Change-Id: I3f8186e0cd44c8e166728e119793ac1eacc95b81

packaging/capi-media-controller.spec
svc/include/media_controller_svc.h
svc/media_controller_svc.c
test/client_test/media_controller_client_test.c
test/server_test/media_controller_server_test.c

index 2207b52..0319ff8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.2.6
+Version:    0.2.7
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
@@ -61,7 +61,7 @@ Collection of files related to Line Coverage. It is teseted as gcov for a media
 %setup -q
 
 %build
-export CFLAGS+=" -Wextra -Wno-array-bounds"
+export CFLAGS+=" -Wextra -Wno-array-bounds -Wno-cast-function-type"
 export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow"
 export CFLAGS+=" -Wwrite-strings -Wswitch-default"
 export CFLAGS+=" -DGST_EXT_TIME_ANALYSIS -include stdint.h"
index e31c1ed..a895e5f 100755 (executable)
@@ -33,7 +33,7 @@ typedef struct {
        GList *connected_apps;
 } mc_service_t;
 
-gboolean mc_svc_thread(void *data);
+gpointer mc_svc_thread(void *data);
 GMainLoop *mc_svc_get_main_loop(void);
 int mc_svc_get_connection_cnt(void);
 
index e935391..021997e 100644 (file)
@@ -771,7 +771,7 @@ ERROR:
        return TRUE;
 }
 
-gboolean mc_svc_thread(void *data)
+gpointer mc_svc_thread(gpointer data)
 {
        int sockfd = -1;
        int ret = MEDIA_CONTROLLER_ERROR_NONE;
index 801497d..03c04c4 100755 (executable)
@@ -1188,13 +1188,19 @@ static void interpret_cmd(char *cmd)
        }
 }
 
-gboolean input(GIOChannel *channel)
+gboolean input(GIOChannel *channel, GIOCondition cond, gpointer data)
 {
        gchar buf[MAX_STRING_LEN];
        gsize read;
        GError *error = NULL;
+       GIOStatus status = G_IO_STATUS_NORMAL;
 
-       g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
+       status = g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
+       if (status != G_IO_STATUS_NORMAL) {
+               g_print("g_io_channel_read_chars failed : %s", error ? error->message : "none");
+               if (error) g_error_free(error);
+               return FALSE;
+       }
 
        buf[read] = '\0';
        g_strstrip(buf);
index 2e1a5bf..b7b3f1b 100755 (executable)
@@ -506,7 +506,10 @@ static void __custom_cmd_received_cb(const char *client_name, const char *reques
        }
 
        g_print("recieved request_id:[%s] command:[%s] from [%s]\n", request_id, command, client_name);
-       g_print("recieved bundle:[%s] from [%s]\n", bundle_data, client_name);
+       if (bundle_data)
+               g_print("recieved bundle:[%s] from [%s]\n", bundle_data, client_name);
+       else
+               g_print("recieved bundle:No bundle from [%s]\n", client_name);
 
        bundle *bundle_reply = bundle_create();
        bundle_add_str(bundle_reply, "key1", "result1_2");
@@ -1394,13 +1397,19 @@ static void __interpret_cmd(char *cmd)
        }
 }
 
-static gboolean __input(GIOChannel *channel)
+static gboolean __input(GIOChannel *channel, GIOCondition cond, gpointer data)
 {
        gchar buf[MAX_STRING_LEN];
        gsize read;
        GError *error = NULL;
+       GIOStatus status = G_IO_STATUS_NORMAL;
 
-       g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
+       status = g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &error);
+       if (status != G_IO_STATUS_NORMAL) {
+               g_print("g_io_channel_read_chars failed : %s", error ? error->message : "none");
+               if (error) g_error_free(error);
+               return FALSE;
+       }
 
        buf[read] = '\0';
        g_strstrip(buf);