From 4842d7025b645e8a884076e30da9c0bba79a5280 Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Tue, 30 Jan 2024 18:59:46 +0200 Subject: [PATCH] message_parser.c: fix -Wextra warnings And arg name in comment for the function calling message parser callback. Signed-off-by: Eero Tamminen --- src/utils/match/match.h | 2 +- src/utils/message_parser/message_parser.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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; -- 2.47.2