From cad2be0b4ffd9490ca83cdb355b6402838811413 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 23 Dec 2011 21:59:34 +0100 Subject: Fix warnings found by -Wcast-qual --- src/libpiano/crypt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libpiano/crypt.c') diff --git a/src/libpiano/crypt.c b/src/libpiano/crypt.c index 9c96629..e833868 100644 --- a/src/libpiano/crypt.c +++ b/src/libpiano/crypt.c @@ -48,7 +48,7 @@ THE SOFTWARE. #define INITIAL_SHIFT 28 #define SHIFT_DEC 4 char *PianoDecryptString (const char * const s) { - const unsigned char *strInput = (unsigned char *) s; + const unsigned char *strInput = (const unsigned char *) s; /* hex-decode => strlen/2 + null-byte */ uint32_t *iDecrypt; char *strDecrypted; @@ -56,7 +56,7 @@ char *PianoDecryptString (const char * const s) { /* blowfish blocks, 32-bit */ uint32_t f, l, r, lrExchange; - if ((iDecrypt = calloc (strlen ((char *) strInput)/2/sizeof (*iDecrypt)+1, + if ((iDecrypt = calloc (strlen ((const char *) strInput)/2/sizeof (*iDecrypt)+1, sizeof (*iDecrypt))) == NULL) { return NULL; } @@ -122,8 +122,8 @@ char *PianoDecryptString (const char * const s) { * @return encrypted, hex-encoded string */ char *PianoEncryptString (const char *s) { - const unsigned char *strInput = (unsigned char *) s; - const size_t strInputN = strlen ((char *) strInput); + const unsigned char *strInput = (const unsigned char *) s; + const size_t strInputN = strlen ((const char *) strInput); /* num of 64-bit blocks, rounded to next block */ size_t blockN = strInputN / 8 + 1; uint32_t *blockInput, *blockPtr; -- cgit v1.2.3