fix gcc 4.x warnings trunk
authornathan
Sat, 29 Dec 2007 14:52:29 +0100
branchtrunk
changeset 6111ef8181229
parent 5 b33ec9d72c19
child 7 f5e05e2022f1
fix gcc 4.x warnings
HISTORY
data.c
decoder-ogg.c
decoder-snd.c
mp3.c
player-mp3.c
     1.1 --- a/HISTORY	Sat Dec 29 14:51:25 2007 +0100
     1.2 +++ b/HISTORY	Sat Dec 29 14:52:29 2007 +0100
     1.3 @@ -2,6 +2,7 @@
     1.4  ---------------------------
     1.5  
     1.6  ..2007: Version 0.10.2 (vdr 1.4.7 / 1.5.11)
     1.7 +- Fixed some gcc 4.x warnings.
     1.8  - Removed line number references from *.po files.
     1.9  
    1.10  27.08.2007: Version 0.10.1 (vdr 1.4.7 / 1.5.9)
     2.1 --- a/data.c	Sat Dec 29 14:51:25 2007 +0100
     2.2 +++ b/data.c	Sat Dec 29 14:52:29 2007 +0100
     2.3 @@ -512,7 +512,7 @@
     2.4  
     2.5  bool cFileSource::Action(eAction act)
     2.6  {
     2.7 -  static char *str[] = { "mount","unmount","eject","status" };
     2.8 +  static const char *str[] = { "mount","unmount","eject","status" };
     2.9    
    2.10    char *cmd=0;
    2.11    asprintf(&cmd,"%s %s %s",mountscript,str[act],basedir);
     3.1 --- a/decoder-ogg.c	Sat Dec 29 14:51:25 2007 +0100
     3.2 +++ b/decoder-ogg.c	Sat Dec 29 14:52:29 2007 +0100
     3.3 @@ -73,7 +73,7 @@
     3.4  
     3.5  void cOggFile::Error(const char *action, const int err)
     3.6  {
     3.7 -  char *errstr;
     3.8 +  const char *errstr;
     3.9    switch(err) {
    3.10      case OV_FALSE:      errstr="false/no data available"; break;
    3.11      case OV_EOF:        errstr="EOF"; break;
     4.1 --- a/decoder-snd.c	Sat Dec 29 14:51:25 2007 +0100
     4.2 +++ b/decoder-snd.c	Sat Dec 29 14:52:29 2007 +0100
     4.3 @@ -643,7 +643,7 @@
     4.4    bool RemoteGet(cDiscID *id);
     4.5    bool GetLine(char *buff, int size, bool log=true);
     4.6    int GetCddbResponse(void);
     4.7 -  int DoCddbCmd(char *format, ...);
     4.8 +  int DoCddbCmd(const char *format, ...);
     4.9  public:
    4.10    cCDDB(void);
    4.11    virtual ~cCDDB();
    4.12 @@ -706,8 +706,8 @@
    4.13    if(net->Connect(MP3Setup.CddbHost,MP3Setup.CddbPort)) {
    4.14      int code=GetCddbResponse();
    4.15      if(code/100==2) {
    4.16 -      char *host=getenv("HOSTNAME"); if(!host) host="unknown";
    4.17 -      char *user=getenv("USER"); if(!user) user="nobody";
    4.18 +      const char *host=getenv("HOSTNAME"); if(!host) host="unknown";
    4.19 +      const char *user=getenv("USER"); if(!user) user="nobody";
    4.20        code=DoCddbCmd("cddb hello %s %s %s %s\n",user,host,PLUGIN_NAME,PLUGIN_VERSION);
    4.21        if(code/100==2) {
    4.22          code=DoCddbCmd("proto %d\n",CDDB_PROTO);
    4.23 @@ -783,7 +783,7 @@
    4.24    return -1;
    4.25  }
    4.26  
    4.27 -int cCDDB::DoCddbCmd(char *format, ...)
    4.28 +int cCDDB::DoCddbCmd(const char *format, ...)
    4.29  {
    4.30    va_list ap;
    4.31    va_start(ap,format);
     5.1 --- a/mp3.c	Sat Dec 29 14:51:25 2007 +0100
     5.2 +++ b/mp3.c	Sat Dec 29 14:52:29 2007 +0100
     5.3 @@ -195,7 +195,7 @@
     5.4  static const char *TitleArtist(const char *title, const char *artist)
     5.5  {
     5.6    static char buf[256]; // clearly not multi-thread save!
     5.7 -  char *fmt;
     5.8 +  const char *fmt;
     5.9    if(artist && artist[0]) {
    5.10      if(MP3Setup.TitleArtistOrder) fmt="%2$s - %1$s";
    5.11      else  fmt="%s - %s";
     6.1 --- a/player-mp3.c	Sat Dec 29 14:51:25 2007 +0100
     6.2 +++ b/player-mp3.c	Sat Dec 29 14:52:29 2007 +0100
     6.3 @@ -955,7 +955,7 @@
     6.4      strn0cpy(pi->Filename,s->FullPath(),sizeof(pi->Filename));
     6.5      cSongInfo *si=s->Info(false);
     6.6      if(si && si->HasInfo()) {
     6.7 -      static char *modestr[] = { "Mono","Dual","Joint-Stereo","Stereo" };
     6.8 +      static const char *modestr[] = { "Mono","Dual","Joint-Stereo","Stereo" };
     6.9  
    6.10        if(si->Title)  strn0cpy(pi->Title,si->Title,sizeof(pi->Title));
    6.11        if(si->Artist) strn0cpy(pi->Artist,si->Artist,sizeof(pi->Artist));