summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2005-01-05 19:01:20 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2005-01-05 19:01:20 +0000
commit73660103ece9dba18099c017ee9956f290c9c79f (patch)
treead5c7552fb8ee17178c37b95af85424d04a090dc
parent8655e61b5ddd3b734d5e64a6e60a2afe89e25ca9 (diff)
downloadlibapr-73660103ece9dba18099c017ee9956f290c9c79f.tar.gz
Clean up 4 extranious emits. Because of the modulo operator, these
becomes safe casts to unsigned. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@124243 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--random/unix/sha2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/random/unix/sha2.c b/random/unix/sha2.c
index 7e35e18f3..7ce6d659b 100644
--- a/random/unix/sha2.c
+++ b/random/unix/sha2.c
@@ -458,7 +458,8 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
/* Sanity check: */
assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0);
- usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
+ usedspace = (unsigned int)((context->bitcount >> 3)
+ % SHA256_BLOCK_LENGTH);
if (usedspace > 0) {
/* Calculate how much free space is available in the buffer */
freespace = SHA256_BLOCK_LENGTH - usedspace;
@@ -504,7 +505,8 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
/* If no digest buffer is passed, we don't bother doing this: */
if (digest != (sha2_byte*)0) {
- usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
+ usedspace = (unsigned int)((context->bitcount >> 3)
+ % SHA256_BLOCK_LENGTH);
#if !APR_IS_BIGENDIAN
/* Convert FROM host byte order */
REVERSE64(context->bitcount,context->bitcount);
@@ -780,7 +782,8 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
/* Sanity check: */
assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0);
- usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
+ usedspace = (unsigned int)((context->bitcount[0] >> 3)
+ % SHA512_BLOCK_LENGTH);
if (usedspace > 0) {
/* Calculate how much free space is available in the buffer */
freespace = SHA512_BLOCK_LENGTH - usedspace;
@@ -820,7 +823,8 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
void SHA512_Last(SHA512_CTX* context) {
unsigned int usedspace;
- usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
+ usedspace = (unsigned int)((context->bitcount[0] >> 3)
+ % SHA512_BLOCK_LENGTH);
#if !APR_IS_BIGENDIAN
/* Convert FROM host byte order */
REVERSE64(context->bitcount[0],context->bitcount[0]);