summaryrefslogtreecommitdiff
path: root/random/rndunix.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-01-21 12:05:23 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2020-01-21 12:05:23 +0900
commit4997139b3e83761c9af0246cec829305c3d7d13b (patch)
treebd342e45cd30ec109ce28f693556e5a21b530b9e /random/rndunix.c
parent5ebb2f0671c902863eee91cbcfc85a72be506410 (diff)
downloadlibgcrypt-4997139b3e83761c9af0246cec829305c3d7d13b.tar.gz
Avoid use of ulong in internal code.
* configure.ac (HAVE_ULONG_TYPEDEF): Remove. * mpi/mpi-div.c (_gcry_mpi_fdiv_r_ui): Use unsigned long. (_gcry_mpi_divisible_ui): Likewise. * random/rndunix.c (_gcry_rndunix_gather_random): Likewise. * random/rndw32.c (_gcry_rndw32_gather_random_fast): Likewise. (ADDINT): Likewise. * random/rndw32ce.c (_gcry_rndw32ce_gather_random_fast): Likewise. * src/mpi.h: Follow the change. * src/types.h (HAVE_ULONG_TYPEDEF): Remove. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'random/rndunix.c')
-rw-r--r--random/rndunix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random/rndunix.c b/random/rndunix.c
index fcb45b78..aff2f85d 100644
--- a/random/rndunix.c
+++ b/random/rndunix.c
@@ -894,7 +894,7 @@ _gcry_rndunix_gather_random (void (*add)(const void*, size_t,
/* now read from the gatherer */
while( length ) {
int goodness;
- ulong subtract;
+ unsigned long subtract;
if( read_a_msg( pipedes[0], &msg ) ) {
log_error("reading from gatherer pipe failed: %s\n",
@@ -928,7 +928,7 @@ _gcry_rndunix_gather_random (void (*add)(const void*, size_t,
(*add)( msg.data, n, origin );
/* this is the trick how we cope with the goodness */
- subtract = (ulong)n * goodness / 100;
+ subtract = (unsigned long)n * goodness / 100;
/* subtract at least 1 byte to avoid infinite loops */
length -= subtract ? subtract : 1;
}