From ec7bd920d94e55f2d21bfa076b7e900b7b2b7537 Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Mon, 20 Mar 2017 18:08:49 +0100 Subject: Changed code for c++11 compatibility --- dist/epgdata2xmltv/epgdata2xmltv.cpp | 2 +- import.cpp | 6 +++--- setup.cpp | 4 ++-- xmltv2vdr.cpp | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dist/epgdata2xmltv/epgdata2xmltv.cpp b/dist/epgdata2xmltv/epgdata2xmltv.cpp index 9437a18..de6fb26 100644 --- a/dist/epgdata2xmltv/epgdata2xmltv.cpp +++ b/dist/epgdata2xmltv/epgdata2xmltv.cpp @@ -93,7 +93,7 @@ static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *da size_t realsize = size * nmemb; if (data->fd!=-1) { - write(data->fd,ptr,realsize); + if (write(data->fd,ptr,realsize)==-1) return -1; data->size+=realsize; } return realsize; diff --git a/import.cpp b/import.cpp index d320bcf..0d6f7bf 100644 --- a/import.cpp +++ b/import.cpp @@ -250,7 +250,7 @@ char *cImport::Add2Description(char *description, const char *Name, const char * char *cImport::Add2Description(char *description, const char *Name, int Value) { char *value=NULL; - if (asprintf(&value,"%i",Value)==-1) return false; + if (asprintf(&value,"%i",Value)==-1) return NULL; description = strcatrealloc(description,Name); description = strcatrealloc(description,": "); description = strcatrealloc(description,value); @@ -261,7 +261,7 @@ char *cImport::Add2Description(char *description, const char *Name, int Value) char *cImport::AddEOT2Description(char *description, bool checkutf8) { - const char nbspUTF8[]={0xc2,0xa0,0}; + const char nbspUTF8[]={-62,-96,0}; if (checkutf8) { @@ -277,7 +277,7 @@ char *cImport::AddEOT2Description(char *description, bool checkutf8) } else { - const char nbsp[]={0xa0,0}; + const char nbsp[]={-96,0}; description=strcatrealloc(description,nbsp); } } diff --git a/setup.cpp b/setup.cpp index b64c8c0..d3e1adc 100644 --- a/setup.cpp +++ b/setup.cpp @@ -628,7 +628,7 @@ eOSState cMenuSetupXmltv2vdrOrder::ProcessKey(eKeys Key) if (state==osContinue) { - switch (Key) + switch ((int) Key) { case kDown: case kUp: @@ -1194,7 +1194,7 @@ eOSState cMenuSetupXmltv2vdrChannelMap::ProcessKey(eKeys Key) if (HasSubMenu()) return osContinue; if (state==osContinue) { - switch (Key) + switch ((int) Key) { case kLeft: case kLeft|k_Repeat: diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp index 1b810ff..e52c3a6 100644 --- a/xmltv2vdr.cpp +++ b/xmltv2vdr.cpp @@ -952,11 +952,10 @@ void cHouseKeeping::checkdir(const char* imgdir, int age, int &cnt, int &lcnt) if (!dir) return; time_t tmin=time(NULL); tmin-=(age*86400); - struct dirent dirent_buf,*dirent; + struct dirent *dirent; - while (readdir_r(dir,&dirent_buf,&dirent)==0) + while (dirent=readdir(dir)) { - if (!dirent) break; if (dirent->d_name[0]=='.') continue; if ((dirent->d_type==DT_LNK) || (dirent->d_type==DT_REG)) { -- cgit v1.2.3