]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/vstructs.h
Update bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entr...
[bcachefs-tools-debian] / libbcachefs / vstructs.h
index c099cdc0605f960c7d2ebae01304d0722194ee05..a6561b4b36a6e15cf020a82ba2c6741659dbf757 100644 (file)
@@ -20,7 +20,7 @@
 ({                                                                     \
        BUILD_BUG_ON(offsetof(_type, _data) % sizeof(u64));             \
                                                                        \
-       (offsetof(_type, _data) + (_u64s) * sizeof(u64));               \
+       (size_t) (offsetof(_type, _data) + (_u64s) * sizeof(u64));      \
 })
 
 #define vstruct_bytes(_s)                                              \
        (round_up(vstruct_bytes(_s), 512 << (_sector_block_bits)) >> 9)
 
 #define vstruct_next(_s)                                               \
-       ((typeof(_s))                   ((_s)->_data + __vstruct_u64s(_s)))
+       ((typeof(_s))                   ((u64 *) (_s)->_data + __vstruct_u64s(_s)))
 #define vstruct_last(_s)                                               \
-       ((typeof(&(_s)->start[0]))      ((_s)->_data + __vstruct_u64s(_s)))
+       ((typeof(&(_s)->start[0]))      ((u64 *) (_s)->_data + __vstruct_u64s(_s)))
 #define vstruct_end(_s)                                                        \
-       ((void *)                       ((_s)->_data + __vstruct_u64s(_s)))
+       ((void *)                       ((u64 *) (_s)->_data + __vstruct_u64s(_s)))
 
 #define vstruct_for_each(_s, _i)                                       \
        for (_i = (_s)->start;                                          \