summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ce42d21)
Fix gcc warnings of this kind:
CC stream-class.lo
/home/simark/src/babeltrace/src/ctf-writer/stream-class.c: In function ‘bt_ctf_stream_class_common_add_event_class’:
/home/simark/src/babeltrace/src/ctf-writer/stream-class.c:177:3: error: jump skips variable initialization [-Werror=jump-misses-init]
177 | goto end;
| ^~~~
/home/simark/src/babeltrace/src/ctf-writer/stream-class.c:389:1: note: label ‘end’ defined here
389 | end:
| ^~~
/home/simark/src/babeltrace/src/ctf-writer/stream-class.c:241:29: note: ‘query’ declared here
241 | struct bt_ctf_search_query query = { .value = event_class, .found = 0 };
| ^~~~~
Fix it by moving the declarations near the top, as our coding style
prescribes.
Change-Id: I49209e40894a362f84c413e50640ea62ff040de4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2267
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
-Wno-logical-op dnl
-Wno-shadow dnl
-Wno-null-dereference dnl
-Wno-logical-op dnl
-Wno-shadow dnl
-Wno-null-dereference dnl
- -Wno-jump-misses-init dnl
-Wno-double-promotion dnl
-Wno-cast-align dnl
])
-Wno-double-promotion dnl
-Wno-cast-align dnl
])
const enum bt_ctf_validation_flag validation_flags =
BT_CTF_VALIDATION_FLAG_EVENT;
struct bt_ctf_clock_class *expected_clock_class = NULL;
const enum bt_ctf_validation_flag validation_flags =
BT_CTF_VALIDATION_FLAG_EVENT;
struct bt_ctf_clock_class *expected_clock_class = NULL;
+ struct bt_ctf_search_query query = { .value = event_class, .found = 0 };
BT_ASSERT_DBG(copy_field_type_func);
BT_ASSERT_DBG(copy_field_type_func);
}
/* Check for duplicate event classes */
}
/* Check for duplicate event classes */
- struct bt_ctf_search_query query = { .value = event_class, .found = 0 };
g_ptr_array_foreach(stream_class->event_classes, event_class_exists,
&query);
if (query.found) {
g_ptr_array_foreach(stream_class->event_classes, event_class_exists,
&query);
if (query.found) {
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
bt_field *field = NULL;
struct bt_msg_iter *notit = data;
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
bt_field *field = NULL;
struct bt_msg_iter *notit = data;
+ bt_field_class_type type;
BT_COMP_LOGT("Floating point number function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_COMP_LOGT("Floating point number function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
}
field = borrow_next_field(notit);
}
field = borrow_next_field(notit);
- bt_field_class_type type = bt_field_get_class_type(field);
+ type = bt_field_get_class_type(field);
BT_ASSERT_DBG(field);
BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
BT_ASSERT_DBG(bt_field_class_type_is(type, BT_FIELD_CLASS_TYPE_REAL));
BT_ASSERT_DBG(field);
BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
BT_ASSERT_DBG(bt_field_class_type_is(type, BT_FIELD_CLASS_TYPE_REAL));
GString *make_trace_path_rel(const struct fs_sink_trace *trace)
{
GString *path = NULL;
GString *make_trace_path_rel(const struct fs_sink_trace *trace)
{
GString *path = NULL;
+ const char *trace_name;
if (trace->fs_sink->assume_single_trace) {
/* Use output directory directly */
if (trace->fs_sink->assume_single_trace) {
/* Use output directory directly */
}
/* Otherwise, use the trace name, if available. */
}
/* Otherwise, use the trace name, if available. */
- const char *trace_name = bt_trace_get_name(trace->ir_trace);
+ trace_name = bt_trace_get_name(trace->ir_trace);
if (trace_name) {
path = g_string_new(trace_name);
goto end;
if (trace_name) {
path = g_string_new(trace_name);
goto end;