From 84b5555a1a254e4bc88c23700302fc069519f37d Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 11 Aug 2015 16:28:41 +1000 Subject: [PATCH] Tools: standardize inclusion of libaries headers This commit changes the way libraries headers are included in source files: - If the header is in the same directory the source belongs to, so the notation '#include ""' is used with the path relative to the directory containing the source. - If the header is outside the directory containing the source, then we use the notation '#include <>' with the path relative to libraries folder. Some of the advantages of such approach: - Only one search path for libraries headers. - OSs like Windows may have a better lookup time. --- .../WorkBasket/Jeti_Duplex/Jetibox/JetiBox.h | 2 +- Tools/CPUInfo/CPUInfo.cpp | 66 ++++++++--------- Tools/Failsafe/Failsafe.pde | 4 +- Tools/FlightGear/FGShim.c | 4 +- Tools/Hello/Hello.cpp | 48 ++++++------ Tools/Replay/DataFlashFileReader.h | 2 +- Tools/Replay/LR_MsgHandler.cpp | 2 +- Tools/Replay/LogReader.cpp | 20 ++--- Tools/Replay/MsgHandler.h | 2 +- Tools/Replay/Parameters.h | 2 +- Tools/Replay/Replay.cpp | 74 +++++++++---------- 11 files changed, 113 insertions(+), 113 deletions(-) diff --git a/Tools/ArduPPM/WorkBasket/Jeti_Duplex/Jetibox/JetiBox.h b/Tools/ArduPPM/WorkBasket/Jeti_Duplex/Jetibox/JetiBox.h index ee39e5a2e8..d18f104ea0 100644 --- a/Tools/ArduPPM/WorkBasket/Jeti_Duplex/Jetibox/JetiBox.h +++ b/Tools/ArduPPM/WorkBasket/Jeti_Duplex/Jetibox/JetiBox.h @@ -24,7 +24,7 @@ #define JetiBox_h #include -#include "Print.h" +#include #define jbox_key_up 0b0010 #define jbox_key_right 0b0001 diff --git a/Tools/CPUInfo/CPUInfo.cpp b/Tools/CPUInfo/CPUInfo.cpp index 42a36dbc45..0f19e8e9df 100644 --- a/Tools/CPUInfo/CPUInfo.cpp +++ b/Tools/CPUInfo/CPUInfo.cpp @@ -5,39 +5,39 @@ Andrew Tridgell September 2011 */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; diff --git a/Tools/Failsafe/Failsafe.pde b/Tools/Failsafe/Failsafe.pde index 6780359662..ec91a02b5d 100644 --- a/Tools/Failsafe/Failsafe.pde +++ b/Tools/Failsafe/Failsafe.pde @@ -9,8 +9,8 @@ version 2.1 of the License, or (at your option) any later version. // Libraries #include -#include -#include +#include +#include #include #include // ArduPilot Mega RC Library diff --git a/Tools/FlightGear/FGShim.c b/Tools/FlightGear/FGShim.c index 9879122cca..3e756020f7 100644 --- a/Tools/FlightGear/FGShim.c +++ b/Tools/FlightGear/FGShim.c @@ -59,12 +59,12 @@ #include #pragma pack(1) -#include "mavlink_types.h" +#include mavlink_system_t mavlink_system; void comm_send_ch(mavlink_channel_t chan, uint8_t ch); #define MAVLINK_USE_CONVENIENCE_FUNCTIONS -#include "ardupilotmega/mavlink.h" +#include #define TARGET_SYSTEM 7 /* XXX what should these really be? */ #define TARGET_COMPONENT 1 diff --git a/Tools/Hello/Hello.cpp b/Tools/Hello/Hello.cpp index 61a8521b50..f1038cac6f 100644 --- a/Tools/Hello/Hello.cpp +++ b/Tools/Hello/Hello.cpp @@ -5,30 +5,30 @@ Andrew Tridgell September 2011 */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; diff --git a/Tools/Replay/DataFlashFileReader.h b/Tools/Replay/DataFlashFileReader.h index 7f8fe81451..ef461fd832 100644 --- a/Tools/Replay/DataFlashFileReader.h +++ b/Tools/Replay/DataFlashFileReader.h @@ -1,7 +1,7 @@ #ifndef REPLAY_DATAFLASHREADER_H #define REPLAY_DATAFLASHREADER_H -#include +#include class DataFlashFileReader { diff --git a/Tools/Replay/LR_MsgHandler.cpp b/Tools/Replay/LR_MsgHandler.cpp index af5330f215..3e37c0e908 100644 --- a/Tools/Replay/LR_MsgHandler.cpp +++ b/Tools/Replay/LR_MsgHandler.cpp @@ -296,7 +296,7 @@ void LR_MsgHandler_MAG::process_message(uint8_t *msg) update_from_msg_compass(0, msg); } -#include +#include #include "VehicleType.h" void LR_MsgHandler_MSG::process_message(uint8_t *msg) diff --git a/Tools/Replay/LogReader.cpp b/Tools/Replay/LogReader.cpp index dcdb2bf762..e7e68ac9bb 100644 --- a/Tools/Replay/LogReader.cpp +++ b/Tools/Replay/LogReader.cpp @@ -1,13 +1,13 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "LogReader.h" #include diff --git a/Tools/Replay/MsgHandler.h b/Tools/Replay/MsgHandler.h index d29ce81e3f..c026fe5cbb 100644 --- a/Tools/Replay/MsgHandler.h +++ b/Tools/Replay/MsgHandler.h @@ -1,7 +1,7 @@ #ifndef AP_MSGHANDLER_H #define AP_MSGHANDLER_H -#include +#include #include "VehicleType.h" #include diff --git a/Tools/Replay/Parameters.h b/Tools/Replay/Parameters.h index e445c2defb..acd2d8188d 100644 --- a/Tools/Replay/Parameters.h +++ b/Tools/Replay/Parameters.h @@ -3,7 +3,7 @@ #ifndef PARAMETERS_H #define PARAMETERS_H -#include +#include // Global parameter class. // diff --git a/Tools/Replay/Replay.cpp b/Tools/Replay/Replay.cpp index ac14179af0..9b112110e3 100644 --- a/Tools/Replay/Replay.cpp +++ b/Tools/Replay/Replay.cpp @@ -14,48 +14,48 @@ along with this program. If not, see . */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include +#include #include "Parameters.h" #include "VehicleType.h" #include "MsgHandler.h"