{
const void *vtable = *static_cast <const void *const *> (src_ptr);
const vtable_prefix *prefix =
- adjust_pointer <vtable_prefix> (vtable,
- -offsetof (vtable_prefix, origin));
+ (adjust_pointer <vtable_prefix>
+ (vtable, -ptrdiff_t (offsetof (vtable_prefix, origin))));
const void *whole_ptr =
adjust_pointer <void> (src_ptr, prefix->whole_object);
const __class_type_info *whole_type = prefix->whole_type;
// segfault later trying to use a vbase offset that doesn't exist.
const void *whole_vtable = *static_cast <const void *const *> (whole_ptr);
const vtable_prefix *whole_prefix =
- adjust_pointer <vtable_prefix> (whole_vtable,
- -offsetof (vtable_prefix, origin));
+ (adjust_pointer <vtable_prefix>
+ (whole_vtable, -ptrdiff_t (offsetof (vtable_prefix, origin))));
if (whole_prefix->whole_type != whole_type)
return NULL;
if (contained_public_p (result.dst2src))
// Src is known to be a public base of dst.
return const_cast <void *> (result.dst_ptr);
- if (contained_public_p (__class_type_info::__sub_kind (result.whole2src & result.whole2dst)))
+ if (contained_public_p (__class_type_info::__sub_kind
+ (result.whole2src & result.whole2dst)))
// Both src and dst are known to be public bases of whole. Found a valid
// cross cast.
return const_cast <void *> (result.dst_ptr);