tree-wide: Fix a some remaining format warnings by casting

This commit is contained in:
Jan Janssen
2022-08-30 12:03:33 +02:00
parent 63b9838639
commit 2676befc73
4 changed files with 14 additions and 8 deletions
+2 -2
View 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;
}
+1 -1
View 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,
+4 -4
View 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);
}
+7 -1
View 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;