def unpack_from_bitmask(channels, swizzles):
depth = format.block_size()
- print(' uint%u_t value = *(const uint%u_t *)src;' % (depth, depth))
+ print(' uint%u_t value;' % (depth))
+ print(' memcpy(&value, src, sizeof value);')
# Compute the intermediate unshifted values
for i in range(format.nr_channels()):
if value is not None:
print(' value |= %s;' % (value))
- print(' *(uint%u_t *)dst = value;' % depth)
+ print(' memcpy(dst, &value, sizeof value);')
def pack_into_struct(channels, swizzles):
inv_swizzle = inv_swizzles(swizzles)