From 705393b30c49f2a543676037a2466d4f57af42e6 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 17 Feb 2016 23:25:26 -0200 Subject: [PATCH] AP_HAL_Linux: replace header guard with pragma once --- libraries/AP_HAL_Linux/AP_HAL_Linux.h | 6 +----- libraries/AP_HAL_Linux/AP_HAL_Linux_Namespace.h | 7 +------ libraries/AP_HAL_Linux/AP_HAL_Linux_Private.h | 6 +----- libraries/AP_HAL_Linux/AnalogIn.h | 5 +---- libraries/AP_HAL_Linux/ConsoleDevice.h | 5 +---- libraries/AP_HAL_Linux/GPIO.h | 4 +--- libraries/AP_HAL_Linux/GPIO_BBB.h | 6 +----- libraries/AP_HAL_Linux/GPIO_RPI.h | 5 +---- libraries/AP_HAL_Linux/Heat.h | 5 +---- libraries/AP_HAL_Linux/Heat_Pwm.h | 5 +---- libraries/AP_HAL_Linux/I2CDriver.h | 6 +----- libraries/AP_HAL_Linux/RCInput.h | 6 +----- libraries/AP_HAL_Linux/RCInput_AioPRU.h | 7 +------ libraries/AP_HAL_Linux/RCInput_PRU.h | 6 +----- libraries/AP_HAL_Linux/RCInput_RPI.h | 5 +---- libraries/AP_HAL_Linux/RCInput_Raspilot.h | 6 +----- libraries/AP_HAL_Linux/RCInput_UDP.h | 5 +---- libraries/AP_HAL_Linux/RCInput_UDP_Protocol.h | 5 +---- libraries/AP_HAL_Linux/RCInput_ZYNQ.h | 6 +----- libraries/AP_HAL_Linux/RCOutput_AioPRU.h | 7 +------ libraries/AP_HAL_Linux/RCOutput_Bebop.h | 5 +---- libraries/AP_HAL_Linux/RCOutput_PCA9685.h | 6 +----- libraries/AP_HAL_Linux/RCOutput_PRU.h | 6 +----- libraries/AP_HAL_Linux/RCOutput_Raspilot.h | 6 +----- libraries/AP_HAL_Linux/RCOutput_ZYNQ.h | 6 +----- libraries/AP_HAL_Linux/RPIOUARTDriver.h | 5 +---- libraries/AP_HAL_Linux/SPIUARTDriver.h | 5 +---- libraries/AP_HAL_Linux/Semaphores.h | 6 +----- libraries/AP_HAL_Linux/SerialDevice.h | 5 +---- libraries/AP_HAL_Linux/Storage.h | 6 +----- libraries/AP_HAL_Linux/Storage_FRAM.h | 4 +--- libraries/AP_HAL_Linux/TCPServerDevice.h | 5 +---- libraries/AP_HAL_Linux/ToneAlarmDriver.h | 5 +---- libraries/AP_HAL_Linux/UARTDevice.h | 5 +---- libraries/AP_HAL_Linux/UARTDriver.h | 6 +----- libraries/AP_HAL_Linux/UDPDevice.h | 5 +---- libraries/AP_HAL_Linux/Util.h | 8 +------- 37 files changed, 37 insertions(+), 170 deletions(-) diff --git a/libraries/AP_HAL_Linux/AP_HAL_Linux.h b/libraries/AP_HAL_Linux/AP_HAL_Linux.h index 8263bb688a..67c9376bbb 100644 --- a/libraries/AP_HAL_Linux/AP_HAL_Linux.h +++ b/libraries/AP_HAL_Linux/AP_HAL_Linux.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_H__ -#define __AP_HAL_LINUX_H__ +#pragma once /* Your layer exports should depend on AP_HAL.h ONLY. */ #include @@ -25,5 +23,3 @@ #include "HAL_Linux_Class.h" #endif // CONFIG_HAL_BOARD -#endif //__AP_HAL_LINUX_H__ - diff --git a/libraries/AP_HAL_Linux/AP_HAL_Linux_Namespace.h b/libraries/AP_HAL_Linux/AP_HAL_Linux_Namespace.h index 7c99b706e9..c5c85bcf84 100644 --- a/libraries/AP_HAL_Linux/AP_HAL_Linux_Namespace.h +++ b/libraries/AP_HAL_Linux/AP_HAL_Linux_Namespace.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_NAMESPACE_H__ -#define __AP_HAL_LINUX_NAMESPACE_H__ +#pragma once namespace Linux { class UARTDriver; @@ -57,6 +55,3 @@ namespace Linux { class Flow_PX4; class Perf_Lttng; } - -#endif // __AP_HAL_LINUX_NAMESPACE_H__ - diff --git a/libraries/AP_HAL_Linux/AP_HAL_Linux_Private.h b/libraries/AP_HAL_Linux/AP_HAL_Linux_Private.h index b046841ee7..692522a911 100644 --- a/libraries/AP_HAL_Linux/AP_HAL_Linux_Private.h +++ b/libraries/AP_HAL_Linux/AP_HAL_Linux_Private.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_PRIVATE_H__ -#define __AP_HAL_LINUX_PRIVATE_H__ +#pragma once /* Umbrella header for all private headers of the AP_HAL_Linux module. * Only import this header from inside AP_HAL_Linux @@ -46,5 +44,3 @@ #include "VideoIn.h" #include "OpticalFlow_Onboard.h" #include "Flow_PX4.h" - -#endif // __AP_HAL_LINUX_PRIVATE_H__ diff --git a/libraries/AP_HAL_Linux/AnalogIn.h b/libraries/AP_HAL_Linux/AnalogIn.h index 979d1383e3..36cfdb229b 100644 --- a/libraries/AP_HAL_Linux/AnalogIn.h +++ b/libraries/AP_HAL_Linux/AnalogIn.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_ANALOGIN_H__ -#define __AP_HAL_LINUX_ANALOGIN_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -29,4 +27,3 @@ public: float board_voltage(void) { return 0.0f; } }; -#endif // __AP_HAL_LINUX_ANALOGIN_H__ diff --git a/libraries/AP_HAL_Linux/ConsoleDevice.h b/libraries/AP_HAL_Linux/ConsoleDevice.h index 88c4e3a551..d510e6b990 100644 --- a/libraries/AP_HAL_Linux/ConsoleDevice.h +++ b/libraries/AP_HAL_Linux/ConsoleDevice.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_CONSOLEDEVICE_UDP_H__ -#define __AP_HAL_LINUX_CONSOLEDEVICE_UDP_H__ +#pragma once #include "SerialDevice.h" #include @@ -21,5 +20,3 @@ private: int _wr_fd = -1; bool _closed = true; }; - -#endif diff --git a/libraries/AP_HAL_Linux/GPIO.h b/libraries/AP_HAL_Linux/GPIO.h index 3f8029efce..d21b617fcf 100644 --- a/libraries/AP_HAL_Linux/GPIO.h +++ b/libraries/AP_HAL_Linux/GPIO.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_GPIO_H__ -#define __AP_HAL_LINUX_GPIO_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -32,4 +31,3 @@ private: #endif #endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX -#endif // __AP_HAL_LINUX_GPIO_H__ diff --git a/libraries/AP_HAL_Linux/GPIO_BBB.h b/libraries/AP_HAL_Linux/GPIO_BBB.h index a39bd34b56..90ec8aa260 100644 --- a/libraries/AP_HAL_Linux/GPIO_BBB.h +++ b/libraries/AP_HAL_Linux/GPIO_BBB.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_GPIO_BBB_H__ -#define __AP_HAL_LINUX_GPIO_BBB_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -133,5 +131,3 @@ public: /* return true if USB cable is connected */ bool usb_connected(void); }; - -#endif // __AP_HAL_LINUX_GPIO_BBB_H__ diff --git a/libraries/AP_HAL_Linux/GPIO_RPI.h b/libraries/AP_HAL_Linux/GPIO_RPI.h index 5fc6d397ae..739ee6e86f 100644 --- a/libraries/AP_HAL_Linux/GPIO_RPI.h +++ b/libraries/AP_HAL_Linux/GPIO_RPI.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_GPIO_RPI_H__ -#define __AP_HAL_LINUX_GPIO_RPI_H__ +#pragma once #include #include "AP_HAL_Linux.h" @@ -98,5 +97,3 @@ public: /* return true if USB cable is connected */ bool usb_connected(void); }; - -#endif // __AP_HAL_LINUX_GPIO_RPI_H__ diff --git a/libraries/AP_HAL_Linux/Heat.h b/libraries/AP_HAL_Linux/Heat.h index 0ebce1c5c7..3a99b3226a 100644 --- a/libraries/AP_HAL_Linux/Heat.h +++ b/libraries/AP_HAL_Linux/Heat.h @@ -13,12 +13,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#ifndef __HEAT_H__ -#define __HEAT_H__ +#pragma once class Linux::Heat { public: virtual void set_imu_temp(float current) { } }; -#endif diff --git a/libraries/AP_HAL_Linux/Heat_Pwm.h b/libraries/AP_HAL_Linux/Heat_Pwm.h index 0f72886683..06ce946fc7 100644 --- a/libraries/AP_HAL_Linux/Heat_Pwm.h +++ b/libraries/AP_HAL_Linux/Heat_Pwm.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 __HEAT_PWM_H__ -#define __HEAT_PWM_H__ +#pragma once #include "AP_HAL_Linux.h" #include "PWM_Sysfs.h" @@ -36,4 +34,3 @@ private: float _sum_error; float _target; }; -#endif diff --git a/libraries/AP_HAL_Linux/I2CDriver.h b/libraries/AP_HAL_Linux/I2CDriver.h index b40ee53e5b..53aa908884 100644 --- a/libraries/AP_HAL_Linux/I2CDriver.h +++ b/libraries/AP_HAL_Linux/I2CDriver.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_I2CDRIVER_H__ -#define __AP_HAL_LINUX_I2CDRIVER_H__ +#pragma once #include @@ -56,5 +54,3 @@ private: uint8_t _addr; bool _print_ioctl_error = true; }; - -#endif // __AP_HAL_LINUX_I2CDRIVER_H__ diff --git a/libraries/AP_HAL_Linux/RCInput.h b/libraries/AP_HAL_Linux/RCInput.h index 2ea32483d3..92ce562c11 100644 --- a/libraries/AP_HAL_Linux/RCInput.h +++ b/libraries/AP_HAL_Linux/RCInput.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCINPUT_H__ -#define __AP_HAL_LINUX_RCINPUT_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -77,5 +75,3 @@ public: #include "RCInput_PRU.h" #include "RCInput_ZYNQ.h" - -#endif // __AP_HAL_LINUX_RCINPUT_H__ diff --git a/libraries/AP_HAL_Linux/RCInput_AioPRU.h b/libraries/AP_HAL_Linux/RCInput_AioPRU.h index 285b6264b6..9c684b76b0 100644 --- a/libraries/AP_HAL_Linux/RCInput_AioPRU.h +++ b/libraries/AP_HAL_Linux/RCInput_AioPRU.h @@ -8,10 +8,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . - - -#ifndef __AP_HAL_LINUX_RCINPUT_AIOPRU_H__ -#define __AP_HAL_LINUX_RCINPUT_AIOPRU_H__ +#pragma once /* This class implements RCInput on the BeagleBoneBlack with a PRU @@ -44,5 +41,3 @@ public: }; volatile struct ring_buffer *ring_buffer; }; - -#endif // __AP_HAL_LINUX_RCINPUT_AIOPRU_H__ diff --git a/libraries/AP_HAL_Linux/RCInput_PRU.h b/libraries/AP_HAL_Linux/RCInput_PRU.h index 1634b3f491..b3f98acf9e 100644 --- a/libraries/AP_HAL_Linux/RCInput_PRU.h +++ b/libraries/AP_HAL_Linux/RCInput_PRU.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCINPUT_PRU_H__ -#define __AP_HAL_LINUX_RCINPUT_PRU_H__ +#pragma once /* This class implements RCInput on the BeagleBoneBlack with a PRU @@ -35,5 +33,3 @@ public: // time spent in the low state uint16_t _s0_time; }; - -#endif // __AP_HAL_LINUX_RCINPUT_PRU_H__ diff --git a/libraries/AP_HAL_Linux/RCInput_RPI.h b/libraries/AP_HAL_Linux/RCInput_RPI.h index 4e1e2a2747..0724491ad4 100644 --- a/libraries/AP_HAL_Linux/RCInput_RPI.h +++ b/libraries/AP_HAL_Linux/RCInput_RPI.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_RCINPUT_RPI_H__ -#define __AP_HAL_LINUX_RCINPUT_RPI_H__ +#pragma once #include "AP_HAL_Linux.h" #include "RCInput.h" @@ -130,5 +129,3 @@ private: void deinit() override; }; - -#endif // __AP_HAL_LINUX_RCINPUT_RPI_H__ diff --git a/libraries/AP_HAL_Linux/RCInput_Raspilot.h b/libraries/AP_HAL_Linux/RCInput_Raspilot.h index 90e9f51620..2a1c32b193 100644 --- a/libraries/AP_HAL_Linux/RCInput_Raspilot.h +++ b/libraries/AP_HAL_Linux/RCInput_Raspilot.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCINPUT_RASPILOT_H__ -#define __AP_HAL_LINUX_RCINPUT_RASPILOT_H__ +#pragma once #include "AP_HAL_Linux.h" #include "RCInput.h" @@ -18,5 +16,3 @@ private: void _poll_data(void); }; - -#endif // __AP_HAL_LINUX_RCINPUT_RASPILOT_H__ diff --git a/libraries/AP_HAL_Linux/RCInput_UDP.h b/libraries/AP_HAL_Linux/RCInput_UDP.h index 5a798e9b59..3658f73d95 100644 --- a/libraries/AP_HAL_Linux/RCInput_UDP.h +++ b/libraries/AP_HAL_Linux/RCInput_UDP.h @@ -1,6 +1,4 @@ - -#ifndef _AP_HAL_LINUX_RCINPUT_UDP_H -#define _AP_HAL_LINUX_RCINPUT_UDP_H +#pragma once #include "RCInput.h" #include @@ -21,4 +19,3 @@ private: uint64_t _last_buf_ts; uint16_t _last_buf_seq; }; -#endif // _AP_HAL_LINUX_RCINPUT_UDP_H diff --git a/libraries/AP_HAL_Linux/RCInput_UDP_Protocol.h b/libraries/AP_HAL_Linux/RCInput_UDP_Protocol.h index 0f26968679..1c1c7b3c50 100644 --- a/libraries/AP_HAL_Linux/RCInput_UDP_Protocol.h +++ b/libraries/AP_HAL_Linux/RCInput_UDP_Protocol.h @@ -1,5 +1,4 @@ -#ifndef _RCINPUT_UDP_PROTOCOL_H -#define _RCINPUT_UDP_PROTOCOL_H +#pragma once #define RCINPUT_UDP_NUM_CHANNELS 8 #define RCINPUT_UDP_VERSION 2 @@ -10,5 +9,3 @@ struct __attribute__((packed)) rc_udp_packet { uint16_t sequence; uint16_t pwms[RCINPUT_UDP_NUM_CHANNELS]; }; - -#endif diff --git a/libraries/AP_HAL_Linux/RCInput_ZYNQ.h b/libraries/AP_HAL_Linux/RCInput_ZYNQ.h index a1960a8c5d..ead6e779d0 100644 --- a/libraries/AP_HAL_Linux/RCInput_ZYNQ.h +++ b/libraries/AP_HAL_Linux/RCInput_ZYNQ.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCINPUT_ZYNQ_H__ -#define __AP_HAL_LINUX_RCINPUT_ZYNQ_H__ +#pragma once /* This class implements RCInput on the ZYNQ / ZyboPilot platform with custom @@ -28,5 +26,3 @@ public: // time spent in the low state uint32_t _s0_time; }; - -#endif // __AP_HAL_LINUX_RCINPUT_ZYNQ_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_AioPRU.h b/libraries/AP_HAL_Linux/RCOutput_AioPRU.h index 5b57444856..9e5ff56041 100644 --- a/libraries/AP_HAL_Linux/RCOutput_AioPRU.h +++ b/libraries/AP_HAL_Linux/RCOutput_AioPRU.h @@ -8,10 +8,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . - - -#ifndef __AP_HAL_LINUX_RCOUTPUT_AIOPRU_H__ -#define __AP_HAL_LINUX_RCOUTPUT_AIOPRU_H__ +#pragma once #include "AP_HAL_Linux.h" #define RCOUT_PRUSS_RAM_BASE 0x4a302000 @@ -43,5 +40,3 @@ private: volatile struct pwm *pwm; }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_AIOPRU_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_Bebop.h b/libraries/AP_HAL_Linux/RCOutput_Bebop.h index f5baceeee1..529a1463f9 100644 --- a/libraries/AP_HAL_Linux/RCOutput_Bebop.h +++ b/libraries/AP_HAL_Linux/RCOutput_Bebop.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_RCOUTPUT_BEBOP_H__ -#define __AP_HAL_LINUX_RCOUTPUT_BEBOP_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -108,5 +107,3 @@ private: void _run_rcout(); static void *_control_thread(void *arg); }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_BEBOP_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_PCA9685.h b/libraries/AP_HAL_Linux/RCOutput_PCA9685.h index a2f71c4d80..095f7ad475 100644 --- a/libraries/AP_HAL_Linux/RCOutput_PCA9685.h +++ b/libraries/AP_HAL_Linux/RCOutput_PCA9685.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__ -#define __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -43,5 +41,3 @@ private: int16_t _oe_pin_number; uint16_t _pending_write_mask; }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_PRU.h b/libraries/AP_HAL_Linux/RCOutput_PRU.h index 558375f9a2..83ebde4d3b 100644 --- a/libraries/AP_HAL_Linux/RCOutput_PRU.h +++ b/libraries/AP_HAL_Linux/RCOutput_PRU.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCOUTPUT_PRU_H__ -#define __AP_HAL_LINUX_RCOUTPUT_PRU_H__ +#pragma once #include "AP_HAL_Linux.h" #define RCOUT_PRUSS_SHAREDRAM_BASE 0x4a310000 @@ -39,5 +37,3 @@ private: volatile struct pwm_cmd *sharedMem_cmd; }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_PRU_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_Raspilot.h b/libraries/AP_HAL_Linux/RCOutput_Raspilot.h index 385d67d024..2e843f54ca 100644 --- a/libraries/AP_HAL_Linux/RCOutput_Raspilot.h +++ b/libraries/AP_HAL_Linux/RCOutput_Raspilot.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCOUTPUT_RASPILOT_H__ -#define __AP_HAL_LINUX_RCOUTPUT_RASPILOT_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -25,5 +23,3 @@ private: uint16_t _frequency; uint16_t _period_us[8]; }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_RASPILOT_H__ diff --git a/libraries/AP_HAL_Linux/RCOutput_ZYNQ.h b/libraries/AP_HAL_Linux/RCOutput_ZYNQ.h index e870c8efdb..30a2bfdaf2 100644 --- a/libraries/AP_HAL_Linux/RCOutput_ZYNQ.h +++ b/libraries/AP_HAL_Linux/RCOutput_ZYNQ.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_RCOUTPUT_ZYNQ_H__ -#define __AP_HAL_LINUX_RCOUTPUT_ZYNQ_H__ +#pragma once #include "AP_HAL_Linux.h" #define RCOUT_ZYNQ_PWM_BASE 0x43c00000 //FIXME hardcoding is the devil's work @@ -38,5 +36,3 @@ private: }; volatile struct pwm_cmd *sharedMem_cmd; }; - -#endif // __AP_HAL_LINUX_RCOUTPUT_ZYNQ_H__ diff --git a/libraries/AP_HAL_Linux/RPIOUARTDriver.h b/libraries/AP_HAL_Linux/RPIOUARTDriver.h index 32153531aa..e77969f6d4 100644 --- a/libraries/AP_HAL_Linux/RPIOUARTDriver.h +++ b/libraries/AP_HAL_Linux/RPIOUARTDriver.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_RPIOUARTDRIVER_H__ -#define __AP_HAL_LINUX_RPIOUARTDRIVER_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -37,5 +36,3 @@ private: bool _need_set_baud; uint32_t _baudrate; }; - -#endif //__AP_HAL_LINUX_RPIOUARTDRIVER_H__ diff --git a/libraries/AP_HAL_Linux/SPIUARTDriver.h b/libraries/AP_HAL_Linux/SPIUARTDriver.h index e104c5eacf..551ec30af7 100644 --- a/libraries/AP_HAL_Linux/SPIUARTDriver.h +++ b/libraries/AP_HAL_Linux/SPIUARTDriver.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_SPIUARTDRIVER_H__ -#define __AP_HAL_LINUX_SPIUARTDRIVER_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -28,5 +27,3 @@ private: uint8_t *_buffer; bool _external; }; - -#endif //__AP_HAL_LINUX_SPIUARTDRIVER_H__ diff --git a/libraries/AP_HAL_Linux/Semaphores.h b/libraries/AP_HAL_Linux/Semaphores.h index d8cf71561d..fd82d059f9 100644 --- a/libraries/AP_HAL_Linux/Semaphores.h +++ b/libraries/AP_HAL_Linux/Semaphores.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_SEMAPHORE_H__ -#define __AP_HAL_LINUX_SEMAPHORE_H__ +#pragma once #include @@ -20,5 +18,3 @@ private: pthread_mutex_t _lock; }; #endif // CONFIG_HAL_BOARD - -#endif // __AP_HAL_LINUX_SEMAPHORE_H__ diff --git a/libraries/AP_HAL_Linux/SerialDevice.h b/libraries/AP_HAL_Linux/SerialDevice.h index 8e65edcfcd..21e7007725 100644 --- a/libraries/AP_HAL_Linux/SerialDevice.h +++ b/libraries/AP_HAL_Linux/SerialDevice.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_SERIALDEVICE_H__ -#define __AP_HAL_LINUX_SERIALDEVICE_H__ +#pragma once #include #include @@ -15,5 +14,3 @@ public: virtual void set_blocking(bool blocking) = 0; virtual void set_speed(uint32_t speed) = 0; }; - -#endif diff --git a/libraries/AP_HAL_Linux/Storage.h b/libraries/AP_HAL_Linux/Storage.h index 05f19777eb..7a98e31f57 100644 --- a/libraries/AP_HAL_Linux/Storage.h +++ b/libraries/AP_HAL_Linux/Storage.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_STORAGE_H__ -#define __AP_HAL_LINUX_STORAGE_H__ +#pragma once #define LINUX_STORAGE_USE_FRAM 0 @@ -44,6 +43,3 @@ protected: }; #include "Storage_FRAM.h" - -#endif // __AP_HAL_LINUX_STORAGE_H__ - diff --git a/libraries/AP_HAL_Linux/Storage_FRAM.h b/libraries/AP_HAL_Linux/Storage_FRAM.h index 03a517a6d4..133b7211b1 100644 --- a/libraries/AP_HAL_Linux/Storage_FRAM.h +++ b/libraries/AP_HAL_Linux/Storage_FRAM.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_STORAGE_FRAM_H__ -#define __AP_HAL_LINUX_STORAGE_FRAM_H__ +#pragma once #include #include "AP_HAL_Linux_Namespace.h" @@ -37,4 +36,3 @@ private: AP_HAL::SPIDeviceDriver *_spi; AP_HAL::Semaphore *_spi_sem; }; -#endif // __AP_HAL_LINUX_STORAGE_H__ diff --git a/libraries/AP_HAL_Linux/TCPServerDevice.h b/libraries/AP_HAL_Linux/TCPServerDevice.h index e42700abbd..488b45b5bc 100644 --- a/libraries/AP_HAL_Linux/TCPServerDevice.h +++ b/libraries/AP_HAL_Linux/TCPServerDevice.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_TCPCLIENTDEVICE_H__ -#define __AP_HAL_LINUX_TCPCLIENTDEVICE_H__ +#pragma once #include "SerialDevice.h" #include @@ -25,5 +24,3 @@ private: bool _blocking = false; uint32_t _last_bind_warning = 0; }; - -#endif diff --git a/libraries/AP_HAL_Linux/ToneAlarmDriver.h b/libraries/AP_HAL_Linux/ToneAlarmDriver.h index a779426227..757b913761 100644 --- a/libraries/AP_HAL_Linux/ToneAlarmDriver.h +++ b/libraries/AP_HAL_Linux/ToneAlarmDriver.h @@ -1,5 +1,4 @@ -#ifndef __TONE_ALARM_DRIVER_H__ -#define __TONE_ALARM_DRIVER_H__ +#pragma once #include #include "AP_HAL_Linux_Namespace.h" @@ -140,5 +139,3 @@ private: int8_t tune_num; uint8_t tune_pos; }; - -#endif diff --git a/libraries/AP_HAL_Linux/UARTDevice.h b/libraries/AP_HAL_Linux/UARTDevice.h index f6fc4a66af..53f9482e74 100644 --- a/libraries/AP_HAL_Linux/UARTDevice.h +++ b/libraries/AP_HAL_Linux/UARTDevice.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_UARTDEVICE_UDP_H__ -#define __AP_HAL_LINUX_UARTDEVICE_UDP_H__ +#pragma once #include "SerialDevice.h" #include @@ -22,5 +21,3 @@ private: int _fd = -1; const char *_device_path; }; - -#endif diff --git a/libraries/AP_HAL_Linux/UARTDriver.h b/libraries/AP_HAL_Linux/UARTDriver.h index dfce309eab..aeec43a8e3 100644 --- a/libraries/AP_HAL_Linux/UARTDriver.h +++ b/libraries/AP_HAL_Linux/UARTDriver.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_UARTDRIVER_H__ -#define __AP_HAL_LINUX_UARTDRIVER_H__ +#pragma once #include "AP_HAL_Linux.h" @@ -93,5 +91,3 @@ protected: virtual int _read_fd(uint8_t *buf, uint16_t n); }; - -#endif // __AP_HAL_LINUX_UARTDRIVER_H__ diff --git a/libraries/AP_HAL_Linux/UDPDevice.h b/libraries/AP_HAL_Linux/UDPDevice.h index ac6928f26c..dcc7e6f27c 100644 --- a/libraries/AP_HAL_Linux/UDPDevice.h +++ b/libraries/AP_HAL_Linux/UDPDevice.h @@ -1,5 +1,4 @@ -#ifndef __AP_HAL_LINUX_UDPDEVICE_UDP_H__ -#define __AP_HAL_LINUX_UDPDEVICE_UDP_H__ +#pragma once #include "SerialDevice.h" #include @@ -22,5 +21,3 @@ private: bool _bcast; bool _connected = false; }; - -#endif diff --git a/libraries/AP_HAL_Linux/Util.h b/libraries/AP_HAL_Linux/Util.h index ae0f6a83c5..07ef4937b9 100644 --- a/libraries/AP_HAL_Linux/Util.h +++ b/libraries/AP_HAL_Linux/Util.h @@ -1,6 +1,4 @@ - -#ifndef __AP_HAL_LINUX_UTIL_H__ -#define __AP_HAL_LINUX_UTIL_H__ +#pragma once #include #include @@ -84,7 +82,3 @@ private: const char* custom_terrain_directory = NULL; static const char *_hw_names[UTIL_NUM_HARDWARES]; }; - - - -#endif // __AP_HAL_LINUX_UTIL_H__