# HG changeset patch # User nathan # Date 1260060537 -28800 # Node ID afc13760179b52f357050fbc9a8f7c6d8c7836b0 # Parent 65ed49cbc08bcdabef30befc62116f685edaf9d2 fixed gcc 4.4.1 const errors diff -r 65ed49cbc08b -r afc13760179b data.c --- a/data.c Fri Nov 13 19:27:36 2009 +0800 +++ b/data.c Sun Dec 06 08:48:57 2009 +0800 @@ -412,7 +412,7 @@ description=strdup(Description); if(Include) { do { - char *s=index(Include,'/'); + const char *s=index(Include,'/'); int l=s ? s-Include : strlen(Include); if(l) { char **s=(char **)realloc(include,(incCount+2)*sizeof(char *)); diff -r 65ed49cbc08b -r afc13760179b decoder-ogg.c --- a/decoder-ogg.c Fri Nov 13 19:27:36 2009 +0800 +++ b/decoder-ogg.c Sun Dec 06 08:48:57 2009 +0800 @@ -162,7 +162,7 @@ for(int i=0 ; icomments ; i++) { const char *cc=vc->user_comments[i]; d(printf("ogg: comment%d='%s'\n",i,cc)) - char *p=strchr(cc,'='); + const char *p=strchr(cc,'='); if(p) { const int len=p-cc; p++; diff -r 65ed49cbc08b -r afc13760179b decoder-snd.c --- a/decoder-snd.c Fri Nov 13 19:27:36 2009 +0800 +++ b/decoder-snd.c Sun Dec 06 08:48:57 2009 +0800 @@ -579,7 +579,8 @@ bool cCDDBDisc::Split(const char *source, char div, char * &first, char * &second, bool only3) { int pos=-1, n=0; - char *p, l[4]={ ' ',div,' ',0 }; + const char *p; + char l[4]={ ' ',div,' ',0 }; if ((p=strstr(source,l))) { pos=p-source; n=3; } else if(!only3 && (p=strchr(source,div))) { pos=p-source; n=1; } if(pos>=0) { @@ -860,7 +861,7 @@ { if(id->Get()) { int tr; - char *s=strstr(filename,CDFS_TRACK); + const char *s=strstr(filename,CDFS_TRACK); if(s && sscanf(s+strlen(CDFS_TRACK),"%d",&tr)==1) { d(printf("snd: looking up disc id %08x track %d\n",id->discid,tr)) return cddb.Lookup(id,tr-1,this); diff -r 65ed49cbc08b -r afc13760179b decoder.c --- a/decoder.c Fri Nov 13 19:27:36 2009 +0800 +++ b/decoder.c Sun Dec 06 08:48:57 2009 +0800 @@ -137,7 +137,7 @@ { // if no title, try to build a reasonable from the filename if(!Title && filename) { - char *s=rindex(filename,'/'); + const char *s=rindex(filename,'/'); if(s && *s=='/') { s++; Title=strdup(s); @@ -147,8 +147,8 @@ if(l>0 && !strcasecmp(Title+l,extention)) Title[l]=0; } else { // strip any extention - s=rindex(Title,'.'); - if(s && *s=='.' && strlen(s)<=5) *s=0; + char *e=rindex(Title,'.'); + if(e && *e=='.' && strlen(e)<=5) *e=0; } d(printf("mp3: faking title '%s' from filename '%s'\n",Title,filename)) } diff -r 65ed49cbc08b -r afc13760179b mp3.c --- a/mp3.c Fri Nov 13 19:27:36 2009 +0800 +++ b/mp3.c Sun Dec 06 08:48:57 2009 +0800 @@ -563,11 +563,11 @@ int hash=MakeHash(buff); if(num==mode->Num) { fg=clrBlack; bg=clrCyan; hash=(hash^77) + 23; } if(all || hash!=hashlist[i]) { - char *s=rindex(buff,'\t'); + const char *s=rindex(buff,'\t'); if(s) { - *s++=0; + Write(5,i,bwc-5,s,fg,bg); + buff.Truncate(s-buff); Write(0,i,5,buff,fg,bg); - Write(5,i,bwc-5,s,fg,bg); } else Write(0,i,bwc,buff,fg,bg); diff -r 65ed49cbc08b -r afc13760179b stream.c --- a/stream.c Fri Nov 13 19:27:36 2009 +0800 +++ b/stream.c Sun Dec 06 08:48:57 2009 +0800 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2007 Stefan Huelswitt + * (C) 2001-2009 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -406,7 +406,7 @@ bool cNetStream::ParseHeader(const char *buff, const char *name, char **value) { - char *s=index(buff,':'); + const char *s=index(buff,':'); if(s && !strncasecmp(buff,name,s-buff)) { s=skipspace(s+1); d(printf("netstream: found header '%s' contents '%s'\n",name,s)) @@ -528,7 +528,7 @@ return false; } -char *cNetStream::ParseMetaString(const char *buff, const char *name, char **value) +char *cNetStream::ParseMetaString(char *buff, const char *name, char **value) { char *s=index(buff,'='); if(s && !strncasecmp(buff,name,s-buff)) { diff -r 65ed49cbc08b -r afc13760179b stream.h --- a/stream.h Fri Nov 13 19:27:36 2009 +0800 +++ b/stream.h Sun Dec 06 08:48:57 2009 +0800 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2006 Stefan Huelswitt + * (C) 2001-2009 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -114,7 +114,7 @@ bool GetHTTPResponse(void); bool ParseHeader(const char *buff, const char *name, char **value); bool ParseMetaData(void); - char *ParseMetaString(const char *buff, const char *name, char **value); + char *ParseMetaString(char *buff, const char *name, char **value); public: cNetStream(const char *Filename); virtual ~cNetStream();