tree-wide: port everything over to new sd-id128 compund literal bliss

This commit is contained in:
Lennart Poettering
2021-08-20 11:09:48 +02:00
parent c970388b22
commit 85b55869bc
28 changed files with 101 additions and 162 deletions
+1 -2
View File
@@ -2873,7 +2873,6 @@ static int process_builtin(sd_bus *bus, sd_bus_message *m) {
r = sd_bus_message_new_method_return(m, &reply);
else if (streq_ptr(m->member, "GetMachineId")) {
sd_id128_t id;
char sid[SD_ID128_STRING_MAX];
r = sd_id128_get_machine(&id);
if (r < 0)
@@ -2883,7 +2882,7 @@ static int process_builtin(sd_bus *bus, sd_bus_message *m) {
if (r < 0)
return r;
r = sd_bus_message_append(reply, "s", sd_id128_to_string(id, sid));
r = sd_bus_message_append(reply, "s", SD_ID128_TO_STRING(id));
} else {
r = sd_bus_message_new_method_errorf(
m, &reply,
+1 -3
View File
@@ -2159,7 +2159,6 @@ _public_ int sd_device_trigger_with_uuid(
sd_device_action_t action,
sd_id128_t *ret_uuid) {
char buf[ID128_UUID_STRING_MAX];
const char *s, *j;
sd_id128_t u;
int r;
@@ -2178,8 +2177,7 @@ _public_ int sd_device_trigger_with_uuid(
if (r < 0)
return r;
id128_to_uuid_string(u, buf);
j = strjoina(s, " ", buf);
j = strjoina(s, " ", ID128_TO_UUID_STRING(u));
r = sd_device_set_sysattr_value(device, "uevent", j);
if (r < 0)
+4 -5
View File
@@ -3273,7 +3273,6 @@ fail:
#define FORMAT_TIMESTAMP_SAFE(t) (FORMAT_TIMESTAMP(t) ?: " --- ")
void journal_file_print_header(JournalFile *f) {
char a[SD_ID128_STRING_MAX], b[SD_ID128_STRING_MAX], c[SD_ID128_STRING_MAX], d[SD_ID128_STRING_MAX];
struct stat st;
assert(f);
@@ -3300,10 +3299,10 @@ void journal_file_print_header(JournalFile *f) {
"Objects: %"PRIu64"\n"
"Entry objects: %"PRIu64"\n",
f->path,
sd_id128_to_string(f->header->file_id, a),
sd_id128_to_string(f->header->machine_id, b),
sd_id128_to_string(f->header->boot_id, c),
sd_id128_to_string(f->header->seqnum_id, d),
SD_ID128_TO_STRING(f->header->file_id),
SD_ID128_TO_STRING(f->header->machine_id),
SD_ID128_TO_STRING(f->header->boot_id),
SD_ID128_TO_STRING(f->header->seqnum_id),
f->header->state == STATE_OFFLINE ? "OFFLINE" :
f->header->state == STATE_ONLINE ? "ONLINE" :
f->header->state == STATE_ARCHIVED ? "ARCHIVED" : "UNKNOWN",
+2 -6
View File
@@ -920,7 +920,6 @@ _public_ int sd_journal_previous_skip(sd_journal *j, uint64_t skip) {
_public_ int sd_journal_get_cursor(sd_journal *j, char **cursor) {
Object *o;
int r;
char bid[SD_ID128_STRING_MAX], sid[SD_ID128_STRING_MAX];
assert_return(j, -EINVAL);
assert_return(!journal_pid_changed(j), -ECHILD);
@@ -933,13 +932,10 @@ _public_ int sd_journal_get_cursor(sd_journal *j, char **cursor) {
if (r < 0)
return r;
sd_id128_to_string(j->current_file->header->seqnum_id, sid);
sd_id128_to_string(o->entry.boot_id, bid);
if (asprintf(cursor,
"s=%s;i=%"PRIx64";b=%s;m=%"PRIx64";t=%"PRIx64";x=%"PRIx64,
sid, le64toh(o->entry.seqnum),
bid, le64toh(o->entry.monotonic),
SD_ID128_TO_STRING(j->current_file->header->seqnum_id), le64toh(o->entry.seqnum),
SD_ID128_TO_STRING(o->entry.boot_id), le64toh(o->entry.monotonic),
le64toh(o->entry.realtime),
le64toh(o->entry.xor_hash)) < 0)
return -ENOMEM;