diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-01 19:15:34 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-01 19:15:34 +0300 |
commit | 6c21cf5fed1ad430fa41445eac2350802bc8aaed (patch) | |
tree | d15e065c53dc895ccff76bf969894a5fec599df3 | |
parent | 9cf224322007d90193d4910f0da6e0e29ce01d70 (diff) | |
download | libgcrypt-6c21cf5fed1ad430fa41445eac2350802bc8aaed.tar.gz |
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 <jussi.kivilinna@iki.fi>
-rw-r--r-- | cipher/des.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |