From: Jan Janssen Date: Mon, 29 Aug 2022 11:36:19 +0000 (+0200) Subject: tree-wide: Mark some constants as unsigned X-Git-Tag: v252-rc1~293^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63b98386392d2b1e686523e75d46a11facd8cb70;p=thirdparty%2Fsystemd.git tree-wide: Mark some constants as unsigned All these are really unsigned and used as such. This silences some -Wformat-signedness warnings with gcc. --- diff --git a/src/basic/user-util.h b/src/basic/user-util.h index 614dec2fde8..8ae205b65ee 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -13,12 +13,12 @@ #include /* Users managed by systemd-homed. See https://systemd.io/UIDS-GIDS for details how this range fits into the rest of the world */ -#define HOME_UID_MIN 60001 -#define HOME_UID_MAX 60513 +#define HOME_UID_MIN ((uid_t) 60001) +#define HOME_UID_MAX ((uid_t) 60513) /* Users mapped from host into a container */ -#define MAP_UID_MIN 60514 -#define MAP_UID_MAX 60577 +#define MAP_UID_MIN ((uid_t) 60514) +#define MAP_UID_MAX ((uid_t) 60577) bool uid_is_valid(uid_t uid); diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index c9a55a314b2..90bce953de8 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -43,8 +43,8 @@ /* internal helper */ #define ANY_LUKS "LUKS" /* as in src/cryptsetup.h */ -#define CRYPT_SECTOR_SIZE 512 -#define CRYPT_MAX_SECTOR_SIZE 4096 +#define CRYPT_SECTOR_SIZE 512U +#define CRYPT_MAX_SECTOR_SIZE 4096U typedef enum PassphraseType { PASSPHRASE_NONE, diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 4f72574318c..8119970209b 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -65,7 +65,7 @@ * to store arbitrary amounts either. As we are not stingy here, we * allow 4k. */ -#define WALL_MESSAGE_MAX 4096 +#define WALL_MESSAGE_MAX 4096U #define SHUTDOWN_SCHEDULE_FILE "/run/systemd/shutdown/scheduled" diff --git a/src/network/netdev/bridge.h b/src/network/netdev/bridge.h index a6f32240441..72dd3e42059 100644 --- a/src/network/netdev/bridge.h +++ b/src/network/netdev/bridge.h @@ -4,8 +4,8 @@ #include "conf-parser.h" #include "netdev.h" -#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 -#define LINK_BRIDGE_PORT_PRIORITY_MAX 63 +#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128U +#define LINK_BRIDGE_PORT_PRIORITY_MAX 63U typedef struct Bridge { NetDev meta; diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 00bbaf6eab5..1de99e89ab8 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -45,7 +45,7 @@ #include "util.h" /* Let's assume that anything above this number is a user misconfiguration. */ -#define MAX_NTP_SERVERS 128 +#define MAX_NTP_SERVERS 128U static int network_resolve_netdev_one(Network *network, const char *name, NetDevKind kind, NetDev **ret) { const char *kind_string; diff --git a/src/shared/journal-importer.h b/src/shared/journal-importer.h index 7eb21692171..6cbac4c4e18 100644 --- a/src/shared/journal-importer.h +++ b/src/shared/journal-importer.h @@ -23,7 +23,7 @@ #define LINE_CHUNK 8*1024u /* The maximum number of fields in an entry */ -#define ENTRY_FIELD_COUNT_MAX 1024 +#define ENTRY_FIELD_COUNT_MAX 1024u typedef struct JournalImporter { int fd;