From 6c21cf5fed1ad430fa41445eac2350802bc8aaed Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Fri, 1 May 2015 19:15:34 +0300 Subject: DES: Silence compiler warnings on Windows * cipher/des.c (working_memcmp): Make pointer arguments 'const void *'. -- Following warning seen on Windows target build: des.c: In function 'is_weak_key': des.c:1019:40: warning: pointer targets in passing argument 1 of 'working_memcmp' differ in signedness [-Wpointer-sign] if ( !(cmp_result=working_memcmp(work, weak_keys[middle], 8)) ) ^ des.c:149:1: note: expected 'const char *' but argument is of type 'unsigned char *' working_memcmp( const char *a, const char *b, size_t n ) ^ des.c:1019:46: warning: pointer targets in passing argument 2 of 'working_memcmp' differ in signedness [-Wpointer-sign] if ( !(cmp_result=working_memcmp(work, weak_keys[middle], 8)) ) ^ des.c:149:1: note: expected 'const char *' but argument is of type 'unsigned char *' working_memcmp( const char *a, const char *b, size_t n ) ^ Signed-off-by: Jussi Kivilinna --- cipher/des.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cipher/des.c b/cipher/des.c index bc2a474d..d4863d1b 100644 --- a/cipher/des.c +++ b/cipher/des.c @@ -146,8 +146,10 @@ * depending on whether characters are signed or not. */ static int -working_memcmp( const char *a, const char *b, size_t n ) +working_memcmp( const void *_a, const void *_b, size_t n ) { + const char *a = _a; + const char *b = _b; for( ; n; n--, a++, b++ ) if( *a != *b ) return (int)(*(byte*)a) - (int)(*(byte*)b); -- cgit v1.2.1