From: asterix Date: Tue, 10 Jun 2008 17:08:43 +0000 (+0000) Subject: Fix type warning. X-Git-Tag: 2.0.0~501 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=c4ce14ab6ed86d2d9a5ee72fcb023110fb1a1772;p=bertos.git Fix type warning. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1433 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/algo/randpool.c b/bertos/algo/randpool.c index 0fc2ee9d..45bf5285 100644 --- a/bertos/algo/randpool.c +++ b/bertos/algo/randpool.c @@ -66,10 +66,11 @@ static void randpool_push(EntropyPool *pool, void *_byte, size_t n_byte) /* * Insert a bytes in entropy pool. */ - for(int j = 0; j < n_byte; j++) + for(size_t j = 0; j < n_byte; j++) { pool->pool_entropy[i] = pool->pool_entropy[i] ^ byte[j]; - i = (++i) % CONFIG_SIZE_ENTROPY_POOL; + i++; + i = i % CONFIG_SIZE_ENTROPY_POOL; } pool->pos_add = i; // Update a insert bytes. @@ -92,7 +93,7 @@ static void randpool_stir(EntropyPool *pool) for (int i = 0; i < (CONFIG_SIZE_ENTROPY_POOL / MD2_DIGEST_LEN); i++) { - sprintf(tmp_buf, "%0x%0x%0x",pool->counter, i, pool->pos_add); + sprintf((char *)tmp_buf, "%0x%0x%0x", pool->counter, i, pool->pos_add); /* * Hash with MD2 algorithm the entropy pool. @@ -245,10 +246,6 @@ void randpool_get(EntropyPool *pool, void *_data, size_t n_byte) pool->pos_get = i; //Current number of byte we get from pool. pool->entropy -= n_byte; //Update a entropy. - /*If we get all entropy entropy is 0*/ - if(pool->entropy < 0) - pool->entropy = 0; - } /**