Skip to content

Commit

Permalink
Include file re-ordering
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
jasmin-j committed May 20, 2017
1 parent c2761cb commit 5f457e6
Show file tree
Hide file tree
Showing 80 changed files with 335 additions and 454 deletions.
2 changes: 2 additions & 0 deletions autoptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)

# include <memory>

#if GCC_VERSION > 50000
# define AUTO_PTR std::unique_ptr
#else
Expand Down
7 changes: 2 additions & 5 deletions cache.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#ifndef VGSTOOLS_CACHE_H
#define VGSTOOLS_CACHE_H

#include "stdext.h"

#include <cassert>
#include <algorithm>
#include <ctime>
#include <functional>
#include <list>
#include <map>
#include <utility>
#include "stdext.h"

/* Interface for TValue:
* size_t weight()
Expand Down
15 changes: 8 additions & 7 deletions epg_events.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#include <time.h>
#include <glob.h>
#include <algorithm>
#include <assert.h>
#include <vdr/player.h>

#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 <vdr/player.h>)
#include <glob.h>
#include <cassert>

#include <vdr/player.h>

using namespace std;

namespace vdrlive
Expand Down
19 changes: 8 additions & 11 deletions epg_events.h
Original file line number Diff line number Diff line change
@@ -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 <ctime>
#include "stdext.h"

// STL headers need to be before VDR tools.h (included by <vdr/channels.h>)
#include <string>
#include <list>

#include <vdr/plugin.h>
#include <vdr/channels.h>
#include <vdr/epg.h>
#include <vdr/config.h>
#include <vdr/i18n.h>

#include "live.h"
#include "stdext.h"
#include <vdr/recording.h>

namespace vdrlive
{
Expand Down Expand Up @@ -252,5 +250,4 @@ namespace vdrlive

}; // namespace vdrlive

#endif // VDR_LIVE_WHATS_ON_H

#endif // VDR_LIVE_EPG_EVENTS_H
11 changes: 5 additions & 6 deletions epgsearch.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#include <vector>
#include <algorithm>
#include <vdr/channels.h>
#include <vdr/plugin.h>
#include <iomanip>
#include "epgsearch/services.h"

#include "epgsearch.h"

#include "epgsearch/services.h"
#include "exception.h"
#include "livefeatures.h"
#include "tools.h"

#include <iomanip>

namespace vdrlive {

using namespace std;
Expand Down
4 changes: 3 additions & 1 deletion epgsearch.h
Original file line number Diff line number Diff line change
@@ -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 <vdr/channels.h>)
#include <vector>
#include <list>
#include <set>
#include <string>
#include <algorithm>

#include <vdr/channels.h>
#include <vdr/epg.h>
#include "tools.h"

namespace vdrlive {

Expand Down
7 changes: 5 additions & 2 deletions epgsearch/services.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <vdr/channels.h>)
#include <string>
#include <list>
#include <memory>
#include <set>

#include <vdr/osdbase.h>
#include "../autoptr.h"


// Data structure for service "Epgsearch-search-v1.0"
struct Epgsearch_search_v1_0
Expand Down
4 changes: 3 additions & 1 deletion filecache.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

#include "filecache.h"

#include <algorithm>
#include <fstream>
#include <istream>
#include <sys/stat.h>
#include "filecache.h"

namespace vdrlive {

Expand Down
8 changes: 5 additions & 3 deletions filecache.h
Original file line number Diff line number Diff line change
@@ -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 <vdr/tools.h>)
#include <limits>
#include <numeric>
#include <string>
#include <ctime>
#include <vector>

#include <vdr/thread.h>
#include <vdr/tools.h>
#include "cache.h"

namespace vdrlive {

Expand Down
8 changes: 5 additions & 3 deletions grab.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include <cstdlib>
#include <vdr/device.h>
#include <vdr/tools.h>

#include "grab.h"

#include "tasks.h"

#include <vdr/device.h>

namespace vdrlive {

using namespace std;
Expand Down
1 change: 0 additions & 1 deletion grab.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define VDR_LIVE_GRAB_H

#include "stdext.h"
#include "tasks.h"
#include "autoptr.h"

namespace vdrlive {
Expand Down
2 changes: 2 additions & 0 deletions i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "i18n.h"

#include <vdr/tools.h>

namespace vdrlive
{

Expand Down
2 changes: 0 additions & 2 deletions i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#define VDR_LIVE_I18N_H

#include <string>
#include <vdr/config.h>
#include <vdr/i18n.h>

namespace vdrlive {

Expand Down
8 changes: 1 addition & 7 deletions live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <vdr/config.h>
#include <vdr/plugin.h>
#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"
Expand Down
12 changes: 8 additions & 4 deletions live.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#ifndef VDR_LIVE_LIVE_H
#define VDR_LIVE_LIVE_H

#include <memory>
#include "thread.h"

// STL headers need to be before VDR tools.h (included by <vdr/plugin.h>)
#include <string>
#include <vdr/config.h>

#ifndef __STL_CONFIG_H
// To get rid of the swap definition in vdr/tools.h
# define __STL_CONFIG_H
#endif
#include <vdr/plugin.h>
#include "thread.h"
#include "autoptr.h"

namespace vdrlive {

Expand Down
2 changes: 2 additions & 0 deletions livefeatures.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#include "livefeatures.h"

#include "tools.h"

namespace vdrlive {
Expand Down
4 changes: 2 additions & 2 deletions livefeatures.h
Original file line number Diff line number Diff line change
@@ -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 <vdr/channels.h>)
#include <string>

#include <vdr/plugin.h>

namespace vdrlive {

//LiveFeatures<EpgsearchFeature>().Available();

class SplitVersion
{
public:
Expand Down
5 changes: 2 additions & 3 deletions md5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
// documentation and/or software.
/////////////////////////////////////////////////////////////////////////

#include "md5.h"

#include <assert.h>
#include <memory.h>
#include <stdio.h>
#include <string.h>
#include "md5.h"


static unsigned char PADDING[64] =
{
Expand Down
5 changes: 3 additions & 2 deletions osd_status.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <string>
#include <sstream>

#include "osd_status.h"

#include <sstream>

namespace vdrlive {

OsdStatusMonitor::OsdStatusMonitor():title(),message(),red(),green(),yellow(),blue(),text(),selected(-1),lastUpdate(0){
Expand Down
4 changes: 3 additions & 1 deletion osd_status.h
Original file line number Diff line number Diff line change
@@ -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 <vdr/status.h>)
#include <string>

#include <vdr/status.h>
#include <time.h>


namespace vdrlive {

Expand Down
7 changes: 3 additions & 4 deletions pages/channels_widget.ecpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<%pre>
#include <vdr/channels.h>
#include "exception.h"
#include "setup.h"
#include "tools.h"

#include <exception.h>
#include <setup.h>

using namespace vdrlive;

Expand Down
7 changes: 2 additions & 5 deletions pages/content.ecpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<%pre>
#include <string>
#include <tnt/httperror.h>
#include <tnt/httpheader.h>
#include "filecache.h"
#include "setup.h"

#include <filecache.h>

using namespace std;
using namespace vdrlive;
Expand Down
16 changes: 6 additions & 10 deletions pages/edit_recording.ecpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<%pre>

#include <tools.h>
#include <recman.h>
#include <setup.h>
#include <users.h>

#include <vdr/recording.h>
#include <vdr/config.h>
#include <vdr/i18n.h>
#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;
Expand Down
17 changes: 6 additions & 11 deletions pages/edit_searchtimer.ecpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<%pre>
#include <memory>
#include <vdr/channels.h>
#include <vdr/config.h>
#include <vdr/epg.h>
#include <vdr/i18n.h>

#include <tools.h>
#include <epgsearch.h>
#include <setup.h>
#include <users.h>

#include <iomanip>
#include "exception.h"
#include "tools.h"
#include "epgsearch.h"
#include "setup.h"
#include "i18n.h"
#include "users.h"

using namespace std;
using namespace vdrlive;
Expand Down
Loading

0 comments on commit 5f457e6

Please sign in to comment.