Skip to content

Commit 80397ca

Browse files
committed
Split up mp_rand_source.c
In order to make `helper.pl` happy, change the ternary operator to an if-else statement, otherwise it won't properly generate `tommath_class.h`. This fixes #582 This closes #583 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent a1f1c5f commit 80397ca

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

mp_rand_source.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include "tommath_private.h"
2-
#ifdef MP_RAND_C
2+
#ifdef MP_RAND_SOURCE_C
33
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
44
/* SPDX-License-Identifier: Unlicense */
5-
6-
mp_err(*s_mp_rand_source)(void *out, size_t size) = s_mp_rand_platform;
7-
85
void mp_rand_source(mp_err(*source)(void *out, size_t size))
96
{
10-
s_mp_rand_source = (source == NULL) ? s_mp_rand_platform : source;
7+
if (source == NULL)
8+
s_mp_rand_source = s_mp_rand_platform;
9+
else
10+
s_mp_rand_source = source;
1111
}
1212
#endif

s_mp_rand_source.c

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "tommath_private.h"
2+
#ifdef S_MP_RAND_SOURCE_C
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
5+
6+
mp_err(*s_mp_rand_source)(void *out, size_t size) = s_mp_rand_platform;
7+
#endif

0 commit comments

Comments
 (0)