From 208ef6b1f2f99f870f6483fbf93368bfe3e66785 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 25 Sep 2007 06:15:47 +0000 Subject: [PATCH] minor signed/unsigned cleanups --- src/bsd-snprintf.c | 8 ++++---- src/mp3-scanner.c | 2 +- src/scan-mp3.c | 7 ++++--- src/util.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/bsd-snprintf.c b/src/bsd-snprintf.c index a5a744d1..12a550b6 100644 --- a/src/bsd-snprintf.c +++ b/src/bsd-snprintf.c @@ -389,7 +389,7 @@ static void fmturl(char *buffer, size_t *currlen, size_t maxlen, char *safe = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789$-_.!*(),/@\\"; - current=value; + current=(unsigned char *)value; while(*current) { if(strchr(safe,*current)) { len++; @@ -399,13 +399,13 @@ static void fmturl(char *buffer, size_t *currlen, size_t maxlen, current++; } - new_string = (char*) malloc(len+1); + new_string = (unsigned char*) malloc(len+1); if(!new_string) { fmtstr(buffer,currlen,maxlen,value,flags,min,max); return; } - current = value; + current = (unsigned char *)value; dest = new_string; while(*current) { if(strchr(safe,*current)) { @@ -423,7 +423,7 @@ static void fmturl(char *buffer, size_t *currlen, size_t maxlen, } } *dest = '\0'; - fmtstr(buffer,currlen,maxlen,new_string,flags,min,max); + fmtstr(buffer,currlen,maxlen,(char*)new_string,flags,min,max); free(new_string); return; } diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index fecd8660..bcaade5c 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -164,7 +164,7 @@ static TAGHANDLER taghandlers[] = { { "mpp", scan_get_mpcinfo, "mpc", "mpc", 0, "Musepack audio file" }, { "mp+", scan_get_mpcinfo, "mpc", "mpc", 0, "Musepack audio file" }, #endif - { NULL, NULL, NULL, NULL, NULL } + { NULL, NULL, NULL, NULL, 0, NULL } }; typedef struct tag_playlistlist { diff --git a/src/scan-mp3.c b/src/scan-mp3.c index 3586b51b..e8f05e11 100644 --- a/src/scan-mp3.c +++ b/src/scan-mp3.c @@ -362,9 +362,10 @@ int scan_mp3_get_mp3tags(char *file, MP3FILE *pmp3) { #ifdef HAVE_ICONV /* this is kinda cheesy, but ucs4* == char* for 8859-1 */ free(utf8_text); - utf8_text = util_xtoutf8_alloc((unsigned char*)native_text, - strlen((char*)native_text), - conversion_codepage); + utf8_text = + (char*)util_xtoutf8_alloc((unsigned char*)native_text, + strlen((char*)native_text), + conversion_codepage); #endif } diff --git a/src/util.c b/src/util.c index f6dee222..e9439452 100644 --- a/src/util.c +++ b/src/util.c @@ -147,8 +147,8 @@ int util_xtoy(unsigned char *dbuffer, int dlen, unsigned char *sbuffer, int slen /* type punning warnings */ size_t st_dlen = (size_t)dlen; size_t st_slen = (size_t)slen; - char *st_dbuffer = dbuffer; - ICONV_CONST char *st_sbuffer = sbuffer; + char *st_dbuffer = (char*)dbuffer; + ICONV_CONST char *st_sbuffer = (char*)sbuffer; memset(dbuffer,0,dlen);