From 7c7301d5827bd10ec7c34da7ffc5fe74e5047d38 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 28 Oct 2019 11:06:04 -0400 Subject: [PATCH] Fix -Wmissing-prototypes/-Wmissing-declarations warnings I think this warning is useful because it catches a lot of instances where we missed including "foo.h" in "foo.c" or where we should make a function static. There are changes in this patch I am not sure about: bt_ctf_event_borrow_stream: there doesn't seem to be any "borrow" functions in the CTF writer API, only get (which return new references), so I presume this is one is not meant to be exposed. I made it static. _bt_ctf_event_freeze: is not used anywhere, starts with an underscore, so I presume it was meant to be internal, so I removed it. bt_ctf_event_common_set_payload: it sounds like something that was meant to be exposed internally, so I added a declaration to the internal event.h. bt_ctf_event_class_get_payload_type_*: they seem like functions that are meant to be exposed in the external API, so I added declarations in the external event.h. bt_ctf_field_type_enumeration_mapping_iterator_next: it probably needs to be exposed to make the functions which return a bt_ctf_field_type_enumeration_mapping_iterator useful. bt_ctf_field_type_enumeration_mapping_iterator_signed_get and bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get: same as above. bt_ctf_trace_visit: I guess it's meant to be exposed, so I added a declaration in the internal trace.h. bt_self_component_port_input_message_iterator_borrow_component_const: I guess this should not exist, because hand out const versions of bt_self_component_port_input_message_iterator? I removed it. bt_plugin_python_create_all_from_file: adding an include of python-plugin-provider.h in python-plugin-provider.c revealed that the declaration was way out of sync with the definition, I've tried to fix that (and succeeded!). Change-Id: I423d70645dbb1305f8993ec837131883bce47031 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2275 --- configure.ac | 2 -- include/babeltrace2-ctf-writer/event.h | 12 +++++++++++ src/bindings/python/bt2/bt2/native_bt.i | 10 +++++++++ .../python/bt2/bt2/native_bt_autodisc.i.h | 1 + .../bt2/bt2/native_bt_message_iterator.i.h | 2 ++ .../python/bt2/bt2/native_bt_plugin.i.h | 5 +++++ src/cli/babeltrace2.c | 1 + src/ctf-writer/attributes.c | 2 ++ src/ctf-writer/event.c | 9 ++------ src/ctf-writer/event.h | 4 ++++ src/ctf-writer/field-types.h | 16 ++++++++++++++ src/ctf-writer/object.c | 1 + src/ctf-writer/stream.c | 1 + src/ctf-writer/trace.h | 4 ++++ src/lib/error.c | 1 + src/lib/graph/iterator.c | 8 ------- src/lib/integer-range-set.c | 1 + src/lib/plugin/plugin.c | 21 ++++++++++++------- src/param-parse/param-parse.c | 2 ++ .../ctf/common/metadata/ctf-meta-resolve.c | 1 + .../decoder-packetized-file-stream-to-buf.c | 2 ++ src/plugins/ctf/common/metadata/lexer.l | 7 ------- src/plugins/ctf/common/metadata/objstack.c | 2 ++ src/plugins/ctf/common/metadata/parser.y | 15 ++++++------- .../ctf/common/metadata/visitor-generate-ir.c | 1 + src/plugins/ctf/common/msg-iter/msg-iter.c | 2 ++ .../ctf/fs-sink/translate-ctf-ir-to-tsdl.c | 2 ++ .../fs-sink/translate-trace-ir-to-ctf-ir.c | 3 +++ .../lttng-utils/debug-info/debug-info.c | 1 + .../trace-ir-metadata-field-class-copy.c | 2 +- src/plugins/text/dmesg/dmesg.c | 2 ++ src/plugins/utils/counter/counter.c | 1 + src/plugins/utils/dummy/dummy.c | 1 + .../python-plugin-provider.c | 4 +++- .../python-plugin-provider.h | 6 ++++-- tests/bitfield/test_bitfield.c | 10 ++++++++- tests/lib/test_bt_values.c | 1 + tests/utils/common.c | 2 ++ 38 files changed, 124 insertions(+), 44 deletions(-) diff --git a/configure.ac b/configure.ac index 8e0e6491..c8012d91 100644 --- a/configure.ac +++ b/configure.ac @@ -672,8 +672,6 @@ AX_COMPILER_FLAGS( -Wno-pointer-arith dnl -Wno-format-nonliteral dnl -Wno-undef dnl - -Wno-missing-prototypes dnl - -Wno-missing-declarations dnl -Wno-double-promotion dnl -Wno-cast-align dnl ]) diff --git a/include/babeltrace2-ctf-writer/event.h b/include/babeltrace2-ctf-writer/event.h index 98151253..6d2ae547 100644 --- a/include/babeltrace2-ctf-writer/event.h +++ b/include/babeltrace2-ctf-writer/event.h @@ -179,6 +179,18 @@ extern int bt_ctf_event_class_set_context_field_type( extern struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type( struct bt_ctf_event_class *event_class); +extern int64_t bt_ctf_event_class_get_payload_type_field_count( + struct bt_ctf_event_class *event_class); + +extern int bt_ctf_event_class_get_payload_type_field_by_index( + struct bt_ctf_event_class *event_class, + const char **field_name, struct bt_ctf_field_type **field_type, + uint64_t index); + +extern struct bt_ctf_field_type * +bt_ctf_event_class_get_payload_type_field_type_by_name( + struct bt_ctf_event_class *event_class, const char *name); + extern int bt_ctf_event_class_set_payload_field_type( struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *payload_type); diff --git a/src/bindings/python/bt2/bt2/native_bt.i b/src/bindings/python/bt2/bt2/native_bt.i index 4e488768..919fc1dc 100644 --- a/src/bindings/python/bt2/bt2/native_bt.i +++ b/src/bindings/python/bt2/bt2/native_bt.i @@ -243,3 +243,13 @@ void bt_bt2_exit_handler(void); %include "native_bt_trace_class.i" %include "native_bt_value.i" %include "native_bt_version.i" + +%{ + +/* + * This function is defined by SWIG. Declare here to avoid a + * -Wmissing-prototypes warning. + */ +PyObject *SWIG_init(void); + +%} diff --git a/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h b/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h index aac92e12..612c9328 100644 --- a/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h @@ -47,6 +47,7 @@ * This function can also return None, if it failed to allocate memory * for the return value and status code. */ +static bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs, const bt_plugin_set *plugin_set) { diff --git a/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h b/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h index deb149cf..7802ee6d 100644 --- a/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h @@ -22,6 +22,7 @@ * THE SOFTWARE. */ +static bt_self_component_port_input_message_iterator_create_from_message_iterator_status bt_bt2_self_component_port_input_message_iterator_create_from_message_iterator( bt_self_message_iterator *self_msg_iter, @@ -41,6 +42,7 @@ bt_bt2_self_component_port_input_message_iterator_create_from_message_iterator( return status; } +static bt_self_component_port_input_message_iterator_create_from_sink_component_status bt_bt2_self_component_port_input_message_iterator_create_from_sink_component( bt_self_component_sink *self_comp, diff --git a/src/bindings/python/bt2/bt2/native_bt_plugin.i.h b/src/bindings/python/bt2/bt2/native_bt_plugin.i.h index 7b15a213..166975b7 100644 --- a/src/bindings/python/bt2/bt2/native_bt_plugin.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_plugin.i.h @@ -30,6 +30,7 @@ * `*OUT`; it could point to unreadable memory. */ +static bt_property_availability bt_bt2_plugin_get_version( const bt_plugin *plugin, unsigned int *major, unsigned int *minor, unsigned int *patch, const char **extra) @@ -45,6 +46,7 @@ bt_property_availability bt_bt2_plugin_get_version( return ret; } +static bt_plugin_find_status bt_bt2_plugin_find(const char *plugin_name, bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, @@ -62,6 +64,7 @@ bt_plugin_find_status bt_bt2_plugin_find(const char *plugin_name, return status; } +static bt_plugin_find_all_status bt_bt2_plugin_find_all(bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, bt_bool fail_on_load_error, @@ -79,6 +82,7 @@ bt_plugin_find_all_status bt_bt2_plugin_find_all(bt_bool find_in_std_env_var, return status; } +static bt_plugin_find_all_from_file_status bt_bt2_plugin_find_all_from_file( const char *path, bt_bool fail_on_load_error, const bt_plugin_set **plugin_set) @@ -94,6 +98,7 @@ bt_plugin_find_all_from_file_status bt_bt2_plugin_find_all_from_file( return status; } +static bt_plugin_find_all_from_dir_status bt_bt2_plugin_find_all_from_dir( const char *path, bt_bool recurse, bt_bool fail_on_load_error, const bt_plugin_set **plugin_set) diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index eaffebcd..c63a16c7 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -811,6 +811,7 @@ typedef void *(* plugin_borrow_comp_cls_by_index_func_t)(const bt_plugin *, typedef const bt_component_class *(* spec_comp_cls_borrow_comp_cls_func_t)( void *); +static void cmd_list_plugins_print_component_classes(const bt_plugin *plugin, const char *cc_type_name, uint64_t count, plugin_borrow_comp_cls_by_index_func_t borrow_comp_cls_by_index_func, diff --git a/src/ctf-writer/attributes.c b/src/ctf-writer/attributes.c index 3665d1fc..5d17f7a9 100644 --- a/src/ctf-writer/attributes.c +++ b/src/ctf-writer/attributes.c @@ -28,6 +28,8 @@ #define BT_LOG_TAG "CTF-WRITER/ATTRS" #include "logging.h" +#include "attributes.h" + #include "common/assert.h" #include "common/macros.h" #include "compat/string.h" diff --git a/src/ctf-writer/event.c b/src/ctf-writer/event.c index 5c483ed4..158aa208 100644 --- a/src/ctf-writer/event.c +++ b/src/ctf-writer/event.c @@ -518,6 +518,7 @@ end: return ret; } +static int map_clock_classes_func(struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_field_type_common *packet_context_type, struct bt_ctf_field_type_common *event_header_type) @@ -645,7 +646,7 @@ struct bt_ctf_event_class *bt_ctf_event_get_class(struct bt_ctf_event *event) return bt_ctf_object_get_ref(bt_ctf_event_common_borrow_class(BT_CTF_TO_COMMON(event))); } -BT_HIDDEN +static struct bt_ctf_stream *bt_ctf_event_borrow_stream(struct bt_ctf_event *event) { BT_ASSERT_DBG(event); @@ -756,12 +757,6 @@ end: return ret; } -BT_HIDDEN -void _bt_ctf_event_freeze(struct bt_ctf_event *event) -{ - _bt_ctf_event_common_set_is_frozen(BT_CTF_TO_COMMON(event), true); -} - int bt_ctf_event_set_header(struct bt_ctf_event *event, struct bt_ctf_field *header) { diff --git a/src/ctf-writer/event.h b/src/ctf-writer/event.h index a51b9011..968abff7 100644 --- a/src/ctf-writer/event.h +++ b/src/ctf-writer/event.h @@ -106,6 +106,10 @@ int bt_ctf_event_common_initialize(struct bt_ctf_event_common *event, create_header_field_func_type create_header_field_func, release_header_field_func_type release_header_field_func); +BT_HIDDEN +int bt_ctf_event_common_set_payload(struct bt_ctf_event *event, + struct bt_ctf_field *payload); + static inline struct bt_ctf_field_common *bt_ctf_event_common_borrow_payload( struct bt_ctf_event_common *event) diff --git a/src/ctf-writer/field-types.h b/src/ctf-writer/field-types.h index ce4dafe6..7fe84638 100644 --- a/src/ctf-writer/field-types.h +++ b/src/ctf-writer/field-types.h @@ -449,6 +449,22 @@ struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value( struct bt_ctf_field_type_common *ft, uint64_t value); +BT_HIDDEN +int bt_ctf_field_type_enumeration_mapping_iterator_next( + struct bt_ctf_field_type_enumeration_mapping_iterator *iter); + +BT_HIDDEN +int bt_ctf_field_type_enumeration_mapping_iterator_signed_get( + struct bt_ctf_field_type_enumeration_mapping_iterator *iter, + const char **mapping_name, int64_t *range_begin, + int64_t *range_end); + +BT_HIDDEN +int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get( + struct bt_ctf_field_type_enumeration_mapping_iterator *iter, + const char **mapping_name, uint64_t *range_begin, + uint64_t *range_end); + BT_HIDDEN int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index( struct bt_ctf_field_type_common *ft, uint64_t index, diff --git a/src/ctf-writer/object.c b/src/ctf-writer/object.c index db799082..12111f74 100644 --- a/src/ctf-writer/object.c +++ b/src/ctf-writer/object.c @@ -21,6 +21,7 @@ */ #include "object.h" +#include void *bt_ctf_object_get_ref(void *obj) { diff --git a/src/ctf-writer/stream.c b/src/ctf-writer/stream.c index 247d64a6..cb882247 100644 --- a/src/ctf-writer/stream.c +++ b/src/ctf-writer/stream.c @@ -668,6 +668,7 @@ end: return ret; } +static int visit_event_update_clock_value(struct bt_ctf_event *event, uint64_t *val) { int ret = 0; diff --git a/src/ctf-writer/trace.h b/src/ctf-writer/trace.h index 63c60798..6e70f720 100644 --- a/src/ctf-writer/trace.h +++ b/src/ctf-writer/trace.h @@ -388,4 +388,8 @@ struct bt_ctf_value * bt_ctf_trace_get_environment_field_value_by_name( struct bt_ctf_trace *trace, const char *name); +BT_HIDDEN +int bt_ctf_trace_visit(struct bt_ctf_trace *trace, + bt_ctf_visitor visitor, void *data); + #endif /* BABELTRACE_CTF_WRITER_TRACE_INTERNAL_H */ diff --git a/src/lib/error.c b/src/lib/error.c index 3ae2db98..7cdf95bc 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -363,6 +363,7 @@ end: return cause; } +static struct bt_error_cause_message_iterator_actor * create_error_cause_message_iterator_actor(struct bt_message_iterator *iter, const char *file_name, uint64_t line_no) diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index 8d0f156d..d70514bd 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -950,14 +950,6 @@ bt_self_component_port_input_message_iterator_borrow_component( return iterator->upstream_component; } -const struct bt_component * -bt_self_component_port_input_message_iterator_borrow_component_const( - const struct bt_self_component_port_input_message_iterator *iterator) -{ - BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator"); - return iterator->upstream_component; -} - struct bt_self_component *bt_self_message_iterator_borrow_component( struct bt_self_message_iterator *self_iterator) { diff --git a/src/lib/integer-range-set.c b/src/lib/integer-range-set.c index d919cf72..5175fe24 100644 --- a/src/lib/integer-range-set.c +++ b/src/lib/integer-range-set.c @@ -185,6 +185,7 @@ struct bt_integer_range_set_signed *bt_integer_range_set_signed_create(void) return (void *) create_range_set(); } +static void add_range_to_range_set(struct bt_integer_range_set *range_set, uint64_t u_lower, uint64_t u_upper) { diff --git a/src/lib/plugin/plugin.c b/src/lib/plugin/plugin.c index aec5ed68..24b3aef9 100644 --- a/src/lib/plugin/plugin.c +++ b/src/lib/plugin/plugin.c @@ -56,26 +56,31 @@ #define APPEND_ALL_FROM_DIR_NFDOPEN_MAX 8 +/* Declare here to make sure definition in both ifdef branches are in sync. */ +static +int init_python_plugin_provider(void); +typedef int (*create_all_from_file_sym_type)( + const char *path, + bool fail_on_load_error, + struct bt_plugin_set **plugin_set_out); + #ifdef BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT #include static -int (*bt_plugin_python_create_all_from_file_sym)( - const char *path, bool fail_on_load_error, - struct bt_plugin_set **plugin_set_out) = - bt_plugin_python_create_all_from_file; +create_all_from_file_sym_type + bt_plugin_python_create_all_from_file_sym = + bt_plugin_python_create_all_from_file; static -enum bt_plugin_status init_python_plugin_provider(void) +int init_python_plugin_provider(void) { } #else /* BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT */ static GModule *python_plugin_provider_module; static -int (*bt_plugin_python_create_all_from_file_sym)( - const char *path, bool fail_on_load_error, - struct bt_plugin_set **plugin_set_out); +create_all_from_file_sym_type bt_plugin_python_create_all_from_file_sym; static int init_python_plugin_provider(void) { diff --git a/src/param-parse/param-parse.c b/src/param-parse/param-parse.c index e7e98b34..c2e0ec59 100644 --- a/src/param-parse/param-parse.c +++ b/src/param-parse/param-parse.c @@ -20,6 +20,8 @@ * SOFTWARE. */ +#include "param-parse.h" + #include #include #include diff --git a/src/plugins/ctf/common/metadata/ctf-meta-resolve.c b/src/plugins/ctf/common/metadata/ctf-meta-resolve.c index 42c84df1..1dcb51fe 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-resolve.c +++ b/src/plugins/ctf/common/metadata/ctf-meta-resolve.c @@ -759,6 +759,7 @@ void get_ctx_stack_field_path(struct resolve_context *ctx, * Returns the index of the lowest common ancestor of two field path * objects having the same root scope. */ +static int64_t get_field_paths_lca_index(struct ctf_field_path *field_path1, struct ctf_field_path *field_path2, struct resolve_context *ctx) diff --git a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.c b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.c index a2f197af..81dcf224 100644 --- a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.c +++ b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.c @@ -17,6 +17,8 @@ #define BT_LOG_TAG "PLUGIN/CTF/META/DECODER-DECODE-PACKET" #include "logging/comp-logging.h" +#include "decoder-packetized-file-stream-to-buf.h" + #include #include #include diff --git a/src/plugins/ctf/common/metadata/lexer.l b/src/plugins/ctf/common/metadata/lexer.l index 55a42d61..2dd45621 100644 --- a/src/plugins/ctf/common/metadata/lexer.l +++ b/src/plugins/ctf/common/metadata/lexer.l @@ -48,13 +48,6 @@ return CTF_ERROR; \ } \ } while (0) - -BT_HIDDEN -void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src); - -BT_HIDDEN -int import_string(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src, char delim); - %} %x comment_ml comment_sl string_lit char_const diff --git a/src/plugins/ctf/common/metadata/objstack.c b/src/plugins/ctf/common/metadata/objstack.c index febb9f28..5919fa13 100644 --- a/src/plugins/ctf/common/metadata/objstack.c +++ b/src/plugins/ctf/common/metadata/objstack.c @@ -28,6 +28,8 @@ #define BT_LOG_TAG "PLUGIN/CTF/META/OBJSTACK" #include "logging.h" +#include "objstack.h" + #include #include "common/list.h" #include "common/macros.h" diff --git a/src/plugins/ctf/common/metadata/parser.y b/src/plugins/ctf/common/metadata/parser.y index 54d28b6f..f75e577b 100644 --- a/src/plugins/ctf/common/metadata/parser.y +++ b/src/plugins/ctf/common/metadata/parser.y @@ -937,19 +937,13 @@ static int set_parent_node(struct ctf_node *node, return 0; } -BT_HIDDEN +static void yyerror(struct ctf_scanner *scanner, yyscan_t yyscanner, const char *str) { _BT_LOGE_LINENO(yyget_lineno(scanner->scanner), "%s: token=\"%s\"", str, yyget_text(scanner->scanner)); } -BT_HIDDEN -int yywrap(void) -{ - return 1; -} - #define reparent_error(scanner, str) \ do { \ yyerror(scanner, scanner->scanner, YY_("reparent_error: " str)); \ @@ -1057,6 +1051,13 @@ void ctf_scanner_free(struct ctf_scanner *scanner) #endif } +%code provides { + BT_HIDDEN + void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src); + + BT_HIDDEN + int import_string(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src, char delim); +} %define api.pure /* %locations */ diff --git a/src/plugins/ctf/common/metadata/visitor-generate-ir.c b/src/plugins/ctf/common/metadata/visitor-generate-ir.c index 11cb3c3d..abac12ae 100644 --- a/src/plugins/ctf/common/metadata/visitor-generate-ir.c +++ b/src/plugins/ctf/common/metadata/visitor-generate-ir.c @@ -868,6 +868,7 @@ end: return ret; } +static int get_unary_uuid(struct ctx *ctx, struct bt_list_head *head, bt_uuid_t uuid) { diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.c b/src/plugins/ctf/common/msg-iter/msg-iter.c index 30552ae0..b536a113 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.c +++ b/src/plugins/ctf/common/msg-iter/msg-iter.c @@ -2216,6 +2216,7 @@ end: return BT_BFCR_STATUS_OK; } +static enum bt_bfcr_status bfcr_compound_begin_cb( struct ctf_field_class *fc, void *data) { @@ -2267,6 +2268,7 @@ end: return BT_BFCR_STATUS_OK; } +static enum bt_bfcr_status bfcr_compound_end_cb( struct ctf_field_class *fc, void *data) { diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c index 73b9f34b..d7a9b848 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c @@ -20,6 +20,8 @@ * SOFTWARE. */ +#include "translate-ctf-ir-to-tsdl.h" + #include #include "common/macros.h" #include diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index 6d32cb19..d1e969f8 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -25,6 +25,8 @@ #define BT_LOG_TAG "PLUGIN/SINK.CTF.FS/TRANSLATE-TRACE-IR-TO-CTF-IR" #include "logging/comp-logging.h" +#include "translate-trace-ir-to-ctf-ir.h" + #include #include "common/macros.h" #include "common/common.h" @@ -1692,6 +1694,7 @@ end: return ret; } +static bool default_clock_class_name_exists(struct fs_sink_ctf_trace *trace, const char *name) { diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index 7a577042..0caebd1d 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -856,6 +856,7 @@ end: return; } +static void trace_debug_info_remove_func(const bt_trace *in_trace, void *data) { struct debug_info_msg_iter *debug_it = data; diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c index 31c9f71a..73f3515c 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c @@ -214,7 +214,7 @@ enum debug_info_trace_ir_mapping_status field_class_signed_integer_copy( return DEBUG_INFO_TRACE_IR_MAPPING_STATUS_OK; } -BT_HIDDEN +static enum debug_info_trace_ir_mapping_status field_class_unsigned_enumeration_copy( struct trace_ir_metadata_maps *md_maps, const bt_field_class *in_field_class, diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index 6031c9ae..02666ada 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -26,6 +26,8 @@ #define BT_LOG_TAG "PLUGIN/SRC.TEXT.DMESG" #include "logging/comp-logging.h" +#include "dmesg.h" + #include #include #include diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index 18ec6055..d9b7baee 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -113,6 +113,7 @@ void try_print_last(struct counter *counter) } } +static void destroy_private_counter_data(struct counter *counter) { if (counter) { diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index f9718808..6f772561 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -34,6 +34,7 @@ static const char * const in_port_name = "in"; +static void destroy_private_dummy_data(struct dummy *dummy) { bt_self_component_port_input_message_iterator_put_ref(dummy->msg_iter); diff --git a/src/python-plugin-provider/python-plugin-provider.c b/src/python-plugin-provider/python-plugin-provider.c index 5bb4e33b..d1bc73a1 100644 --- a/src/python-plugin-provider/python-plugin-provider.c +++ b/src/python-plugin-provider/python-plugin-provider.c @@ -25,8 +25,10 @@ */ #define BT_LOG_TAG "LIB/PLUGIN-PY" - #include "lib/logging.h" + +#include "python-plugin-provider.h" + #include "common/macros.h" #include "compat/compiler.h" #include diff --git a/src/python-plugin-provider/python-plugin-provider.h b/src/python-plugin-provider/python-plugin-provider.h index a8848c74..3deb16f9 100644 --- a/src/python-plugin-provider/python-plugin-provider.h +++ b/src/python-plugin-provider/python-plugin-provider.h @@ -23,10 +23,12 @@ * SOFTWARE. */ -#include +#include +#include extern -enum bt_plugin_status bt_plugin_python_create_all_from_file(const char *path, +int bt_plugin_python_create_all_from_file(const char *path, + bool fail_on_load_error, struct bt_plugin_set **plugin_set_out); #endif /* BABELTRACE_PLUGIN_PYTHON_PLUGIN_PROVIDER_INTERNAL_H */ diff --git a/tests/bitfield/test_bitfield.c b/tests/bitfield/test_bitfield.c index 558e3419..b8e7bcb4 100644 --- a/tests/bitfield/test_bitfield.c +++ b/tests/bitfield/test_bitfield.c @@ -30,8 +30,9 @@ unsigned int glob; /* * This function is only declared to show the size of a bitfield write in - * objdump. + * objdump. The declaration is there to avoid a -Wmissing-prototypes warning. */ +void fct(void); void fct(void) { bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); @@ -148,6 +149,7 @@ do { \ (val) != (ref); \ }) +static void run_test_unsigned_write(unsigned int src_ui, unsigned long long src_ull) { unsigned int nrbits_ui, nrbits_ull; @@ -270,6 +272,7 @@ void run_test_unsigned_write(unsigned int src_ui, unsigned long long src_ull) pass(UNSIGNED_LONG_LONG_WRITE_TEST_DESC_FMT_STR, src_ull); } +static void run_test_unsigned_read(unsigned int src_ui, unsigned long long src_ull) { unsigned int nrbits_ui, nrbits_ull, readval_ui; @@ -392,12 +395,14 @@ void run_test_unsigned_read(unsigned int src_ui, unsigned long long src_ull) pass(UNSIGNED_LONG_LONG_READ_TEST_DESC_FMT_STR, src_ull); } +static void run_test_unsigned(unsigned int src_ui, unsigned long long src_ull) { run_test_unsigned_write(src_ui, src_ull); run_test_unsigned_read(src_ui, src_ull); } +static void run_test_signed_write(int src_i, long long src_ll) { unsigned int nrbits_i, nrbits_ll; @@ -528,6 +533,7 @@ void run_test_signed_write(int src_i, long long src_ll) pass(SIGNED_LONG_LONG_WRITE_TEST_DESC_FMT_STR, src_ll); } +static void run_test_signed_read(int src_i, long long src_ll) { unsigned int nrbits_i, nrbits_ll; @@ -659,12 +665,14 @@ void run_test_signed_read(int src_i, long long src_ll) pass(SIGNED_LONG_LONG_READ_TEST_DESC_FMT_STR, src_ll); } +static void run_test_signed(int src_i, long long src_ll) { run_test_signed_write(src_i, src_ll); run_test_signed_read(src_i, src_ll); } +static void run_test(void) { int i; diff --git a/tests/lib/test_bt_values.c b/tests/lib/test_bt_values.c index 4f9423ea..c0a9f5a7 100644 --- a/tests/lib/test_bt_values.c +++ b/tests/lib/test_bt_values.c @@ -794,6 +794,7 @@ void test_is_equal_unsigned_integer(void) BT_VALUE_PUT_REF_AND_RESET(int3); } +static void test_is_equal_signed_integer(void) { bt_value *int1 = diff --git a/tests/utils/common.c b/tests/utils/common.c index 1878d777..dbc63d97 100644 --- a/tests/utils/common.c +++ b/tests/utils/common.c @@ -19,6 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "common.h" + #include #include #include -- 2.34.1