From d8523b0db8adf0559040834487e5371c525132cb Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 2 Nov 2017 15:04:56 +0100 Subject: [PATCH] The macros used to control deprecated code or functions have been changed to hold numeric values; the default for DEPRECATED_VDR_CHARSET_OVERRIDE has been set to 0 --- CONTRIBUTORS | 3 +++ HISTORY | 8 ++++++++ device.h | 8 +++++--- osd.h | 8 +++++--- skins.h | 8 +++++--- vdr.c | 10 ++++++---- 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 34d71abc..4ab280a9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3446,6 +3446,9 @@ Jasmin Jessich for suggesting to use $(Q) to control Makefile verbosity for adding handling DEBUG to the Make.config.template file, in order to control code optimization + for suggesting to change the macros used to control deprecated code or functions + to numeric values (0 and 1), so that they can be controlled at compile time, without + having to edit the actual source code Martin Schirrmacher for suggesting to provide a way for skin plugins to get informed about the currently diff --git a/HISTORY b/HISTORY index ef35c377..5a932b1d 100644 --- a/HISTORY +++ b/HISTORY @@ -9178,3 +9178,11 @@ Video Disk Recorder Revision History to prevent possible problems with old data in buffers (thanks to Onur Sentürk). - The function cDevice::GetVideoSystem() (which has been deprecated since version 2.1.6) has been finally removed. +- The macros used to control deprecated code or functions have been changed to hold + numeric values (0 and 1), so that they can be controlled at compile time, without + having to edit the actual source code (suggested by Jasmin Jessich). +- The default for DEPRECATED_VDR_CHARSET_OVERRIDE has been set to 0, which means VDR + no longer reacts on the environment variable VDR_CHARSET_OVERRIDE. You can add + 'DEPRECATED_VDR_CHARSET_OVERRIDE=1' when compiling in order to restore this + functionality. However, it is recommended to use the command line option --chartab + instead. diff --git a/device.h b/device.h index 9a4a9085..ce0b0d27 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 4.11 2017/11/02 14:37:02 kls Exp $ + * $Id: device.h 4.12 2017/11/02 14:47:33 kls Exp $ */ #ifndef __DEVICE_H @@ -349,8 +349,10 @@ protected: public: static int CurrentChannel(void) { return primaryDevice ? currentChannel : 0; } ///< Returns the number of the current channel on the primary device. -#define DEPRECATED_SETCURRENTCHANNEL -#ifdef DEPRECATED_SETCURRENTCHANNEL +#ifndef DEPRECATED_SETCURRENTCHANNEL +#define DEPRECATED_SETCURRENTCHANNEL 1 +#endif +#if DEPRECATED_SETCURRENTCHANNEL static void SetCurrentChannel(const cChannel *Channel) { currentChannel = Channel ? Channel->Number() : 0; } #endif static void SetCurrentChannel(int ChannelNumber) { currentChannel = ChannelNumber; } diff --git a/osd.h b/osd.h index 61b318d1..559819e3 100644 --- a/osd.h +++ b/osd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.h 4.4 2015/04/19 12:18:25 kls Exp $ + * $Id: osd.h 4.5 2017/11/02 14:59:19 kls Exp $ */ #ifndef __OSD_H @@ -785,8 +785,10 @@ protected: ///< If there are no dirty pixmaps, or if this is not a true color OSD, ///< this function returns NULL. ///< The caller must call DestroyPixmap() for the returned pixmap after use. -//#define DEPRECATED_GETBITMAP -#ifdef DEPRECATED_GETBITMAP +#ifndef DEPRECATED_GETBITMAP +#define DEPRECATED_GETBITMAP 0 +#endif +#if DEPRECATED_GETBITMAP public: #endif cBitmap *GetBitmap(int Area); diff --git a/skins.h b/skins.h index 81d68ffe..bd8e15d1 100644 --- a/skins.h +++ b/skins.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skins.h 4.4 2017/06/25 10:02:09 kls Exp $ + * $Id: skins.h 4.5 2017/11/02 15:04:56 kls Exp $ */ #ifndef __SKINS_H @@ -244,8 +244,10 @@ public: ///< If the skin displays the Event item in its own way, it shall return true. ///< The default implementation does nothing and returns false, which results in ///< a call to SetItem() with a proper text. -#define DEPRECATED_SKIN_SETITEMEVENT -#ifdef DEPRECATED_SKIN_SETITEMEVENT +#ifndef DEPRECATED_SKIN_SETITEMEVENT +#define DEPRECATED_SKIN_SETITEMEVENT 1 +#endif +#if DEPRECATED_SKIN_SETITEMEVENT virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) { return SetItemEvent(Event, Index, Current, Selectable, Channel, WithDate, TimerMatch, true); } ///< This function is here for comaptibility with older plugins and may be removed ///< in a future version. Use the above version of SetItemEvent() with the TimerActive diff --git a/vdr.c b/vdr.c index fe104df2..41673660 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 4.19 2017/10/31 09:46:22 kls Exp $ + * $Id: vdr.c 4.20 2017/11/02 14:59:50 kls Exp $ */ #include @@ -221,8 +221,10 @@ int main(int argc, char *argv[]) int WatchdogTimeout = DEFAULTWATCHDOG; const char *Terminal = NULL; const char *OverrideCharacterTable = NULL; -#define DEPRECATED_VDR_CHARSET_OVERRIDE -#ifdef DEPRECATED_VDR_CHARSET_OVERRIDE +#ifndef DEPRECATED_VDR_CHARSET_OVERRIDE +#define DEPRECATED_VDR_CHARSET_OVERRIDE 0 +#endif +#if DEPRECATED_VDR_CHARSET_OVERRIDE OverrideCharacterTable = getenv("VDR_CHARSET_OVERRIDE"); const char *DeprecatedVdrCharsetOverride = OverrideCharacterTable; #endif @@ -703,7 +705,7 @@ int main(int argc, char *argv[]) isyslog("codeset is '%s' - %s", CodeSet, known ? "known" : "unknown"); cCharSetConv::SetSystemCharacterTable(CodeSet); } -#ifdef DEPRECATED_VDR_CHARSET_OVERRIDE +#if DEPRECATED_VDR_CHARSET_OVERRIDE if (DeprecatedVdrCharsetOverride) isyslog("use of environment variable VDR_CHARSET_OVERRIDE (%s) is deprecated!", DeprecatedVdrCharsetOverride); #endif