Plugins: use UNUSED_VAR instead of casting to void
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 26 Jan 2017 22:09:53 +0000 (17:09 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
13 files changed:
plugins/ctf/fs/Makefile.am
plugins/ctf/fs/fs.c
plugins/ctf/lttng-live/Makefile.am
plugins/ctf/lttng-live/lttng-live.c
plugins/muxer/Makefile.am
plugins/muxer/muxer.c
plugins/plugins-common.h [new file with mode: 0644]
plugins/text/Makefile.am
plugins/text/text.c
plugins/trimmer/Makefile.am
plugins/trimmer/trimmer.c
plugins/writer/Makefile.am
plugins/writer/writer.c

index c08c1aa9e3464c454536e62e0218d814bd7ff102..4585c8ea4f092aede94b5e0e0492ff65445d666a 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 noinst_HEADERS = \
        fs.h \
index 75be8f13a552b2b0ee164821e61e50612508baa8..450627d7bb60258b101590fadb31858df9e94443 100644 (file)
@@ -33,6 +33,7 @@
 #include <babeltrace/component/notification/event.h>
 #include <babeltrace/component/notification/packet.h>
 #include <babeltrace/component/notification/heap.h>
+#include <plugins-common.h>
 #include <glib.h>
 #include <assert.h>
 #include <unistd.h>
@@ -723,11 +724,10 @@ end:
 
 BT_HIDDEN
 enum bt_component_status ctf_fs_init(struct bt_component *source,
-               struct bt_value *params, void *init_method_data)
+               struct bt_value *params, UNUSED_VAR void *init_method_data)
 {
        struct ctf_fs_component *ctf_fs;
        enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-       (void) init_method_data;
 
        assert(source);
        ctf_fs_debug = g_strcmp0(getenv("CTF_FS_DEBUG"), "1") == 0;
index 755be6e8695269eb774f9390284f08324c833a6a..339e432c313707d14c4ba4a96c785626294dca0c 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 libbabeltrace_plugin_ctf_lttng_live_la_SOURCES = lttng-live.c
 
index cac2250316fbdcbb66811783003e65e8fd0e4b27..add91ccb0005ac294c6fc7ad3f2efdef1782f9a8 100644 (file)
 
 #include "lttng-live-internal.h"
 #include <babeltrace/component/component-source.h>
+#include <plugins-common.h>
 
 BT_HIDDEN
 enum bt_component_status lttng_live_iterator_init(struct bt_component *source,
                struct bt_notification_iterator *it)
 {
+    return BT_COMPONENT_STATUS_OK;
 }
 
 BT_HIDDEN
 enum bt_component_status lttng_live_init(struct bt_component *component,
-               struct bt_value *params, void *init_method_data)
+               struct bt_value *params, UNUSED_VAR void *init_method_data)
 {
        return BT_COMPONENT_STATUS_OK;
 }
index a142a856f96b0c6ca0e28bd7b8e009ae663156ae..2aed0496379ec56d1b7824551e0babfb2fb88560 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 SUBDIRS = .
 
index cbc65c4a6b6a6329f0939e2f037699ea15f7da96..f8eb7d30c9f82ec96d2b9d44d04266295e96a946 100644 (file)
@@ -32,6 +32,7 @@
 #include <babeltrace/component/notification/notification.h>
 #include <babeltrace/component/notification/iterator.h>
 #include <babeltrace/component/notification/event.h>
+#include <plugins-common.h>
 #include "muxer.h"
 
 static
@@ -63,11 +64,10 @@ void destroy_muxer(struct bt_component *component)
 
 enum bt_component_status muxer_component_init(
        struct bt_component *component, struct bt_value *params,
-       void *init_method_data)
+       UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        struct muxer *muxer = create_muxer();
-       (void) init_method_data;
 
        if (!muxer) {
                ret = BT_COMPONENT_STATUS_NOMEM;
diff --git a/plugins/plugins-common.h b/plugins/plugins-common.h
new file mode 100644 (file)
index 0000000..c7377bf
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef PLUGINS_COMMON_H
+#define PLUGINS_COMMON_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * UNUSED_VAR: tag a variable or parameter as explicitly unused so that
+ *             the compiler does not warn.
+ */
+#define UNUSED_VAR __attribute__((unused))
+
+#endif /* PLUGINS_COMMON_H */
index 8b12e3124d51adaf83a69ae7a2417e4c84d4c381..cada4e3bee44dd0a9d7437d84c98b92e3bfeb5c2 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 SUBDIRS = .
 
index 2652e6b2f13ecef5b5ebf1b4467c69414015e5c4..78ddd4c58c401f65d2d66253604af810339826d5 100644 (file)
@@ -35,6 +35,7 @@
 #include <babeltrace/component/notification/event.h>
 #include <babeltrace/values.h>
 #include <babeltrace/compiler.h>
+#include <plugins-common.h>
 #include <stdio.h>
 #include <stdbool.h>
 #include <glib.h>
@@ -605,11 +606,10 @@ end:
 static
 enum bt_component_status text_component_init(
                struct bt_component *component, struct bt_value *params,
-               void *init_method_data)
+               UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        struct text_component *text = create_text();
-       (void) init_method_data;
 
        if (!text) {
                ret = BT_COMPONENT_STATUS_NOMEM;
index 4729bc4f240d5c29e8166d0309c9852da77d533b..637564fa9532be532796db1baf80765ccbe3afae 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 SUBDIRS = .
 
index 2848c8006df976b33ed1ca9e13c1b199c0fec3a2..fd028d027cce40ba74cd41ef41fb36dfff347d4a 100644 (file)
@@ -32,6 +32,7 @@
 #include <babeltrace/component/notification/notification.h>
 #include <babeltrace/component/notification/iterator.h>
 #include <babeltrace/component/notification/event.h>
+#include <plugins-common.h>
 #include "trimmer.h"
 #include "iterator.h"
 #include <assert.h>
@@ -350,11 +351,10 @@ end:
 
 enum bt_component_status trimmer_component_init(
        struct bt_component *component, struct bt_value *params,
-       void *init_method_data)
+       UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        struct trimmer *trimmer = create_trimmer_data();
-       (void) init_method_data;
 
        if (!trimmer) {
                ret = BT_COMPONENT_STATUS_NOMEM;
index 3311656725468b166549655e76bf11ee17b24e1a..2f3239ebde2442da87c7ab7e9b73ab39ffddfd6f 100644 (file)
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/plugins
 
 SUBDIRS = .
 
index 4b36757fb628cba75b0647c2a380facdfd1ab6fc..8e4703768f9473a6e6f5da5bde9910f94ec55477 100644 (file)
@@ -34,6 +34,7 @@
 #include <babeltrace/component/notification/iterator.h>
 #include <babeltrace/component/notification/event.h>
 #include <babeltrace/component/notification/packet.h>
+#include <plugins-common.h>
 #include <stdio.h>
 #include <stdbool.h>
 #include <glib.h>
@@ -214,14 +215,13 @@ end:
 static
 enum bt_component_status writer_component_init(
        struct bt_component *component, struct bt_value *params,
-       void *init_method_data)
+       UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        enum bt_value_status value_ret;
        struct writer_component *writer_component = create_writer_component();
        struct bt_value *value = NULL;
        const char *path;
-       (void) init_method_data;
 
        if (!writer_component) {
                ret = BT_COMPONENT_STATUS_NOMEM;
This page took 0.030435 seconds and 4 git commands to generate.