From 3a0cee353a5517c6d71e14eddbaee7f6a2b4d27e Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Tue, 19 Jun 2012 11:57:22 +0200 Subject: [PATCH] Fix include header order according to Google style guidelines "build/include_order" --- telldus-core/common/Event.cpp | 2 +- telldus-core/common/Event.h | 13 ++++++------- telldus-core/common/Message.cpp | 3 +-- telldus-core/common/Socket.h | 4 ++-- telldus-core/common/Strings.cpp | 7 ++++--- telldus-core/common/Strings.h | 2 +- telldus-core/common/common.h | 5 ++--- telldus-core/service/ClientCommunicationHandler.cpp | 7 ++++--- telldus-core/service/ConnectionListener_unix.cpp | 10 ++++------ telldus-core/service/Controller.h | 2 +- telldus-core/service/ControllerManager.cpp | 9 ++++++--- telldus-core/service/ControllerManager.h | 2 +- telldus-core/service/ControllerMessage.cpp | 5 ++--- telldus-core/service/Device.h | 4 ++-- telldus-core/service/DeviceManager.cpp | 13 ++++++++----- telldus-core/service/DeviceManager.h | 2 +- telldus-core/service/EventUpdateManager.cpp | 6 +++--- telldus-core/service/Protocol.cpp | 7 ++++--- telldus-core/service/ProtocolComen.h | 2 +- telldus-core/service/ProtocolEverflourish.cpp | 6 +++--- telldus-core/service/ProtocolFineoffset.cpp | 5 +++-- telldus-core/service/ProtocolHasta.cpp | 3 ++- telldus-core/service/ProtocolIkea.cpp | 4 ++-- telldus-core/service/ProtocolMandolyn.cpp | 5 +++-- telldus-core/service/ProtocolNexa.cpp | 1 + telldus-core/service/ProtocolNexa.h | 2 +- telldus-core/service/ProtocolOregon.cpp | 5 +++-- telldus-core/service/ProtocolSartano.cpp | 3 ++- telldus-core/service/ProtocolWaveman.cpp | 3 ++- telldus-core/service/Sensor.cpp | 3 ++- telldus-core/service/Sensor.h | 2 +- telldus-core/service/SettingsConfuse.cpp | 11 +++++------ telldus-core/service/TellStick.cpp | 3 ++- telldus-core/service/TellStick_libftdi.cpp | 9 ++++----- telldus-core/service/TelldusMain.cpp | 8 +++++--- telldus-core/service/Timer.cpp | 2 +- telldus-core/service/main_unix.cpp | 2 +- 37 files changed, 97 insertions(+), 85 deletions(-) diff --git a/telldus-core/common/Event.cpp b/telldus-core/common/Event.cpp index 7f89ecf9..fa4176fd 100644 --- a/telldus-core/common/Event.cpp +++ b/telldus-core/common/Event.cpp @@ -5,10 +5,10 @@ // // #include "common/Event.h" +#include #include "common/EventHandler.h" #include "common/Mutex.h" -#include using namespace TelldusCore; diff --git a/telldus-core/common/Event.h b/telldus-core/common/Event.h index 56274a1d..f8451f73 100644 --- a/telldus-core/common/Event.h +++ b/telldus-core/common/Event.h @@ -7,15 +7,14 @@ #ifndef TELLDUS_CORE_COMMON_EVENT_H_ #define TELLDUS_CORE_COMMON_EVENT_H_ -#include "Thread.h" -#ifdef _WINDOWS -#include -#include - typedef HANDLE EVENT_T; -#else -#include +#ifndef _WINDOWS + #include typedef void* EVENT_T; +#else + #include + #include + typedef HANDLE EVENT_T; #endif #include "common/Thread.h" diff --git a/telldus-core/common/Message.cpp b/telldus-core/common/Message.cpp index 8099c653..600cb460 100644 --- a/telldus-core/common/Message.cpp +++ b/telldus-core/common/Message.cpp @@ -4,16 +4,15 @@ // Copyright: See COPYING file that comes with this distribution // // +#include "common/Message.h" #include #include #include -#include "common/Message.h" #include "common/Socket.h" #include "common/Strings.h" using namespace TelldusCore; - Message::Message() : std::wstring() { } diff --git a/telldus-core/common/Socket.h b/telldus-core/common/Socket.h index b8ee4aef..98fdbc51 100644 --- a/telldus-core/common/Socket.h +++ b/telldus-core/common/Socket.h @@ -7,8 +7,6 @@ #ifndef TELLDUS_CORE_COMMON_SOCKET_H_ #define TELLDUS_CORE_COMMON_SOCKET_H_ -#include - #ifdef _WINDOWS #include typedef HANDLE SOCKET_T; @@ -16,6 +14,8 @@ typedef int SOCKET_T; #endif +#include + namespace TelldusCore { class Socket { public: diff --git a/telldus-core/common/Strings.cpp b/telldus-core/common/Strings.cpp index b1457849..6b2f1bf2 100644 --- a/telldus-core/common/Strings.cpp +++ b/telldus-core/common/Strings.cpp @@ -6,9 +6,6 @@ // #include "common/Strings.h" -#include -#include -#include #include #include @@ -17,6 +14,10 @@ #else #include #endif +#include +#include +#include + #ifdef _MACOSX #define WCHAR_T_ENCODING "UCS-4-INTERNAL" diff --git a/telldus-core/common/Strings.h b/telldus-core/common/Strings.h index 6a4c5eaa..d4b81971 100644 --- a/telldus-core/common/Strings.h +++ b/telldus-core/common/Strings.h @@ -7,7 +7,6 @@ #ifndef TELLDUS_CORE_COMMON_STRINGS_H_ #define TELLDUS_CORE_COMMON_STRINGS_H_ -#include #include #ifdef _MSC_VER typedef unsigned __int8 uint8_t; @@ -17,6 +16,7 @@ typedef unsigned __int64 uint64_t; #else #include #endif +#include namespace TelldusCore { std::wstring charToWstring(const char *value); diff --git a/telldus-core/common/common.h b/telldus-core/common/common.h index 1a596dd3..13e39bda 100644 --- a/telldus-core/common/common.h +++ b/telldus-core/common/common.h @@ -16,12 +16,11 @@ #else #include #endif -#include "Strings.h" -#include +#include #include #include +#include #include -#include #include "common/Strings.h" inline void msleep( const int msec) { diff --git a/telldus-core/service/ClientCommunicationHandler.cpp b/telldus-core/service/ClientCommunicationHandler.cpp index 9d982f52..5b091343 100644 --- a/telldus-core/service/ClientCommunicationHandler.cpp +++ b/telldus-core/service/ClientCommunicationHandler.cpp @@ -4,13 +4,14 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "ClientCommunicationHandler.h" -#include "common/Message.h" -#include "common/Strings.h" +#include "service/ClientCommunicationHandler.h" #include #include +#include "common/Message.h" +#include "common/Strings.h" + class ClientCommunicationHandler::PrivateData { public: TelldusCore::Socket *clientSocket; diff --git a/telldus-core/service/ConnectionListener_unix.cpp b/telldus-core/service/ConnectionListener_unix.cpp index 0c9600dd..32b991a9 100644 --- a/telldus-core/service/ConnectionListener_unix.cpp +++ b/telldus-core/service/ConnectionListener_unix.cpp @@ -4,19 +4,17 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "service/ConnectionListener.h" -#include "common/Socket.h" - -#include #include #include #include #include - - #include #include #include +#include + +#include "service/ConnectionListener.h" +#include "common/Socket.h" class ConnectionListener::PrivateData { public: diff --git a/telldus-core/service/Controller.h b/telldus-core/service/Controller.h index 3dcdd709..3bbb667c 100644 --- a/telldus-core/service/Controller.h +++ b/telldus-core/service/Controller.h @@ -7,8 +7,8 @@ #ifndef TELLDUS_CORE_SERVICE_CONTROLLER_H_ #define TELLDUS_CORE_SERVICE_CONTROLLER_H_ -#include "common/Event.h" #include +#include "common/Event.h" class ControllerEventData : public TelldusCore::EventDataBase { public: diff --git a/telldus-core/service/ControllerManager.cpp b/telldus-core/service/ControllerManager.cpp index d4e70a1d..a8ac4ecd 100644 --- a/telldus-core/service/ControllerManager.cpp +++ b/telldus-core/service/ControllerManager.cpp @@ -5,6 +5,12 @@ // // #include "service/ControllerManager.h" + +#include +#include +#include +#include + #include "service/Controller.h" #include "common/Mutex.h" #include "service/TellStick.h" @@ -15,9 +21,6 @@ #include "service/EventUpdateManager.h" #include "client/telldus-core.h" -#include -#include - class ControllerDescriptor { public: std::wstring name, serial; diff --git a/telldus-core/service/ControllerManager.h b/telldus-core/service/ControllerManager.h index f1000c5f..f5e583b5 100644 --- a/telldus-core/service/ControllerManager.h +++ b/telldus-core/service/ControllerManager.h @@ -7,10 +7,10 @@ #ifndef TELLDUS_CORE_SERVICE_CONTROLLERMANAGER_H_ #define TELLDUS_CORE_SERVICE_CONTROLLERMANAGER_H_ +#include #include "common/Event.h" class Controller; -#include class ControllerManager { public: diff --git a/telldus-core/service/ControllerMessage.cpp b/telldus-core/service/ControllerMessage.cpp index d749d77b..32746d95 100644 --- a/telldus-core/service/ControllerMessage.cpp +++ b/telldus-core/service/ControllerMessage.cpp @@ -5,13 +5,12 @@ // // #include "service/ControllerMessage.h" +#include +#include #include "service/Device.h" #include "common/Strings.h" - #include "common/common.h" -#include - class ControllerMessage::PrivateData { public: std::map parameters; diff --git a/telldus-core/service/Device.h b/telldus-core/service/Device.h index 77272987..8ef9107d 100644 --- a/telldus-core/service/Device.h +++ b/telldus-core/service/Device.h @@ -7,11 +7,11 @@ #ifndef TELLDUS_CORE_SERVICE_DEVICE_H_ #define TELLDUS_CORE_SERVICE_DEVICE_H_ +#include +#include #include "service/Controller.h" #include "common/Mutex.h" #include "service/Protocol.h" -#include -#include class Device : public TelldusCore::Mutex { public: diff --git a/telldus-core/service/DeviceManager.cpp b/telldus-core/service/DeviceManager.cpp index e4b4a218..cc4b56cc 100644 --- a/telldus-core/service/DeviceManager.cpp +++ b/telldus-core/service/DeviceManager.cpp @@ -5,6 +5,14 @@ // // #include "service/DeviceManager.h" +#include +#include +#include +#include +#include +#include +#include + #include "service/ControllerMessage.h" #include "common/Mutex.h" #include "service/Sensor.h" @@ -13,11 +21,6 @@ #include "common/Message.h" #include "service/Log.h" -#include -#include -#include -#include - typedef std::map DeviceMap; class DeviceManager::PrivateData { diff --git a/telldus-core/service/DeviceManager.h b/telldus-core/service/DeviceManager.h index 9ed8be2c..152dec12 100644 --- a/telldus-core/service/DeviceManager.h +++ b/telldus-core/service/DeviceManager.h @@ -7,12 +7,12 @@ #ifndef TELLDUS_CORE_SERVICE_DEVICEMANAGER_H_ #define TELLDUS_CORE_SERVICE_DEVICEMANAGER_H_ +#include #include #include "service/Device.h" #include "service/ControllerManager.h" #include "service/ControllerMessage.h" #include "service/EventUpdateManager.h" -#include class Sensor; diff --git a/telldus-core/service/EventUpdateManager.cpp b/telldus-core/service/EventUpdateManager.cpp index 5ac35c06..3f5dc623 100644 --- a/telldus-core/service/EventUpdateManager.cpp +++ b/telldus-core/service/EventUpdateManager.cpp @@ -6,14 +6,14 @@ // #include "service/EventUpdateManager.h" +#include +#include + #include "service/ConnectionListener.h" #include "common/EventHandler.h" #include "common/Message.h" #include "common/Socket.h" -#include -#include - typedef std::list SocketList; class EventUpdateManager::PrivateData { diff --git a/telldus-core/service/Protocol.cpp b/telldus-core/service/Protocol.cpp index 1b49442c..8c4f8ca0 100644 --- a/telldus-core/service/Protocol.cpp +++ b/telldus-core/service/Protocol.cpp @@ -5,8 +5,11 @@ // // #include "service/Protocol.h" -#include "client/telldus-core.h" +#include +#include +#include +#include "client/telldus-core.h" #include "service/ControllerMessage.h" #include "service/ProtocolBrateck.h" #include "service/ProtocolComen.h" @@ -27,9 +30,7 @@ #include "service/ProtocolWaveman.h" #include "service/ProtocolX10.h" #include "service/ProtocolYidong.h" - #include "common/Strings.h" -#include class Protocol::PrivateData { public: diff --git a/telldus-core/service/ProtocolComen.h b/telldus-core/service/ProtocolComen.h index d6a9e8b9..a9ef9211 100644 --- a/telldus-core/service/ProtocolComen.h +++ b/telldus-core/service/ProtocolComen.h @@ -7,8 +7,8 @@ #ifndef TELLDUS_CORE_SERVICE_PROTOCOLCOMEN_H_ #define TELLDUS_CORE_SERVICE_PROTOCOLCOMEN_H_ -#include "service/ProtocolNexa.h" #include +#include "service/ProtocolNexa.h" class ProtocolComen : public ProtocolNexa { public: diff --git a/telldus-core/service/ProtocolEverflourish.cpp b/telldus-core/service/ProtocolEverflourish.cpp index 913b37a8..a9defc2a 100644 --- a/telldus-core/service/ProtocolEverflourish.cpp +++ b/telldus-core/service/ProtocolEverflourish.cpp @@ -4,11 +4,11 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "ProtocolEverflourish.h" -#include +#include "service/ProtocolEverflourish.h" #include -#include "service/ControllerMessage.h" +#include #include +#include "service/ControllerMessage.h" int ProtocolEverflourish::methods() const { return TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_LEARN; diff --git a/telldus-core/service/ProtocolFineoffset.cpp b/telldus-core/service/ProtocolFineoffset.cpp index 85962422..d7b8119e 100644 --- a/telldus-core/service/ProtocolFineoffset.cpp +++ b/telldus-core/service/ProtocolFineoffset.cpp @@ -5,10 +5,11 @@ // // #include "service/ProtocolFineoffset.h" -#include "common/Strings.h" #include -#include #include +#include +#include +#include "common/Strings.h" std::string ProtocolFineoffset::decodeData(ControllerMessage &dataMsg) { std::string data = dataMsg.getParameter("data"); diff --git a/telldus-core/service/ProtocolHasta.cpp b/telldus-core/service/ProtocolHasta.cpp index 963e98da..d89c4830 100644 --- a/telldus-core/service/ProtocolHasta.cpp +++ b/telldus-core/service/ProtocolHasta.cpp @@ -5,8 +5,9 @@ // // #include "service/ProtocolHasta.h" -#include #include +#include +#include int ProtocolHasta::methods() const { return TELLSTICK_UP | TELLSTICK_DOWN | TELLSTICK_STOP | TELLSTICK_LEARN; diff --git a/telldus-core/service/ProtocolIkea.cpp b/telldus-core/service/ProtocolIkea.cpp index 6985b0e7..1d8d7c45 100644 --- a/telldus-core/service/ProtocolIkea.cpp +++ b/telldus-core/service/ProtocolIkea.cpp @@ -5,10 +5,10 @@ // // #include "service/ProtocolIkea.h" -#include "common/Strings.h" - #include #include +#include +#include "common/Strings.h" int ProtocolIkea::methods() const { return TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_DIM; diff --git a/telldus-core/service/ProtocolMandolyn.cpp b/telldus-core/service/ProtocolMandolyn.cpp index 28ff77d5..fd720893 100644 --- a/telldus-core/service/ProtocolMandolyn.cpp +++ b/telldus-core/service/ProtocolMandolyn.cpp @@ -5,10 +5,11 @@ // // #include "service/ProtocolMandolyn.h" -#include "common/Strings.h" #include -#include #include +#include +#include +#include "common/Strings.h" std::string ProtocolMandolyn::decodeData(ControllerMessage &dataMsg) { std::string data = dataMsg.getParameter("data"); diff --git a/telldus-core/service/ProtocolNexa.cpp b/telldus-core/service/ProtocolNexa.cpp index feac5df4..3036ff00 100644 --- a/telldus-core/service/ProtocolNexa.cpp +++ b/telldus-core/service/ProtocolNexa.cpp @@ -7,6 +7,7 @@ #include "service/ProtocolNexa.h" #include #include +#include #include "service/TellStick.h" #include "common/Strings.h" diff --git a/telldus-core/service/ProtocolNexa.h b/telldus-core/service/ProtocolNexa.h index a4bc8b83..37e6b813 100644 --- a/telldus-core/service/ProtocolNexa.h +++ b/telldus-core/service/ProtocolNexa.h @@ -7,9 +7,9 @@ #ifndef TELLDUS_CORE_SERVICE_PROTOCOLNEXA_H_ #define TELLDUS_CORE_SERVICE_PROTOCOLNEXA_H_ +#include #include "service/ControllerMessage.h" #include "service/Device.h" -#include class ProtocolNexa : public Protocol { public: diff --git a/telldus-core/service/ProtocolOregon.cpp b/telldus-core/service/ProtocolOregon.cpp index 737ad91f..6870929d 100644 --- a/telldus-core/service/ProtocolOregon.cpp +++ b/telldus-core/service/ProtocolOregon.cpp @@ -5,10 +5,11 @@ // // #include "service/ProtocolOregon.h" -#include "common/Strings.h" #include -#include #include +#include +#include +#include "common/Strings.h" std::string ProtocolOregon::decodeData(ControllerMessage &dataMsg) { std::string data = dataMsg.getParameter("data"); diff --git a/telldus-core/service/ProtocolSartano.cpp b/telldus-core/service/ProtocolSartano.cpp index c0cc1185..6fa9c7e6 100644 --- a/telldus-core/service/ProtocolSartano.cpp +++ b/telldus-core/service/ProtocolSartano.cpp @@ -5,8 +5,9 @@ // // #include "service/ProtocolSartano.h" -#include #include +#include +#include int ProtocolSartano::methods() const { return TELLSTICK_TURNON | TELLSTICK_TURNOFF; diff --git a/telldus-core/service/ProtocolWaveman.cpp b/telldus-core/service/ProtocolWaveman.cpp index 00ced94a..fecd4c3c 100644 --- a/telldus-core/service/ProtocolWaveman.cpp +++ b/telldus-core/service/ProtocolWaveman.cpp @@ -5,8 +5,9 @@ // // #include "service/ProtocolWaveman.h" -#include #include +#include +#include int ProtocolWaveman::lastArctecCodeSwitchWasTurnOff=0; diff --git a/telldus-core/service/Sensor.cpp b/telldus-core/service/Sensor.cpp index 65870b66..787bf4c9 100644 --- a/telldus-core/service/Sensor.cpp +++ b/telldus-core/service/Sensor.cpp @@ -5,9 +5,10 @@ // // #include "service/Sensor.h" +#include +#include #include "common/common.h" #include "client/telldus-core.h" -#include class Sensor::PrivateData { public: diff --git a/telldus-core/service/Sensor.h b/telldus-core/service/Sensor.h index 3c6561e2..0ebd6332 100644 --- a/telldus-core/service/Sensor.h +++ b/telldus-core/service/Sensor.h @@ -7,8 +7,8 @@ #ifndef TELLDUS_CORE_SERVICE_SENSOR_H_ #define TELLDUS_CORE_SERVICE_SENSOR_H_ -#include "common/Mutex.h" #include +#include "common/Mutex.h" class Sensor : public TelldusCore::Mutex { public: diff --git a/telldus-core/service/SettingsConfuse.cpp b/telldus-core/service/SettingsConfuse.cpp index db3f9325..95042105 100644 --- a/telldus-core/service/SettingsConfuse.cpp +++ b/telldus-core/service/SettingsConfuse.cpp @@ -4,16 +4,15 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "Settings.h" -#include "client/telldus-core.h" -#include "service/Settings.h" -#include "service/SettingsConfusePaths.h" -#include "client/telldus-core.h" -#include "common/Strings.h" #include #include #include #include +#include +#include "service/Settings.h" +#include "service/SettingsConfusePaths.h" +#include "client/telldus-core.h" +#include "common/Strings.h" using namespace std; diff --git a/telldus-core/service/TellStick.cpp b/telldus-core/service/TellStick.cpp index 074a99fd..4987118a 100644 --- a/telldus-core/service/TellStick.cpp +++ b/telldus-core/service/TellStick.cpp @@ -6,8 +6,9 @@ // #include "service/TellStick.h" -#include #include +#include +#include std::string TellStick::createTPacket( const std::string &msg ) { std::map times; diff --git a/telldus-core/service/TellStick_libftdi.cpp b/telldus-core/service/TellStick_libftdi.cpp index d3535df9..ce726b64 100644 --- a/telldus-core/service/TellStick_libftdi.cpp +++ b/telldus-core/service/TellStick_libftdi.cpp @@ -4,24 +4,23 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "service/TellStick.h" -#include "client/telldus-core.h" +#include #include #include #include #include -#include #include #include + +#include "service/TellStick.h" #include "service/Log.h" #include "service/Settings.h" +#include "client/telldus-core.h" #include "common/Thread.h" #include "common/Mutex.h" #include "common/Strings.h" #include "common/common.h" -#include - typedef struct _EVENT_HANDLE { pthread_cond_t eCondVar; pthread_mutex_t eMutex; diff --git a/telldus-core/service/TelldusMain.cpp b/telldus-core/service/TelldusMain.cpp index 52ad2ffa..3016a520 100644 --- a/telldus-core/service/TelldusMain.cpp +++ b/telldus-core/service/TelldusMain.cpp @@ -5,6 +5,11 @@ // // #include "service/TelldusMain.h" + +#include +#include +#include + #include "service/ConnectionListener.h" #include "common/EventHandler.h" #include "service/ClientCommunicationHandler.h" @@ -15,9 +20,6 @@ #include "service/Timer.h" #include "service/Log.h" -#include -#include -#include class TelldusMain::PrivateData { public: diff --git a/telldus-core/service/Timer.cpp b/telldus-core/service/Timer.cpp index 4f2e3dbf..758881e3 100644 --- a/telldus-core/service/Timer.cpp +++ b/telldus-core/service/Timer.cpp @@ -5,12 +5,12 @@ // // #include "service/Timer.h" -#include "common/Mutex.h" #ifdef _WINDOWS #else #include #include #endif +#include "common/Mutex.h" class Timer::PrivateData { public: diff --git a/telldus-core/service/main_unix.cpp b/telldus-core/service/main_unix.cpp index 4e72f3b8..97d9358e 100644 --- a/telldus-core/service/main_unix.cpp +++ b/telldus-core/service/main_unix.cpp @@ -4,7 +4,6 @@ // Copyright: See COPYING file that comes with this distribution // // -#include "service/TelldusMain.h" #include #include #include @@ -16,6 +15,7 @@ #include #include +#include "service/TelldusMain.h" #include "service/Settings.h" #include "common/Strings.h" #include "service/Log.h"