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 ++++++++----- src/libpiano/piano.c | 8 ++++---- src/libpiano/xml.c | 1 + src/libpiano/xml.h | 20 ++++++++++---------- 4 files changed, 23 insertions(+), 19 deletions(-) (limited to 'src/libpiano') 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; } diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c index 367a2c9..56f2bf7 100644 --- a/src/libpiano/piano.c +++ b/src/libpiano/piano.c @@ -62,7 +62,7 @@ void PianoInit (PianoHandle_t *ph) { /* destroy artist linked list */ -void PianoDestroyArtists (PianoArtist_t *artists) { +static void PianoDestroyArtists (PianoArtist_t *artists) { PianoArtist_t *curArtist, *lastArtist; curArtist = artists; @@ -98,7 +98,7 @@ void PianoDestroyStation (PianoStation_t *station) { /* free complete station list * @param piano handle */ -void PianoDestroyStations (PianoStation_t *stations) { +static void PianoDestroyStations (PianoStation_t *stations) { PianoStation_t *curStation, *lastStation; curStation = stations; @@ -148,7 +148,7 @@ void PianoDestroyStationInfo (PianoStationInfo_t *info) { /* destroy genre linked list */ -void PianoDestroyGenres (PianoGenre_t *genres) { +static void PianoDestroyGenres (PianoGenre_t *genres) { PianoGenre_t *curGenre, *lastGenre; curGenre = genres; @@ -163,7 +163,7 @@ void PianoDestroyGenres (PianoGenre_t *genres) { /* destroy user information */ -void PianoDestroyUserInfo (PianoUserInfo_t *user) { +static void PianoDestroyUserInfo (PianoUserInfo_t *user) { free (user->webAuthToken); free (user->authToken); free (user->listenerId); diff --git a/src/libpiano/xml.c b/src/libpiano/xml.c index a4250a7..1f6eed7 100644 --- a/src/libpiano/xml.c +++ b/src/libpiano/xml.c @@ -32,6 +32,7 @@ THE SOFTWARE. #include #include +#include "xml.h" #include "piano.h" #include "crypt.h" #include "config.h" diff --git a/src/libpiano/xml.h b/src/libpiano/xml.h index cca82c0..58ee28f 100644 --- a/src/libpiano/xml.h +++ b/src/libpiano/xml.h @@ -26,21 +26,21 @@ THE SOFTWARE. #include "piano.h" -PianoReturn_t PianoXmlParseUserinfo (PianoHandle_t *ph, const char *xml); -PianoReturn_t PianoXmlParseStations (PianoHandle_t *ph, const char *xml); -PianoReturn_t PianoXmlParsePlaylist (PianoHandle_t *ph, const char *xml, +PianoReturn_t PianoXmlParseUserinfo (PianoHandle_t *ph, char *xml); +PianoReturn_t PianoXmlParseStations (PianoHandle_t *ph, char *xml); +PianoReturn_t PianoXmlParsePlaylist (PianoHandle_t *ph, char *xml, PianoSong_t **); -PianoReturn_t PianoXmlParseSearch (const char *searchXml, +PianoReturn_t PianoXmlParseSearch (char *searchXml, PianoSearchResult_t *searchResult); -PianoReturn_t PianoXmlParseSimple (const char *xml); +PianoReturn_t PianoXmlParseSimple (char *xml); PianoReturn_t PianoXmlParseCreateStation (PianoHandle_t *ph, - const char *xml); -PianoReturn_t PianoXmlParseAddSeed (PianoHandle_t *ph, const char *xml, + char *xml); +PianoReturn_t PianoXmlParseAddSeed (PianoHandle_t *ph, char *xml, PianoStation_t *station); PianoReturn_t PianoXmlParseGenreExplorer (PianoHandle_t *ph, - const char *xmlContent); -PianoReturn_t PianoXmlParseTranformStation (const char *searchXml); -PianoReturn_t PianoXmlParseNarrative (const char *xml, char **retNarrative); + char *xmlContent); +PianoReturn_t PianoXmlParseTranformStation (char *searchXml); +PianoReturn_t PianoXmlParseNarrative (char *xml, char **retNarrative); PianoReturn_t PianoXmlParseSeedSuggestions (char *, PianoSearchResult_t *); PianoReturn_t PianoXmlParseGetStationInfo (char *, PianoStationInfo_t *); -- cgit v1.2.3