[code-utils] fix wrong pointer size in otALIGN (#3468)

This commit is contained in:
Yakun Xu
2019-01-17 02:59:32 -08:00
committed by Jonathan Hui
parent 16c904955a
commit e45107dac7
+2 -1
View File
@@ -57,7 +57,8 @@
* @returns The aligned pointer.
*
*/
#define otALIGN(aPointer, aAlignment) ((void *)(((uintptr_t)(aPointer) + (aAlignment)-1U) & ~((aAlignment)-1U)))
#define otALIGN(aPointer, aAlignment) \
((void *)(((uintptr_t)(aPointer) + (aAlignment)-1UL) & ~((uintptr_t)(aAlignment)-1UL)))
// Calculates the aligned variable size.
#define otALIGNED_VAR_SIZE(size, align_type) (((size) + (sizeof(align_type) - 1)) / sizeof(align_type))