From 008e3c9810c066445c06ebcab0717ec2af452e1e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 17 Feb 2016 23:25:42 -0200 Subject: [PATCH] AP_OpticalFlow: replace header guard with pragma once --- libraries/AP_OpticalFlow/AP_OpticalFlow_HIL.h | 7 +------ libraries/AP_OpticalFlow/AP_OpticalFlow_Linux.h | 6 +----- libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.h | 6 +----- libraries/AP_OpticalFlow/OpticalFlow.h | 5 +---- libraries/AP_OpticalFlow/OpticalFlow_backend.h | 6 +----- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_HIL.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_HIL.h index 14ae83205a..1a58dd516b 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_HIL.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_HIL.h @@ -1,7 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- - -#ifndef AP_OpticalFlow_HIL_H -#define AP_OpticalFlow_HIL_H +#pragma once #include "OpticalFlow.h" @@ -17,6 +15,3 @@ public: // update - read latest values from sensor and fill in x,y and totals. void update(void); }; - -#endif // AP_OpticalFlow_HIL_H - diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_Linux.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_Linux.h index bdd862ee6b..fd9f561686 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_Linux.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_Linux.h @@ -4,9 +4,7 @@ * Portions of this driver were borrowed from the PX4Firmware px4flow driver which can be found here: * https://github.com/PX4/Firmware/blob/master/src/drivers/px4flow/px4flow.cpp */ - -#ifndef AP_OpticalFlow_Linux_H -#define AP_OpticalFlow_Linux_H +#pragma once #include "OpticalFlow.h" @@ -82,5 +80,3 @@ private: uint16_t num_errors = 0; uint32_t last_read_ms = 0; }; - -#endif diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.h index 68304b0c0f..2f50a2c20c 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.h @@ -1,7 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- - -#ifndef AP_OpticalFlow_PX4_H -#define AP_OpticalFlow_PX4_H +#pragma once #include "OpticalFlow.h" @@ -21,5 +19,3 @@ private: int _fd; // file descriptor for sensor uint64_t _last_timestamp; // time of last update (used to avoid processing old reports) }; - -#endif diff --git a/libraries/AP_OpticalFlow/OpticalFlow.h b/libraries/AP_OpticalFlow/OpticalFlow.h index dd00aa3c27..b36dbc2cb2 100644 --- a/libraries/AP_OpticalFlow/OpticalFlow.h +++ b/libraries/AP_OpticalFlow/OpticalFlow.h @@ -1,5 +1,3 @@ -#ifndef __OpticalFlow_H__ -#define __OpticalFlow_H__ /* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#pragma once /* * OpticalFlow.h - OpticalFlow Base Class for Ardupilot @@ -98,5 +97,3 @@ private: #include "AP_OpticalFlow_HIL.h" #include "AP_OpticalFlow_PX4.h" #include "AP_OpticalFlow_Linux.h" - -#endif diff --git a/libraries/AP_OpticalFlow/OpticalFlow_backend.h b/libraries/AP_OpticalFlow/OpticalFlow_backend.h index fadd6636f5..5d8d661ee3 100644 --- a/libraries/AP_OpticalFlow/OpticalFlow_backend.h +++ b/libraries/AP_OpticalFlow/OpticalFlow_backend.h @@ -1,5 +1,3 @@ -#ifndef __OpticalFlow_backend_H__ -#define __OpticalFlow_backend_H__ /* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#pragma once /* OpticalFlow backend class for ArduPilot @@ -48,6 +47,3 @@ protected: // get the yaw angle in radians float _yawAngleRad(void) const { return radians(float(frontend._yawAngle_cd) * 0.01f); } }; - -#endif // __OpticalFlow_backend_H__ -