summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-12-23 21:59:34 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-12-23 21:59:34 +0100
commitcad2be0b4ffd9490ca83cdb355b6402838811413 (patch)
treea798f3199bbab548362bf95f49055b80dfdf3026 /src
parent65517aebee0a7624b31dd9ce481e7f00ece3d497 (diff)
downloadpianobar-windows-cad2be0b4ffd9490ca83cdb355b6402838811413.tar.gz
pianobar-windows-cad2be0b4ffd9490ca83cdb355b6402838811413.tar.bz2
pianobar-windows-cad2be0b4ffd9490ca83cdb355b6402838811413.zip
Fix warnings found by -Wcast-qual
Diffstat (limited to 'src')
-rw-r--r--src/libezxml/ezxml.c4
-rw-r--r--src/libpiano/crypt.c8
-rw-r--r--src/ui.c8
3 files changed, 10 insertions, 10 deletions
diff --git a/src/libezxml/ezxml.c b/src/libezxml/ezxml.c
index ced87ea..0e1dd5d 100644
--- a/src/libezxml/ezxml.c
+++ b/src/libezxml/ezxml.c
@@ -108,7 +108,7 @@ static ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off)
// Adds a child tag. off is the offset of the child tag relative to the start
// of the parent tag's character content. Returns the child tag.
-static ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off)
+static ezxml_t ezxml_add_child(ezxml_t xml, char *name, size_t off)
{
ezxml_t child;
@@ -131,7 +131,7 @@ ezxml_t ezxml_child(ezxml_t xml, const char *name)
}
// returns a new empty ezxml structure with the given root tag name
-static ezxml_t ezxml_new(const char *name)
+static ezxml_t ezxml_new(char *name)
{
static char *ent[] = { "lt;", "&#60;", "gt;", "&#62;", "quot;", "&#34;",
"apos;", "&#39;", "amp;", "&#38;", NULL };
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;
diff --git a/src/ui.c b/src/ui.c
index c474a3d..d24db1c 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -235,16 +235,16 @@ int BarUiPianoCall (BarApp_t * const app, PianoRequestType_t type,
/* Station sorting functions */
static inline int BarStationQuickmix01Cmp (const void *a, const void *b) {
- const PianoStation_t *stationA = *((PianoStation_t **) a),
- *stationB = *((PianoStation_t **) b);
+ const PianoStation_t *stationA = *((PianoStation_t * const *) a),
+ *stationB = *((PianoStation_t * const *) b);
return stationA->isQuickMix - stationB->isQuickMix;
}
/* sort by station name from a to z, case insensitive
*/
static inline int BarStationNameAZCmp (const void *a, const void *b) {
- const PianoStation_t *stationA = *((PianoStation_t **) a),
- *stationB = *((PianoStation_t **) b);
+ const PianoStation_t *stationA = *((PianoStation_t * const *) a),
+ *stationB = *((PianoStation_t * const *) b);
return strcasecmp (stationA->name, stationB->name);
}