Fix -Wextra and -pedantic errors 16/258416/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20210518.013119 submit/tizen_4.0/20210517.082517 submit/tizen_4.0/20210518.000739
authorAgnieszka Baumann <a.baumann@samsung.com>
Fri, 14 Feb 2020 16:56:33 +0000 (17:56 +0100)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 17 May 2021 07:24:11 +0000 (07:24 +0000)
Change-Id: I310c578efcb4dcddd1e3e0ecf6a5c7c81826bcfc
(cherry picked from commit 7bcccb7b32f562f61e08fafe9675804c1811ede4)

src/common/config-parser.c
src/common/dbus.c
src/common/event.c
src/common/log.h
src/common/module.c
src/memory/memory-killer.c
src/proc-usage/proc-usage-dbus.c
src/test/test.c
src/watchdog/watchdog.c

index 32265fd18b0f796464b0d9b55a441b99777d00cf..c8df4def2af833c9602b3993b77924f0e0cd7f31 100644 (file)
@@ -77,7 +77,7 @@ API int config_parser_get_int_list(const char *name, const char *group, const ch
 
 API void config_parser_foreach(const char *name, const char *group, config_parser_foreach_func func)
 {
-       int i;
+       size_t i;
        gsize len;
        gchar *value;
        GError *err = NULL;
index 9acd81441655e5f32472817d1ad5501ffc7cdf65..501e78c414293129f4c3128aee02f1697dfdce2b 100644 (file)
@@ -67,7 +67,11 @@ static void dbus_method_handler(GDBusConnection *connection,
                GVariant *parameters, GDBusMethodInvocation *invocation,
                gpointer user_data)
 {
-       int i;
+       (void) connection;
+       (void) sender;
+       (void) object_path;
+       (void) interface_name;
+       size_t i;
        struct dbus_method_handle *handle;
        int name_len;
 
@@ -130,7 +134,7 @@ static int dbus_generate_introspection_xml(const char *interface,
                struct dbus_method *methods, const size_t num_methods, gchar *xml)
 {
        gchar buf[DBUS_BUF_SIZE];
-       int i;
+       size_t i;
 
        g_snprintf(buf, DBUS_BUF_SIZE, DBUS_XML_PREFIX, interface);
        g_strlcat(xml, buf, DBUS_BUF_SIZE);
@@ -219,6 +223,11 @@ static void dbus_signal_handler(GDBusConnection *connection,
                const gchar *interface_name, const gchar *signal_name,
                GVariant *parameters, gpointer user_data)
 {
+       (void) connection;
+       (void) sender;
+       (void) object_path;
+       (void) interface_name;
+       (void) signal_name;
        struct dbus_signal *signal = (struct dbus_signal *)user_data;
        if (!signal || !signal->callback)
                return;
@@ -332,7 +341,7 @@ API int dbus_init(void)
 
 API void dbus_exit(void)
 {
-       int i;
+       size_t i;
        struct dbus_signal_handle *signal_handle;
        struct dbus_method_handle *method_handle;
        GDBusConnection *conn = dbus_get_connection();
index 5015f13539c38e610fd645492a09d6db120a0c53..3f4f11ebaf05f80e0bb6c4c3527e369ca2db0ae6 100644 (file)
@@ -124,6 +124,7 @@ static gboolean event_worker_source_check(GSource *source)
 static gboolean event_worker_source_dispatch(GSource *source,
                GSourceFunc callback, gpointer user_data)
 {
+       (void) source;
        struct event_worker *worker = user_data;
        struct event *event;
 
index 655cc8b2f55555df71cf561787fb0168551a7681..28e12deda281133d2a711151e11f094d22adc2ff 100644 (file)
@@ -33,9 +33,9 @@
 #undef LOG_TAG
 #define LOG_TAG "RESOURCED"
 
-#define _D(fmt, arg...) SLOGD(fmt, ##arg)
-#define _I(fmt, arg...) SLOGI(fmt, ##arg)
-#define _W(fmt, arg...) SLOGW(fmt, ##arg)
-#define _E(fmt, arg...) SLOGE(fmt, ##arg)
+#define _D(fmt, ...) SLOGD(fmt, ##__VA_ARGS__)
+#define _I(fmt, ...) SLOGI(fmt, ##__VA_ARGS__)
+#define _W(fmt, ...) SLOGW(fmt, ##__VA_ARGS__)
+#define _E(fmt, ...) SLOGE(fmt, ##__VA_ARGS__)
 
 #endif /* __RESOURCED_HEADLESS_LOG_H__ */
index 6c4877c58cae11b41730b39b65d113d00e4ca391..59fd6958d54f2fd5682b3b52c3e4523e51b4353d 100644 (file)
@@ -137,6 +137,7 @@ API int module_register(void)
 
 static void module_exit(struct module *module, void *user_data)
 {
+       (void) user_data;
        int ret;
 
        if (module->event_handler) {
index 4d5e97a39c345fe2f1c26f3826cf021279dacd5d..bc26f93c4433fd19dd65ba8e3a1fcf844e7d70ae 100644 (file)
@@ -359,6 +359,7 @@ API int memory_killer_work(void)
 
 static gboolean memory_killer_notify(gpointer user_data)
 {
+       (void) user_data;
        static enum memory_level last_level = MEMORY_LEVEL_NORMAL;
        enum memory_level cur_level;
        int ret;
@@ -502,6 +503,7 @@ clean:
  */
 static void memory_killer_add_whitelist(const char *key, const void *not_used)
 {
+       (void) not_used;
        gchar *basename;
 
        basename = g_strndup(key, strlen(key));
index ec11f79e84b3ac158ad578fb1bb831c018032715..03beca035dba1e3baa9b2896f9fd1112ee3dcf13 100644 (file)
@@ -69,11 +69,13 @@ static void proc_usage_dbus_process_cpu_usage(GDBusMethodInvocation *invocation,
 
 static void proc_usage_dbus_all_apps_memory_usage(GDBusMethodInvocation *invocation, GVariant *params)
 {
+       (void) params;
        proc_usage_dbus_push_event(PROC_USAGE_EVENT_ALL_APPS_MEMORY_USAGE, invocation, NULL);
 }
 
 static void proc_usage_dbus_all_apps_cpu_usage(GDBusMethodInvocation *invocation, GVariant *params)
 {
+       (void) params;
        proc_usage_dbus_push_event(PROC_USAGE_EVENT_ALL_APPS_CPU_USAGE, invocation, NULL);
 }
 
index 81aa74e65bafdb40d36b849dd00a5acad8430d35..90960f0a36a52e9461a07be25cdebc71413f299d 100644 (file)
@@ -80,6 +80,7 @@ void test_dbus_method(GDBusMethodInvocation *invocation, GVariant *params)
 
 void test_event(GDBusMethodInvocation *invocation, GVariant *params)
 {
+       (void) params;
        int *arg_broadcast = malloc(sizeof(int));
        int *arg_send = malloc(sizeof(int));
        gint err_code;
index d04134a0625ebf3822796afe25ea281feac132ef..fc444823552ed363c6630f961e5ec8e2a33e1b9f 100644 (file)
@@ -175,6 +175,7 @@ static void proc_argos_watchdog_handler(GDBusMethodInvocation *invocation, GVari
 
 static gboolean watchdog_check_cb(gpointer data)
 {
+       (void) data;
        int oom_score_adj = 0, ret;
        pid_t pid = watchdog_info.pid;