Merge #880: Add parens around ROUND_TO_ALIGN's parameter.
b6f649889a
Add parens around ROUND_TO_ALIGN's parameter. This makes the macro robust against a hypothetical ROUND_TO_ALIGN(foo ? sizeA : size B) invocation. (Russell O'Connor) Pull request description: This makes the macro robust against a hypothetical `ROUND_TO_ALIGN(foo ? sizeA : size B)` invocation. See also <https://wiki.sei.cmu.edu/confluence/display/c/PRE01-C.+Use+parentheses+within+macros+around+parameter+names>. ACKs for top commit: sipa: ACKb6f649889a
. This is the way. jonasnick: utACKb6f649889a
real-or-random: utACKb6f649889a
Tree-SHA512: 6a2685f959e8ae472259e5ea75fe12e8e6213f56f5aec7603a896c294e6a8833caae25c412607d9c9a3125370a7765a3e506127b101a1b87203f95e326f6c6c6
This commit is contained in:
commit
659d0d4798
|
@ -113,7 +113,7 @@ static SECP256K1_INLINE void *checked_realloc(const secp256k1_callback* cb, void
|
||||||
#define ALIGNMENT 16
|
#define ALIGNMENT 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ROUND_TO_ALIGN(size) (((size + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT)
|
#define ROUND_TO_ALIGN(size) ((((size) + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT)
|
||||||
|
|
||||||
/* Assume there is a contiguous memory object with bounds [base, base + max_size)
|
/* Assume there is a contiguous memory object with bounds [base, base + max_size)
|
||||||
* of which the memory range [base, *prealloc_ptr) is already allocated for usage,
|
* of which the memory range [base, *prealloc_ptr) is already allocated for usage,
|
||||||
|
|
Loading…
Reference in New Issue