]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
message_parser.c: fix -Wextra warnings 4264/head
authorEero Tamminen <eero.t.tamminen@intel.com>
Tue, 30 Jan 2024 16:59:46 +0000 (18:59 +0200)
committerEero Tamminen <eero.t.tamminen@intel.com>
Tue, 30 Jan 2024 17:01:56 +0000 (19:01 +0200)
And arg name in comment for the function calling message parser
callback.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
src/utils/match/match.h
src/utils/message_parser/message_parser.c

index 7a0087f0448ba6acfc6ce632bebd590d183632c5..9ff7e99818df41b4aef30b5acf119e4fdc67d6f8 100644 (file)
@@ -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]*)"
index 60ca0d89c0763c731f445c93cffa9443bb6e0bb1..99e1307f311e059e3b77f74512fae2cd5679c43c 100644 (file)
@@ -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;