From b7726e327a09e8ceadb4e131d7d757d500ba7d62 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 25 Nov 2016 17:33:39 -0500 Subject: [PATCH] Fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Left one FIXME about unused function. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- converter/babeltrace-cfg.c | 6 ++++-- lib/plugin-system/iterator.c | 4 ++-- plugins/ctf/common/notif-iter/notif-iter.c | 15 +++++++++------ plugins/text/print.c | 2 -- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/converter/babeltrace-cfg.c b/converter/babeltrace-cfg.c index 6094b127..a2b2ac4f 100644 --- a/converter/babeltrace-cfg.c +++ b/converter/babeltrace-cfg.c @@ -2300,8 +2300,8 @@ struct bt_config *bt_config_from_args(int argc, char *argv[], int *exit_code) struct bt_config *cfg = NULL; poptContext pc = NULL; char *arg = NULL; - struct ctf_legacy_opts ctf_legacy_opts = { 0 }; - struct text_legacy_opts text_legacy_opts = { 0 }; + struct ctf_legacy_opts ctf_legacy_opts; + struct text_legacy_opts text_legacy_opts; enum legacy_input_format legacy_input_format = LEGACY_INPUT_FORMAT_NONE; enum legacy_output_format legacy_output_format = LEGACY_OUTPUT_FORMAT_NONE; @@ -2316,6 +2316,8 @@ struct bt_config *bt_config_from_args(int argc, char *argv[], int *exit_code) bool cur_cfg_comp_params_set = false; unsigned int i; + memset(&ctf_legacy_opts, 0, sizeof(ctf_legacy_opts)); + memset(&text_legacy_opts, 0, sizeof(text_legacy_opts)); *exit_code = 0; if (argc <= 1) { diff --git a/lib/plugin-system/iterator.c b/lib/plugin-system/iterator.c index a1629f90..71393d12 100644 --- a/lib/plugin-system/iterator.c +++ b/lib/plugin-system/iterator.c @@ -188,7 +188,7 @@ enum bt_notification_iterator_status bt_notification_iterator_seek_time( enum bt_notification_iterator_seek_origin seek_origin, int64_t time) { - enum bt_notification_iterator_status ret = BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED; -end: + enum bt_notification_iterator_status ret = + BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED; return ret; } diff --git a/plugins/ctf/common/notif-iter/notif-iter.c b/plugins/ctf/common/notif-iter/notif-iter.c index 6411dd1f..692ed6a9 100644 --- a/plugins/ctf/common/notif-iter/notif-iter.c +++ b/plugins/ctf/common/notif-iter/notif-iter.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -1942,26 +1943,28 @@ end: BT_PUT(event); } +//FIXME: not used ? static void notify_eos(struct bt_ctf_notif_iter *notit, struct bt_notification **notification) { - struct bt_ctf_event *event; + struct bt_ctf_stream *stream = NULL; struct bt_notification *ret = NULL; - /* Create event */ - event = create_event(notit); - if (!event) { + /* Ask the user for the stream */ + stream = notit->medium.medops.get_stream(notit->meta.stream_class, + notit->medium.data); + if (!stream) { goto end; } - ret = bt_notification_stream_end_create(event); + ret = bt_notification_stream_end_create(stream); if (!ret) { goto end; } *notification = ret; end: - BT_PUT(event); + BT_PUT(stream); } static diff --git a/plugins/text/print.c b/plugins/text/print.c index bef50314..df0bea5e 100644 --- a/plugins/text/print.c +++ b/plugins/text/print.c @@ -209,8 +209,6 @@ enum bt_component_status print_event_timestamp(struct text_component *text, struct bt_ctf_trace *trace = NULL; struct bt_ctf_clock *clock = NULL; FILE *out = text->out; - FILE *err = text->err; - uint64_t real_timestamp; stream = bt_ctf_event_get_stream(event); if (!stream) { -- 2.34.1