From 8d82b050712de0db83ac3b28d04a59479b024622 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 15 Jul 2024 14:42:22 +0200 Subject: [PATCH] Disabled/removed deprecated code --- HISTORY | 21 +++++++++++++++++++ device.h | 8 +------ epg.h | 6 ++++-- filter.h | 6 ++++-- player.h | 6 ++++-- skins.h | 11 +--------- tools.c | 63 ++------------------------------------------------------ tools.h | 15 +------------- 8 files changed, 38 insertions(+), 98 deletions(-) diff --git a/HISTORY b/HISTORY index 93903729..10151e87 100644 --- a/HISTORY +++ b/HISTORY @@ -9951,3 +9951,24 @@ Video Disk Recorder Revision History Device->SetPowerSaveIfUnused() low. - Added the lines from 'Fixed a timeout in cDvbDevice while tuning after the frontend has been reopened' to cDvbTuner::ProvidesFrontend() (suggested by Markus Ehrnsperger). + +2024-07-15: + +- Removed deprecated function cDevice::SetCurrentChannel(const cChannel *Channel). +- Removed deprecated function cSkinDisplayMenu::SetItemEvent(const cEvent *Event, int Index, + bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch). +- Removed deprecated functions from cFile. +- The default for DEPRECATED_SCHEDULE_GET_EVENT has been set to 0, which means that + the function GetEvent(tEventID EventID, time_t StartTime = 0) is no longer available. + You can add 'DEPRECATED_SCHEDULE_GET_EVENT=1' when compiling in order to restore this + functionality. However, it is recommended to use GetEventById() and GetEventByTime() + instead. +- The default for DEPRECATED_SECTIONSYNCER_SYNC_REPEAT has been set to 0, which means that + the functions Repeat() and Sync() are no longer available. + You can add 'DEPRECATED_SECTIONSYNCER_SYNC_REPEAT=1' when compiling in order to restore this + functionality. However, it is recommended to use Check() and Processed() instead. +- The default for DEPRECATED_CCONTROL has been set to 0, which means that + the function Control(bool Hidden) is no longer available. + You can add 'DEPRECATED_CCONTROL=1' when compiling in order to restore this + functionality. However, it is recommended to use Control(cMutexLock &MutexLock, bool Hidden) + instead. diff --git a/device.h b/device.h index 9354b163..fe60b3ef 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 5.5 2024/07/06 11:19:21 kls Exp $ + * $Id: device.h 5.6 2024/07/15 14:42:22 kls Exp $ */ #ifndef __DEVICE_H @@ -370,12 +370,6 @@ protected: public: static int CurrentChannel(void) { return primaryDevice ? currentChannel : 0; } ///< Returns the number of the current channel on the primary device. -#ifndef DEPRECATED_SETCURRENTCHANNEL -#define DEPRECATED_SETCURRENTCHANNEL 0 -#endif -#if DEPRECATED_SETCURRENTCHANNEL - static void SetCurrentChannel(const cChannel *Channel) { currentChannel = Channel ? Channel->Number() : 0; } -#endif static void SetCurrentChannel(int ChannelNumber) { currentChannel = ChannelNumber; } ///< Sets the number of the current channel on the primary device, without ///< actually switching to it. This can be used to correct the current diff --git a/epg.h b/epg.h index d8c08fd2..09910155 100644 --- a/epg.h +++ b/epg.h @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.h 5.3 2022/12/24 11:37:17 kls Exp $ + * $Id: epg.h 5.4 2024/07/15 14:42:22 kls Exp $ */ #ifndef __EPG_H @@ -187,7 +187,9 @@ public: const cList *Events(void) const { return &events; } const cEvent *GetPresentEvent(void) const; const cEvent *GetFollowingEvent(void) const; -#define DEPRECATED_SCHEDULE_GET_EVENT 1 +#ifndef DEPRECATED_SCHEDULE_GET_EVENT +#define DEPRECATED_SCHEDULE_GET_EVENT 0 +#endif #if DEPRECATED_SCHEDULE_GET_EVENT const cEvent *GetEvent(tEventID EventID, time_t StartTime = 0) const; #endif diff --git a/filter.h b/filter.h index deb75162..3478b8a2 100644 --- a/filter.h +++ b/filter.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: filter.h 5.1 2021/03/16 15:10:54 kls Exp $ + * $Id: filter.h 5.2 2024/07/15 14:42:22 kls Exp $ */ #ifndef __FILTER_H @@ -13,7 +13,9 @@ #include #include "tools.h" -#define DEPRECATED_SECTIONSYNCER_SYNC_REPEAT 1 +#ifndef DEPRECATED_SECTIONSYNCER_SYNC_REPEAT +#define DEPRECATED_SECTIONSYNCER_SYNC_REPEAT 0 +#endif class cSectionSyncer { private: diff --git a/player.h b/player.h index 5507a4fe..7dbb5f9e 100644 --- a/player.h +++ b/player.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: player.h 5.1 2022/12/05 14:45:51 kls Exp $ + * $Id: player.h 5.2 2024/07/15 14:42:22 kls Exp $ */ #ifndef __PLAYER_H @@ -115,7 +115,9 @@ public: static void Launch(cControl *Control); static void Attach(void); static void Shutdown(void); -#define DEPRECATED_CCONTROL 1 +#ifndef DEPRECATED_CCONTROL +#define DEPRECATED_CCONTROL 0 +#endif #if DEPRECATED_CCONTROL static cControl *Control(bool Hidden = false); ///< Old version of this function, for backwards compatibility with plugins. diff --git a/skins.h b/skins.h index 0a65c36b..9fdd72da 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 5.3 2024/07/13 09:12:18 kls Exp $ + * $Id: skins.h 5.4 2024/07/15 14:42:22 kls Exp $ */ #ifndef __SKINS_H @@ -244,15 +244,6 @@ 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. -#ifndef DEPRECATED_SKIN_SETITEMEVENT -#define DEPRECATED_SKIN_SETITEMEVENT 0 -#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 - ///< parameter instead. -#endif virtual bool SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) { return false; } ///< Sets the item at the given Index to Timer. See SetItem() for more information. ///< If a derived skin class implements this function, it can display a Timer item diff --git a/tools.c b/tools.c index 9cce09e8..77b82389 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 5.12 2024/07/10 14:50:07 kls Exp $ + * $Id: tools.c 5.13 2024/07/15 14:42:22 kls Exp $ */ #include "tools.h" @@ -1664,11 +1664,6 @@ bool cFileNameList::Load(const char *Directory, bool DirsOnly) // --- cFile ----------------------------------------------------------------- -#if DEPRECATED_CFILE -bool cFile::files[FD_SETSIZE] = { false }; -int cFile::maxFiles = 0; -#endif - cFile::cFile(void) { f = -1; @@ -1690,24 +1685,8 @@ bool cFile::Open(const char *FileName, int Flags, mode_t Mode) bool cFile::Open(int FileDes) { if (FileDes >= 0) { - if (!IsOpen()) { + if (!IsOpen()) f = FileDes; -#if DEPRECATED_CFILE - if (f >= 0) { - if (f < FD_SETSIZE) { - if (f >= maxFiles) - maxFiles = f + 1; - if (!files[f]) - files[f] = true; - else - esyslog("ERROR: file descriptor %d already in files[]", f); - return true; - } - else - esyslog("ERROR: file descriptor %d is larger than FD_SETSIZE (%d)", f, FD_SETSIZE); - } -#endif - } else esyslog("ERROR: attempt to re-open file descriptor %d", FileDes); } @@ -1718,9 +1697,6 @@ void cFile::Close(void) { if (f >= 0) { close(f); -#if DEPRECATED_CFILE - files[f] = false; -#endif f = -1; } } @@ -1730,26 +1706,6 @@ bool cFile::Ready(bool Wait) return f >= 0 && FileReady(f, Wait ? 1000 : 0); } -#if DEPRECATED_CFILE -bool cFile::AnyFileReady(int FileDes, int TimeoutMs) -{ - fd_set set; - FD_ZERO(&set); - for (int i = 0; i < maxFiles; i++) { - if (files[i]) - FD_SET(i, &set); - } - if (0 <= FileDes && FileDes < FD_SETSIZE && !files[FileDes]) - FD_SET(FileDes, &set); // in case we come in with an arbitrary descriptor - if (TimeoutMs == 0) - TimeoutMs = 10; // load gets too heavy with 0 - struct timeval timeout; - timeout.tv_sec = TimeoutMs / 1000; - timeout.tv_usec = (TimeoutMs % 1000) * 1000; - return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && (FileDes < 0 || FD_ISSET(FileDes, &set)); -} -#endif - bool cFile::FileReady(int FileDes, int TimeoutMs) { fd_set set; @@ -1765,21 +1721,6 @@ bool cFile::FileReady(int FileDes, int TimeoutMs) return select(FD_SETSIZE, &set, NULL, NULL, (TimeoutMs >= 0) ? &timeout : NULL) > 0 && FD_ISSET(FileDes, &set); } -#if DEPRECATED_CFILE -bool cFile::FileReadyForWriting(int FileDes, int TimeoutMs) -{ - fd_set set; - struct timeval timeout; - FD_ZERO(&set); - FD_SET(FileDes, &set); - if (TimeoutMs < 100) - TimeoutMs = 100; - timeout.tv_sec = 0; - timeout.tv_usec = TimeoutMs * 1000; - return select(FD_SETSIZE, NULL, &set, NULL, &timeout) > 0 && FD_ISSET(FileDes, &set); -} -#endif - // --- cSafeFile ------------------------------------------------------------- cSafeFile::cSafeFile(const char *FileName) diff --git a/tools.h b/tools.h index 5f50cfe0..a59b24a8 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 5.8 2024/01/20 13:59:55 kls Exp $ + * $Id: tools.h 5.9 2024/07/15 14:42:22 kls Exp $ */ #ifndef __TOOLS_H @@ -460,15 +460,8 @@ public: struct dirent *Next(void); }; -#ifndef DEPRECATED_CFILE -#define DEPRECATED_CFILE 0 -#endif class cFile { private: -#if DEPRECATED_CFILE - static bool files[]; - static int maxFiles; -#endif int f; public: cFile(void); @@ -479,13 +472,7 @@ public: void Close(void); bool IsOpen(void) { return f >= 0; } bool Ready(bool Wait = true); -#if DEPRECATED_CFILE - static bool AnyFileReady(int FileDes = -1, int TimeoutMs = 1000); -#endif static bool FileReady(int FileDes, int TimeoutMs = 1000); -#if DEPRECATED_CFILE - static bool FileReadyForWriting(int FileDes, int TimeoutMs = 1000); -#endif }; class cSafeFile {