Skip to content

Commit 3811607

Browse files
committed
literal suffix
1 parent 04cff08 commit 3811607

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

bn_s_mp_rand_jenkins.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ static uint64_t s_rand_jenkins_val(void)
2828
void s_mp_rand_jenkins_init(uint64_t seed)
2929
{
3030
uint64_t i;
31-
jenkins_x.a = 0xf1ea5eed;
31+
jenkins_x.a = 0xf1ea5eedULL;
3232
jenkins_x.b = jenkins_x.c = jenkins_x.d = seed;
33-
for (i = 0; i < 20; ++i) {
33+
for (i = 0uLL; i < 20uLL; ++i) {
3434
(void)s_rand_jenkins_val();
3535
}
3636
}
3737

3838
int s_mp_rand_jenkins(void *p, size_t n)
3939
{
4040
char *q = (char *)p;
41-
while (n > 0) {
41+
while (n > 0u) {
4242
int i;
4343
uint64_t x = s_rand_jenkins_val();
44-
for (i = 0; (i < 8) && (n > 0); ++i, --n) {
45-
*q++ = (char)(x & 0xFF);
44+
for (i = 0; (i < 8) && (n > 0u); ++i, --n) {
45+
*q++ = (char)(x & 0xFFuLL);
4646
x >>= 8;
4747
}
4848
}

bn_s_mp_rand_platform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int s_read_win_csp(void *p, size_t n)
5252
static int s_read_getrandom(void *p, size_t n)
5353
{
5454
char *q = (char *)p;
55-
while (n > 0) {
55+
while (n > 0u) {
5656
ssize_t ret = getrandom(q, n, 0);
5757
if (ret < 0) {
5858
if (errno == EINTR) {
@@ -89,7 +89,7 @@ static int s_read_dev_urandom(void *p, size_t n)
8989
} while ((fd == -1) && (errno == EINTR));
9090
if (fd == -1) return MP_ERR;
9191

92-
while (n > 0) {
92+
while (n > 0u) {
9393
ssize_t ret = read(fd, p, n);
9494
if (ret < 0) {
9595
if (errno == EINTR) {

tommath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ TOOM_SQR_CUTOFF;
151151
#endif
152152

153153
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
154-
#define PRIVATE_MP_WARRAY (1u << (((CHAR_BIT * sizeof(mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
154+
#define PRIVATE_MP_WARRAY (1uLL << (((CHAR_BIT * sizeof(mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
155155
#define MP_WARRAY (MP_DEPRECATED_PRAGMA("MP_WARRAY is an internal macro") PRIVATE_MP_WARRAY)
156156

157157
#if defined(__GNUC__) && __GNUC__ >= 4

tommath_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ extern void MP_FREE(void *mem, size_t size);
139139
#define MP_IS_ODD(a) (((a)->used > 0) && (((a)->dp[0] & 1u) == 1u))
140140

141141
#define MP_SIZEOF_BITS(type) (CHAR_BIT * sizeof(type))
142-
#define MP_MAXFAST (int)(1u << (MP_SIZEOF_BITS(mp_word) - (2u * (size_t)MP_DIGIT_BIT)))
142+
#define MP_MAXFAST (int)(1uL << (MP_SIZEOF_BITS(mp_word) - (2u * (size_t)MP_DIGIT_BIT)))
143143

144144
/* random number source */
145145
extern int (*s_mp_rand_source)(void *out, size_t size);

0 commit comments

Comments
 (0)