Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/crypto/ripemd160 Lint warnings.
details: https://anonhg.NetBSD.org/src/rev/d3561ac1ed80
branches: trunk
changeset: 584215:d3561ac1ed80
user: elad <elad%NetBSD.org@localhost>
date: Sun Sep 11 16:11:22 2005 +0000
description:
Lint warnings.
diffstat:
sys/crypto/ripemd160/rmd160.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diffs (101 lines):
diff -r 5c80c1060a18 -r d3561ac1ed80 sys/crypto/ripemd160/rmd160.c
--- a/sys/crypto/ripemd160/rmd160.c Sun Sep 11 16:09:51 2005 +0000
+++ b/sys/crypto/ripemd160/rmd160.c Sun Sep 11 16:11:22 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rmd160.c,v 1.4 2005/05/31 00:43:56 christos Exp $ */
+/* $NetBSD: rmd160.c,v 1.5 2005/09/11 16:11:22 elad Exp $ */
/* $KAME: rmd160.c,v 1.2 2003/07/25 09:37:55 itojun Exp $ */
/* $OpenBSD: rmd160.c,v 1.3 2001/09/26 21:40:13 markus Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmd160.c,v 1.4 2005/05/31 00:43:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmd160.c,v 1.5 2005/09/11 16:11:22 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -39,20 +39,20 @@
#include <crypto/ripemd160/rmd160.h>
#define PUT_64BIT_LE(cp, value) do { \
- (cp)[7] = (value) >> 56; \
- (cp)[6] = (value) >> 48; \
- (cp)[5] = (value) >> 40; \
- (cp)[4] = (value) >> 32; \
- (cp)[3] = (value) >> 24; \
- (cp)[2] = (value) >> 16; \
- (cp)[1] = (value) >> 8; \
- (cp)[0] = (value); } while (0)
+ (cp)[7] = (u_char)((value) >> 56); \
+ (cp)[6] = (u_char)((value) >> 48); \
+ (cp)[5] = (u_char)((value) >> 40); \
+ (cp)[4] = (u_char)((value) >> 32); \
+ (cp)[3] = (u_char)((value) >> 24); \
+ (cp)[2] = (u_char)((value) >> 16); \
+ (cp)[1] = (u_char)((value) >> 8); \
+ (cp)[0] = (u_char)((value)); } while (/*CONSTCOND*/0)
#define PUT_32BIT_LE(cp, value) do { \
(cp)[3] = (value) >> 24; \
(cp)[2] = (value) >> 16; \
(cp)[1] = (value) >> 8; \
- (cp)[0] = (value); } while (0)
+ (cp)[0] = (value); } while (/*CONSTCOND*/0)
#define H0 0x67452301U
#define H1 0xEFCDAB89U
@@ -85,7 +85,7 @@
do { \
a = ROL(sj, a + Fj(b,c,d) + X(rj) + Kj) + e; \
c = ROL(10, c); \
- } while(0)
+ } while(/*CONSTCOND*/0)
#define X(i) x[i]
@@ -111,14 +111,14 @@
{
u_int32_t have, off, need;
- have = (ctx->count/8) % 64;
+ have = (u_int32_t)((ctx->count/8) % 64);
need = 64 - have;
ctx->count += 8 * len;
off = 0;
if (len >= need) {
if (have) {
- memcpy(ctx->buffer + have, input, need);
+ memcpy(ctx->buffer + have, input, (size_t)need);
RMD160Transform(ctx->state, ctx->buffer);
off = need;
have = 0;
@@ -130,7 +130,7 @@
}
}
if (off < len)
- memcpy(ctx->buffer + have, input+off, len-off);
+ memcpy(ctx->buffer + have, input+off, (size_t)len-off);
}
void
@@ -146,7 +146,7 @@
* pad to 64 byte blocks, at least one byte from PADDING plus 8 bytes
* for the size
*/
- padlen = 64 - ((ctx->count/8) % 64);
+ padlen = (u_int32_t)(64 - ((ctx->count/8) % 64));
if (padlen < 1 + 8)
padlen += 64;
RMD160Update(ctx, PADDING, padlen - 8); /* padlen - 8 <= 64 */
@@ -165,7 +165,7 @@
u_int32_t a, b, c, d, e, aa, bb, cc, dd, ee, t, x[16];
#if BYTE_ORDER == LITTLE_ENDIAN
- memcpy(x, block, 64);
+ memcpy(x, block, (size_t)64);
#else
int i;
Home |
Main Index |
Thread Index |
Old Index