fix build (hopefully)

This commit is contained in:
Jan Nijtmans 2019-11-12 14:29:02 +01:00 committed by Steffen Jaeckel
parent 9cfb6c3298
commit a91eb5a0d9
No known key found for this signature in database
GPG Key ID: AF0CB17621EDAD72
2 changed files with 4 additions and 4 deletions

View File

@ -625,7 +625,7 @@ static int test_mp_get_u32(void)
DOR(mp_init_multi(&a, &b, NULL));
for (i = 0; i < 1000; ++i) {
t = (unsigned long)rand_long() & 0xFFFFFFFFuL;
t = (unsigned long)rand_long() & (unsigned long)UINT32_MAX;
mp_set_ul(&a, t);
if (t != mp_get_u32(&a)) {
printf("\nmp_get_u32() bad result!");
@ -637,8 +637,8 @@ static int test_mp_get_u32(void)
printf("\nmp_get_u32() bad result!");
goto LBL_ERR;
}
mp_set_ul(&a, 0xFFFFFFFFuL);
if (mp_get_u32(&a) != 0xFFFFFFFFuL) {
mp_set_ul(&a, (unsigned long)UINT32_MAX);
if (mp_get_u32(&a) != UINT32_MAX) {
printf("\nmp_get_u32() bad result!");
goto LBL_ERR;
}

View File

@ -47,7 +47,7 @@ static unsigned long lfsr = 0xAAAAAAAAuL;
static unsigned int lbit(void)
{
if ((lfsr & 0x80000000uL) != 0uL) {
lfsr = ((lfsr << 1) ^ 0x8000001BuL) & 0xFFFFFFFFuL;
lfsr = ((lfsr << 1) ^ 0x8000001BuL) & (unsigned long)UINT32_MAX;
return 1u;
} else {
lfsr <<= 1;