Clean up mem allocation alignment macro usage + small refactoring of the typehash dependencies search

This commit is contained in:
Alexandre Paillier
2022-06-30 18:43:01 +02:00
parent 339d24445e
commit 4574c223f2
6 changed files with 25 additions and 24 deletions

View File

@@ -359,7 +359,7 @@ bool path_set_root(const char *const struct_name, uint8_t name_length)
// TODO: Move elsewhere
cx_sha3_t *hash_ctx;
const uint8_t *thash_ptr;
if ((hash_ctx = MEM_ALLOC_AND_ALIGN_TO_TYPE(sizeof(*hash_ctx), *hash_ctx)) == NULL)
if ((hash_ctx = MEM_ALLOC_AND_ALIGN_TYPE(*hash_ctx)) == NULL)
{
return false;
}
@@ -638,7 +638,7 @@ bool path_init(void)
{
if (path_struct == NULL)
{
path_struct = MEM_ALLOC_AND_ALIGN_TO_TYPE(sizeof(*path_struct), *path_struct);
path_struct = MEM_ALLOC_AND_ALIGN_TYPE(*path_struct);
}
return path_struct != NULL;
}