From 8fb7098903d822ab2eda7f5719a54ed05a0d46e3 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 11 Aug 2015 16:28:42 +1000 Subject: [PATCH] AP_Airspeed: 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_Airspeed/AP_Airspeed.cpp | 12 ++-- libraries/AP_Airspeed/AP_Airspeed.h | 18 +++--- libraries/AP_Airspeed/AP_Airspeed_Backend.h | 4 +- libraries/AP_Airspeed/AP_Airspeed_I2C.cpp | 8 +-- libraries/AP_Airspeed/AP_Airspeed_I2C.h | 4 +- libraries/AP_Airspeed/AP_Airspeed_I2C_PX4.h | 4 +- libraries/AP_Airspeed/AP_Airspeed_PX4.cpp | 4 +- libraries/AP_Airspeed/AP_Airspeed_PX4.h | 4 +- libraries/AP_Airspeed/AP_Airspeed_analog.cpp | 12 ++-- libraries/AP_Airspeed/AP_Airspeed_analog.h | 4 +- .../AP_Airspeed/Airspeed_Calibration.cpp | 8 +-- .../examples/Airspeed/Airspeed.cpp | 62 +++++++++---------- 12 files changed, 72 insertions(+), 72 deletions(-) diff --git a/libraries/AP_Airspeed/AP_Airspeed.cpp b/libraries/AP_Airspeed/AP_Airspeed.cpp index 5f7364d46c..18507d136d 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed.cpp @@ -18,16 +18,16 @@ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include "AP_Airspeed.h" extern const AP_HAL::HAL& hal; #if CONFIG_HAL_BOARD == HAL_BOARD_APM1 - #include + #include #define ARSPD_DEFAULT_PIN 64 #elif CONFIG_HAL_BOARD == HAL_BOARD_APM2 #define ARSPD_DEFAULT_PIN 0 diff --git a/libraries/AP_Airspeed/AP_Airspeed.h b/libraries/AP_Airspeed/AP_Airspeed.h index 427c1097e9..af4db761be 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.h +++ b/libraries/AP_Airspeed/AP_Airspeed.h @@ -3,15 +3,15 @@ #ifndef __AP_AIRSPEED_H__ #define __AP_AIRSPEED_H__ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include "AP_Airspeed_Backend.h" +#include "AP_Airspeed_analog.h" +#include "AP_Airspeed_PX4.h" +#include "AP_Airspeed_I2C.h" class Airspeed_Calibration { public: diff --git a/libraries/AP_Airspeed/AP_Airspeed_Backend.h b/libraries/AP_Airspeed/AP_Airspeed_Backend.h index b1a093d8b1..413fc35097 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_Backend.h +++ b/libraries/AP_Airspeed/AP_Airspeed_Backend.h @@ -22,8 +22,8 @@ #ifndef __AP_AIRSPEED_BACKEND_H__ #define __AP_AIRSPEED_BACKEND_H__ -#include -#include +#include +#include class AP_Airspeed_Backend { public: diff --git a/libraries/AP_Airspeed/AP_Airspeed_I2C.cpp b/libraries/AP_Airspeed/AP_Airspeed_I2C.cpp index 21abb02bf7..0647f300ff 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_I2C.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed_I2C.cpp @@ -19,10 +19,10 @@ backend driver for airspeed from a I2C MS4525D0 sensor */ -#include -#include -#include -#include +#include +#include +#include +#include "AP_Airspeed_I2C.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Airspeed/AP_Airspeed_I2C.h b/libraries/AP_Airspeed/AP_Airspeed_I2C.h index 4151653d61..0343da3325 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_I2C.h +++ b/libraries/AP_Airspeed/AP_Airspeed_I2C.h @@ -22,8 +22,8 @@ #ifndef __AP_AIRSPEED_I2C_H__ #define __AP_AIRSPEED_I2C_H__ -#include -#include +#include +#include "AP_Airspeed_Backend.h" class AP_Airspeed_I2C : public AP_Airspeed_Backend { diff --git a/libraries/AP_Airspeed/AP_Airspeed_I2C_PX4.h b/libraries/AP_Airspeed/AP_Airspeed_I2C_PX4.h index 55157fefb5..44013921c3 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_I2C_PX4.h +++ b/libraries/AP_Airspeed/AP_Airspeed_I2C_PX4.h @@ -22,8 +22,8 @@ #ifndef __AP_AIRSPEED_I2C_H__ #define __AP_AIRSPEED_I2C_H__ -#include -#include +#include +#include class AP_Airspeed_I2C_PX4 : AP_Airspeed_I2C { public: diff --git a/libraries/AP_Airspeed/AP_Airspeed_PX4.cpp b/libraries/AP_Airspeed/AP_Airspeed_PX4.cpp index 05dd07d5bf..924f4a2de0 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_PX4.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed_PX4.cpp @@ -18,11 +18,11 @@ */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN -#include +#include "AP_Airspeed_PX4.h" #include #include #include diff --git a/libraries/AP_Airspeed/AP_Airspeed_PX4.h b/libraries/AP_Airspeed/AP_Airspeed_PX4.h index a75748765f..8b2dcab23e 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_PX4.h +++ b/libraries/AP_Airspeed/AP_Airspeed_PX4.h @@ -22,8 +22,8 @@ #ifndef __AP_AIRSPEED_PX4_H__ #define __AP_AIRSPEED_PX4_H__ -#include -#include +#include +#include "AP_Airspeed_Backend.h" class AP_Airspeed_PX4 : public AP_Airspeed_Backend { public: diff --git a/libraries/AP_Airspeed/AP_Airspeed_analog.cpp b/libraries/AP_Airspeed/AP_Airspeed_analog.cpp index 833d6d5b87..8012737865 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_analog.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed_analog.cpp @@ -18,12 +18,12 @@ */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include "AP_Airspeed.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Airspeed/AP_Airspeed_analog.h b/libraries/AP_Airspeed/AP_Airspeed_analog.h index fc202424da..cbe02ec9eb 100644 --- a/libraries/AP_Airspeed/AP_Airspeed_analog.h +++ b/libraries/AP_Airspeed/AP_Airspeed_analog.h @@ -3,8 +3,8 @@ #ifndef __AP_AIRSPEED_ANALOG_H__ #define __AP_AIRSPEED_ANALOG_H__ -#include -#include +#include +#include "AP_Airspeed_Backend.h" class AP_Airspeed_Analog : public AP_Airspeed_Backend { diff --git a/libraries/AP_Airspeed/Airspeed_Calibration.cpp b/libraries/AP_Airspeed/Airspeed_Calibration.cpp index d51daa35df..00798077e9 100644 --- a/libraries/AP_Airspeed/Airspeed_Calibration.cpp +++ b/libraries/AP_Airspeed/Airspeed_Calibration.cpp @@ -6,10 +6,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include "AP_Airspeed.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp b/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp index 7903f6840d..2368affe61 100644 --- a/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp +++ b/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp @@ -19,37 +19,37 @@ * */ -#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 #if CONFIG_HAL_BOARD == HAL_BOARD_APM1 AP_ADC_ADS7844 apm1_adc;