summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-08-29 13:43:29 +0200
committerJan Janssen <medhefgo@web.de>2022-08-30 12:03:33 +0200
commit2676befc73b3f40974ddad84972e873e5b826262 (patch)
tree77963e05083cb3bdc3359b18351f4300c4fddbae /src
parent63b98386392d2b1e686523e75d46a11facd8cb70 (diff)
downloadsystemd-2676befc73b3f40974ddad84972e873e5b826262.tar.gz
tree-wide: Fix a some remaining format warnings by casting
Diffstat (limited to 'src')
-rw-r--r--src/sysusers/sysusers.c4
-rw-r--r--src/test/test-path.c2
-rw-r--r--src/test/test-uid-alloc-range.c8
-rw-r--r--src/tmpfiles/tmpfiles.c8
4 files changed, 14 insertions, 8 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 93c32d8eeb..8b2c242e7c 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -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;
}
diff --git a/src/test/test-path.c b/src/test/test-path.c
index a440ca08b4..4066f6ad93 100644
--- a/src/test/test-path.c
+++ b/src/test/test-path.c
@@ -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,
diff --git a/src/test/test-uid-alloc-range.c b/src/test/test-uid-alloc-range.c
index ac08b74a03..cd06463cef 100644
--- a/src/test/test-uid-alloc-range.c
+++ b/src/test/test-uid-alloc-range.c
@@ -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);
}
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 8012d0d5df..93b29e2edb 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -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;