Browse Source

AP_HAL: replace header guard with pragma once

master
Lucas De Marchi 9 years ago
parent
commit
dbf2aedf1e
  1. 6
      libraries/AP_HAL/AP_HAL_Boards.h
  2. 5
      libraries/AP_HAL/AP_HAL_Macros.h
  3. 5
      libraries/AP_HAL/AP_HAL_Main.h
  4. 6
      libraries/AP_HAL/AP_HAL_Namespace.h
  5. 7
      libraries/AP_HAL/AnalogIn.h
  6. 6
      libraries/AP_HAL/GPIO.h
  7. 7
      libraries/AP_HAL/HAL.h
  8. 7
      libraries/AP_HAL/I2CDriver.h
  9. 7
      libraries/AP_HAL/RCInput.h
  10. 7
      libraries/AP_HAL/RCOutput.h
  11. 7
      libraries/AP_HAL/Scheduler.h
  12. 6
      libraries/AP_HAL/Semaphores.h
  13. 7
      libraries/AP_HAL/Storage.h
  14. 7
      libraries/AP_HAL/UARTDriver.h
  15. 7
      libraries/AP_HAL/Util.h
  16. 7
      libraries/AP_HAL/utility/BetterStream.h
  17. 7
      libraries/AP_HAL/utility/Print.h
  18. 5
      libraries/AP_HAL/utility/Socket.h
  19. 7
      libraries/AP_HAL/utility/Stream.h
  20. 6
      libraries/AP_HAL/utility/ftoa_engine.h
  21. 5
      libraries/AP_HAL/utility/getopt_cpp.h
  22. 6
      libraries/AP_HAL/utility/xtoa_fast.h

6
libraries/AP_HAL/AP_HAL_Boards.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_BOARDS_H__
#define __AP_HAL_BOARDS_H__
#pragma once
/**
* C preprocesor enumeration of the boards supported by the AP_HAL.
@ -463,5 +461,3 @@ @@ -463,5 +461,3 @@
#ifndef HAL_PARAM_DEFAULTS_PATH
#define HAL_PARAM_DEFAULTS_PATH NULL
#endif
#endif // __AP_HAL_BOARDS_H__

5
libraries/AP_HAL/AP_HAL_Macros.h

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
#ifndef __AP_HAL_MACROS_H__
#define __AP_HAL_MACROS_H__
#pragma once
/*
macros to allow code to build on multiple platforms more easily
@ -18,5 +17,3 @@ @@ -18,5 +17,3 @@
#endif
#define NORETURN __attribute__ ((noreturn))
#endif // __AP_HAL_MACROS_H__

5
libraries/AP_HAL/AP_HAL_Main.h

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
#ifndef __AP_HAL_MAIN_H__
#define __AP_HAL_MAIN_H__
#pragma once
#include "HAL.h"
@ -56,5 +55,3 @@ @@ -56,5 +55,3 @@
}
#endif
#endif // __AP_HAL_MAIN_H__

6
libraries/AP_HAL/AP_HAL_Namespace.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_NAMESPACE_H__
#define __AP_HAL_NAMESPACE_H__
#pragma once
#include "string.h"
#include "utility/functor.h"
@ -70,5 +68,3 @@ namespace AP_HAL { @@ -70,5 +68,3 @@ namespace AP_HAL {
// Must be implemented by the concrete HALs.
const HAL& get_HAL();
}
#endif // __AP_HAL_NAMESPACE_H__

7
libraries/AP_HAL/AnalogIn.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_ANALOG_IN_H__
#define __AP_HAL_ANALOG_IN_H__
#pragma once
#include <inttypes.h>
@ -56,6 +54,3 @@ public: @@ -56,6 +54,3 @@ public:
#define ANALOG_INPUT_BOARD_VCC 254
#define ANALOG_INPUT_NONE 255
#endif // __AP_HAL_ANALOG_IN_H__

6
libraries/AP_HAL/GPIO.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_GPIO_H__
#define __AP_HAL_GPIO_H__
#pragma once
#include <stdint.h>
@ -48,5 +46,3 @@ public: @@ -48,5 +46,3 @@ public:
/* return true if USB cable is connected */
virtual bool usb_connected(void) = 0;
};
#endif // __AP_HAL_GPIO_H__

7
libraries/AP_HAL/HAL.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_HAL_H__
#define __AP_HAL_HAL_H__
#pragma once
#include "AP_HAL_Namespace.h"
@ -97,6 +95,3 @@ public: @@ -97,6 +95,3 @@ public:
AP_HAL::Util *util;
AP_HAL::OpticalFlow *opticalflow;
};
#endif // __AP_HAL_HAL_H__

7
libraries/AP_HAL/I2CDriver.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_I2C_DRIVER_H__
#define __AP_HAL_I2C_DRIVER_H__
#pragma once
#include <stdint.h>
@ -49,6 +47,3 @@ public: @@ -49,6 +47,3 @@ public:
protected:
bool _ignore_errors;
};
#endif // __AP_HAL_I2C_DRIVER_H__

7
libraries/AP_HAL/RCInput.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_RC_INPUT_H__
#define __AP_HAL_RC_INPUT_H__
#pragma once
#include "AP_HAL_Namespace.h"
@ -56,6 +54,3 @@ public: @@ -56,6 +54,3 @@ public:
/* execute receiver bind */
virtual bool rc_bind(int dsmMode) { return false; };
};
#endif // __AP_HAL_RC_INPUT_H__

7
libraries/AP_HAL/RCOutput.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_RC_OUTPUT_H__
#define __AP_HAL_RC_OUTPUT_H__
#pragma once
#include "AP_HAL_Namespace.h"
@ -104,6 +102,3 @@ public: @@ -104,6 +102,3 @@ public:
*/
virtual void set_esc_scaling(uint16_t min_pwm, uint16_t max_pwm) {}
};
#endif // __AP_HAL_RC_OUTPUT_H__

7
libraries/AP_HAL/Scheduler.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_SCHEDULER_H__
#define __AP_HAL_SCHEDULER_H__
#pragma once
#include <stdint.h>
@ -63,6 +61,3 @@ public: @@ -63,6 +61,3 @@ public:
*/
virtual void stop_clock(uint64_t time_usec) {}
};
#endif // __AP_HAL_SCHEDULER_H__

6
libraries/AP_HAL/Semaphores.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_SEMAPHORES_H__
#define __AP_HAL_SEMAPHORES_H__
#pragma once
#include "AP_HAL_Namespace.h"
@ -12,5 +10,3 @@ public: @@ -12,5 +10,3 @@ public:
virtual bool take_nonblocking() WARN_IF_UNUSED = 0;
virtual bool give() = 0;
};
#endif // __AP_HAL_SEMAPHORES_H__

7
libraries/AP_HAL/Storage.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_STORAGE_H__
#define __AP_HAL_STORAGE_H__
#pragma once
#include <stdint.h>
#include "AP_HAL_Namespace.h"
@ -11,6 +9,3 @@ public: @@ -11,6 +9,3 @@ public:
virtual void read_block(void *dst, uint16_t src, size_t n) = 0;
virtual void write_block(uint16_t dst, const void* src, size_t n) = 0;
};
#endif // __AP_HAL_STORAGE_H__

7
libraries/AP_HAL/UARTDriver.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_UART_DRIVER_H__
#define __AP_HAL_UART_DRIVER_H__
#pragma once
#include <stdint.h>
@ -54,6 +52,3 @@ public: @@ -54,6 +52,3 @@ public:
void printf(const char *s, ...) FMT_PRINTF(2, 3);
void vprintf(const char *s, va_list ap);
};
#endif // __AP_HAL_UART_DRIVER_H__

7
libraries/AP_HAL/Util.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_UTIL_H__
#define __AP_HAL_UTIL_H__
#pragma once
#include <stdarg.h>
#include "AP_HAL_Namespace.h"
@ -104,6 +102,3 @@ protected: @@ -104,6 +102,3 @@ protected:
bool soft_armed = false;
uint64_t capabilities = 0;
};
#endif // __AP_HAL_UTIL_H__

7
libraries/AP_HAL/utility/BetterStream.h

@ -17,9 +17,7 @@ @@ -17,9 +17,7 @@
// Copyright (c) 2010 Michael Smith. All rights reserved.
//
//
#ifndef __AP_HAL_UTILITY_BETTERSTREAM_H__
#define __AP_HAL_UTILITY_BETTERSTREAM_H__
#pragma once
#include <stdarg.h>
@ -35,6 +33,3 @@ public: @@ -35,6 +33,3 @@ public:
virtual void printf(const char *, ...) FMT_PRINTF(2, 3) = 0;
virtual void vprintf(const char *, va_list) = 0;
};
#endif // __AP_HAL_UTILITY_BETTERSTREAM_H__

7
libraries/AP_HAL/utility/Print.h

@ -16,9 +16,7 @@ @@ -16,9 +16,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AP_HAL_UTILITY_PRINT_H__
#define __AP_HAL_UTILITY_PRINT_H__
#pragma once
#include <AP_HAL/AP_HAL_Namespace.h>
@ -75,6 +73,3 @@ class AP_HAL::Print { @@ -75,6 +73,3 @@ class AP_HAL::Print {
size_t println(void);
};
#endif // __AP_HAL_UTILITY_PRINT_H__

5
libraries/AP_HAL/utility/Socket.h

@ -15,9 +15,7 @@ @@ -15,9 +15,7 @@
/*
simple socket handling class for systems with BSD socket API
*/
#ifndef HAL_SOCKET_H
#define HAL_SOCKET_H
#pragma once
#include <AP_HAL/AP_HAL.h>
#if HAL_OS_SOCKETS
@ -73,4 +71,3 @@ private: @@ -73,4 +71,3 @@ private:
};
#endif // HAL_OS_SOCKETS
#endif // HAL_SOCKET_H

7
libraries/AP_HAL/utility/Stream.h

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
#ifndef __AP_HAL_UTILITY_STREAM_H__
#define __AP_HAL_UTILITY_STREAM_H__
#pragma once
#include <AP_HAL/AP_HAL_Namespace.h>
#include "Print.h"
@ -20,6 +18,3 @@ public: @@ -20,6 +18,3 @@ public:
virtual int16_t read() = 0;
};
#endif // __AP_HAL_UTILITY_STREAM_H__

6
libraries/AP_HAL/utility/ftoa_engine.h

@ -27,9 +27,7 @@ @@ -27,9 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. */
/* $Id: ftoa_engine.h 1218 2007-02-18 13:18:41Z dmix $ */
#ifndef _FTOA_ENGINE_H
#define _FTOA_ENGINE_H
#pragma once
#include <AP_HAL/AP_HAL.h>
#include <stdint.h>
@ -43,5 +41,3 @@ int16_t ftoa_engine(float val, char *buf, @@ -43,5 +41,3 @@ int16_t ftoa_engine(float val, char *buf,
#define FTOA_INF 4
#define FTOA_NAN 8
#define FTOA_CARRY 16 /* Carry was to master position. */
#endif /* !_FTOA_ENGINE_H */

5
libraries/AP_HAL/utility/getopt_cpp.h

@ -8,8 +8,7 @@ @@ -8,8 +8,7 @@
* Simple conversion to C++ by Andrew Tridgell for ArduPilot. Based on
* getopt_long.h from ccache
*/
#ifndef GETOPT_LONG_H
#define GETOPT_LONG_H
#pragma once
#include <stdbool.h>
@ -45,5 +44,3 @@ private: @@ -45,5 +44,3 @@ private:
const struct option *longopts;
const char *place;
};
#endif /* GETOPT_LONG_H */

6
libraries/AP_HAL/utility/xtoa_fast.h

@ -30,9 +30,7 @@ @@ -30,9 +30,7 @@
POSSIBILITY OF SUCH DAMAGE. */
/* $Id: xtoa_fast.h 1223 2007-02-18 13:33:09Z dmix $ */
#ifndef _XTOA_FAST_H_
#define _XTOA_FAST_H_
#pragma once
/* Internal function for use from `printf'. */
char *ultoa_invert (uint32_t val, char *s, uint8_t base);
@ -41,5 +39,3 @@ char *ulltoa_invert (uint64_t val, char *s, uint8_t base); @@ -41,5 +39,3 @@ char *ulltoa_invert (uint64_t val, char *s, uint8_t base);
/* Next flags are to use with `base'. Unused fields are reserved. */
#define XTOA_PREFIX 0x0100 /* put prefix for octal or hex */
#define XTOA_UPPER 0x0200 /* use upper case letters */
#endif /* _XTOA_FAST_H_ */

Loading…
Cancel
Save