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
@@ -476,8 +476,8 @@ int xstatfsat(int dir_fd, const char *path, struct statfs *ret) {
}
void inode_hash_func(const struct stat *q, struct siphash *state) {
siphash24_compress(&q->st_dev, sizeof(q->st_dev), state);
siphash24_compress(&q->st_ino, sizeof(q->st_ino), state);
siphash24_compress_typesafe(q->st_dev, state);
siphash24_compress_typesafe(q->st_ino, state);
}
int inode_compare_func(const struct stat *a, const struct stat *b) {