[vdr] [PATCH] epgsearch: g++-4.1 fixups etc.

Darren Salt linux at youmustbejoking.demon.co.uk
Sun Mar 12 15:35:27 CET 2006


Patches attached.

* The g++-4.1 fixes are required to avoid "extra qualification 'foo::' on
  member 'bar'" errors.

* 10 characters for the channel name isn't enough ("BBC Radio ").

* Use of thread-unsafe function.

* The constness fixes patch, as well as making a few things constant, gets
  rid of multiple declarations of AllowedChars.

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Travel less. Share transport more.           PRODUCE LESS CARBON DIOXIDE.

Money is the root of all wealth.
-------------- next part --------------
diff -u vdr-plugin-epgsearch-0.9.14a~/log.h vdr-plugin-epgsearch-0.9.14a/log.h
--- vdr-plugin-epgsearch-0.9.14a~/log.h
+++ vdr-plugin-epgsearch-0.9.14a/log.h
@@ -9,7 +9,7 @@
 {
     int loglevel;
  public:
-    void cLogFile::Open(const char* filename, int LogLevel, const char* version)
+    void Open(const char* filename, int LogLevel, const char* version)
 	{
 	    loglevel = LogLevel;
 	    if (loglevel == 0) return;
@@ -18,7 +18,7 @@
 	    Log(1, "---------------------------------------", loglevel);
 	    Log(1, "EPGSearch log started (verbose level %d, version %s)", loglevel, version);
 	}
-    void cLogFile::Log(int LogLevel, const char *text, ...)
+    void Log(int LogLevel, const char *text, ...)
 	{
 	    if (LogLevel > loglevel) return;
 	    if(IsOpen()) 
diff -u vdr-plugin-epgsearch-0.9.14a~/searchtimer_thread.h vdr-plugin-epgsearch-0.9.14a/searchtimer_thread.h
--- vdr-plugin-epgsearch-0.9.14a~/searchtimer_thread.h
+++ vdr-plugin-epgsearch-0.9.14a/searchtimer_thread.h
@@ -25,7 +25,7 @@
     void Stop(void);
     bool NeedUpdate();
  public:
-    static char* cSearchTimerThread::SummaryExtended(cSearchExt* searchExt, cTimer* Timer, const cEvent* pEvent);
+    static char* SummaryExtended(cSearchExt* searchExt, cTimer* Timer, const cEvent* pEvent);
     static cSearchTimerThread *m_Instance;
 
     static cTimer* GetTimer(cSearchExt *searchExt, const cEvent *pEvent, bool& bTimesMatchExactly);
Common subdirectories: ./source and /unstable/home/ds/vdr-plugin-epgsearch-0.9.14a/source
-------------- next part --------------
diff -urNad vdr-plugin-epgsearch-0.9.12~/menu_whatson.c vdr-plugin-epgsearch-0.9.12/menu_whatson.c
--- vdr-plugin-epgsearch-0.9.12~/menu_whatson.c	2006-02-13 22:41:46.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.12/menu_whatson.c	2006-02-16 21:47:56.935304242 +0000
@@ -54,7 +54,7 @@
       
       char szChannelpart[20] = "";
       if (channel)
-	  sprintf(szChannelpart, "%s%.*s\t", szChannelNr, 10, CHANNELNAME(channel));
+	  sprintf(szChannelpart, "%s%.*s\t", szChannelNr, 12, CHANNELNAME(channel));
       
       char szProgressPart[12] = "";
       if (progress > 0 && channel)
-------------- next part --------------
diff -urNad vdr-plugin-epgsearch-0.9.11a~/menu_whatson.c vdr-plugin-epgsearch-0.9.11a/menu_whatson.c
--- vdr-plugin-epgsearch-0.9.11a~/menu_whatson.c	2006-02-08 19:44:30.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.11a/menu_whatson.c	2006-02-08 19:44:31.396890204 +0000
@@ -307,7 +307,8 @@
           char *buffer=NULL;       // allows setting the channel for a timer without event
           int starthh,startmm,stophh,stopmm;
           //for getting the day of month
-          struct tm *tm_t=localtime(&now);
+	  struct tm tm_t_store;
+	  struct tm *tm_t = localtime_r(&now, &tm_t_store);
           //we have to get away the ':' from the time string
           sscanf(TIMESTRING(now),"%2d:%2d",&starthh,&startmm);
           sscanf(TIMESTRING(now+Setup.InstantRecordTime*60),"%2d:%2d",&stophh,&stopmm);
-------------- next part --------------
diff -urNad vdr-plugin-epgsearch-0.9.14a~/createcats.c vdr-plugin-epgsearch-0.9.14a/createcats.c
--- vdr-plugin-epgsearch-0.9.14a~/createcats.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/createcats.c	2006-03-05 20:26:07.418794784 +0000
@@ -150,7 +150,7 @@
     unsigned int maxvalues = MAXVALUES;
     unsigned int maxlength = MAXNAMELENGTH;
 
-    static struct option long_options[] = {
+    static const struct option long_options[] = {
       { "minappearance", required_argument, NULL, 'm' },
       { "maxvalues",   required_argument, NULL, 'v' },
       { "maxlength",   required_argument,       NULL, 'l' },
diff -urNad vdr-plugin-epgsearch-0.9.14a~/epgsearch.c vdr-plugin-epgsearch-0.9.14a/epgsearch.c
--- vdr-plugin-epgsearch-0.9.14a~/epgsearch.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/epgsearch.c	2006-03-05 20:26:21.373894963 +0000
@@ -30,9 +30,9 @@
 #include "blacklist.h"
 
 
-static const char *VERSION        = "0.9.14a";
-static const char *DESCRIPTION    = "search the EPG for repeats and more";
-static const char *MAINMENUENTRY  = "Search";
+static const char VERSION[]       = "0.9.14a";
+static const char DESCRIPTION[]   = "search the EPG for repeats and more";
+static const char MAINMENUENTRY[] = "Search";
 const char *SVDRPSendCmd = "svdrpsend.pl";
 char *ConfigDir = NULL;
 char *LogFileName = NULL;
@@ -120,7 +120,7 @@
       return true;
   }
 
-  static struct option long_options[] = {
+  static const struct option long_options[] = {
     { "svdrpsendcmd",          required_argument, NULL, 'f' },
     { "config",           required_argument, NULL, 'c' },
     { "logfile",           required_argument, NULL, 'l' },
diff -urNad vdr-plugin-epgsearch-0.9.14a~/epgsearchsetup.c vdr-plugin-epgsearch-0.9.14a/epgsearchsetup.c
--- vdr-plugin-epgsearch-0.9.14a~/epgsearchsetup.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/epgsearchsetup.c	2006-03-05 20:26:07.422794526 +0000
@@ -13,8 +13,6 @@
 const char *StartMenuMode[2];
 const char *AddSubtitleMode[3];
 
-extern const char *AllowedChars;
-
 #define REDBUTTON (data.SetupMode?tr("Button$Standard"):tr("Button$Extended"))
 
 cMenuEPGSearchSetup::cMenuEPGSearchSetup(void)
diff -urNad vdr-plugin-epgsearch-0.9.14a~/menu_blacklistedit.c vdr-plugin-epgsearch-0.9.14a/menu_blacklistedit.c
--- vdr-plugin-epgsearch-0.9.14a~/menu_blacklistedit.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/menu_blacklistedit.c	2006-03-05 20:26:07.422794526 +0000
@@ -12,7 +12,7 @@
 extern cChannelGroups ChannelGroups;
 extern cSearchExtCats SearchExtCats;
 
-extern const char *AllowedChars;
+extern const char AllowedChars[];
 
 // --- cMenuBlacklistEdit --------------------------------------------------------
 cMenuBlacklistEdit::cMenuBlacklistEdit(cBlacklist *Blacklist, bool New)
diff -urNad vdr-plugin-epgsearch-0.9.14a~/menu_myedittimer.c vdr-plugin-epgsearch-0.9.14a/menu_myedittimer.c
--- vdr-plugin-epgsearch-0.9.14a~/menu_myedittimer.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/menu_myedittimer.c	2006-03-05 20:26:07.422794526 +0000
@@ -8,7 +8,6 @@
 #include "recstatus.h"
 #include <math.h>
 
-extern const char *AllowedChars;
 extern int PluginIndex;
 
 cMenuMyEditTimer::cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* Event, const cChannel* forcechannel)
diff -urNad vdr-plugin-epgsearch-0.9.14a~/menu_searchedit.c vdr-plugin-epgsearch-0.9.14a/menu_searchedit.c
--- vdr-plugin-epgsearch-0.9.14a~/menu_searchedit.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/menu_searchedit.c	2006-03-05 20:26:07.422794526 +0000
@@ -10,12 +10,9 @@
 #include "menu_blacklists.h"
 #include <math.h>
 
-
 cChannelGroups ChannelGroups;
 cSearchExtCats SearchExtCats;
 
-const char *AllowedChars = "$ abcdefghijklmnopqrstuvwxyz0123456789-.#~\\^$[]|()*+?{}/:%";
-
 // --- cMenuEditSearchExt --------------------------------------------------------
 cMenuEditSearchExt::cMenuEditSearchExt(cSearchExt *SearchExt, bool New, bool Template)
 :cOsdMenu(tr("Edit search"),32)
diff -urNad vdr-plugin-epgsearch-0.9.14a~/menu_templateedit.c vdr-plugin-epgsearch-0.9.14a/menu_templateedit.c
--- vdr-plugin-epgsearch-0.9.14a~/menu_templateedit.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/menu_templateedit.c	2006-03-05 20:26:07.422794526 +0000
@@ -12,8 +12,6 @@
 extern cChannelGroups ChannelGroups;
 extern cSearchExtCats SearchExtCats;
 
-extern const char *AllowedChars;
-
 eOSState cMenuEditTemplate::ProcessKey(eKeys Key)
 {
     bool bHadSubMenu = HasSubMenu();
diff -urNad vdr-plugin-epgsearch-0.9.14a~/tools.c vdr-plugin-epgsearch-0.9.14a/tools.c
--- vdr-plugin-epgsearch-0.9.14a~/tools.c	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/tools.c	2006-03-05 20:26:07.422794526 +0000
@@ -12,6 +12,8 @@
 #endif
 #include <ctype.h>
 
+const char AllowedChars[] = "$ abcdefghijklmnopqrstuvwxyz0123456789-.#~\\^$[]|()*+?{}/:%";
+
 #define MATCHLIMIT 0.9
 
 int CompareEventTime(const void *p1, const void *p2)
diff -urNad vdr-plugin-epgsearch-0.9.14a~/tools.h vdr-plugin-epgsearch-0.9.14a/tools.h
--- vdr-plugin-epgsearch-0.9.14a~/tools.h	2006-03-05 20:25:16.000000000 +0000
+++ vdr-plugin-epgsearch-0.9.14a/tools.h	2006-03-05 20:26:07.422794526 +0000
@@ -76,6 +76,7 @@
   (EVENT && EPGSearchConfig.showShortText && !isempty((EVENT)->ShortText()))?" ~ ":"", \
   (EVENT && EPGSearchConfig.showShortText && !isempty((EVENT)->ShortText()))?(EVENT)->ShortText():""
 
+extern const char AllowedChars[];
 
 extern char* ConfigDir;
 


More information about the vdr mailing list