From 203fb488271c83ba6db7f0f3570ed8e776250e95 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 11 Aug 2015 16:28:45 +1000 Subject: [PATCH] AP_RangeFinder: 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. --- .../AP_RangeFinder/AP_RangeFinder_BBB_PRU.cpp | 2 +- .../AP_RangeFinder_MaxsonarI2CXL.cpp | 2 +- .../AP_RangeFinder/AP_RangeFinder_PX4.cpp | 2 +- .../AP_RangeFinder/AP_RangeFinder_PX4_PWM.cpp | 2 +- .../AP_RangeFinder_PulsedLightLRF.cpp | 2 +- .../AP_RangeFinder/AP_RangeFinder_analog.cpp | 6 +- libraries/AP_RangeFinder/RangeFinder.h | 8 +-- .../AP_RangeFinder/RangeFinder_Backend.cpp | 4 +- .../AP_RangeFinder/RangeFinder_Backend.h | 4 +- .../examples/RFIND_test/RFIND_test.cpp | 64 +++++++++---------- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_BBB_PRU.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_BBB_PRU.cpp index 560da79ffe..7b11b94e9a 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_BBB_PRU.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_BBB_PRU.cpp @@ -16,7 +16,7 @@ by Mirko Denecke */ -#include +#include #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI #include "AP_RangeFinder_BBB_PRU.h" diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp index a414313e1a..f3831bcb4a 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp @@ -24,7 +24,7 @@ */ #include "AP_RangeFinder_MaxsonarI2CXL.h" -#include +#include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_PX4.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_PX4.cpp index 8e196fe74b..15ddc88593 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_PX4.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_PX4.cpp @@ -14,7 +14,7 @@ along with this program. If not, see . */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN #include "AP_RangeFinder_PX4.h" diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_PX4_PWM.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_PX4_PWM.cpp index 8ec2d8f00b..3512581eb2 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_PX4_PWM.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_PX4_PWM.cpp @@ -14,7 +14,7 @@ along with this program. If not, see . */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN #include "AP_RangeFinder_PX4_PWM.h" diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp index af8483b1fb..a40b290e3a 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp @@ -15,7 +15,7 @@ */ #include "AP_RangeFinder_PulsedLightLRF.h" -#include +#include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp index c88b72d325..2e9eee3f8a 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include "RangeFinder.h" #include "AP_RangeFinder_analog.h" diff --git a/libraries/AP_RangeFinder/RangeFinder.h b/libraries/AP_RangeFinder/RangeFinder.h index 19eb4d6d25..e1de23ff6b 100644 --- a/libraries/AP_RangeFinder/RangeFinder.h +++ b/libraries/AP_RangeFinder/RangeFinder.h @@ -17,10 +17,10 @@ #ifndef __RANGEFINDER_H__ #define __RANGEFINDER_H__ -#include -#include -#include -#include +#include +#include +#include +#include // Maximum number of range finder instances available on this platform #define RANGEFINDER_MAX_INSTANCES 2 diff --git a/libraries/AP_RangeFinder/RangeFinder_Backend.cpp b/libraries/AP_RangeFinder/RangeFinder_Backend.cpp index 07dcc82739..b27253ac66 100644 --- a/libraries/AP_RangeFinder/RangeFinder_Backend.cpp +++ b/libraries/AP_RangeFinder/RangeFinder_Backend.cpp @@ -14,8 +14,8 @@ along with this program. If not, see . */ -#include -#include +#include +#include #include "RangeFinder.h" #include "RangeFinder_Backend.h" diff --git a/libraries/AP_RangeFinder/RangeFinder_Backend.h b/libraries/AP_RangeFinder/RangeFinder_Backend.h index 90beee5f62..3ff5d18c69 100644 --- a/libraries/AP_RangeFinder/RangeFinder_Backend.h +++ b/libraries/AP_RangeFinder/RangeFinder_Backend.h @@ -17,8 +17,8 @@ #ifndef __AP_RANGEFINDER_BACKEND_H__ #define __AP_RANGEFINDER_BACKEND_H__ -#include -#include +#include +#include #include "RangeFinder.h" class AP_RangeFinder_Backend diff --git a/libraries/AP_RangeFinder/examples/RFIND_test/RFIND_test.cpp b/libraries/AP_RangeFinder/examples/RFIND_test/RFIND_test.cpp index bca352d10e..af9d3e4e83 100644 --- a/libraries/AP_RangeFinder/examples/RFIND_test/RFIND_test.cpp +++ b/libraries/AP_RangeFinder/examples/RFIND_test/RFIND_test.cpp @@ -2,38 +2,38 @@ * RangeFinder test code */ -#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;