apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/random/unix apr_random.c
Date Mon, 17 Nov 2003 00:18:44 GMT
wrowe       2003/11/16 16:18:44

  Modified:    random/unix apr_random.c
  Log:
    Correct signedness of abs values.
  
  Reviewed by Will Rowe, Ben Laurie
  
  Revision  Changes    Path
  1.8       +6 -6      apr/random/unix/apr_random.c
  
  Index: apr_random.c
  ===================================================================
  RCS file: /home/cvs/apr/random/unix/apr_random.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- apr_random.c	16 Nov 2003 23:49:15 -0000	1.7
  +++ apr_random.c	17 Nov 2003 00:18:44 -0000	1.8
  @@ -75,8 +75,8 @@
   
   typedef struct apr_random_pool_t {
       unsigned char *pool;
  -    int bytes;
  -    int pool_size;
  +    unsigned int bytes;
  +    unsigned int pool_size;
   } apr_random_pool_t;
   
   #define hash_init(h)            (h)->init(h)
  @@ -126,7 +126,7 @@
                                     apr_crypto_hash_t *key_hash,
                                     apr_crypto_hash_t *prng_hash)
   {
  -    int n;
  +    unsigned int n;
   
       g->apr_pool = p;
   
  @@ -208,7 +208,7 @@
   
   static void rekey(apr_random_t *g)
   {
  -    int n;
  +    unsigned int n;
       unsigned char *H = H_current(g);
   
       hash_init(g->key_hash);
  @@ -238,7 +238,7 @@
   APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_,
                                            apr_size_t bytes)
   {
  -    int n;
  +    unsigned int n;
       const unsigned char *entropy = entropy_;
   
       for (n = 0; n < bytes; ++n) {
  @@ -257,7 +257,7 @@
           p->pool[p->bytes++] = entropy[n];
   
           if (p->bytes == g->rehash_size) {
  -            int r;
  +            unsigned int r;
   
               for (r = 0; r < p->bytes/2; r+=g->pool_hash->size)
                   hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2);
  
  
  

Mime
View raw message