From 876a48dbce515d1ea7a9697962fa799216cf3ba6 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 11 Aug 2015 16:28:44 +1000 Subject: [PATCH] AP_Mount: 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. --- libraries/AP_Mount/AP_Gimbal.cpp | 10 ++-- libraries/AP_Mount/AP_Gimbal.h | 18 +++--- libraries/AP_Mount/AP_Mount.cpp | 20 +++---- libraries/AP_Mount/AP_Mount.h | 10 ++-- libraries/AP_Mount/AP_Mount_Alexmos.h | 14 ++--- libraries/AP_Mount/AP_Mount_Backend.cpp | 2 +- libraries/AP_Mount/AP_Mount_Backend.h | 4 +- libraries/AP_Mount/AP_Mount_MAVLink.cpp | 6 +- libraries/AP_Mount/AP_Mount_MAVLink.h | 18 +++--- libraries/AP_Mount/AP_Mount_SToRM32.cpp | 6 +- libraries/AP_Mount/AP_Mount_SToRM32.h | 18 +++--- .../AP_Mount/AP_Mount_SToRM32_serial.cpp | 8 +-- libraries/AP_Mount/AP_Mount_SToRM32_serial.h | 16 +++--- libraries/AP_Mount/AP_Mount_Servo.cpp | 2 +- libraries/AP_Mount/AP_Mount_Servo.h | 12 ++-- .../trivial_AP_Mount/trivial_AP_Mount.cpp | 56 +++++++++---------- 16 files changed, 110 insertions(+), 110 deletions(-) diff --git a/libraries/AP_Mount/AP_Gimbal.cpp b/libraries/AP_Mount/AP_Gimbal.cpp index 14a60409dd..d8f6ce762a 100644 --- a/libraries/AP_Mount/AP_Gimbal.cpp +++ b/libraries/AP_Mount/AP_Gimbal.cpp @@ -1,14 +1,14 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include "AP_Gimbal.h" #if AP_AHRS_NAVEKF_AVAILABLE #include -#include -#include -#include -#include "AP_Math.h" +#include +#include +#include +#include void AP_Gimbal::receive_feedback(mavlink_channel_t chan, mavlink_message_t *msg) { diff --git a/libraries/AP_Mount/AP_Gimbal.h b/libraries/AP_Mount/AP_Gimbal.h index f0bd59c0f1..aa9d362275 100644 --- a/libraries/AP_Mount/AP_Gimbal.h +++ b/libraries/AP_Mount/AP_Gimbal.h @@ -9,18 +9,18 @@ #ifndef __AP_GIMBAL_H__ #define __AP_GIMBAL_H__ -#include -#include +#include +#include #if AP_AHRS_NAVEKF_AVAILABLE -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include "AP_Mount.h" +#include +#include class AP_Gimbal { diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index 27987656c7..b0f16577ca 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -1,15 +1,15 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include "AP_Mount.h" +#include "AP_Mount_Backend.h" +#include "AP_Mount_Servo.h" +#include "AP_Mount_MAVLink.h" +#include "AP_Mount_Alexmos.h" +#include "AP_Mount_SToRM32.h" +#include "AP_Mount_SToRM32_serial.h" const AP_Param::GroupInfo AP_Mount::var_info[] PROGMEM = { // @Param: _DEFLT_MODE diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index 62d861d825..b8b5d2d28c 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -22,11 +22,11 @@ #ifndef __AP_MOUNT_H__ #define __AP_MOUNT_H__ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "../RC_Channel/RC_Channel.h" #include "../AP_SerialManager/AP_SerialManager.h" diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.h b/libraries/AP_Mount/AP_Mount_Alexmos.h index 2931e0fd4d..2cef5ca961 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.h +++ b/libraries/AP_Mount/AP_Mount_Alexmos.h @@ -7,13 +7,13 @@ #ifndef __AP_MOUNT_ALEXMOS_H__ #define __AP_MOUNT_ALEXMOS_H__ -#include -#include -#include -#include -#include -#include -#include +#include "AP_Mount.h" +#include +#include +#include +#include +#include +#include "AP_Mount_Backend.h" //definition of the commands id for the Alexmos Serial Protocol diff --git a/libraries/AP_Mount/AP_Mount_Backend.cpp b/libraries/AP_Mount/AP_Mount_Backend.cpp index 08f35deb1b..b1f08a92e7 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.cpp +++ b/libraries/AP_Mount/AP_Mount_Backend.cpp @@ -1,6 +1,6 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include "AP_Mount_Backend.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Mount/AP_Mount_Backend.h b/libraries/AP_Mount/AP_Mount_Backend.h index f8f19007a8..e3bc39274a 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.h +++ b/libraries/AP_Mount/AP_Mount_Backend.h @@ -22,8 +22,8 @@ #ifndef __AP_MOUNT_BACKEND_H__ #define __AP_MOUNT_BACKEND_H__ -#include -#include +#include +#include "AP_Mount.h" class AP_Mount_Backend { diff --git a/libraries/AP_Mount/AP_Mount_MAVLink.cpp b/libraries/AP_Mount/AP_Mount_MAVLink.cpp index a9751901e9..d76b68ed94 100644 --- a/libraries/AP_Mount/AP_Mount_MAVLink.cpp +++ b/libraries/AP_Mount/AP_Mount_MAVLink.cpp @@ -1,10 +1,10 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include "AP_Mount_MAVLink.h" #if AP_AHRS_NAVEKF_AVAILABLE -#include +#include #include -#include +#include "AP_Gimbal.h" #if MOUNT_DEBUG #include diff --git a/libraries/AP_Mount/AP_Mount_MAVLink.h b/libraries/AP_Mount/AP_Mount_MAVLink.h index b6431d4416..fd62a72e32 100644 --- a/libraries/AP_Mount/AP_Mount_MAVLink.h +++ b/libraries/AP_Mount/AP_Mount_MAVLink.h @@ -7,17 +7,17 @@ #ifndef __AP_MOUNT_MAVLINK_H__ #define __AP_MOUNT_MAVLINK_H__ -#include -#include +#include +#include #if AP_AHRS_NAVEKF_AVAILABLE -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include "AP_Mount_Backend.h" +#include "AP_Gimbal.h" class AP_Mount_MAVLink : public AP_Mount_Backend { diff --git a/libraries/AP_Mount/AP_Mount_SToRM32.cpp b/libraries/AP_Mount/AP_Mount_SToRM32.cpp index 0618d472f9..784c7fc72d 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32.cpp +++ b/libraries/AP_Mount/AP_Mount_SToRM32.cpp @@ -1,8 +1,8 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include -#include -#include +#include "AP_Mount_SToRM32.h" +#include +#include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Mount/AP_Mount_SToRM32.h b/libraries/AP_Mount/AP_Mount_SToRM32.h index 39fa878d24..19caceb3da 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32.h +++ b/libraries/AP_Mount/AP_Mount_SToRM32.h @@ -7,16 +7,16 @@ #ifndef __AP_MOUNT_STORM32_H__ #define __AP_MOUNT_STORM32_H__ -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include "AP_Mount_Backend.h" #define AP_MOUNT_STORM32_RESEND_MS 1000 // resend angle targets to gimbal once per second #define AP_MOUNT_STORM32_SEARCH_MS 60000 // search for gimbal for 1 minute after startup diff --git a/libraries/AP_Mount/AP_Mount_SToRM32_serial.cpp b/libraries/AP_Mount/AP_Mount_SToRM32_serial.cpp index 0821833976..6f392bd2c5 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32_serial.cpp +++ b/libraries/AP_Mount/AP_Mount_SToRM32_serial.cpp @@ -1,9 +1,9 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include -#include -#include -#include "include/mavlink/v1.0/checksum.h" +#include "AP_Mount_SToRM32_serial.h" +#include +#include +#include #include "../AP_HAL/utility/RingBuffer.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Mount/AP_Mount_SToRM32_serial.h b/libraries/AP_Mount/AP_Mount_SToRM32_serial.h index d10ca9c31a..82953af286 100644 --- a/libraries/AP_Mount/AP_Mount_SToRM32_serial.h +++ b/libraries/AP_Mount/AP_Mount_SToRM32_serial.h @@ -7,15 +7,15 @@ #ifndef __AP_MOUNT_STORM32_SERIAL_H__ #define __AP_MOUNT_STORM32_SERIAL_H__ -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include "AP_Mount_Backend.h" #define AP_MOUNT_STORM32_SERIAL_RESEND_MS 1000 // resend angle targets to gimbal once per second diff --git a/libraries/AP_Mount/AP_Mount_Servo.cpp b/libraries/AP_Mount/AP_Mount_Servo.cpp index a07a459eb0..aa1107a21c 100644 --- a/libraries/AP_Mount/AP_Mount_Servo.cpp +++ b/libraries/AP_Mount/AP_Mount_Servo.cpp @@ -1,6 +1,6 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include "AP_Mount_Servo.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Mount/AP_Mount_Servo.h b/libraries/AP_Mount/AP_Mount_Servo.h index c5b32bba3b..d7997e2258 100644 --- a/libraries/AP_Mount/AP_Mount_Servo.h +++ b/libraries/AP_Mount/AP_Mount_Servo.h @@ -7,12 +7,12 @@ #ifndef __AP_MOUNT_SERVO_H__ #define __AP_MOUNT_SERVO_H__ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "AP_Mount_Backend.h" class AP_Mount_Servo : public AP_Mount_Backend diff --git a/libraries/AP_Mount/examples/trivial_AP_Mount/trivial_AP_Mount.cpp b/libraries/AP_Mount/examples/trivial_AP_Mount/trivial_AP_Mount.cpp index 4fdbbf8b1a..1c6eb3eefb 100644 --- a/libraries/AP_Mount/examples/trivial_AP_Mount/trivial_AP_Mount.cpp +++ b/libraries/AP_Mount/examples/trivial_AP_Mount/trivial_AP_Mount.cpp @@ -1,35 +1,35 @@ -#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; void setup () {