Skip to content

Commit f38c730

Browse files
authored
Merge pull request #5853 from douzzer/20221205-sp-int-bugprone-macro-parentheses
20221205-sp-int-bugprone-macro-parentheses
2 parents 9d9549f + 595f8a3 commit f38c730

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

wolfcrypt/src/sp_int.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ This library provides single precision (SP) integer math functions.
128128
/* Dynamically allocate just enough data to support size. */
129129
#define ALLOC_SP_INT(n, s, err, h) \
130130
do { \
131-
if (((err) == MP_OKAY) && (s > SP_INT_DIGITS)) { \
131+
if (((err) == MP_OKAY) && ((s) > SP_INT_DIGITS)) { \
132132
(err) = MP_VAL; \
133133
} \
134134
if ((err) == MP_OKAY) { \
@@ -154,7 +154,7 @@ This library provides single precision (SP) integer math functions.
154154
/* Array declared on stack - check size is valid. */
155155
#define ALLOC_SP_INT(n, s, err, h) \
156156
do { \
157-
if (((err) == MP_OKAY) && (s > SP_INT_DIGITS)) { \
157+
if (((err) == MP_OKAY) && ((s) > SP_INT_DIGITS)) { \
158158
(err) = MP_VAL; \
159159
} \
160160
} \
@@ -218,7 +218,7 @@ This library provides single precision (SP) integer math functions.
218218
*/
219219
#define ALLOC_SP_INT_ARRAY(n, s, c, err, h) \
220220
do { \
221-
if (((err) == MP_OKAY) && (s > SP_INT_DIGITS)) { \
221+
if (((err) == MP_OKAY) && ((s) > SP_INT_DIGITS)) { \
222222
(err) = MP_VAL; \
223223
} \
224224
if ((err) == MP_OKAY) { \
@@ -247,7 +247,7 @@ This library provides single precision (SP) integer math functions.
247247
*/
248248
#define ALLOC_SP_INT_ARRAY(n, s, c, err, h) \
249249
do { \
250-
if (((err) == MP_OKAY) && (s > SP_INT_DIGITS)) { \
250+
if (((err) == MP_OKAY) && ((s) > SP_INT_DIGITS)) { \
251251
(err) = MP_VAL; \
252252
} \
253253
if ((err) == MP_OKAY) { \
@@ -267,7 +267,7 @@ This library provides single precision (SP) integer math functions.
267267
*/
268268
#define ALLOC_SP_INT_ARRAY(n, s, c, err, h) \
269269
do { \
270-
if (((err) == MP_OKAY) && (s > SP_INT_DIGITS)) { \
270+
if (((err) == MP_OKAY) && ((s) > SP_INT_DIGITS)) { \
271271
(err) = MP_VAL; \
272272
} \
273273
if ((err) == MP_OKAY) { \

0 commit comments

Comments
 (0)