summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-04-25 07:45:15 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-05-15 15:29:58 +0200
commitde0671ee7fe465e108f62dcbbbe9366f81dd9e9a (patch)
tree3ee30af44852655c365104703359b47a6e6219b5 /src/core
parent12ed81d9c88406234c20e9261ae8c8b992d8bc4d (diff)
Remove unnecessary casts in printfs
No functional change expected :)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/condition.c2
-rw-r--r--src/core/dbus-scope.c2
-rw-r--r--src/core/execute.c5
-rw-r--r--src/core/socket.c6
-rw-r--r--src/core/swap.c6
-rw-r--r--src/core/unit-printf.c4
6 files changed, 13 insertions, 12 deletions
diff --git a/src/core/condition.c b/src/core/condition.c
index 1448fa19dc..24684580a8 100644
--- a/src/core/condition.c
+++ b/src/core/condition.c
@@ -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);
diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c
index b9e3be483b..fbb4ff5646 100644
--- a/src/core/dbus-scope.c
+++ b/src/core/dbus-scope.c
@@ -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)
diff --git a/src/core/execute.c b/src/core/execute.c
index 4a3aeda3cd..af8e7c725b 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -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;
diff --git a/src/core/socket.c b/src/core/socket.c
index 536904f309..05af8fe9d2 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -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));
diff --git a/src/core/swap.c b/src/core/swap.c
index 10eed6d25f..9f353af430 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -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));
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index d16d856b51..5bd30f0bf7 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -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)