From 5f457e6d67133e2b7e7269efedbbe758227b44e3 Mon Sep 17 00:00:00 2001 From: Jasmin Jessich Date: Sun, 21 May 2017 00:50:00 +0200 Subject: Include file re-ordering - Reorder all included header files to this order: * own headers * STL headers * VDR headers * system headers This has been done in all source and all own header files. Normally the STL headers should have gone after the VDR headers, but due to an compilation error with GCC 6 and the definition of swap in vdr/tools.h if __STL_CONFIG_H is not defined, the STL headers need to be before the VDR headers. Please note, that GCC 4.x, 5.x and 6.x do no longer define __STL_CONFIG_H resulting in the definition of swap in vdr/tools.h. This was no problem till GCC 6.x. To overcome the error in GCC 6.x, __STL_CONFIG_H is now defined in some headers before including a VDR header file, so that vdr/tools.h doe not define swap any more. Klaus S. might change the definition in vdr/tools.h with the next VDR version. So the setting of "__STL_CONFIG_H" may be removed. - Added all missing system/STL/VDR header files to the own header files, so that they can be included as first file. - Removed all unnecessary header file includes in source and own header files. - Used #include "..." only for header files in the same directory and #include <...> for all header files which need to be searched via the -I and built in path. --- autoptr.h | 2 ++ cache.h | 7 ++----- epg_events.cpp | 15 ++++++++------- epg_events.h | 19 ++++++++----------- epgsearch.cpp | 11 +++++------ epgsearch.h | 4 +++- epgsearch/services.h | 7 +++++-- filecache.cpp | 4 +++- filecache.h | 8 +++++--- grab.cpp | 8 +++++--- grab.h | 1 - i18n.cpp | 2 ++ i18n.h | 2 -- live.cpp | 8 +------- live.h | 12 ++++++++---- livefeatures.cpp | 2 ++ livefeatures.h | 4 ++-- md5.cpp | 5 ++--- osd_status.cpp | 5 +++-- osd_status.h | 4 +++- pages/channels_widget.ecpp | 7 +++---- pages/content.ecpp | 7 ++----- pages/edit_recording.ecpp | 16 ++++++---------- pages/edit_searchtimer.ecpp | 17 ++++++----------- pages/edit_timer.ecpp | 34 +++++++++++++--------------------- pages/edit_user.ecpp | 9 ++++----- pages/epginfo.ecpp | 16 +++++++--------- pages/error.ecpp | 4 ++-- pages/event_widget.ecpp | 8 ++------ pages/ffw_recording.ecpp | 9 +++------ pages/ibox.ecpp | 19 +++++++------------ pages/keypress.ecpp | 4 +++- pages/login.ecpp | 6 +++--- pages/menu.ecpp | 10 +++------- pages/multischedule.ecpp | 19 ++++++------------- pages/osd.ecpp | 12 +++--------- pages/page_exit.eh | 2 +- pages/page_init.eh | 6 +++--- pages/pageelems.ecpp | 19 +++++++------------ pages/pause_recording.ecpp | 9 +++------ pages/play_recording.ecpp | 12 +++++------- pages/recordings.ecpp | 21 +++++++-------------- pages/recstream.ecpp | 12 ++---------- pages/remote.ecpp | 13 +++++-------- pages/rwd_recording.ecpp | 9 +++------ pages/schedule.ecpp | 16 +++++----------- pages/screenshot.ecpp | 6 +++--- pages/searchepg.ecpp | 14 ++++---------- pages/searchresults.ecpp | 12 +++++------- pages/searchtimers.ecpp | 10 ++++------ pages/setup.ecpp | 11 +++++------ pages/stop_recording.ecpp | 9 +++------ pages/switch_channel.ecpp | 10 +++++----- pages/timerconflicts.ecpp | 14 ++++++-------- pages/timers.ecpp | 18 ++++++++---------- pages/tooltip.ecpp | 3 ++- pages/users.ecpp | 7 +++---- pages/vlc.ecpp | 11 ++++------- pages/whats_on.ecpp | 16 ++++++---------- pages/xmlresponse.ecpp | 4 ++-- preload.cpp | 5 ++--- recman.cpp | 15 +++++++-------- recman.h | 7 +++++-- setup.cpp | 24 ++++++++++-------------- setup.h | 5 ++--- status.cpp | 2 ++ tasks.cpp | 14 ++++++-------- tasks.h | 3 ++- thread.cpp | 9 ++++----- thread.h | 4 +--- timerconflict.cpp | 12 +++++------- timerconflict.h | 6 ++++-- timers.cpp | 14 +++++++++----- timers.h | 6 ++---- tntconfig.cpp | 22 +++++++--------------- tntconfig.h | 5 ++--- tools.cpp | 21 ++++++++++----------- tools.h | 13 ++++++------- users.cpp | 5 +++-- users.h | 6 +++--- 80 files changed, 335 insertions(+), 454 deletions(-) diff --git a/autoptr.h b/autoptr.h index 3349367..4dc0263 100644 --- a/autoptr.h +++ b/autoptr.h @@ -5,6 +5,8 @@ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) +# include + #if GCC_VERSION > 50000 # define AUTO_PTR std::unique_ptr #else diff --git a/cache.h b/cache.h index 88fbd60..b69bd62 100644 --- a/cache.h +++ b/cache.h @@ -1,14 +1,11 @@ #ifndef VGSTOOLS_CACHE_H #define VGSTOOLS_CACHE_H +#include "stdext.h" + #include -#include -#include -#include #include #include -#include -#include "stdext.h" /* Interface for TValue: * size_t weight() diff --git a/epg_events.cpp b/epg_events.cpp index fabf033..e4bfde7 100644 --- a/epg_events.cpp +++ b/epg_events.cpp @@ -1,15 +1,16 @@ -#include -#include -#include -#include -#include + +#include "epg_events.h" #include "tools.h" #include "recman.h" - -#include "epg_events.h" #include "setup.h" +// STL headers need to be before VDR tools.h (included by ) +#include +#include + +#include + using namespace std; namespace vdrlive diff --git a/epg_events.h b/epg_events.h index 0729ad2..ebd583b 100644 --- a/epg_events.h +++ b/epg_events.h @@ -1,17 +1,15 @@ -#ifndef VDR_LIVE_WHATS_ON_H -#define VDR_LIVE_WHATS_ON_H +#ifndef VDR_LIVE_EPG_EVENTS_H +#define VDR_LIVE_EPG_EVENTS_H -#include +#include "stdext.h" + +// STL headers need to be before VDR tools.h (included by ) +#include #include -#include #include #include -#include -#include - -#include "live.h" -#include "stdext.h" +#include namespace vdrlive { @@ -252,5 +250,4 @@ namespace vdrlive }; // namespace vdrlive -#endif // VDR_LIVE_WHATS_ON_H - +#endif // VDR_LIVE_EPG_EVENTS_H diff --git a/epgsearch.cpp b/epgsearch.cpp index b157ea0..48e7fbf 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -1,14 +1,13 @@ -#include -#include -#include -#include -#include -#include "epgsearch/services.h" + #include "epgsearch.h" + +#include "epgsearch/services.h" #include "exception.h" #include "livefeatures.h" #include "tools.h" +#include + namespace vdrlive { using namespace std; diff --git a/epgsearch.h b/epgsearch.h index 95d7387..c5f81e6 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -1,13 +1,15 @@ #ifndef VDR_LIVE_EPGSEARCH_H #define VDR_LIVE_EPGSEARCH_H +// STL headers need to be before VDR tools.h (included by ) #include #include #include #include +#include + #include #include -#include "tools.h" namespace vdrlive { diff --git a/epgsearch/services.h b/epgsearch/services.h index e7f80dd..fee274e 100644 --- a/epgsearch/services.h +++ b/epgsearch/services.h @@ -24,12 +24,15 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #ifndef EPGSEARCHSERVICES_INC #define EPGSEARCHSERVICES_INC +#include "../autoptr.h" + +// STL headers need to be before VDR tools.h (included by ) #include #include -#include #include + #include -#include "../autoptr.h" + // Data structure for service "Epgsearch-search-v1.0" struct Epgsearch_search_v1_0 diff --git a/filecache.cpp b/filecache.cpp index 1ecb60f..a9c7c11 100644 --- a/filecache.cpp +++ b/filecache.cpp @@ -1,8 +1,10 @@ + +#include "filecache.h" + #include #include #include #include -#include "filecache.h" namespace vdrlive { diff --git a/filecache.h b/filecache.h index 6833193..25679c0 100644 --- a/filecache.h +++ b/filecache.h @@ -1,13 +1,15 @@ #ifndef VDR_LIVE_FILECACHE_H #define VDR_LIVE_FILECACHE_H +#include "cache.h" + +// STL headers need to be before VDR tools.h (included by ) #include -#include #include +#include #include + #include -#include -#include "cache.h" namespace vdrlive { diff --git a/grab.cpp b/grab.cpp index a86f3e9..cf8cf2c 100644 --- a/grab.cpp +++ b/grab.cpp @@ -1,8 +1,10 @@ -#include -#include -#include + #include "grab.h" +#include "tasks.h" + +#include + namespace vdrlive { using namespace std; diff --git a/grab.h b/grab.h index f1c3aed..3895e9d 100644 --- a/grab.h +++ b/grab.h @@ -2,7 +2,6 @@ #define VDR_LIVE_GRAB_H #include "stdext.h" -#include "tasks.h" #include "autoptr.h" namespace vdrlive { diff --git a/i18n.cpp b/i18n.cpp index 5c01b0c..0e74a9b 100644 --- a/i18n.cpp +++ b/i18n.cpp @@ -7,6 +7,8 @@ #include "i18n.h" +#include + namespace vdrlive { diff --git a/i18n.h b/i18n.h index e584d17..7e8cba9 100644 --- a/i18n.h +++ b/i18n.h @@ -2,8 +2,6 @@ #define VDR_LIVE_I18N_H #include -#include -#include namespace vdrlive { diff --git a/live.cpp b/live.cpp index 232965a..d948f7d 100644 --- a/live.cpp +++ b/live.cpp @@ -4,17 +4,11 @@ * See the README file for copyright information and how to reach the author. */ -// To get rid of the swap definition in vdr/tools.h -#define __STL_CONFIG_H - -#include -#include -#include "i18n.h" #include "live.h" + #include "setup.h" #include "status.h" #include "tasks.h" -#include "thread.h" #include "timers.h" #include "preload.h" #include "users.h" diff --git a/live.h b/live.h index 93e441d..bf874be 100644 --- a/live.h +++ b/live.h @@ -1,12 +1,16 @@ #ifndef VDR_LIVE_LIVE_H #define VDR_LIVE_LIVE_H -#include +#include "thread.h" + +// STL headers need to be before VDR tools.h (included by ) #include -#include + +#ifndef __STL_CONFIG_H +// To get rid of the swap definition in vdr/tools.h +# define __STL_CONFIG_H +#endif #include -#include "thread.h" -#include "autoptr.h" namespace vdrlive { diff --git a/livefeatures.cpp b/livefeatures.cpp index 94aa4cc..edc4e92 100644 --- a/livefeatures.cpp +++ b/livefeatures.cpp @@ -1,4 +1,6 @@ + #include "livefeatures.h" + #include "tools.h" namespace vdrlive { diff --git a/livefeatures.h b/livefeatures.h index 8c6f361..98f2d8a 100644 --- a/livefeatures.h +++ b/livefeatures.h @@ -1,13 +1,13 @@ #ifndef VDR_LIVE_FEATURES_H #define VDR_LIVE_FEATURES_H +// STL headers need to be before VDR tools.h (included by ) #include + #include namespace vdrlive { -//LiveFeatures().Available(); - class SplitVersion { public: diff --git a/md5.cpp b/md5.cpp index 7befb44..9bdbefa 100644 --- a/md5.cpp +++ b/md5.cpp @@ -33,12 +33,11 @@ // documentation and/or software. ///////////////////////////////////////////////////////////////////////// +#include "md5.h" + #include #include #include -#include -#include "md5.h" - static unsigned char PADDING[64] = { diff --git a/osd_status.cpp b/osd_status.cpp index a6791ab..90e6257 100644 --- a/osd_status.cpp +++ b/osd_status.cpp @@ -1,7 +1,8 @@ -#include -#include + #include "osd_status.h" +#include + namespace vdrlive { OsdStatusMonitor::OsdStatusMonitor():title(),message(),red(),green(),yellow(),blue(),text(),selected(-1),lastUpdate(0){ diff --git a/osd_status.h b/osd_status.h index f84b1ef..3c86d45 100644 --- a/osd_status.h +++ b/osd_status.h @@ -1,9 +1,11 @@ #ifndef VDR_LIVE_OSD_STATUS_H #define VDR_LIVE_OSD_STATUS_H +// STL headers need to be before VDR tools.h (included by ) #include + #include -#include + namespace vdrlive { diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index d4c06b4..c71506d 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -1,8 +1,7 @@ <%pre> -#include -#include "exception.h" -#include "setup.h" -#include "tools.h" + +#include +#include using namespace vdrlive; diff --git a/pages/content.ecpp b/pages/content.ecpp index cde092f..28f43c1 100644 --- a/pages/content.ecpp +++ b/pages/content.ecpp @@ -1,9 +1,6 @@ <%pre> -#include -#include -#include -#include "filecache.h" -#include "setup.h" + +#include using namespace std; using namespace vdrlive; diff --git a/pages/edit_recording.ecpp b/pages/edit_recording.ecpp index a810908..e3e3deb 100644 --- a/pages/edit_recording.ecpp +++ b/pages/edit_recording.ecpp @@ -1,15 +1,11 @@ <%pre> + +#include +#include +#include +#include + #include -#include -#include -#include "exception.h" -#include "tools.h" -#include "epg_events.h" -#include "recman.h" -#include "setup.h" -#include "i18n.h" -#include "livefeatures.h" -#include "users.h" using namespace std; using namespace vdrlive; diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index a17b9d8..a81a15a 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -1,16 +1,11 @@ <%pre> -#include -#include -#include -#include -#include + +#include +#include +#include +#include + #include -#include "exception.h" -#include "tools.h" -#include "epgsearch.h" -#include "setup.h" -#include "i18n.h" -#include "users.h" using namespace std; using namespace vdrlive; diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index ecc8c6e..d080ee5 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -1,24 +1,16 @@ <%pre> -// To get rid of the swap definition in vdr/tools.h -#define __STL_CONFIG_H +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include "exception.h" -#include "tools.h" -#include "timers.h" -#include "setup.h" -#include "epg_events.h" -#include "timerconflict.h" -#include "i18n.h" -#include "livefeatures.h" -#include "epgsearch.h" -#include "users.h" -#include "autoptr.h" +#include using namespace std; using namespace vdrlive; @@ -226,15 +218,15 @@ cTimer* timer; <%cpp> if ( LiveFeatures< features::epgsearch >().Recent() ) { - RecordingDirs recordingdirs(true); + RecordingDirs recordingdirs(true);
<$ tr("Directory" ) $>: