mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-18 18:42:06 +00:00
storage: Fix for Clang
This commit is contained in:
parent
78bc7377a0
commit
6a2b92c49e
@ -46,12 +46,18 @@
|
|||||||
static const uint32_t storage_magic = 0x726f7473; // 'stor' as uint32_t
|
static const uint32_t storage_magic = 0x726f7473; // 'stor' as uint32_t
|
||||||
|
|
||||||
static uint32_t storage_uuid[12 / sizeof(uint32_t)];
|
static uint32_t storage_uuid[12 / sizeof(uint32_t)];
|
||||||
|
#ifndef __clang__
|
||||||
|
// TODO: Fix this for Clang
|
||||||
_Static_assert(((uint32_t)storage_uuid & 3) == 0, "uuid unaligned");
|
_Static_assert(((uint32_t)storage_uuid & 3) == 0, "uuid unaligned");
|
||||||
_Static_assert((sizeof(storage_uuid) & 3) == 0, "uuid unaligned");
|
_Static_assert((sizeof(storage_uuid) & 3) == 0, "uuid unaligned");
|
||||||
|
#endif
|
||||||
|
|
||||||
Storage CONFIDENTIAL storageUpdate;
|
Storage CONFIDENTIAL storageUpdate;
|
||||||
|
#ifndef __clang__
|
||||||
|
// TODO: Fix this for Clang
|
||||||
_Static_assert(((uint32_t)&storageUpdate & 3) == 0, "storage unaligned");
|
_Static_assert(((uint32_t)&storageUpdate & 3) == 0, "storage unaligned");
|
||||||
_Static_assert((sizeof(storageUpdate) & 3) == 0, "storage unaligned");
|
_Static_assert((sizeof(storageUpdate) & 3) == 0, "storage unaligned");
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STORAGE_ROM ((const Storage *)(FLASH_STORAGE_START + sizeof(storage_magic) + sizeof(storage_uuid)))
|
#define STORAGE_ROM ((const Storage *)(FLASH_STORAGE_START + sizeof(storage_magic) + sizeof(storage_uuid)))
|
||||||
|
|
||||||
@ -461,7 +467,7 @@ void storage_loadDevice(LoadDevice *msg)
|
|||||||
memset(&sessionSeed, 0, sizeof(sessionSeed));
|
memset(&sessionSeed, 0, sizeof(sessionSeed));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->has_language && msg->language) {
|
if (msg->has_language) {
|
||||||
storageUpdate.has_language = true;
|
storageUpdate.has_language = true;
|
||||||
strlcpy(storageUpdate.language, msg->language, sizeof(storageUpdate.language));
|
strlcpy(storageUpdate.language, msg->language, sizeof(storageUpdate.language));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user