]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: Fix a some remaining format warnings by casting
authorJan Janssen <medhefgo@web.de>
Mon, 29 Aug 2022 11:43:29 +0000 (13:43 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 30 Aug 2022 10:03:33 +0000 (12:03 +0200)
src/sysusers/sysusers.c
src/test/test-path.c
src/test/test-uid-alloc-range.c
src/tmpfiles/tmpfiles.c

index 93c32d8eeb95f64505f4f0b211030f78f548ece6..8b2c242e7cfe7364f5677bc1d56da98602c9ee1b 100644 (file)
@@ -141,13 +141,13 @@ static void maybe_emit_login_defs_warning(void) {
                 log_warning("login.defs specifies UID allocation range "UID_FMT"–"UID_FMT
                             " that is different than the built-in defaults ("UID_FMT"–"UID_FMT")",
                             login_defs.system_alloc_uid_min, login_defs.system_uid_max,
-                            SYSTEM_ALLOC_UID_MIN, SYSTEM_UID_MAX);
+                            (uid_t) SYSTEM_ALLOC_UID_MIN, (uid_t) SYSTEM_UID_MAX);
         if (login_defs.system_alloc_gid_min != SYSTEM_ALLOC_GID_MIN ||
             login_defs.system_gid_max != SYSTEM_GID_MAX)
                 log_warning("login.defs specifies GID allocation range "GID_FMT"–"GID_FMT
                             " that is different than the built-in defaults ("GID_FMT"–"GID_FMT")",
                             login_defs.system_alloc_gid_min, login_defs.system_gid_max,
-                            SYSTEM_ALLOC_GID_MIN, SYSTEM_GID_MAX);
+                            (gid_t) SYSTEM_ALLOC_GID_MIN, (gid_t) SYSTEM_GID_MAX);
 
         login_defs_need_warning = false;
 }
index a440ca08b479a64b433a3518046a09b36d4d4b7f..4066f6ad9395e2b42cdd8444f228f2e9fb51b5f9 100644 (file)
@@ -94,7 +94,7 @@ static int _check_states(unsigned line,
                          UNIT(path)->id,
                          path_state_to_string(path->state),
                          path_result_to_string(path->result),
-                         end - n);
+                         (int64_t) (end - n));
                 log_info("line %u: %s: state = %s; result = %s",
                          line,
                          UNIT(service)->id,
index ac08b74a034803874282d273221cd17a0a6a10b5..cd06463cefbbb26c9b4ebee76a714a0505b6c987 100644 (file)
@@ -23,10 +23,10 @@ static void test_read_login_defs_one(const char *path) {
                         "SYS_UID_MAX "UID_FMT"\n"
                         "SYS_GID_MIN "GID_FMT"\n"
                         "SYS_GID_MAX "GID_FMT"\n",
-                        SYSTEM_ALLOC_UID_MIN + 5,
-                        SYSTEM_UID_MAX + 5,
-                        SYSTEM_ALLOC_GID_MIN + 5,
-                        SYSTEM_GID_MAX + 5);
+                        (uid_t) (SYSTEM_ALLOC_UID_MIN + 5),
+                        (uid_t) (SYSTEM_UID_MAX + 5),
+                        (gid_t) (SYSTEM_ALLOC_GID_MIN + 5),
+                        (gid_t) (SYSTEM_GID_MAX + 5));
                 assert_se(fflush_and_check(f) >= 0);
         }
 
index 8012d0d5df2f9e1d7ab42ac6239a7dcd45e0432a..93b29e2edbeba25cf248131e9104742d70bb5ed6 100644 (file)
@@ -3107,7 +3107,13 @@ static int parse_line(
         case RELABEL_PATH:
         case RECURSIVE_RELABEL_PATH:
                 if (i.argument)
-                        log_syntax(NULL, LOG_WARNING, fname, line, 0, "%c lines don't take argument fields, ignoring.", i.type);
+                        log_syntax(NULL,
+                                   LOG_WARNING,
+                                   fname,
+                                   line,
+                                   0,
+                                   "%c lines don't take argument fields, ignoring.",
+                                   (char) i.type);
 
                 break;