comparison random.c @ 698:5f2d16d3e598

fix signedness error in prototype
author Matt Johnston <matt@ucc.asn.au>
date Mon, 11 Mar 2013 23:07:45 +0800
parents c85bb68e1db6
children 48e173a0c52b
comparison
equal deleted inserted replaced
697:aadfa8de977d 698:5f2d16d3e598
24 24
25 #include "includes.h" 25 #include "includes.h"
26 #include "buffer.h" 26 #include "buffer.h"
27 #include "dbutil.h" 27 #include "dbutil.h"
28 #include "bignum.h" 28 #include "bignum.h"
29 #include "random.h"
29 30
30 /* this is used to generate unique output from the same hashpool */ 31 /* this is used to generate unique output from the same hashpool */
31 static uint32_t counter = 0; 32 static uint32_t counter = 0;
32 /* the max value for the counter, so it won't integer overflow */ 33 /* the max value for the counter, so it won't integer overflow */
33 #define MAX_COUNTER 1<<30 34 #define MAX_COUNTER 1<<30
134 out: 135 out:
135 close(readfd); 136 close(readfd);
136 return ret; 137 return ret;
137 } 138 }
138 139
139 void addrandom(char * buf, int len) 140 void addrandom(char * buf, unsigned int len)
140 { 141 {
141 hash_state hs; 142 hash_state hs;
142 143
143 /* hash in the new seed data */ 144 /* hash in the new seed data */
144 sha1_init(&hs); 145 sha1_init(&hs);