From 7ca64c58dcf4958dabeefe87a9eff0ef09dfaa67 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sat, 11 Feb 2012 12:27:11 +0000 Subject: [PATCH] Fix header inclusions Including only the necessary headers reduces both compilation time and executable size. Also, some (system) headers were included with double quotes instead of angle brackets. --- .svn-revision | 2 +- src/ClientUDPSocket.cpp | 2 +- src/SearchListCtrl.h | 2 +- src/UPnPCompatibility.h | 4 ++-- src/utils/aLinkCreator/src/alc.cpp | 9 --------- src/utils/aLinkCreator/src/alc.h | 9 +-------- src/utils/aLinkCreator/src/alcc.cpp | 9 +-------- src/utils/aLinkCreator/src/alcc.h | 10 +--------- src/utils/aLinkCreator/src/alcframe.cpp | 29 +++++++++++++---------------- src/utils/aLinkCreator/src/alcframe.h | 19 ++++++++----------- src/utils/aLinkCreator/src/alcpix.cpp | 9 --------- src/utils/aLinkCreator/src/alcpix.h | 9 +-------- src/utils/aLinkCreator/src/ed2khash.cpp | 11 +---------- src/utils/aLinkCreator/src/ed2khash.h | 9 --------- src/utils/aLinkCreator/src/md4.cpp | 10 +--------- src/utils/aLinkCreator/src/md4.h | 9 --------- src/utils/wxCas/src/linuxmon.cpp | 9 --------- src/utils/wxCas/src/linuxmon.h | 9 --------- src/utils/wxCas/src/onlinesig.cpp | 9 --------- src/utils/wxCas/src/onlinesig.h | 9 --------- src/utils/wxCas/src/wxcas.cpp | 19 +++++-------------- src/utils/wxCas/src/wxcas.h | 9 +-------- src/utils/wxCas/src/wxcascte.cpp | 5 ----- src/utils/wxCas/src/wxcascte.h | 9 --------- src/utils/wxCas/src/wxcasframe.cpp | 13 ++++--------- src/utils/wxCas/src/wxcasframe.h | 22 ++++++++++------------ src/utils/wxCas/src/wxcaspix.cpp | 9 --------- src/utils/wxCas/src/wxcaspix.h | 9 +-------- src/utils/wxCas/src/wxcasprefs.cpp | 11 +---------- src/utils/wxCas/src/wxcasprefs.h | 15 ++++++--------- src/utils/wxCas/src/wxcasprint.cpp | 9 --------- src/utils/wxCas/src/wxcasprint.h | 10 +--------- 32 files changed, 61 insertions(+), 267 deletions(-) diff --git a/.svn-revision b/.svn-revision index 170076af..0192d272 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10752 +10753 diff --git a/src/ClientUDPSocket.cpp b/src/ClientUDPSocket.cpp index 4ebc60f8..649eab1a 100644 --- a/src/ClientUDPSocket.cpp +++ b/src/ClientUDPSocket.cpp @@ -48,7 +48,7 @@ #include "Logger.h" #include "kademlia/kademlia/Kademlia.h" #include "kademlia/utils/KadUDPKey.h" -#include "zlib.h" +#include #include "EncryptedDatagramSocket.h" // diff --git a/src/SearchListCtrl.h b/src/SearchListCtrl.h index db278447..953a415a 100644 --- a/src/SearchListCtrl.h +++ b/src/SearchListCtrl.h @@ -27,7 +27,7 @@ #define SEARCHLISTCTRL_H -#include "wx/colour.h" // Needed for wxColour +#include // Needed for wxColour #include // Needed for wxRegExp #include "MuleListCtrl.h" // Needed for CMuleListCtrl diff --git a/src/UPnPCompatibility.h b/src/UPnPCompatibility.h index fb6742dc..ce247c50 100644 --- a/src/UPnPCompatibility.h +++ b/src/UPnPCompatibility.h @@ -28,8 +28,8 @@ #define UPNPCOMPATIBILITY_H -#include "upnp.h" -#include "upnptools.h" +#include +#include #include diff --git a/src/utils/aLinkCreator/src/alc.cpp b/src/utils/aLinkCreator/src/alc.cpp index 91445d0c..fff373b0 100644 --- a/src/utils/aLinkCreator/src/alc.cpp +++ b/src/utils/aLinkCreator/src/alc.cpp @@ -26,15 +26,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #ifdef HAVE_CONFIG_H #include "config.h" // Needed for PACKAGE #else diff --git a/src/utils/aLinkCreator/src/alc.h b/src/utils/aLinkCreator/src/alc.h index 0db34a29..70b9bf8e 100644 --- a/src/utils/aLinkCreator/src/alc.h +++ b/src/utils/aLinkCreator/src/alc.h @@ -29,14 +29,7 @@ #define _ALC_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif +#include #include "alcframe.h" diff --git a/src/utils/aLinkCreator/src/alcc.cpp b/src/utils/aLinkCreator/src/alcc.cpp index f6264cad..f28e063f 100644 --- a/src/utils/aLinkCreator/src/alcc.cpp +++ b/src/utils/aLinkCreator/src/alcc.cpp @@ -24,14 +24,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif #ifdef HAVE_CONFIG_H #include "config.h" // Needed for PACKAGE @@ -39,6 +31,7 @@ #define PACKAGE "amule" #endif +#include #include "alcc.h" #include "ed2khash.h" diff --git a/src/utils/aLinkCreator/src/alcc.h b/src/utils/aLinkCreator/src/alcc.h index becbafab..94e61c4d 100644 --- a/src/utils/aLinkCreator/src/alcc.h +++ b/src/utils/aLinkCreator/src/alcc.h @@ -27,15 +27,7 @@ #define _ALCC_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - +#include #include //----------------------------------------------------------------------------- diff --git a/src/utils/aLinkCreator/src/alcframe.cpp b/src/utils/aLinkCreator/src/alcframe.cpp index acdf2d8f..bc2a5e71 100644 --- a/src/utils/aLinkCreator/src/alcframe.cpp +++ b/src/utils/aLinkCreator/src/alcframe.cpp @@ -31,25 +31,22 @@ //////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef __WXMSW__ #include diff --git a/src/utils/aLinkCreator/src/alcframe.h b/src/utils/aLinkCreator/src/alcframe.h index fe7055ce..520bc82f 100644 --- a/src/utils/aLinkCreator/src/alcframe.h +++ b/src/utils/aLinkCreator/src/alcframe.h @@ -30,19 +30,16 @@ #ifndef _ALCFRAME_H #define _ALCFRAME_H -// For compilers that support precompilation, includes "wx/wx.h" -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#include +#include +#include +#include +#include +#include #include +#include +#include +#include // Compute and display md4sum or not diff --git a/src/utils/aLinkCreator/src/alcpix.cpp b/src/utils/aLinkCreator/src/alcpix.cpp index 54503813..dac9ff61 100644 --- a/src/utils/aLinkCreator/src/alcpix.cpp +++ b/src/utils/aLinkCreator/src/alcpix.cpp @@ -26,15 +26,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include "alcpix.h" wxBitmap AlcPix::getPixmap(const wxString& name) diff --git a/src/utils/aLinkCreator/src/alcpix.h b/src/utils/aLinkCreator/src/alcpix.h index 97276cd3..3938bdda 100644 --- a/src/utils/aLinkCreator/src/alcpix.h +++ b/src/utils/aLinkCreator/src/alcpix.h @@ -29,14 +29,7 @@ #define _ALCPIX_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif +#include // Switch between themes (select just one of them) //#define WANT_KDE_THEME 1 diff --git a/src/utils/aLinkCreator/src/ed2khash.cpp b/src/utils/aLinkCreator/src/ed2khash.cpp index 1f02aba8..a96642f6 100644 --- a/src/utils/aLinkCreator/src/ed2khash.cpp +++ b/src/utils/aLinkCreator/src/ed2khash.cpp @@ -25,18 +25,9 @@ /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //////////////////////////////////////////////////////////////////////////////// -// For compilers that support precompilation, includes "wx/wx.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif #include +#include #include #include "ed2khash.h" diff --git a/src/utils/aLinkCreator/src/ed2khash.h b/src/utils/aLinkCreator/src/ed2khash.h index 33cf4911..13039266 100644 --- a/src/utils/aLinkCreator/src/ed2khash.h +++ b/src/utils/aLinkCreator/src/ed2khash.h @@ -29,15 +29,6 @@ #define _ED2KHASH_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include #include "md4.h" diff --git a/src/utils/aLinkCreator/src/md4.cpp b/src/utils/aLinkCreator/src/md4.cpp index 8c40958f..7bbfae64 100644 --- a/src/utils/aLinkCreator/src/md4.cpp +++ b/src/utils/aLinkCreator/src/md4.cpp @@ -36,16 +36,8 @@ //////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include +#include #include "md4.h" #include "bithelp.h" diff --git a/src/utils/aLinkCreator/src/md4.h b/src/utils/aLinkCreator/src/md4.h index 3b73e89a..c54167e9 100644 --- a/src/utils/aLinkCreator/src/md4.h +++ b/src/utils/aLinkCreator/src/md4.h @@ -39,15 +39,6 @@ #define _MD4_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include "../../../Types.h" // needed for uint32_t // Use wxString implementation or not diff --git a/src/utils/wxCas/src/linuxmon.cpp b/src/utils/wxCas/src/linuxmon.cpp index d00050aa..e87c4297 100644 --- a/src/utils/wxCas/src/linuxmon.cpp +++ b/src/utils/wxCas/src/linuxmon.cpp @@ -28,15 +28,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include "linuxmon.h" #include diff --git a/src/utils/wxCas/src/linuxmon.h b/src/utils/wxCas/src/linuxmon.h index 6ea76a1d..26e8007e 100644 --- a/src/utils/wxCas/src/linuxmon.h +++ b/src/utils/wxCas/src/linuxmon.h @@ -31,15 +31,6 @@ #define _LINUXMON_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include /// Linux Monitoring diff --git a/src/utils/wxCas/src/onlinesig.cpp b/src/utils/wxCas/src/onlinesig.cpp index e462e0f1..3543e548 100644 --- a/src/utils/wxCas/src/onlinesig.cpp +++ b/src/utils/wxCas/src/onlinesig.cpp @@ -28,15 +28,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include "onlinesig.h" #include diff --git a/src/utils/wxCas/src/onlinesig.h b/src/utils/wxCas/src/onlinesig.h index 3849d785..2167c5e4 100644 --- a/src/utils/wxCas/src/onlinesig.h +++ b/src/utils/wxCas/src/onlinesig.h @@ -31,15 +31,6 @@ #define _ONLINESIG_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include #include diff --git a/src/utils/wxCas/src/wxcas.cpp b/src/utils/wxCas/src/wxcas.cpp index 883f1800..49f61327 100644 --- a/src/utils/wxCas/src/wxcas.cpp +++ b/src/utils/wxCas/src/wxcas.cpp @@ -27,16 +27,6 @@ /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// For compilers that support precompilation, includes "wx/wx.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif #ifdef HAVE_CONFIG_H #include "config.h" // Needed for PACKAGE @@ -44,14 +34,15 @@ #define PACKAGE "amule" #endif -#if !wxUSE_PRINTING_ARCHITECTURE -#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in setup.h to compile wxCas. -#endif - #include +#include #include "wxcas.h" +#if !wxUSE_PRINTING_ARCHITECTURE +#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in setup.h to compile wxCas. +#endif + // Application implementation IMPLEMENT_APP ( WxCas ) diff --git a/src/utils/wxCas/src/wxcas.h b/src/utils/wxCas/src/wxcas.h index db64ddb2..22325957 100644 --- a/src/utils/wxCas/src/wxcas.h +++ b/src/utils/wxCas/src/wxcas.h @@ -31,14 +31,7 @@ #define _WXCAS_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif +#include #include "wxcasframe.h" diff --git a/src/utils/wxCas/src/wxcascte.cpp b/src/utils/wxCas/src/wxcascte.cpp index 59706424..830c747c 100644 --- a/src/utils/wxCas/src/wxcascte.cpp +++ b/src/utils/wxCas/src/wxcascte.cpp @@ -27,11 +27,6 @@ /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// For compilers that support precompilation - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif #include diff --git a/src/utils/wxCas/src/wxcascte.h b/src/utils/wxCas/src/wxcascte.h index 5809a81b..17ac3ca6 100644 --- a/src/utils/wxCas/src/wxcascte.h +++ b/src/utils/wxCas/src/wxcascte.h @@ -31,15 +31,6 @@ #define _WXCASCTE_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - /// Constants used in wxCas struct WxCasCte { diff --git a/src/utils/wxCas/src/wxcasframe.cpp b/src/utils/wxCas/src/wxcasframe.cpp index 92c09d56..19c0bc10 100644 --- a/src/utils/wxCas/src/wxcasframe.cpp +++ b/src/utils/wxCas/src/wxcasframe.cpp @@ -28,19 +28,14 @@ //////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include +#include #include #include +#include #include +#include +#include #include #include #include diff --git a/src/utils/wxCas/src/wxcasframe.h b/src/utils/wxCas/src/wxcasframe.h index e40a7070..6eb742d1 100644 --- a/src/utils/wxCas/src/wxcasframe.h +++ b/src/utils/wxCas/src/wxcasframe.h @@ -31,22 +31,20 @@ #define _WXCASFRAME_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include -#include +#include -#include "onlinesig.h" +#include "onlinesig.h" #ifdef __LINUX__ // System monitoring on Linux #include "linuxmon.h" diff --git a/src/utils/wxCas/src/wxcaspix.cpp b/src/utils/wxCas/src/wxcaspix.cpp index a005db2a..daeb6bc2 100644 --- a/src/utils/wxCas/src/wxcaspix.cpp +++ b/src/utils/wxCas/src/wxcaspix.cpp @@ -28,15 +28,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include "wxcaspix.h" wxBitmap WxCasPix::getPixmap( const wxString& name ) diff --git a/src/utils/wxCas/src/wxcaspix.h b/src/utils/wxCas/src/wxcaspix.h index ffd07468..db5c5976 100644 --- a/src/utils/wxCas/src/wxcaspix.h +++ b/src/utils/wxCas/src/wxcaspix.h @@ -31,14 +31,7 @@ #define _WXCASPIX_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif +#include class WxCasPix { diff --git a/src/utils/wxCas/src/wxcasprefs.cpp b/src/utils/wxCas/src/wxcasprefs.cpp index 12cd3643..cd7a9ddb 100644 --- a/src/utils/wxCas/src/wxcasprefs.cpp +++ b/src/utils/wxCas/src/wxcasprefs.cpp @@ -27,18 +27,9 @@ /// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// For compilers that support precompilation, includes "wx/wx.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif #include +#include #include "wxcasprefs.h" #include "wxcascte.h" diff --git a/src/utils/wxCas/src/wxcasprefs.h b/src/utils/wxCas/src/wxcasprefs.h index 24eb2956..b12a91e7 100644 --- a/src/utils/wxCas/src/wxcasprefs.h +++ b/src/utils/wxCas/src/wxcasprefs.h @@ -31,18 +31,15 @@ #define _WXCASPREFS_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - +#include +#include #include +#include #include +#include #include +#include +#include /// Preference Dialog class WxCasPrefs: public wxDialog diff --git a/src/utils/wxCas/src/wxcasprint.cpp b/src/utils/wxCas/src/wxcasprint.cpp index 768bd7c2..fd952e1a 100644 --- a/src/utils/wxCas/src/wxcasprint.cpp +++ b/src/utils/wxCas/src/wxcasprint.cpp @@ -28,15 +28,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - #include #include "wxcas.h" diff --git a/src/utils/wxCas/src/wxcasprint.h b/src/utils/wxCas/src/wxcasprint.h index 1cd4f994..deb46b4c 100644 --- a/src/utils/wxCas/src/wxcasprint.h +++ b/src/utils/wxCas/src/wxcasprint.h @@ -31,15 +31,7 @@ #define _WXCASPRINT_H -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// For all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - +#include #include /// Statistic image printing -- 2.11.4.GIT