From 62f50aede702b0014690176e7276bd9492df2c9f Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 17 Feb 2016 23:25:15 -0200 Subject: [PATCH] AP_BattMonitor: replace header guard with pragma once --- libraries/AP_BattMonitor/AP_BattMonitor.h | 4 +--- libraries/AP_BattMonitor/AP_BattMonitor_Analog.h | 4 +--- libraries/AP_BattMonitor/AP_BattMonitor_Backend.h | 5 +---- libraries/AP_BattMonitor/AP_BattMonitor_Bebop.h | 5 +---- libraries/AP_BattMonitor/AP_BattMonitor_SMBus.h | 5 +---- libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.h | 5 +---- libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.h | 5 +---- 7 files changed, 7 insertions(+), 26 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.h b/libraries/AP_BattMonitor/AP_BattMonitor.h index 04a817f4cb..29ac4a2fe0 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor.h @@ -1,6 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#ifndef AP_BATTMONITOR_H -#define AP_BATTMONITOR_H +#pragma once #include #include @@ -126,4 +125,3 @@ private: AP_BattMonitor_Backend *drivers[AP_BATT_MONITOR_MAX_INSTANCES]; uint8_t _num_instances; /// number of monitors }; -#endif // AP_BATTMONITOR_H diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_Analog.h b/libraries/AP_BattMonitor/AP_BattMonitor_Analog.h index 4dbd1ea746..97a864ef40 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_Analog.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_Analog.h @@ -1,6 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#ifndef AP_BATTMONITOR_ANALOG_H -#define AP_BATTMONITOR_ANALOG_H +#pragma once #include // ArduPilot Mega Analog to Digital Converter Library #include "AP_BattMonitor.h" @@ -97,4 +96,3 @@ protected: AP_HAL::AnalogSource *_volt_pin_analog_source; AP_HAL::AnalogSource *_curr_pin_analog_source; }; -#endif // AP_BATTMONITOR_ANALOG_H diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_Backend.h b/libraries/AP_BattMonitor/AP_BattMonitor_Backend.h index 86bab451bd..3778e5b8f4 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_Backend.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_Backend.h @@ -13,9 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#ifndef __AP_BATTMONITOR_BACKEND_H__ -#define __AP_BATTMONITOR_BACKEND_H__ +#pragma once #include #include @@ -48,4 +46,3 @@ protected: AP_BattMonitor::BattMonitor_State &_state; // reference to this instances state (held in the front-end) uint8_t _instance; // this instance }; -#endif // __AP_BATTMONITOR_BACKEND_H__ diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.h b/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.h index 0535b7e313..b400d44a41 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.h @@ -13,9 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#ifndef __AP_BATTMONITOR_BEBOP_H__ -#define __AP_BATTMONITOR_BEBOP_H__ +#pragma once #include #include @@ -48,4 +46,3 @@ private: float _filter_voltage(float vbat_raw); float _compute_battery_percentage(float vbat); }; -#endif // __AP_BATTMONITOR_BEBOP_H__ diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus.h b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus.h index 110b87492a..91ca4592ec 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus.h @@ -1,6 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#ifndef AP_BATTMONITOR_SMBUS_H -#define AP_BATTMONITOR_SMBUS_H +#pragma once #include #include @@ -26,5 +25,3 @@ public: // include specific implementations #include "AP_BattMonitor_SMBus_PX4.h" #include "AP_BattMonitor_SMBus_I2C.h" - -#endif // AP_BATTMONITOR_SMBUS_H diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.h b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.h index 0f43627de9..7b6170bda0 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.h @@ -1,6 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#ifndef AP_BATTMONITOR_SMBUS_I2C_H -#define AP_BATTMONITOR_SMBUS_I2C_H +#pragma once #include #include @@ -30,5 +29,3 @@ private: // buff is the data that was read or will be written uint8_t get_PEC(const uint8_t i2c_addr, uint8_t cmd, bool reading, const uint8_t buff[], uint8_t len) const; }; - -#endif // AP_BATTMONITOR_SMBUS_I2C_H diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.h b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.h index 07fc41de04..57f21a1c56 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef AP_BATTMONITOR_SMBUS_PX4_H -#define AP_BATTMONITOR_SMBUS_PX4_H +#pragma once #include #include @@ -40,5 +39,3 @@ private: int _batt_fd; // file descriptor bool _capacity_updated; // capacity info read }; - -#endif // AP_BATTMONITOR_SMBUS_PX4_H