From aa70dd624bff6280ab6f2871f62d313bdb1e1bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Fri, 11 Nov 2022 15:28:51 +0000 Subject: [PATCH 1/3] journal-remote: code is of type enum MHD_RequestTerminationCode Fixes gcc 13 -Wenum-int-mismatch which are enabled by default. --- src/journal-remote/microhttpd-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h index 7e7d1b56b1..df18335469 100644 --- a/src/journal-remote/microhttpd-util.h +++ b/src/journal-remote/microhttpd-util.h @@ -64,11 +64,11 @@ void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0); int mhd_respondf(struct MHD_Connection *connection, int error, - unsigned code, + enum MHD_RequestTerminationCode code, const char *format, ...) _printf_(4,5); int mhd_respond(struct MHD_Connection *connection, - unsigned code, + enum MHD_RequestTerminationCode code, const char *message); int mhd_respond_oom(struct MHD_Connection *connection); From e14afe31c3e8380496dc85b57103b2f648bc7d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Fri, 11 Nov 2022 15:31:18 +0000 Subject: [PATCH 2/3] resolve: dns_server_feature_level_*_string type is DnsServerFeatureLevel gcc 13 -Wenum-int-mismatch reminds us that enum != int --- src/resolve/resolved-dns-server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h index be9efb0a79..f939b534c3 100644 --- a/src/resolve/resolved-dns-server.h +++ b/src/resolve/resolved-dns-server.h @@ -44,8 +44,8 @@ typedef enum DnsServerFeatureLevel { #define DNS_SERVER_FEATURE_LEVEL_IS_DNSSEC(x) ((x) >= DNS_SERVER_FEATURE_LEVEL_DO) #define DNS_SERVER_FEATURE_LEVEL_IS_UDP(x) IN_SET(x, DNS_SERVER_FEATURE_LEVEL_UDP, DNS_SERVER_FEATURE_LEVEL_EDNS0, DNS_SERVER_FEATURE_LEVEL_DO) -const char* dns_server_feature_level_to_string(int i) _const_; -int dns_server_feature_level_from_string(const char *s) _pure_; +const char* dns_server_feature_level_to_string(DnsServerFeatureLevel i) _const_; +DnsServerFeatureLevel dns_server_feature_level_from_string(const char *s) _pure_; struct DnsServer { Manager *manager; From 9264db1a0ac6034ab5b40ef3f5914d8dc7d77aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Fri, 11 Nov 2022 15:34:32 +0000 Subject: [PATCH 3/3] shared|install: Use InstallChangeType consistently gcc 13 -Wenum-int-mismatch, enabled by default, reminds us enum ! = int --- src/shared/install.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/install.h b/src/shared/install.h index 9bb412ba06..0abc73897e 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -197,7 +197,7 @@ int unit_file_exists(LookupScope scope, const LookupPaths *paths, const char *na int unit_file_get_list(LookupScope scope, const char *root_dir, Hashmap *h, char **states, char **patterns); Hashmap* unit_file_list_free(Hashmap *h); -InstallChangeType install_changes_add(InstallChange **changes, size_t *n_changes, int type, const char *path, const char *source); +InstallChangeType install_changes_add(InstallChange **changes, size_t *n_changes, InstallChangeType type, const char *path, const char *source); void install_changes_free(InstallChange *changes, size_t n_changes); void install_changes_dump(int r, const char *verb, const InstallChange *changes, size_t n_changes, bool quiet); @@ -224,7 +224,7 @@ UnitFileState unit_file_state_from_string(const char *s) _pure_; /* from_string conversion is unreliable because of the overlap between -EPERM and -1 for error. */ const char *install_change_type_to_string(InstallChangeType t) _const_; -int install_change_type_from_string(const char *s) _pure_; +InstallChangeType install_change_type_from_string(const char *s) _pure_; const char *unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; UnitFilePresetMode unit_file_preset_mode_from_string(const char *s) _pure_;