all: avoid various "-Wcast-align=strict" warnings
This commit is contained in:
+2
-1
@@ -501,7 +501,8 @@ void cmsg_close_all(struct msghdr *mh) {
|
||||
|
||||
CMSG_FOREACH(cmsg, mh)
|
||||
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS)
|
||||
close_many((int*) CMSG_DATA(cmsg), (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int));
|
||||
close_many(CMSG_TYPED_DATA(cmsg, int),
|
||||
(cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int));
|
||||
}
|
||||
|
||||
bool fdname_is_valid(const char *s) {
|
||||
|
||||
+3
-2
@@ -373,8 +373,9 @@ static void get_hash_key(uint8_t hash_key[HASH_KEY_SIZE], bool reuse_is_ok) {
|
||||
}
|
||||
|
||||
static struct hashmap_base_entry* bucket_at(HashmapBase *h, unsigned idx) {
|
||||
return (struct hashmap_base_entry*)
|
||||
((uint8_t*) storage_ptr(h) + idx * hashmap_type_info[h->type].entry_size);
|
||||
return CAST_ALIGN_PTR(
|
||||
struct hashmap_base_entry,
|
||||
(uint8_t *) storage_ptr(h) + idx * hashmap_type_info[h->type].entry_size);
|
||||
}
|
||||
|
||||
static struct plain_hashmap_entry* plain_bucket_at(Hashmap *h, unsigned idx) {
|
||||
|
||||
Reference in New Issue
Block a user