From: Eero Tamminen Date: Tue, 30 Jan 2024 16:59:46 +0000 (+0200) Subject: message_parser.c: fix -Wextra warnings X-Git-Tag: collectd-6.0.0.rc2~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4264%2Fhead;p=thirdparty%2Fcollectd.git message_parser.c: fix -Wextra warnings And arg name in comment for the function calling message parser callback. Signed-off-by: Eero Tamminen --- diff --git a/src/utils/match/match.h b/src/utils/match/match.h index 7a0087f04..9ff7e9981 100644 --- a/src/utils/match/match.h +++ b/src/utils/match/match.h @@ -82,7 +82,7 @@ typedef struct cu_match_value_s cu_match_value_t; * Creates a new `cu_match_t' object which will use the regular expression * `regex' to match lines, see the `match_apply' method below. If the line * matches, the callback passed in `callback' will be called along with the - * pointer `user_pointer'. + * `user_data' pointer. * The string that's passed to the callback depends on the regular expression: * If the regular expression includes a sub-match, i. e. something like * "value=([0-9][0-9]*)" diff --git a/src/utils/message_parser/message_parser.c b/src/utils/message_parser/message_parser.c index 60ca0d89c..99e1307f3 100644 --- a/src/utils/message_parser/message_parser.c +++ b/src/utils/message_parser/message_parser.c @@ -88,7 +88,7 @@ static int start_message_assembly(parser_job_data_t *self) { ++(self->message_idx); /* Resize messages buffer if needed */ - if (self->message_idx >= self->messages_max_len) { + if (self->message_idx >= (int)self->messages_max_len) { INFO(UTIL_NAME ": Exceeded message buffer size: %zu", self->messages_max_len); if (self->resize_message_buffer(self, self->messages_max_len + @@ -147,8 +147,9 @@ static void end_message_assembly(parser_job_data_t *self) { self->message_item_idx = 0; } -static int message_assembler(const char *row, char *const *matches, - size_t matches_num, void *user_data) { +static int message_assembler(__attribute__((unused)) const char *row, + char *const *matches, size_t matches_num, + void *user_data) { if (user_data == NULL) { ERROR(UTIL_NAME ": Invalid user_data pointer"); return -1;