diff mbox series

Fix warning in channel_settings

Message ID 20231017102257.63826-1-stefano.babic@swupdate.org
State Accepted
Headers show
Series Fix warning in channel_settings | expand

Commit Message

Stefano Babic Oct. 17, 2023, 10:22 a.m. UTC
Fix the following warning:

handlers/delta_downloader.c:207:64: warning: passing argument 3 of ‘read_module_settings’
from incompatible pointer type [-Wincompatible-pointer-types]
  207 |                         read_module_settings(&handle, "delta", channel_settings, &channel_data);
      |                                                                ^~~~~~~~~~~~~~~~

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 corelib/server_utils.c | 5 ++++-
 include/server_utils.h | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/corelib/server_utils.c b/corelib/server_utils.c
index 025a57d6..3c56b50a 100644
--- a/corelib/server_utils.c
+++ b/corelib/server_utils.c
@@ -15,9 +15,10 @@ 
 #include <channel_curl.h>
 #include "server_utils.h"
 
-void channel_settings(void *elem, channel_data_t *chan)
+int channel_settings(void *elem, void *data)
 {
 	char tmp[128];
+	channel_data_t *chan = (channel_data_t *)data;
 
 	get_field(LIBCFG_PARSER, elem, "retry",
 		&chan->retries);
@@ -48,6 +49,8 @@  void channel_settings(void *elem, channel_data_t *chan)
 	GET_FIELD_STRING_RESET(LIBCFG_PARSER, elem, "interface", tmp);
 	if (strlen(tmp))
 		SETSTRING(chan->iface, tmp);
+
+	return 0;
 }
 
 server_op_res_t map_channel_retcode(channel_op_res_t response)
diff --git a/include/server_utils.h b/include/server_utils.h
index 9cca3a90..3b262e59 100644
--- a/include/server_utils.h
+++ b/include/server_utils.h
@@ -14,6 +14,6 @@ 
 
 struct json_object;
 
-void channel_settings(void *elem, channel_data_t *chan);
+int channel_settings(void *elem, void *data);
 server_op_res_t map_channel_retcode(channel_op_res_t response);
 struct json_object *server_tokenize_msg(char *buf, size_t size);