summaryrefslogtreecommitdiff
path: root/random
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2005-01-05 19:01:20 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2005-01-05 19:01:20 +0000
commit20bd254752928374deb8b2cb8cde225815f462fb (patch)
treead5c7552fb8ee17178c37b95af85424d04a090dc /random
parentcc4345ebd2bd5b88f1e6e903297743646879cfff (diff)
downloadapr-20bd254752928374deb8b2cb8cde225815f462fb.tar.gz
Clean up 4 extranious emits. Because of the modulo operator, these
becomes safe casts to unsigned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124243 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'random')
-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]);