]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: replace unsigned int -> unsigned, long int -> long 36980/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Apr 2025 20:48:59 +0000 (05:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Apr 2025 21:01:31 +0000 (06:01 +0900)
17 files changed:
src/basic/memfd-util.c
src/basic/nss-util.h
src/basic/parse-util.c
src/basic/parse-util.h
src/core/bpf/restrict_fs/restrict-fs.bpf.c
src/core/execute-serialize.c
src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c
src/nsresourced/nsresourced-manager.c
src/nsresourced/userns-restrict.c
src/nss-systemd/nss-systemd.c
src/nss-systemd/userdb-glue.c
src/shared/firewall-util-nft.c
src/shared/firewall-util.h
src/shared/openssl-util.c
src/shared/qrcode-util.c
src/test/test-log.c
src/udev/udev-builtin-input_id.c

index 2e1125b867f4bf2a14485b4549c2e6d593ff6174..f2ddd4dd96366a5394496e22a6c19bd36f4b9937 100644 (file)
@@ -97,7 +97,7 @@ int memfd_set_sealed(int fd) {
 }
 
 int memfd_get_sealed(int fd) {
-        unsigned int seals;
+        unsigned seals;
         int r;
 
         r = memfd_get_seals(fd, &seals);
index 579e2c0bded657c0673f906cc76e5f805f17b402..2f55b7bc749f5fa50e47582beee4424479fb6444 100644 (file)
@@ -201,10 +201,10 @@ enum nss_status _nss_##module##_getsgent_r(             \
 enum nss_status _nss_##module##_initgroups_dyn(         \
                 const char *user,                       \
                 gid_t group,                            \
-                long int *start,                        \
-                long int *size,                         \
+                long *start,                            \
+                long *size,                             \
                 gid_t **groupsp,                        \
-                long int limit,                         \
+                long limit,                             \
                 int *errnop) _public_;
 
 typedef enum nss_status (*_nss_gethostbyname4_r_t)(
index 2869a51aaa8c0b074e9e63021d5512b96e9eb029..e3cc8451b690b739dd6aa1fd9d92ee56ad66ad30 100644 (file)
@@ -528,7 +528,7 @@ int safe_atollu_full(const char *s, unsigned base, unsigned long long *ret_llu)
         return 0;
 }
 
-int safe_atolli(const char *s, long long int *ret_lli) {
+int safe_atolli(const char *s, long long *ret_lli) {
         unsigned base = 0;
         char *x = NULL;
         long long l;
index a47c8c7935b32d8e9cef09498ee2c0620e21041d..0af407b335bb6e3632dd7b02adde3154e347eb70 100644 (file)
@@ -41,7 +41,7 @@ static inline int safe_atou(const char *s, unsigned *ret_u) {
 int safe_atou_bounded(const char *s, unsigned min, unsigned max, unsigned *ret);
 
 int safe_atoi(const char *s, int *ret_i);
-int safe_atolli(const char *s, long long int *ret_i);
+int safe_atolli(const char *s, long long *ret_i);
 
 int safe_atou8_full(const char *s, unsigned base, uint8_t *ret);
 
@@ -87,8 +87,8 @@ static inline int safe_atou64(const char *s, uint64_t *ret_u) {
 }
 
 static inline int safe_atoi64(const char *s, int64_t *ret_i) {
-        assert_cc(sizeof(int64_t) == sizeof(long long int));
-        return safe_atolli(s, (long long int*) ret_i);
+        assert_cc(sizeof(int64_t) == sizeof(long long));
+        return safe_atolli(s, (long long*) ret_i);
 }
 
 static inline int safe_atoux64(const char *s, uint64_t *ret) {
@@ -101,8 +101,8 @@ static inline int safe_atolu_full(const char *s, unsigned base, unsigned long *r
         assert_cc(sizeof(unsigned long) == sizeof(unsigned));
         return safe_atou_full(s, base, (unsigned*) ret_u);
 }
-static inline int safe_atoli(const char *s, long int *ret_u) {
-        assert_cc(sizeof(long int) == sizeof(int));
+static inline int safe_atoli(const char *s, long *ret_u) {
+        assert_cc(sizeof(long) == sizeof(int));
         return safe_atoi(s, (int*) ret_u);
 }
 #else
@@ -110,9 +110,9 @@ static inline int safe_atolu_full(const char *s, unsigned base, unsigned long *r
         assert_cc(sizeof(unsigned long) == sizeof(unsigned long long));
         return safe_atollu_full(s, base, (unsigned long long*) ret_u);
 }
-static inline int safe_atoli(const char *s, long int *ret_u) {
-        assert_cc(sizeof(long int) == sizeof(long long int));
-        return safe_atolli(s, (long long int*) ret_u);
+static inline int safe_atoli(const char *s, long *ret_u) {
+        assert_cc(sizeof(long) == sizeof(long long));
+        return safe_atolli(s, (long long*) ret_u);
 }
 #endif
 
index eb5ed3e7fec1bd269d115e85d238345de61e3720..28fd555d5ffbb165dc9dcd0e4c05fa25cb799441 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdint.h>
 
 struct super_block {
-        unsigned long int s_magic;
+        unsigned long s_magic;
 } __attribute__((preserve_access_index));
 
 struct inode {
index 220b4be5caf12b9419dcebc5fed39d18f0252e2b..2a9c619f2c2d8c24dda9111b2339474d7c8ffeea 100644 (file)
@@ -3493,7 +3493,7 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) {
                         if (r < 0)
                                 return r;
                 } else if ((val = startswith(l, "exec-context-syscall-archs="))) {
-                        unsigned int id;
+                        unsigned id;
 
                         r = safe_atou(val, &id);
                         if (r < 0)
index 0ff41a138bee96922d61f8d191422823ef93bc53..8d75339b4bc82d455e56af8630e09844000c84ba 100644 (file)
@@ -141,7 +141,7 @@ int BPF_PROG(userns_restrict_path_mkdir, struct path *dir, struct dentry *dentry
 }
 
 SEC("lsm/path_mknod")
-int BPF_PROG(userns_restrict_path_mknod, const struct path *dir, struct dentry *dentry, umode_t mode, unsigned int dev, int ret) {
+int BPF_PROG(userns_restrict_path_mknod, const struct path *dir, struct dentry *dentry, umode_t mode, unsigned dev, int ret) {
         return validate_path(dir, ret);
 }
 
index 99a6e1fedeccd216682ac1ed6d7dce4eb2bece0d..b5e4376723a9aa1929c7629fd6d64efcc5995aac 100644 (file)
@@ -521,15 +521,15 @@ static int ringbuf_event(void *userdata, void *data, size_t size) {
         Manager *m = ASSERT_PTR(userdata);
         size_t n;
 
-        if ((size % sizeof(unsigned int)) != 0) /* Not multiples of "unsigned int"? */
+        if ((size % sizeof(unsigned)) != 0) /* Not multiples of "unsigned"? */
                 return -EIO;
 
-        n = size / sizeof(unsigned int);
+        n = size / sizeof(unsigned);
         for (size_t i = 0; i < n; i++) {
                 const void *d;
                 uint64_t inode;
 
-                d = (const uint8_t*) data + i * sizeof(unsigned int);
+                d = (const uint8_t*) data + i * sizeof(unsigned);
                 inode = unaligned_read_ne32(d);
 
                 log_debug("Got BPF ring buffer notification that user namespace %" PRIu64 " is now dead.", inode);
index f23526c55f472e8cad646e9abdfafd1047a148b3..cd53463b74f77d735645e293d1d3457d18ed0cb0 100644 (file)
@@ -101,7 +101,7 @@ int userns_restrict_install(
         if (r < 0)
                 return log_error_errno(r, "Failed to size userns/mnt_id hash table: %m");
 
-        r = sym_bpf_map__set_max_entries(obj->maps.userns_ringbuf, USERNS_MAX * sizeof(unsigned int));
+        r = sym_bpf_map__set_max_entries(obj->maps.userns_ringbuf, USERNS_MAX * sizeof(unsigned));
         if (r < 0)
                 return log_error_errno(r, "Failed to size userns ring buffer: %m");
 
index 0dfafa15634d8a352b8fe4584a799ac91ed2a5a7..b7a71d7bb142a2c9de37b79376e884bc6823fd06 100644 (file)
@@ -965,7 +965,7 @@ enum nss_status _nss_systemd_initgroups_dyn(
                 long *start,
                 long *size,
                 gid_t **groupsp,
-                long int limit,
+                long limit,
                 int *errnop) {
 
         _cleanup_(userdb_iterator_freep) UserDBIterator *iterator = NULL;
index 4f96e9b90f2f5e72f55935322034edd180e58a9d..110235bb4ae37e9ccbd66c5139b3a4e5e5c4e406 100644 (file)
@@ -156,14 +156,14 @@ int nss_pack_user_record_shadow(
                 .sp_namp = buffer,
                 .sp_lstchg = hr->last_password_change_usec == 0 ? 1 :               /* map 0 to 1, since 0 means please change password on next login */
                              hr->last_password_change_usec == UINT64_MAX ? -1 :
-                             (long int) (hr->last_password_change_usec / USEC_PER_DAY),
-                .sp_min = hr->password_change_min_usec != UINT64_MAX ? (long int) (hr->password_change_min_usec / USEC_PER_DAY) : -1,
-                .sp_max = hr->password_change_max_usec != UINT64_MAX ? (long int) (hr->password_change_max_usec / USEC_PER_DAY) : -1,
-                .sp_warn = hr->password_change_warn_usec != UINT64_MAX ? (long int) (hr->password_change_warn_usec / USEC_PER_DAY) : -1,
-                .sp_inact = hr->password_change_inactive_usec != UINT64_MAX ? (long int) (hr->password_change_inactive_usec / USEC_PER_DAY) : -1,
+                             (long) (hr->last_password_change_usec / USEC_PER_DAY),
+                .sp_min = hr->password_change_min_usec != UINT64_MAX ? (long) (hr->password_change_min_usec / USEC_PER_DAY) : -1,
+                .sp_max = hr->password_change_max_usec != UINT64_MAX ? (long) (hr->password_change_max_usec / USEC_PER_DAY) : -1,
+                .sp_warn = hr->password_change_warn_usec != UINT64_MAX ? (long) (hr->password_change_warn_usec / USEC_PER_DAY) : -1,
+                .sp_inact = hr->password_change_inactive_usec != UINT64_MAX ? (long) (hr->password_change_inactive_usec / USEC_PER_DAY) : -1,
                 .sp_expire = hr->locked > 0 || hr->not_after_usec == 0 ? 1 : /* already expired/locked */
                              hr->not_after_usec == UINT64_MAX ? -1 :
-                             (long int) (hr->not_after_usec / USEC_PER_DAY),
+                             (long) (hr->not_after_usec / USEC_PER_DAY),
                 .sp_flag = ULONG_MAX,
         };
 
index 07a5c2c8540601a37a4f2f2f85816415e0815d9b..01bc43632bf14551b4a47c5da71d5d53024aeb07 100644 (file)
@@ -857,10 +857,10 @@ void fw_nftables_exit(FirewallContext *ctx) {
 static int nft_message_append_setelem_iprange(
                 sd_netlink_message *m,
                 const union in_addr_union *source,
-                unsigned int prefixlen) {
+                unsigned prefixlen) {
 
         uint32_t mask, start, end;
-        unsigned int nplen;
+        unsigned nplen;
         int r;
 
         assert(m);
@@ -896,7 +896,7 @@ static int nft_message_append_setelem_iprange(
 static int nft_message_append_setelem_ip6range(
                 sd_netlink_message *m,
                 const union in_addr_union *source,
-                unsigned int prefixlen) {
+                unsigned prefixlen) {
 
         union in_addr_union start, end;
         int r;
@@ -931,7 +931,7 @@ int nft_set_element_modify_iprange(
                 const char *table,
                 const char *set,
                 const union in_addr_union *source,
-                unsigned int source_prefixlen) {
+                unsigned source_prefixlen) {
 
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
         int r;
@@ -1041,7 +1041,7 @@ int fw_nftables_add_masquerade(
                 bool add,
                 int af,
                 const union in_addr_union *source,
-                unsigned int source_prefixlen) {
+                unsigned source_prefixlen) {
 
         int r;
 
index 5b3fda8732a08835257075f4eca5df8b8d0a7d4f..2c79ab4081747b79b0b019157817abac449db35a 100644 (file)
@@ -74,7 +74,7 @@ int nft_set_element_modify_iprange(
                 const char *table,
                 const char *set,
                 const union in_addr_union *source,
-                unsigned int source_prefixlen);
+                unsigned source_prefixlen);
 
 int nft_set_element_modify_ip(
                 FirewallContext *ctx,
index b19c18e56ed179d914267809d7c096b2ea6456b8..96de0708761535d17b094a136f0738c6192b5f72 100644 (file)
@@ -164,7 +164,7 @@ int openssl_digest_many(
         if (!buf)
                 return log_oom_debug();
 
-        unsigned int size;
+        unsigned size;
         if (!EVP_DigestFinal_ex(ctx, buf, &size))
                 return log_openssl_errors("Failed to finalize Digest");
 
@@ -260,7 +260,7 @@ int openssl_hmac_many(
         size_t size;
         if (!EVP_MAC_final(ctx, buf, &size, digest_size))
 #else
-        unsigned int size;
+        unsigned size;
         if (!HMAC_Final(ctx, buf, &size))
 #endif
                 return log_openssl_errors("Failed to finalize HMAC");
index aac0b3886befb936c5536c069712f549dece76c9..ff93a25a97e43552c03413bf81934488a8abe384 100644 (file)
@@ -82,7 +82,7 @@ static void print_border(FILE *output, unsigned width, unsigned row, unsigned co
         }
 }
 
-static void write_qrcode(FILE *output, QRcode *qr, unsigned int row, unsigned int column) {
+static void write_qrcode(FILE *output, QRcode *qr, unsigned row, unsigned column) {
         assert(qr);
 
         if (!output)
index b36e0fcd966b4f09e70ec310ffe2504f4cb55b69..b973ba94274df7518c44dc8bf579088d88550888 100644 (file)
@@ -66,7 +66,7 @@ static void test_log_struct(void) {
         log_struct(LOG_INFO,
                    LOG_MESSAGE("Foobar PID="PID_FMT, getpid_cached()),
                    LOG_ITEM("FORMAT_STR_TEST=1=%i A=%c 2=%hi 3=%li 4=%lli 1=%p foo=%s 2.5=%g 3.5=%g 4.5=%Lg",
-                            (int) 1, 'A', (short) 2, (long int) 3, (long long int) 4, (void*) 1, "foo", (float) 2.5f, (double) 3.5, (long double) 4.5),
+                            (int) 1, 'A', (short) 2, (long) 3, (long long) 4, (void*) 1, "foo", (float) 2.5f, (double) 3.5, (long double) 4.5),
                    LOG_ITEM("SUFFIX=GOT IT"));
 }
 
index f16ca00e139697acf2c1fc530f659edb3ab63686..60fc95e0d2718d20aa1e52c306aeb158422986ed 100644 (file)
@@ -288,7 +288,7 @@ static bool test_pointers(
          * libinput uses similar heuristics, any changes here should be added to libinput too.
          */
         if (is_joystick) {
-                static const unsigned int well_known_keyboard_keys[] = {
+                static const unsigned well_known_keyboard_keys[] = {
                         KEY_LEFTCTRL, KEY_CAPSLOCK, KEY_NUMLOCK, KEY_INSERT,
                         KEY_MUTE, KEY_CALC, KEY_FILE, KEY_MAIL, KEY_PLAYPAUSE,
                         KEY_BRIGHTNESSDOWN,