From c88dd1cb8e4858f962f417943983cb39c1a2c245 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 13 Jun 2019 11:09:29 -0400 Subject: [PATCH] Cleanup: remove plugin-common.h It was only used to define 'UNUSED_VAR' which we can use literally. Change-Id: Idf84f6ecee711e2caf4b7d68f5e6f598b0aca22e Signed-off-by: Michael Jeanson Reviewed-on: https://review.lttng.org/c/babeltrace/+/1425 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/plugins/Makefile.am | 2 -- src/plugins/ctf/fs-src/fs.c | 3 +- src/plugins/ctf/lttng-live/lttng-live.c | 3 +- .../lttng-utils/debug-info/debug-info.c | 3 +- src/plugins/plugins-common.h | 32 ------------------- src/plugins/text/pretty/pretty.c | 3 +- src/plugins/utils/counter/counter.c | 3 +- src/plugins/utils/dummy/dummy.c | 3 +- src/plugins/utils/muxer/muxer.c | 1 - src/plugins/utils/trimmer/trimmer.c | 1 - 10 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 src/plugins/plugins-common.h diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 9b23e3c4..0c53f764 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -3,5 +3,3 @@ SUBDIRS = utils text ctf if ENABLE_DEBUG_INFO SUBDIRS += lttng-utils endif - -noinst_HEADERS = plugins-common.h diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index 5ff6d352..0361018b 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -28,7 +28,6 @@ #include "common/common.h" #include #include "compat/uuid.h" -#include "plugins/plugins-common.h" #include #include "common/assert.h" #include @@ -1928,7 +1927,7 @@ end: BT_HIDDEN bt_self_component_status ctf_fs_init( bt_self_component_source *self_comp, - const bt_value *params, UNUSED_VAR void *init_method_data) + const bt_value *params, __attribute__((unused)) void *init_method_data) { struct ctf_fs_component *ctf_fs; bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK; diff --git a/src/plugins/ctf/lttng-live/lttng-live.c b/src/plugins/ctf/lttng-live/lttng-live.c index 1a24a734..b7df57b9 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.c +++ b/src/plugins/ctf/lttng-live/lttng-live.c @@ -39,7 +39,6 @@ #include #include "compat/compiler.h" #include -#include "plugins/plugins-common.h" #include "data-stream.h" #include "metadata.h" @@ -1564,7 +1563,7 @@ end: BT_HIDDEN bt_self_component_status lttng_live_component_init( bt_self_component_source *self_comp, - const bt_value *params, UNUSED_VAR void *init_method_data) + const bt_value *params, __attribute__((unused)) void *init_method_data) { struct lttng_live_component *lttng_live; bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK; diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index 297be248..a2e0643a 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -30,7 +30,6 @@ #include "logging.h" #include -#include "plugins/plugins-common.h" #include "common/assert.h" #include "common/common.h" @@ -1757,7 +1756,7 @@ int init_from_params(struct debug_info_component *debug_info_component, BT_HIDDEN bt_self_component_status debug_info_comp_init( bt_self_component_filter *self_comp, - const bt_value *params, UNUSED_VAR void *init_method_data) + const bt_value *params, __attribute__((unused)) void *init_method_data) { int ret; struct debug_info_component *debug_info_comp; diff --git a/src/plugins/plugins-common.h b/src/plugins/plugins-common.h deleted file mode 100644 index c7377bf8..00000000 --- a/src/plugins/plugins-common.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef PLUGINS_COMMON_H -#define PLUGINS_COMMON_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 */ diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 9db8770e..cef02609 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -29,7 +29,6 @@ #include #include "compat/compiler.h" #include "common/common.h" -#include "plugins/plugins-common.h" #include #include #include @@ -645,7 +644,7 @@ BT_HIDDEN bt_self_component_status pretty_init( bt_self_component_sink *comp, const bt_value *params, - UNUSED_VAR void *init_method_data) + __attribute__((unused)) void *init_method_data) { bt_self_component_status ret; struct pretty_component *pretty = create_pretty(); diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index 200b9aa7..a6c53936 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -26,7 +26,6 @@ #include #include "common/macros.h" #include "common/common.h" -#include "plugins/plugins-common.h" #include "common/assert.h" #include #include @@ -139,7 +138,7 @@ BT_HIDDEN bt_self_component_status counter_init( bt_self_component_sink *component, const bt_value *params, - UNUSED_VAR void *init_method_data) + __attribute__((unused)) void *init_method_data) { bt_self_component_status ret; struct counter *counter = g_new0(struct counter, 1); diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index d21f26a3..a2a35cb9 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -22,7 +22,6 @@ #include #include "common/macros.h" -#include "plugins/plugins-common.h" #include "common/assert.h" #include "dummy.h" @@ -52,7 +51,7 @@ BT_HIDDEN bt_self_component_status dummy_init( bt_self_component_sink *component, const bt_value *params, - UNUSED_VAR void *init_method_data) + __attribute__((unused)) void *init_method_data) { bt_self_component_status ret; struct dummy *dummy = g_new0(struct dummy, 1); diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index 827532d9..fc725272 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -30,7 +30,6 @@ #include "lib/graph/component.h" #include "lib/graph/message/iterator.h" #include "lib/graph/connection.h" -#include "plugins/plugins-common.h" #include #include #include diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index b8cc481a..1275750d 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -28,7 +28,6 @@ #include "compat/time.h" #include #include "common/common.h" -#include "plugins/plugins-common.h" #include "common/assert.h" #include #include -- 2.34.1