From be22806715ee51b5bb8d1fe9953f74bb2ee32792 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 23 Dec 2011 21:35:51 +0100 Subject: Fix warnings found by -Wmissing-declarations --- src/libpiano/crypt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/libpiano/crypt.c') diff --git a/src/libpiano/crypt.c b/src/libpiano/crypt.c index 8d743e2..9c96629 100644 --- a/src/libpiano/crypt.c +++ b/src/libpiano/crypt.c @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include +#include "crypt.h" #include "crypt_key_output.h" #include "crypt_key_input.h" #include "piano_private.h" @@ -46,10 +47,11 @@ THE SOFTWARE. */ #define INITIAL_SHIFT 28 #define SHIFT_DEC 4 -unsigned char *PianoDecryptString (const unsigned char *strInput) { +char *PianoDecryptString (const char * const s) { + const unsigned char *strInput = (unsigned char *) s; /* hex-decode => strlen/2 + null-byte */ uint32_t *iDecrypt; - unsigned char *strDecrypted; + char *strDecrypted; unsigned char shift = INITIAL_SHIFT, intsDecoded = 0, j; /* blowfish blocks, 32-bit */ uint32_t f, l, r, lrExchange; @@ -58,7 +60,7 @@ unsigned char *PianoDecryptString (const unsigned char *strInput) { sizeof (*iDecrypt))) == NULL) { return NULL; } - strDecrypted = (unsigned char *) iDecrypt; + strDecrypted = (char *) iDecrypt; while (*strInput != '\0') { /* hex-decode string */ @@ -119,7 +121,8 @@ unsigned char *PianoDecryptString (const unsigned char *strInput) { * @param encrypt this * @return encrypted, hex-encoded string */ -unsigned char *PianoEncryptString (const unsigned char *strInput) { +char *PianoEncryptString (const char *s) { + const unsigned char *strInput = (unsigned char *) s; const size_t strInputN = strlen ((char *) strInput); /* num of 64-bit blocks, rounded to next block */ size_t blockN = strInputN / 8 + 1; @@ -193,5 +196,5 @@ unsigned char *PianoEncryptString (const unsigned char *strInput) { free (blockInput); - return strHex; + return (char *) strHex; } -- cgit v1.2.3