From 059be57bd68f55a0d07c257ff84c0c2b27ef7d01 Mon Sep 17 00:00:00 2001 From: leslie Date: Fri, 4 Jan 2008 20:14:35 +0100 Subject: [PATCH] try to fix compile problem with newer gcc --- cam.c | 2 +- cam.h | 2 +- data.c | 4 ++-- data.h | 2 +- misc.c | 3 --- systems/cardclient/cc.c | 4 ++-- systems/viaccess/tps.c | 6 +++--- systems/viaccess/tps.h | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cam.c b/cam.c index 4030e72..23ed104 100644 --- a/cam.c +++ b/cam.c @@ -691,7 +691,7 @@ void cEcmCache::Flush(void) ListUnlock(); } -bool cEcmCache::ParseLinePlain(char *line) +bool cEcmCache::ParseLinePlain(const char *line) { cEcmData *dat=new cEcmData; if(dat && dat->Parse(line) && !Exists(dat)) { Add(dat); return true; } diff --git a/cam.h b/cam.h index dd4ebf3..852b961 100644 --- a/cam.h +++ b/cam.h @@ -45,7 +45,7 @@ class cEcmCache : public cStructListPlain { private: cEcmData *Exists(cEcmInfo *e); protected: - virtual bool ParseLinePlain(char *line); + virtual bool ParseLinePlain(const char *line); public: cEcmCache(void); void New(cEcmInfo *e); diff --git a/data.c b/data.c index 52983df..e2f9088 100644 --- a/data.c +++ b/data.c @@ -319,7 +319,7 @@ void cStructLoader::Load(bool reload) cStructItem *it=0; if(hasContent) { char save=*ls; - *ls=0; it=ParseLine(buff); *ls=save; + *ls=0; it=ParseLine(skipspace(buff)); *ls=save; if(!it) { PRINTF(L_GEN_ERROR,"file %s has error in line #%d",path,lineNum); ls=buff; @@ -419,7 +419,7 @@ void cStructLoaderPlain::Load(bool reload) } if(hasContent) { *ls=0; - if(!ParseLinePlain(buff)) + if(!ParseLinePlain(skipspace(buff))) PRINTF(L_GEN_ERROR,"file %s has error in line #%d",path,lineNum); } } diff --git a/data.h b/data.h index ff5e378..8353a04 100644 --- a/data.h +++ b/data.h @@ -155,7 +155,7 @@ public: class cStructLoaderPlain : public cStructLoader { protected: virtual cStructItem *ParseLine(char *line) { return 0; } - virtual bool ParseLinePlain(char *line)=0; + virtual bool ParseLinePlain(const char *line)=0; virtual void PreSave(FILE *f); virtual void PostSave(FILE *f) {}; public: diff --git a/misc.c b/misc.c index e0f83e2..fa9965a 100644 --- a/misc.c +++ b/misc.c @@ -19,11 +19,8 @@ #include #include -#include #include -#include #include -#include #include #include diff --git a/systems/cardclient/cc.c b/systems/cardclient/cc.c index 797d0fc..feb9816 100644 --- a/systems/cardclient/cc.c +++ b/systems/cardclient/cc.c @@ -161,7 +161,7 @@ cCardClientLink::cCardClientLink(const char *Name) class cSystemLinkCardClient : public cSystemLink, public cStructListPlain { protected: - virtual bool ParseLinePlain(char *line); + virtual bool ParseLinePlain(const char *line); public: cSystemLinkCardClient(void); virtual bool CanHandle(unsigned short SysId); @@ -259,7 +259,7 @@ cSystem *cSystemLinkCardClient::Create(void) return new cSystemCardClient(); } -bool cSystemLinkCardClient::ParseLinePlain(char *line) +bool cSystemLinkCardClient::ParseLinePlain(const char *line) { char name[32]; int num; diff --git a/systems/viaccess/tps.c b/systems/viaccess/tps.c index 39c340b..b03202d 100644 --- a/systems/viaccess/tps.c +++ b/systems/viaccess/tps.c @@ -892,7 +892,7 @@ void cTpsKeys::DecryptBin(const unsigned char *in, unsigned char *out) } */ -bool cTpsKeys::ParseLinePlain(char *line) +bool cTpsKeys::ParseLinePlain(const char *line) { unsigned char tmp[60]; if(line[0]=='X') { @@ -915,7 +915,7 @@ bool cTpsKeys::ParseLinePlain(char *line) if(sscanf(&line[2],"%x %x %n",&off,&crc,&len)==2) { line+=len+2; unsigned char buff[210]; - if((len=GetHex((const char *)line,buff,200,false))) { + if((len=GetHex(line,buff,200,false))) { if(crc==crc32_le(0,buff,len) && off>=0 && off+len<=algolen) { memcpy(&algomem[off],buff,len); algoread+=len; @@ -934,7 +934,7 @@ bool cTpsKeys::ParseLinePlain(char *line) else PRINTF(L_SYS_TPS,"unknown extention during cache load"); } else { - if(GetHex((const char *)line,tmp,sizeof(tmp))) { + if(GetHex(line,tmp,sizeof(tmp))) { unsigned int crc=crc32_le(0,&tmp[4],sizeof(tmp)-4); if(*((unsigned int *)tmp)==crc) { cTpsKey *k=new cTpsKey; diff --git a/systems/viaccess/tps.h b/systems/viaccess/tps.h index 0391895..0d04baf 100644 --- a/systems/viaccess/tps.h +++ b/systems/viaccess/tps.h @@ -125,7 +125,7 @@ private: cString Time(time_t t); bool ProcessAu(const cOpenTVModule *mod); protected: - virtual bool ParseLinePlain(char *line); + virtual bool ParseLinePlain(const char *line); virtual void PostSave(FILE *f); public: cTpsKeys(void); -- 2.39.5