From 60fd4d61efcce3cda09ef2273f77bce49c1db456 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 26 Dec 2020 15:56:11 +1100 Subject: Change include guards in tmk_core/ and drivers/ to pragma once (#11240) --- tmk_core/protocol/adb.h | 5 +-- tmk_core/protocol/chibios/usb_driver.h | 43 ++++++++++------------ tmk_core/protocol/chibios/usb_main.h | 5 +-- tmk_core/protocol/ibm4704.h | 6 +-- tmk_core/protocol/lufa/lufa.h | 5 +-- tmk_core/protocol/m0110.h | 5 +-- tmk_core/protocol/midi/Config/LUFAConfig.h | 4 +- tmk_core/protocol/midi/bytequeue/bytequeue.h | 5 +-- .../protocol/midi/bytequeue/interrupt_setting.h | 5 +-- tmk_core/protocol/midi/midi.h | 5 +-- tmk_core/protocol/midi/midi_device.h | 5 +-- tmk_core/protocol/midi/midi_function_types.h | 5 +-- tmk_core/protocol/midi/sysex_tools.h | 5 +-- tmk_core/protocol/news.h | 6 +-- tmk_core/protocol/next_kbd.h | 11 ++---- tmk_core/protocol/ps2.h | 5 +-- tmk_core/protocol/ps2_io.h | 5 +-- tmk_core/protocol/ps2_mouse.h | 5 +-- tmk_core/protocol/serial_mouse.h | 5 +-- tmk_core/protocol/usb_descriptor.h | 5 +-- tmk_core/protocol/xt.h | 5 +-- 21 files changed, 46 insertions(+), 104 deletions(-) (limited to 'tmk_core/protocol') diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h index 7d37485fcd..34cbcf7691 100644 --- a/tmk_core/protocol/adb.h +++ b/tmk_core/protocol/adb.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ADB_H -#define ADB_H +#pragma once #include #include @@ -57,5 +56,3 @@ void adb_host_listen(uint8_t cmd, uint8_t data_h, uint8_t data_l); void adb_host_kbd_led(uint8_t led); void adb_mouse_task(void); void adb_mouse_init(void); - -#endif diff --git a/tmk_core/protocol/chibios/usb_driver.h b/tmk_core/protocol/chibios/usb_driver.h index 6d71bcec4f..f94387debd 100644 --- a/tmk_core/protocol/chibios/usb_driver.h +++ b/tmk_core/protocol/chibios/usb_driver.h @@ -22,10 +22,9 @@ * @{ */ -#ifndef USB_DRIVER_H -# define USB_DRIVER_H +#pragma once -# include +#include /*===========================================================================*/ /* Driver constants. */ @@ -35,9 +34,9 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -# if HAL_USE_USB == FALSE -# error "The USB Driver requires HAL_USE_USB" -# endif +#if HAL_USE_USB == FALSE +# error "The USB Driver requires HAL_USE_USB" +#endif /*===========================================================================*/ /* Driver data structures and types. */ @@ -112,21 +111,21 @@ typedef struct { /** * @brief @p SerialDriver specific data. */ -# define _qmk_usb_driver_data \ - _base_asynchronous_channel_data /* Driver state.*/ \ - qmkusbstate_t state; \ - /* Input buffers queue.*/ \ - input_buffers_queue_t ibqueue; \ - /* Output queue.*/ \ - output_buffers_queue_t obqueue; \ - /* End of the mandatory fields.*/ \ - /* Current configuration data.*/ \ - const QMKUSBConfig *config; +#define _qmk_usb_driver_data \ + _base_asynchronous_channel_data /* Driver state.*/ \ + qmkusbstate_t state; \ + /* Input buffers queue.*/ \ + input_buffers_queue_t ibqueue; \ + /* Output queue.*/ \ + output_buffers_queue_t obqueue; \ + /* End of the mandatory fields.*/ \ + /* Current configuration data.*/ \ + const QMKUSBConfig *config; /** * @brief @p SerialUSBDriver specific methods. */ -# define _qmk_usb_driver_methods _base_asynchronous_channel_methods +#define _qmk_usb_driver_methods _base_asynchronous_channel_methods /** * @extends BaseAsynchronousChannelVMT @@ -158,9 +157,9 @@ struct QMKUSBDriver { /* External declarations. */ /*===========================================================================*/ -# ifdef __cplusplus +#ifdef __cplusplus extern "C" { -# endif +#endif void qmkusbInit(void); void qmkusbObjectInit(QMKUSBDriver *qmkusbp, const QMKUSBConfig *config); void qmkusbStart(QMKUSBDriver *qmkusbp, const QMKUSBConfig *config); @@ -173,10 +172,8 @@ void qmkusbSOFHookI(QMKUSBDriver *qmkusbp); void qmkusbDataTransmitted(USBDriver *usbp, usbep_t ep); void qmkusbDataReceived(USBDriver *usbp, usbep_t ep); void qmkusbInterruptTransmitted(USBDriver *usbp, usbep_t ep); -# ifdef __cplusplus +#ifdef __cplusplus } -# endif - -#endif /* USB_DRIVER_H */ +#endif /** @} */ diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 1381d07654..eaa08d8f79 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -15,8 +15,7 @@ * GPL v2 or later. */ -#ifndef _USB_MAIN_H_ -#define _USB_MAIN_H_ +#pragma once // TESTING // extern uint8_t blinkLed; @@ -89,5 +88,3 @@ int8_t sendchar(uint8_t c); void console_flush_output(void); #endif /* CONSOLE_ENABLE */ - -#endif /* _USB_MAIN_H_ */ diff --git a/tmk_core/protocol/ibm4704.h b/tmk_core/protocol/ibm4704.h index cc2418ee68..4f88d148b3 100644 --- a/tmk_core/protocol/ibm4704.h +++ b/tmk_core/protocol/ibm4704.h @@ -1,8 +1,8 @@ /* Copyright 2014 Jun WAKO */ -#ifndef IBM4704_H -#define IBM4704_H + +#pragma once #define IBM4704_ERR_NONE 0 #define IBM4704_ERR_PARITY 0x70 @@ -101,5 +101,3 @@ static inline void inhibit(void) { clock_hi(); data_lo(); } - -#endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 71fd7aad85..348a84c031 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -36,8 +36,7 @@ this software. */ -#ifndef _LUFA_H_ -#define _LUFA_H_ +#pragma once #include #include @@ -68,5 +67,3 @@ extern host_driver_t lufa_driver; // The header and terminator are not stored to save a few bytes of precious ram # define MIDI_SYSEX_BUFFER (API_SYSEX_MAX_SIZE + API_SYSEX_MAX_SIZE / 7 + (API_SYSEX_MAX_SIZE % 7 ? 1 : 0)) #endif - -#endif diff --git a/tmk_core/protocol/m0110.h b/tmk_core/protocol/m0110.h index 3f9686b0d9..63ff3e90ec 100644 --- a/tmk_core/protocol/m0110.h +++ b/tmk_core/protocol/m0110.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef M0110_H -#define M0110_H +#pragma once /* port settings for clock and data line */ #if !(defined(M0110_CLOCK_PORT) && defined(M0110_CLOCK_PIN) && defined(M0110_CLOCK_DDR) && defined(M0110_CLOCK_BIT)) @@ -80,5 +79,3 @@ uint8_t m0110_recv(void); uint8_t m0110_recv_key(void); uint8_t m0110_inquiry(void); uint8_t m0110_instant(void); - -#endif diff --git a/tmk_core/protocol/midi/Config/LUFAConfig.h b/tmk_core/protocol/midi/Config/LUFAConfig.h index b346c05bdd..dead96de78 100644 --- a/tmk_core/protocol/midi/Config/LUFAConfig.h +++ b/tmk_core/protocol/midi/Config/LUFAConfig.h @@ -39,8 +39,7 @@ * manual section "Summary of Compile Tokens". */ -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ +#pragma once #if (ARCH == ARCH_AVR8) @@ -90,4 +89,3 @@ # error Unsupported architecture for this LUFA configuration file. #endif -#endif diff --git a/tmk_core/protocol/midi/bytequeue/bytequeue.h b/tmk_core/protocol/midi/bytequeue/bytequeue.h index 33fb63a8cb..29d15abbd3 100644 --- a/tmk_core/protocol/midi/bytequeue/bytequeue.h +++ b/tmk_core/protocol/midi/bytequeue/bytequeue.h @@ -17,8 +17,7 @@ // You should have received a copy of the GNU General Public License // along with avr-bytequeue. If not, see . -#ifndef BYTEQUEUE_H -#define BYTEQUEUE_H +#pragma once #ifdef __cplusplus extern "C" { @@ -54,5 +53,3 @@ void bytequeue_remove(byteQueue_t* queue, byteQueueIndex_t numToRemove); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.h b/tmk_core/protocol/midi/bytequeue/interrupt_setting.h index 788f75d79f..78294f0765 100644 --- a/tmk_core/protocol/midi/bytequeue/interrupt_setting.h +++ b/tmk_core/protocol/midi/bytequeue/interrupt_setting.h @@ -16,8 +16,7 @@ // You should have received a copy of the GNU General Public License // along with avr-bytequeue. If not, see . -#ifndef INTERRUPT_SETTING_H -#define INTERRUPT_SETTING_H +#pragma once #ifdef __cplusplus extern "C" { @@ -34,5 +33,3 @@ void restore_interrupt_setting(interrupt_setting_t setting); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi.h b/tmk_core/protocol/midi/midi.h index 07d8cebc10..75f3b13b0b 100644 --- a/tmk_core/protocol/midi/midi.h +++ b/tmk_core/protocol/midi/midi.h @@ -25,8 +25,7 @@ * */ -#ifndef XNOR_MIDI_H -#define XNOR_MIDI_H +#pragma once #ifdef __cplusplus extern "C" { @@ -486,5 +485,3 @@ midi_packet_length_t midi_packet_length(uint8_t status); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi_device.h b/tmk_core/protocol/midi/midi_device.h index 693d81a8e2..79e8f7a936 100644 --- a/tmk_core/protocol/midi/midi_device.h +++ b/tmk_core/protocol/midi/midi_device.h @@ -21,8 +21,7 @@ * @brief Device implementation functions */ -#ifndef MIDI_DEVICE_H -#define MIDI_DEVICE_H +#pragma once #ifdef __cplusplus extern "C" { @@ -147,5 +146,3 @@ void midi_device_set_pre_input_process_func(MidiDevice* device, midi_no_byte_fun #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi_function_types.h b/tmk_core/protocol/midi/midi_function_types.h index 761e881178..6f98a72981 100644 --- a/tmk_core/protocol/midi/midi_function_types.h +++ b/tmk_core/protocol/midi/midi_function_types.h @@ -21,8 +21,7 @@ * @brief Function signature definitions */ -#ifndef MIDI_FUNCTION_TYPES_H -#define MIDI_FUNCTION_TYPES_H +#pragma once #ifdef __cplusplus extern "C" { @@ -46,5 +45,3 @@ typedef void (*midi_sysex_func_t)(MidiDevice *device, uint16_t start_byte, uint8 #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/sysex_tools.h b/tmk_core/protocol/midi/sysex_tools.h index 454a92ea58..7d7f10d24e 100644 --- a/tmk_core/protocol/midi/sysex_tools.h +++ b/tmk_core/protocol/midi/sysex_tools.h @@ -16,8 +16,7 @@ // You should have received a copy of the GNU General Public License // along with avr-midi. If not, see . -#ifndef SYSEX_TOOLS_H -#define SYSEX_TOOLS_H +#pragma once #ifdef __cplusplus extern "C" { @@ -91,5 +90,3 @@ uint16_t sysex_decode(uint8_t *decoded, const uint8_t *source, uint16_t length); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/news.h b/tmk_core/protocol/news.h index d0c4bc6a4d..327a13856d 100644 --- a/tmk_core/protocol/news.h +++ b/tmk_core/protocol/news.h @@ -35,8 +35,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef NEWS_H -#define NEWS_H +#pragma once + /* * Primitive PS/2 Library for AVR */ @@ -46,5 +46,3 @@ void news_init(void); uint8_t news_recv(void); /* device role */ - -#endif diff --git a/tmk_core/protocol/next_kbd.h b/tmk_core/protocol/next_kbd.h index bff7a474d3..1249ebf392 100644 --- a/tmk_core/protocol/next_kbd.h +++ b/tmk_core/protocol/next_kbd.h @@ -45,13 +45,12 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include +#pragma once -#ifndef NEXT_KBD_H -# define NEXT_KBD_H +#include -# define NEXT_KBD_KMBUS_IDLE 0x300600 -# define NEXT_KBD_TIMING 50 +#define NEXT_KBD_KMBUS_IDLE 0x300600 +#define NEXT_KBD_TIMING 50 extern uint8_t next_kbd_error; @@ -59,5 +58,3 @@ extern uint8_t next_kbd_error; void next_kbd_init(void); void next_kbd_set_leds(bool left, bool right); uint32_t next_kbd_recv(void); - -#endif diff --git a/tmk_core/protocol/ps2.h b/tmk_core/protocol/ps2.h index e32cc9603f..f123192852 100644 --- a/tmk_core/protocol/ps2.h +++ b/tmk_core/protocol/ps2.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PS2_H -#define PS2_H +#pragma once #include #include "wait.h" @@ -138,5 +137,3 @@ static inline void inhibit(void) { clock_lo(); data_hi(); } - -#endif diff --git a/tmk_core/protocol/ps2_io.h b/tmk_core/protocol/ps2_io.h index 35e26561d4..de93cb7a39 100644 --- a/tmk_core/protocol/ps2_io.h +++ b/tmk_core/protocol/ps2_io.h @@ -1,5 +1,4 @@ -#ifndef PS2_IO_H -#define PS2_IO_H +#pragma once void clock_init(void); void clock_lo(void); @@ -10,5 +9,3 @@ void data_init(void); void data_lo(void); void data_hi(void); bool data_in(void); - -#endif diff --git a/tmk_core/protocol/ps2_mouse.h b/tmk_core/protocol/ps2_mouse.h index d743fb3d85..c97c6c893a 100644 --- a/tmk_core/protocol/ps2_mouse.h +++ b/tmk_core/protocol/ps2_mouse.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 PS2_MOUSE_H -#define PS2_MOUSE_H +#pragma once #include #include "debug.h" @@ -176,5 +175,3 @@ void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution); void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate); void ps2_mouse_moved_user(report_mouse_t *mouse_report); - -#endif diff --git a/tmk_core/protocol/serial_mouse.h b/tmk_core/protocol/serial_mouse.h index b10315f366..cb83cf4f62 100644 --- a/tmk_core/protocol/serial_mouse.h +++ b/tmk_core/protocol/serial_mouse.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 SERIAL_MOUSE_H -#define SERIAL_MOUSE_H +#pragma once #include @@ -28,5 +27,3 @@ static inline uint8_t serial_mouse_init(void) { } void serial_mouse_task(void); - -#endif diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 5a223ead8a..e208ce0398 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -40,8 +40,8 @@ * * Header file for Descriptors.c. */ -#ifndef _DESCRIPTORS_H_ -#define _DESCRIPTORS_H_ + +#pragma once #include @@ -307,4 +307,3 @@ enum usb_endpoints { #define JOYSTICK_EPSIZE 8 uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress); -#endif diff --git a/tmk_core/protocol/xt.h b/tmk_core/protocol/xt.h index e7e1a13f4d..6dc5f19d00 100644 --- a/tmk_core/protocol/xt.h +++ b/tmk_core/protocol/xt.h @@ -36,8 +36,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef XT_H -#define XT_H +#pragma once #define XT_DATA_IN() \ do { \ @@ -69,5 +68,3 @@ POSSIBILITY OF SUCH DAMAGE. void xt_host_init(void); uint8_t xt_host_recv(void); - -#endif -- cgit v1.2.3