Remove unnecessary casts in printfs
No functional change expected :)
This commit is contained in:
@@ -59,7 +59,7 @@ static bool condition_test_capability(Condition *c) {
|
||||
cap_value_t value;
|
||||
FILE *f;
|
||||
char line[LINE_MAX];
|
||||
unsigned long long capabilities = (unsigned long long) -1;
|
||||
unsigned long long capabilities = -1;
|
||||
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
|
||||
@@ -138,7 +138,7 @@ static int bus_scope_set_transient_property(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
unit_write_drop_in_format(UNIT(s), mode, name, "[Scope]\nTimeoutStopSec=%lluus\n", (unsigned long long) s->timeout_stop_usec);
|
||||
unit_write_drop_in_format(UNIT(s), mode, name, "[Scope]\nTimeoutStopSec="USEC_FMT"us\n", s->timeout_stop_usec);
|
||||
} else {
|
||||
r = sd_bus_message_skip(message, "t");
|
||||
if (r < 0)
|
||||
|
||||
+3
-2
@@ -1173,7 +1173,7 @@ static int build_environment(
|
||||
return -ENOMEM;
|
||||
our_env[n_env++] = x;
|
||||
|
||||
if (asprintf(&x, "WATCHDOG_USEC=%llu", (unsigned long long) watchdog_usec) < 0)
|
||||
if (asprintf(&x, "WATCHDOG_USEC="USEC_FMT, watchdog_usec) < 0)
|
||||
return -ENOMEM;
|
||||
our_env[n_env++] = x;
|
||||
}
|
||||
@@ -2139,7 +2139,8 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
|
||||
|
||||
for (i = 0; i < RLIM_NLIMITS; i++)
|
||||
if (c->rlimit[i])
|
||||
fprintf(f, "%s%s: %llu\n", prefix, rlimit_to_string(i), (unsigned long long) c->rlimit[i]->rlim_max);
|
||||
fprintf(f, "%s%s: "RLIM_FMT"\n",
|
||||
prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
|
||||
|
||||
if (c->ioprio_set) {
|
||||
_cleanup_free_ char *class_str = NULL;
|
||||
|
||||
+3
-3
@@ -470,8 +470,8 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
|
||||
if (s->control_pid > 0)
|
||||
fprintf(f,
|
||||
"%sControl PID: %lu\n",
|
||||
prefix, (unsigned long) s->control_pid);
|
||||
"%sControl PID: "PID_FMT"\n",
|
||||
prefix, s->control_pid);
|
||||
|
||||
if (s->bind_to_device)
|
||||
fprintf(f,
|
||||
@@ -1710,7 +1710,7 @@ static int socket_serialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
unit_serialize_item_format(u, f, "n-accepted", "%u", s->n_accepted);
|
||||
|
||||
if (s->control_pid > 0)
|
||||
unit_serialize_item_format(u, f, "control-pid", "%lu", (unsigned long) s->control_pid);
|
||||
unit_serialize_item_format(u, f, "control-pid", PID_FMT, s->control_pid);
|
||||
|
||||
if (s->control_command_id >= 0)
|
||||
unit_serialize_item(u, f, "control-command", socket_exec_command_to_string(s->control_command_id));
|
||||
|
||||
+3
-3
@@ -609,8 +609,8 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
|
||||
if (s->control_pid > 0)
|
||||
fprintf(f,
|
||||
"%sControl PID: %lu\n",
|
||||
prefix, (unsigned long) s->control_pid);
|
||||
"%sControl PID: "PID_FMT"\n",
|
||||
prefix, s->control_pid);
|
||||
|
||||
exec_context_dump(&s->exec_context, f, prefix);
|
||||
kill_context_dump(&s->kill_context, f, prefix);
|
||||
@@ -878,7 +878,7 @@ static int swap_serialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
unit_serialize_item(u, f, "result", swap_result_to_string(s->result));
|
||||
|
||||
if (s->control_pid > 0)
|
||||
unit_serialize_item_format(u, f, "control-pid", "%lu", (unsigned long) s->control_pid);
|
||||
unit_serialize_item_format(u, f, "control-pid", PID_FMT, s->control_pid);
|
||||
|
||||
if (s->control_command_id >= 0)
|
||||
unit_serialize_item(u, f, "control-command", swap_exec_command_to_string(s->control_command_id));
|
||||
|
||||
@@ -208,7 +208,7 @@ static int specifier_user_name(char specifier, void *data, void *userdata, char
|
||||
if (r < 0)
|
||||
return -ENODATA;
|
||||
|
||||
asprintf(&printed, "%lu", (unsigned long) uid);
|
||||
asprintf(&printed, UID_FMT, uid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ static int specifier_user_name(char specifier, void *data, void *userdata, char
|
||||
if (specifier == 'u')
|
||||
printed = strdup(username);
|
||||
else
|
||||
asprintf(&printed, "%lu", (unsigned long) uid);
|
||||
asprintf(&printed, UID_FMT, uid);
|
||||
}
|
||||
|
||||
if (!printed)
|
||||
|
||||
Reference in New Issue
Block a user