]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: Mark some constants as unsigned
authorJan Janssen <medhefgo@web.de>
Mon, 29 Aug 2022 11:36:19 +0000 (13:36 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 30 Aug 2022 10:03:33 +0000 (12:03 +0200)
All these are really unsigned and used as such. This silences some
-Wformat-signedness warnings with gcc.

src/basic/user-util.h
src/cryptsetup/cryptsetup.c
src/login/logind-dbus.c
src/network/netdev/bridge.h
src/network/networkd-network.c
src/shared/journal-importer.h

index 614dec2fde8a5845e7a184c493c2e1c29fd1e7d3..8ae205b65ee0a1bcfc59299a3793a1a4bbf95dbb 100644 (file)
 #include <unistd.h>
 
 /* 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);
 
index c9a55a314b2be37774669f069d42acf6d1df69b3..90bce953de8cf9850a44c8378306766ed49c923e 100644 (file)
@@ -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,
index 4f72574318cdd5b35c7351678e63cafab9094833..8119970209ba2cd51a5f39ae004b1e95b6a6cc32 100644 (file)
@@ -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"
 
index a6f322404410d210426dba8e36b71e7527489604..72dd3e42059066c72b05b3d067df5873110d3b37 100644 (file)
@@ -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;
index 00bbaf6eab5687021baf4b8318ae9fdc9c51bb8e..1de99e89ab8821e0ac7c5ba41e94c3caf70e7372 100644 (file)
@@ -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;
index 7eb2169217153deabe9ff0a89c97bcff8eb54168..6cbac4c4e181d3096acabe73a458efa06629d5d3 100644 (file)
@@ -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;