summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-20 16:55:35 (GMT)
committerhorchi <vdr@jwendel.de>2017-03-20 16:55:35 (GMT)
commit1fe6380b69b14c3840010aed520aeb2e946219a5 (patch)
tree392ff4401fedee9d6c1ba12b3ca27ea443e114fc
parentfa25e7126b97348f825abad9fabb2bdc82e52a05 (diff)
downloadvdr-plugin-epg2vdr-1.1.51.tar.gz
vdr-plugin-epg2vdr-1.1.51.tar.bz2
2017-03-20: version 1.1.51 (horchi)\n - change: Removed compiler warnings when using clang\n - added: Added clang++ to Make.config (as optional compiler)\n - change: Fixed APIVERSION check for VDR < 2.2.0 (thx to nobanzai)\n\n1.1.51
-rw-r--r--HISTORY.h9
-rw-r--r--Make.config26
-rw-r--r--Makefile7
-rw-r--r--epg2vdr.c2
-rw-r--r--handler.h6
-rw-r--r--lib/common.h3
-rw-r--r--lib/db.h2
-rw-r--r--lib/searchtimer.h2
-rw-r--r--menu.c2
-rw-r--r--menu.h4
-rw-r--r--menusched.c10
-rw-r--r--parameters.c13
-rw-r--r--recinfofile.c36
-rw-r--r--svdrpclient.c8
-rw-r--r--svdrpclient.h7
-rw-r--r--ttools.c2
-rw-r--r--update.c2
-rw-r--r--update.h2
18 files changed, 77 insertions, 66 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 45f3406..893ae4e 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -5,8 +5,8 @@
*
*/
-#define _VERSION "1.1.50"
-#define VERSION_DATE "19.03.2017"
+#define _VERSION "1.1.51"
+#define VERSION_DATE "20.03.2017"
#define DB_API 4
@@ -19,6 +19,11 @@
/*
* ------------------------------------
+2017-03-20: version 1.1.51 (horchi)
+ - change: Removed compiler warnings when using clang
+ - added: Added clang++ to Make.config (as optional compiler)
+ - change: Fixed APIVERSION check for VDR < 2.2.0 (thx to nobanzai)
+
2017-03-19: version 1.1.50 (horchi)
- bugfix: Fixed AMC address lookup
diff --git a/Make.config b/Make.config
index a7e2c8b..66bf692 100644
--- a/Make.config
+++ b/Make.config
@@ -10,11 +10,17 @@
PREFIX = /usr/local
DEBUG = 1
+#USE_CLANG = 1
# -----------------------
# don't touch below ;)
-CC = g++
+ifdef USE_CLANG
+ CC = clang++
+else
+ CC = g++
+endif
+
doCompile = $(CC) -c $(CFLAGS) $(DEFINES)
doLink = $(CC) $(LFLAGS)
doLib = ar -rs
@@ -28,14 +34,20 @@ ifdef DEBUG
CXXFLAGS += -ggdb -O0
endif
-CXXFLAGS += -fPIC -Wreturn-type -Wall -Wno-parentheses -Wformat -pedantic \
- -Wno-long-long -Wunused-variable -Wunused-label -Wno-unused-result \
- -Wunused-value -Wunused-but-set-variable -Wunused-function -Wno-variadic-macros \
- -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CXXFLAGS += -fPIC -Wreturn-type -Wall -Wno-parentheses -Wformat -pedantic \
+ -Wno-long-long -Wunused-variable -Wunused-label -Wno-unused-result \
+ -Wunused-value -Wunused-function -Wno-variadic-macros \
+ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CXXFLAGS += -std=c++11 -D__STDC_FORMAT_MACROS
-CXXFLAGS += -std=c++11 -D__STDC_FORMAT_MACROS
+ifdef USE_CLANG
+ CXXFLAGS += -x c++ -Wunused-const-variable
+else
+ CXXFLAGS += -Wunused-but-set-variable
+endif
-CFLAGS += $(CXXFLAGS)
+DEFINES += -D__STL_CONFIG_H
+CFLAGS += $(CXXFLAGS)
%.o: %.c
$(doCompile) -o $@ $<
diff --git a/Makefile b/Makefile
index 86fd27f..941a31e 100644
--- a/Makefile
+++ b/Makefile
@@ -117,11 +117,12 @@ hlib:
### Implicit rules:
%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+ $(doCompile) $(INCLUDES) -o $@ $<
+# $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
### Dependencies:
-MAKEDEP = $(CXX) -MM -MG
+MAKEDEP = $(CC) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
@@ -157,7 +158,7 @@ install-i18n: $(I18Nmsgs)
### Targets:
$(SOFILE): hlib $(OBJS)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
+ $(CC) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
install-lib: $(SOFILE)
install -D -m644 $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
diff --git a/epg2vdr.c b/epg2vdr.c
index 1c2d7e9..1732574 100644
--- a/epg2vdr.c
+++ b/epg2vdr.c
@@ -14,7 +14,7 @@
#include "menu.h"
#include "handler.h"
-#if defined (APIVERSNUM) && (APIVERSNUM < 20200)
+#if defined (APIVERSNUM) || (APIVERSNUM < 20200)
# error VDR API versions < 2.2.0 are not supported !
#endif
diff --git a/handler.h b/handler.h
index f341d94..43e9d14 100644
--- a/handler.h
+++ b/handler.h
@@ -480,7 +480,7 @@ class cEpgHandlerInstance
return true;
}
- uchar currentTableId = ::max(uchar(evtMemList[evtKey].tableid), uchar(0x4E));
+ uchar currentTableId = std::max(uchar(evtMemList[evtKey].tableid), uchar(0x4E));
// skip bigger ids as current
@@ -596,7 +596,7 @@ class cEpgHandlerInstance
eventsDb->getValue("DELFLG")->setNull();
}
- if (!insert && abs(event->StartTime() - eventsDb->getIntValue("StartTime")) > 6*tmeSecondsPerHour)
+ if (!insert && std::abs(event->StartTime() - eventsDb->getIntValue("StartTime")) > 6*tmeSecondsPerHour)
{
tell(3, "Handler: Info: Start time of %d/%s - '%s' moved %ld hours from %s to %s - '%s'",
event->EventID(), (const char*)channelId.ToString(),
@@ -892,7 +892,7 @@ class cEpgHandlerInstance
cDbStatement* selectMergeSp;
cDbStatement* selectEventByStarttime;
- cUpdate* update;
+ // cUpdate* update;
};
//***************************************************************************
diff --git a/lib/common.h b/lib/common.h
index df1c236..28536ec 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -45,7 +45,6 @@ class MemoryStruct;
inline long min(long a, long b) { return a < b ? a : b; }
inline long max(long a, long b) { return a > b ? a : b; }
#else
-# define __STL_CONFIG_H
# include <vdr/tools.h>
#endif
@@ -133,7 +132,7 @@ int gunzip(MemoryStruct* zippedData, MemoryStruct* unzippedData);
// MemoryStruct
//***************************************************************************
-struct MemoryStruct
+class MemoryStruct
{
public:
diff --git a/lib/db.h b/lib/db.h
index e16aeb8..02c9c06 100644
--- a/lib/db.h
+++ b/lib/db.h
@@ -1055,7 +1055,7 @@ class cDbConnection
MYSQL* mysql;
- int initialized;
+ // int initialized;
int attached;
int inTact;
int connectDropped;
diff --git a/lib/searchtimer.h b/lib/searchtimer.h
index ecd3624..c99bc6b 100644
--- a/lib/searchtimer.h
+++ b/lib/searchtimer.h
@@ -65,9 +65,9 @@ class cSearchTimer
cDbStatement* selectDoneTimer;
cDbStatement* selectActiveSearchtimers;
cDbStatement* selectSearchtimerMaxModSp;
- cDbStatement* selectActiveVdrs;
cDbStatement* selectAllTimer;
cDbStatement* selectTimerByEvent;
+ // cDbStatement* selectActiveVdrs;
// cDbStatement* selectConflictingTimers;
cDbValue startValue;
diff --git a/menu.c b/menu.c
index 248dc71..09c0194 100644
--- a/menu.c
+++ b/menu.c
@@ -511,7 +511,7 @@ int cMenuDb::initUserTimes()
{
char* time;
- if (time = strchr(p, '='))
+ if ((time = strchr(p, '=')))
*time++ = 0;
if (!isEmpty(time))
diff --git a/menu.h b/menu.h
index 0d80793..42f752a 100644
--- a/menu.h
+++ b/menu.h
@@ -359,7 +359,7 @@ class cMenuEpgSearchTimers : public cOsdMenu
private:
cMenuDb* menuDb;
- int helpKeys;
+ // int helpKeys;
};
//***************************************************************************
@@ -452,7 +452,7 @@ class cMenuEpgWhatsOn : public cOsdMenu
int helpKeys;
time_t helpKeyTime;
int helpKeyTimeMode;
- int timerState;
+ // int timerState;
eOSState Record();
eOSState Switch();
bool Update();
diff --git a/menusched.c b/menusched.c
index c2521e3..40b345d 100644
--- a/menusched.c
+++ b/menusched.c
@@ -5,8 +5,6 @@
*
*/
-#define __STL_CONFIG_H
-
#include <string>
#include <vdr/menuitems.h>
@@ -207,7 +205,7 @@ cMenuEpgScheduleItem::cMenuEpgScheduleItem(cMenuDb* db, const cEvent* Event,
char* bp;
size_t size;
- if (inMem = open_memstream(&bp, &size))
+ if ((inMem = open_memstream(&bp, &size)))
{
Event->Dump(inMem, "", yes);
fflush(inMem);
@@ -436,7 +434,7 @@ int cMenuEpgEvent::setEvent(const cEvent* Event, int timerMatch)
{
const cEvent* e;
- if (e = getNextPrevEvent(event, -1))
+ if ((e = getNextPrevEvent(event, -1)))
{
if (dispSchedule)
prevTime = l2pTime(e->StartTime(), "%H:%M");
@@ -444,7 +442,7 @@ int cMenuEpgEvent::setEvent(const cEvent* Event, int timerMatch)
prevChannel = channels->GetByChannelID(e->ChannelID(), true);
}
- if (e = getNextPrevEvent(event, +1))
+ if ((e = getNextPrevEvent(event, +1)))
{
if (dispSchedule)
nextTime = l2pTime(e->StartTime(), "%H:%M");
@@ -1037,7 +1035,7 @@ eOSState cMenuEpgWhatsOn::Record()
if (!item)
return osContinue;
- if (timerid = menuDb->lookupTimer(item->epgEvent, timerMatch, remote)) // -> loads timerDb and vdrDb
+ if ((timerid = menuDb->lookupTimer(item->epgEvent, timerMatch, remote))) // -> loads timerDb and vdrDb
{
menuDb->timerDb->clear();
menuDb->timerDb->setValue("ID", timerid);
diff --git a/parameters.c b/parameters.c
index 05b0eba..fdd3e4b 100644
--- a/parameters.c
+++ b/parameters.c
@@ -87,7 +87,7 @@ cParameters::Parameter* cParameters::getDefinition(const char* owner, const char
if (owner[0] == '@')
owner = "@";
-
+
if (strcmp(owner, "epgd") == 0 && strstr(name, ".md5"))
name = "md5";
@@ -161,12 +161,12 @@ int cParameters::getParameter(const char* owner, const char* name, char* value)
if (strcasecmp(owner, "uuid") == 0)
owner = Epg2VdrConfig.uuid;
-
+
parametersDb->clear();
parametersDb->setValue("OWNER", owner);
parametersDb->setValue("NAME", name);
- if (found = parametersDb->find())
+ if ((found = parametersDb->find()))
{
if (value)
sprintf(value, "%s", parametersDb->getStrValue("Value"));
@@ -193,7 +193,7 @@ int cParameters::getParameter(const char* owner, const char* name, long int& val
int found;
found = getParameter(owner, name, txt);
-
+
if (!isEmpty(txt))
value = atol(txt);
else
@@ -203,7 +203,7 @@ int cParameters::getParameter(const char* owner, const char* name, long int& val
}
//***************************************************************************
-// Set String Parameter
+// Set String Parameter
//***************************************************************************
int cParameters::setParameter(const char* owner, const char* name, const char* value)
@@ -227,7 +227,7 @@ int cParameters::setParameter(const char* owner, const char* name, const char* v
{
if (rep(value, definition->regexp) != success)
{
- tell(0, "Ignoring '%s' for parameter '%s/%s' don't match expression '%s'",
+ tell(0, "Ignoring '%s' for parameter '%s/%s' don't match expression '%s'",
value, owner, name, definition->regexp);
return fail;
@@ -250,4 +250,3 @@ int cParameters::setParameter(const char* owner, const char* name, long int valu
return setParameter(owner, name, txt);
}
-
diff --git a/recinfofile.c b/recinfofile.c
index cc957da..6c1b00c 100644
--- a/recinfofile.c
+++ b/recinfofile.c
@@ -37,7 +37,7 @@ const char* cEventDetails::fields[] =
"SCRSERIESID",
"SCRSERIESEPISODE",
"SCRMOVIEID",
-
+
// just in recordinglist, not in events or useevents row
"CHANNELNAME",
@@ -57,7 +57,7 @@ void cEventDetails::setValue(const char* name, const char* value)
std::map<std::string,std::string>::iterator it;
it = values.find(name);
-
+
if (it == values.end() || it->first != value)
{
changes++;
@@ -162,24 +162,24 @@ int cEventDetails::storeToFs(const char* path)
FILE* f;
char* fileName = 0;
std::map<std::string,std::string>::iterator it;
-
+
asprintf(&fileName, "%s/info.epg2vdr", path);
-
+
if (!(f = fopen(fileName, "w")))
{
tell(0, "Error opening file '%s' failed, %s", fileName, strerror(errno));
free(fileName);
-
+
return fail;
}
-
+
tell(0, "Storing event details to '%s'", fileName);
-
- // store fields
-
+
+ // store fields
+
for (it = values.begin(); it != values.end(); it++)
fprintf(f, "%s: %s\n", it->first.c_str(), it->second.c_str());
-
+
free(fileName);
fclose(f);
@@ -211,32 +211,32 @@ int cEventDetails::loadFromFs(const char* path)
{
tell(0, "Error opening file '%s' failed, %s", fileName, strerror(errno));
free(fileName);
-
+
return fail;
}
-
+
tell(3, "Loading event details from '%s'", fileName);
-
- // load fields
-
+
+ // load fields
+
char* p;
char* s;
cReadLine readLine;
- while (s = readLine.Read(f))
+ while ((s = readLine.Read(f)))
{
if (!(p = strchr(s, ':')))
{
tell(0, " ");
continue;
}
-
+
*(p++) = 0;
p = skipspace(rTrim(p));
if (!isEmpty(p))
values[s] = p;
- }
+ }
free(fileName);
fclose(f);
diff --git a/svdrpclient.c b/svdrpclient.c
index 53be015..8b1ee54 100644
--- a/svdrpclient.c
+++ b/svdrpclient.c
@@ -479,7 +479,7 @@ int cSvdrpClient::connect()
{
// map hostname to ip
- if (hostInfo = ::gethostbyname(ip))
+ if ((hostInfo = ::gethostbyname(ip)))
memcpy((char*)&remoteAddr, hostInfo->h_addr, hostInfo->h_length);
else if ((remoteAddr = inet_addr(ip)) == INADDR_NONE)
@@ -515,7 +515,7 @@ int cSvdrpClient::connect()
{
if (errno != EINPROGRESS)
{
- tell(0, "SVDRPCL: connect to %s:%hu failed: %s", ip, port, strerror(errno));
+ tell(0, "SVDRPCL: connect to %s:%d failed: %s", ip, port, strerror(errno));
return -1;
}
@@ -554,7 +554,7 @@ int cSvdrpClient::connect()
if (result != 0)
{
- tell(0, "SVDRPCL: Error connecting to %s:%hu: %s", ip, port, strerror(errno));
+ tell(0, "SVDRPCL: Error connecting to %s:%d: %s", ip, port, strerror(errno));
::close(sock);
return -1;
@@ -597,7 +597,7 @@ int cSvdrpClient::open()
if (greeting.First() && greeting.First()->Text())
msg = greeting.First()->Text();
- tell(2, "SVDRPCL: connected to %s:%hu '%s'", ip, port, msg);
+ tell(2, "SVDRPCL: connected to %s:%d '%s'", ip, port, msg);
return 0;
}
diff --git a/svdrpclient.h b/svdrpclient.h
index f0f7078..d927c47 100644
--- a/svdrpclient.h
+++ b/svdrpclient.h
@@ -17,12 +17,11 @@
#include "lib/common.h"
#ifdef VDR_PLUGIN
-# define __STL_CONFIG_H
# include <vdr/tools.h>
#else
//***************************************************************************
-//
+//
//***************************************************************************
class cListObject {
@@ -109,7 +108,7 @@ public:
// Line
//***************************************************************************
-class cLine : public cListObject
+class cLine : public cListObject
{
public:
@@ -128,7 +127,7 @@ class cLine : public cListObject
// SVDRP Client
//***************************************************************************
-class cSvdrpClient
+class cSvdrpClient
{
private:
diff --git a/ttools.c b/ttools.c
index 6c2ad4f..e24b652 100644
--- a/ttools.c
+++ b/ttools.c
@@ -666,7 +666,7 @@ cEpgEvent* createEventCopy(const cEvent* event)
char* bp;
size_t size;
- if (inMem = open_memstream(&bp, &size))
+ if ((inMem = open_memstream(&bp, &size)))
{
event->Dump(inMem, "", yes);
fflush(inMem);
diff --git a/update.c b/update.c
index 317451f..094e805 100644
--- a/update.c
+++ b/update.c
@@ -1429,7 +1429,7 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries)
// get event / timer
- if (event = s->GetEvent(eventsDb->getIntValue("USEID")))
+ if ((event = s->GetEvent(eventsDb->getIntValue("USEID"))))
{
if (Us::isRemove(updFlg))
tell(2, "Remove event %uld of channel '%s' due to updflg %c",
diff --git a/update.h b/update.h
index 3dde7fc..ebe9840 100644
--- a/update.h
+++ b/update.h
@@ -11,8 +11,6 @@
#include <mysql/mysql.h>
#include <queue>
-#define __STL_CONFIG_H
-
#include <vdr/status.h>
#include "lib/common.h"