mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Workaround clang alignment warnings (Wcast-align) when working with byt arrays.
This should silence similar warnings like warning: cast from 'char *' to 'struct xyz *' increases required alignment from 1 to X when we try to calclulate byte pointer offsets in a buffer.
This commit is contained in:
@@ -264,8 +264,8 @@ static int TCRYPT_hdr_from_disk(struct crypt_device *cd,
|
||||
*/
|
||||
static void TCRYPT_swab_le(char *buf)
|
||||
{
|
||||
uint32_t *l = (uint32_t*)&buf[0];
|
||||
uint32_t *r = (uint32_t*)&buf[4];
|
||||
uint32_t *l = VOIDP_CAST(uint32_t*)&buf[0];
|
||||
uint32_t *r = VOIDP_CAST(uint32_t*)&buf[4];
|
||||
*l = swab32(*l);
|
||||
*r = swab32(*r);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user