siphash24: introduce siphash24_compress_typesafe() macro

To prevent copy-and-paste mistake.

This also introduce in_addr_hash_func().

No functional change, just refactoring.
This commit is contained in:
Yu Watanabe
2023-12-25 15:38:59 +09:00
parent ac1b7b9e19
commit c01a5c0527
38 changed files with 177 additions and 162 deletions
+2 -2
View File
@@ -192,9 +192,9 @@ static uint64_t timer_get_fixed_delay_hash(Timer *t) {
}
siphash24_init(&state, hash_key);
siphash24_compress(&machine_id, sizeof(sd_id128_t), &state);
siphash24_compress_typesafe(machine_id, &state);
siphash24_compress_boolean(MANAGER_IS_SYSTEM(UNIT(t)->manager), &state);
siphash24_compress(&uid, sizeof(uid_t), &state);
siphash24_compress_typesafe(uid, &state);
siphash24_compress_string(UNIT(t)->id, &state);
return siphash24_finalize(&state);