瀏覽代碼

Change include guards in tmk_core/ and drivers/ to pragma once (#11240)

Ryan 4 年之前
父節點
當前提交
1d1d5da43f
共有 60 個文件被更改,包括 96 次插入258 次删除
  1. 2 4
      drivers/avr/hd44780.h
  2. 1 4
      drivers/avr/i2c_master.h
  3. 1 4
      drivers/avr/i2c_slave.h
  4. 1 4
      drivers/avr/ssd1306.h
  5. 2 4
      tmk_core/common/action.h
  6. 2 4
      tmk_core/common/action_code.h
  7. 2 4
      tmk_core/common/action_layer.h
  8. 3 4
      tmk_core/common/action_macro.h
  9. 2 4
      tmk_core/common/action_tapping.h
  10. 2 4
      tmk_core/common/action_util.h
  11. 1 4
      tmk_core/common/arm_atsam/printf.h
  12. 1 4
      tmk_core/common/avr/suspend_avr.h
  13. 1 4
      tmk_core/common/avr/timer_avr.h
  14. 1 4
      tmk_core/common/avr/xprintf.h
  15. 1 4
      tmk_core/common/bootloader.h
  16. 1 4
      tmk_core/common/bootmagic.h
  17. 1 4
      tmk_core/common/chibios/eeprom_stm32.h
  18. 1 4
      tmk_core/common/chibios/flash_stm32.h
  19. 1 4
      tmk_core/common/debug.h
  20. 1 4
      tmk_core/common/eeconfig.h
  21. 1 4
      tmk_core/common/eeprom.h
  22. 1 4
      tmk_core/common/host_driver.h
  23. 1 4
      tmk_core/common/keyboard.h
  24. 2 3
      tmk_core/common/keycode.h
  25. 1 4
      tmk_core/common/magic.h
  26. 2 4
      tmk_core/common/matrix.h
  27. 1 3
      tmk_core/common/mousekey.h
  28. 1 4
      tmk_core/common/nodebug.h
  29. 1 4
      tmk_core/common/print.h
  30. 1 4
      tmk_core/common/raw_hid.h
  31. 1 4
      tmk_core/common/sendchar.h
  32. 1 4
      tmk_core/common/sleep_led.h
  33. 1 4
      tmk_core/common/suspend.h
  34. 1 4
      tmk_core/common/timer.h
  35. 1 4
      tmk_core/common/uart.h
  36. 1 4
      tmk_core/common/util.h
  37. 1 4
      tmk_core/common/virtser.h
  38. 1 4
      tmk_core/common/wait.h
  39. 1 4
      tmk_core/protocol/adb.h
  40. 20 23
      tmk_core/protocol/chibios/usb_driver.h
  41. 1 4
      tmk_core/protocol/chibios/usb_main.h
  42. 2 4
      tmk_core/protocol/ibm4704.h
  43. 1 4
      tmk_core/protocol/lufa/lufa.h
  44. 1 4
      tmk_core/protocol/m0110.h
  45. 1 3
      tmk_core/protocol/midi/Config/LUFAConfig.h
  46. 1 4
      tmk_core/protocol/midi/bytequeue/bytequeue.h
  47. 1 4
      tmk_core/protocol/midi/bytequeue/interrupt_setting.h
  48. 1 4
      tmk_core/protocol/midi/midi.h
  49. 1 4
      tmk_core/protocol/midi/midi_device.h
  50. 1 4
      tmk_core/protocol/midi/midi_function_types.h
  51. 1 4
      tmk_core/protocol/midi/sysex_tools.h
  52. 2 4
      tmk_core/protocol/news.h
  53. 4 7
      tmk_core/protocol/next_kbd.h
  54. 1 4
      tmk_core/protocol/ps2.h
  55. 1 4
      tmk_core/protocol/ps2_io.h
  56. 1 4
      tmk_core/protocol/ps2_mouse.h
  57. 1 4
      tmk_core/protocol/serial_mouse.h
  58. 2 3
      tmk_core/protocol/usb_descriptor.h
  59. 1 4
      tmk_core/protocol/xt.h
  60. 2 4
      tmk_core/ring_buffer.h

+ 2 - 4
drivers/avr/hd44780.h

@@ -1,5 +1,3 @@
-#ifndef LCD_H
-#define LCD_H
 /*************************************************************************
  Title	:   C include file for the HD44780U LCD library (lcd.c)
  Author:    Peter Fleury <pfleury@gmx.ch>  http://tinyurl.com/peterfleury
@@ -43,6 +41,8 @@
 
 */
 
+#pragma once
+
 #include <inttypes.h>
 #include <avr/pgmspace.h>
 
@@ -346,5 +346,3 @@ extern void lcd_data(uint8_t data);
 #define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
 
 /**@}*/
-
-#endif  // LCD_H

+ 1 - 4
drivers/avr/i2c_master.h

@@ -17,8 +17,7 @@
  * GitHub repository: https://github.com/g4lvanix/I2C-master-lib
  */
 
-#ifndef I2C_MASTER_H
-#define I2C_MASTER_H
+#pragma once
 
 #define I2C_READ 0x01
 #define I2C_WRITE 0x00
@@ -42,5 +41,3 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
 i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
 i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
 void         i2c_stop(void);
-
-#endif  // I2C_MASTER_H

+ 1 - 4
drivers/avr/i2c_slave.h

@@ -20,8 +20,7 @@
        Read or write to the necessary buffer according to the opperation.
  */
 
-#ifndef I2C_SLAVE_H
-#define I2C_SLAVE_H
+#pragma once
 
 #define I2C_SLAVE_REG_COUNT 30
 
@@ -29,5 +28,3 @@ extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
 
 void i2c_slave_init(uint8_t address);
 void i2c_slave_stop(void);
-
-#endif  // I2C_SLAVE_H

+ 1 - 4
drivers/avr/ssd1306.h

@@ -1,5 +1,4 @@
-#ifndef SSD1306_H
-#define SSD1306_H
+#pragma once
 
 #include <stdbool.h>
 #include <stdio.h>
@@ -86,5 +85,3 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
 void matrix_write(struct CharacterMatrix *matrix, const char *data);
 void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
 void matrix_render(struct CharacterMatrix *matrix);
-
-#endif

+ 2 - 4
tmk_core/common/action.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_H
-#define ACTION_H
+
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -124,5 +124,3 @@ void debug_action(action_t action);
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* ACTION_H */

+ 2 - 4
tmk_core/common/action_code.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_CODE_H
-#define ACTION_CODE_H
+
+#pragma once
 
 /** \brief Action codes
  *
@@ -306,5 +306,3 @@ enum swap_hands_param_tap_op {
 #define ACTION_SWAP_HANDS_OFF_ON() ACTION(ACT_SWAP_HANDS, OP_SH_OFF_ON)
 #define ACTION_SWAP_HANDS_ON() ACTION(ACT_SWAP_HANDS, OP_SH_ON)
 #define ACTION_SWAP_HANDS_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_OFF)
-
-#endif /* ACTION_CODE_H */

+ 2 - 4
tmk_core/common/action_layer.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_LAYER_H
-#define ACTION_LAYER_H
+
+#pragma once
 
 #include <stdint.h>
 #include "keyboard.h"
@@ -120,5 +120,3 @@ uint8_t layer_switch_get_layer(keypos_t key);
 
 /* return action depending on current layer status */
 action_t layer_switch_get_action(keypos_t key);
-
-#endif

+ 3 - 4
tmk_core/common/action_macro.h

@@ -14,8 +14,9 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_MACRO_H
-#define ACTION_MACRO_H
+
+#pragma once
+
 #include <stdint.h>
 #include "progmem.h"
 
@@ -120,5 +121,3 @@ enum macro_command_id {
 /* for backward comaptibility */
 #define MD(key) DOWN(KC_##key)
 #define MU(key) UP(KC_##key)
-
-#endif /* ACTION_MACRO_H */

+ 2 - 4
tmk_core/common/action_tapping.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_TAPPING_H
-#define ACTION_TAPPING_H
+
+#pragma once
 
 /* period of tapping(ms) */
 #ifndef TAPPING_TERM
@@ -36,5 +36,3 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
 uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record);
 void     action_tapping_process(keyrecord_t record);
 #endif
-
-#endif

+ 2 - 4
tmk_core/common/action_util.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef ACTION_UTIL_H
-#define ACTION_UTIL_H
+
+#pragma once
 
 #include <stdint.h>
 #include "report.h"
@@ -98,5 +98,3 @@ void clear_oneshot_swaphands(void);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/arm_atsam/printf.h

@@ -1,10 +1,7 @@
-#ifndef _PRINTF_H_
-#define _PRINTF_H_
+#pragma once
 
 #define CONSOLE_PRINTBUF_SIZE 512
 
 void console_printf(char *fmt, ...);
 
 #define __xprintf console_printf
-
-#endif  //_PRINTF_H_

+ 1 - 4
tmk_core/common/avr/suspend_avr.h

@@ -1,5 +1,4 @@
-#ifndef SUSPEND_AVR_H
-#define SUSPEND_AVR_H
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -24,5 +23,3 @@ __asm__ __volatile__ (                      \
     : "r0"  \
 )
 // clang-format on
-
-#endif

+ 1 - 4
tmk_core/common/avr/timer_avr.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef TIMER_AVR_H
-#define TIMER_AVR_H 1
+#pragma once
 
 #include <stdint.h>
 
@@ -38,5 +37,3 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #if (TIMER_RAW_TOP > 255)
 #    error "Timer0 can't count 1ms at this clock freq. Use larger prescaler."
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/avr/xprintf.h

@@ -2,8 +2,7 @@
    Extended itoa, puts and printf                    (C)ChaN, 2011
 -----------------------------------------------------------------------------*/
 
-#ifndef XPRINTF_H
-#define XPRINTF_H
+#pragma once
 
 #include <inttypes.h>
 #include <avr/pgmspace.h>
@@ -102,5 +101,3 @@ char xatoi(char **str, long *ret);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/bootloader.h

@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef BOOTLOADER_H
-#define BOOTLOADER_H
+#pragma once
 
 /* give code for your bootloader to come up if needed */
 void bootloader_jump(void);
-
-#endif

+ 1 - 4
tmk_core/common/bootmagic.h

@@ -1,5 +1,4 @@
-#ifndef BOOTMAGIC_H
-#define BOOTMAGIC_H
+#pragma once
 
 /* FIXME: Add special doxygen comments for defines here. */
 
@@ -101,5 +100,3 @@
 
 void bootmagic(void);
 bool bootmagic_scan_keycode(uint8_t keycode);
-
-#endif

+ 1 - 4
tmk_core/common/chibios/eeprom_stm32.h

@@ -21,8 +21,7 @@
  * This library also assumes that the pages are not used by the firmware.
  */
 
-#ifndef __EEPROM_H
-#define __EEPROM_H
+#pragma once
 
 #include <ch.h>
 #include <hal.h>
@@ -83,5 +82,3 @@ uint16_t EEPROM_Init(void);
 void     EEPROM_Erase(void);
 uint16_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte);
 uint8_t  EEPROM_ReadDataByte(uint16_t Address);
-
-#endif /* __EEPROM_H */

+ 1 - 4
tmk_core/common/chibios/flash_stm32.h

@@ -16,8 +16,7 @@
  * Modifications for QMK and STM32F303 by Yiancar
  */
 
-#ifndef __FLASH_STM32_H
-#define __FLASH_STM32_H
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -41,5 +40,3 @@ void FLASH_ClearFlag(uint32_t FLASH_FLAG);
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* __FLASH_STM32_H */

+ 1 - 4
tmk_core/common/debug.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef DEBUG_H
-#define DEBUG_H 1
+#pragma once
 
 #include <stdbool.h>
 #include "print.h"
@@ -168,5 +167,3 @@ extern debug_config_t debug_config;
 #    define debug_bin_reverse(data)
 
 #endif /* NO_DEBUG */
-
-#endif

+ 1 - 4
tmk_core/common/eeconfig.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef EECONFIG_H
-#define EECONFIG_H
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -111,5 +110,3 @@ void     eeconfig_update_haptic(uint32_t val);
 
 bool eeconfig_read_handedness(void);
 void eeconfig_update_handedness(bool val);
-
-#endif

+ 1 - 4
tmk_core/common/eeprom.h

@@ -1,5 +1,4 @@
-#ifndef TMK_CORE_COMMON_EEPROM_H_
-#define TMK_CORE_COMMON_EEPROM_H_
+#pragma once
 
 #if defined(__AVR__) && !defined(EEPROM_DRIVER)
 #    include <avr/eeprom.h>
@@ -20,5 +19,3 @@ void     eeprom_update_word(uint16_t *__p, uint16_t __value);
 void     eeprom_update_dword(uint32_t *__p, uint32_t __value);
 void     eeprom_update_block(const void *__src, void *__dst, size_t __n);
 #endif
-
-#endif /* TMK_CORE_COMMON_EEPROM_H_ */

+ 1 - 4
tmk_core/common/host_driver.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef HOST_DRIVER_H
-#define HOST_DRIVER_H
+#pragma once
 
 #include <stdint.h>
 #include "report.h"
@@ -31,5 +30,3 @@ typedef struct {
     void (*send_system)(uint16_t);
     void (*send_consumer)(uint16_t);
 } host_driver_t;
-
-#endif

+ 1 - 4
tmk_core/common/keyboard.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef KEYBOARD_H
-#define KEYBOARD_H
+#pragma once
 
 #include <stdbool.h>
 #include <stdint.h>
@@ -77,5 +76,3 @@ void housekeeping_task_user(void);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 2 - 3
tmk_core/common/keycode.h

@@ -21,8 +21,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * See https://web.archive.org/web/20060218214400/http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
  * or http://www.usb.org/developers/hidpage/Hut1_12v2.pdf (older)
  */
-#ifndef KEYCODE_H
-#define KEYCODE_H
+
+#pragma once
 
 /* FIXME: Add doxygen comments here */
 
@@ -542,4 +542,3 @@ enum mouse_keys {
     KC_MS_ACCEL1,
     KC_MS_ACCEL2
 };
-#endif

+ 1 - 4
tmk_core/common/magic.h

@@ -1,6 +1,3 @@
-#ifndef MAGIC_H
-#define MAGIC_H
+#pragma once
 
 void magic(void);
-
-#endif

+ 2 - 4
tmk_core/common/matrix.h

@@ -14,8 +14,8 @@ 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 <http://www.gnu.org/licenses/>.
 */
-#ifndef MATRIX_H
-#define MATRIX_H
+
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -76,5 +76,3 @@ void matrix_scan_user(void);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 3
tmk_core/common/mousekey.h

@@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef MOUSEKEY_H
-#    define MOUSEKEY_H
-#endif
+#pragma once
 
 #include <stdbool.h>
 #include "host.h"

+ 1 - 4
tmk_core/common/nodebug.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef NODEBUG_H
-#define NODEBUG_H
+#pragma once
 
 #ifndef NO_DEBUG
 #    define NO_DEBUG
@@ -25,5 +24,3 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #else
 #    include "debug.h"
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/print.h

@@ -22,8 +22,7 @@
  * THE SOFTWARE.
  */
 
-#ifndef PRINT_H__
-#define PRINT_H__ 1
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -269,5 +268,3 @@ extern "C"
 #define pbin16(data) print_bin16(data)
 #define pbin_reverse(data) print_bin_reverse8(data)
 #define pbin_reverse16(data) print_bin_reverse16(data)
-
-#endif

+ 1 - 4
tmk_core/common/raw_hid.h

@@ -1,8 +1,5 @@
-#ifndef _RAW_HID_H_
-#define _RAW_HID_H_
+#pragma once
 
 void raw_hid_receive(uint8_t *data, uint8_t length);
 
 void raw_hid_send(uint8_t *data, uint8_t length);
-
-#endif

+ 1 - 4
tmk_core/common/sendchar.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef SENDCHAR_H
-#define SENDCHAR_H
+#pragma once
 
 #include <stdint.h>
 
@@ -30,5 +29,3 @@ int8_t sendchar(uint8_t c);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/sleep_led.h

@@ -1,5 +1,4 @@
-#ifndef SLEEP_LED_H
-#define SLEEP_LED_H
+#pragma once
 
 #ifdef SLEEP_LED_ENABLE
 
@@ -16,5 +15,3 @@ void sleep_led_toggle(void);
 #    define sleep_led_toggle()
 
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/suspend.h

@@ -1,5 +1,4 @@
-#ifndef SUSPEND_H
-#define SUSPEND_H
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -13,5 +12,3 @@ void suspend_wakeup_init_user(void);
 void suspend_wakeup_init_kb(void);
 void suspend_power_down_user(void);
 void suspend_power_down_kb(void);
-
-#endif

+ 1 - 4
tmk_core/common/timer.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef TIMER_H
-#define TIMER_H 1
+#pragma once
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -51,5 +50,3 @@ uint32_t timer_elapsed32(uint32_t last);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/uart.h

@@ -1,5 +1,4 @@
-#ifndef _uart_included_h_
-#define _uart_included_h_
+#pragma once
 
 #include <stdint.h>
 
@@ -7,5 +6,3 @@ void    uart_init(uint32_t baud);
 void    uart_putchar(uint8_t c);
 uint8_t uart_getchar(void);
 uint8_t uart_available(void);
-
-#endif

+ 1 - 4
tmk_core/common/util.h

@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef UTIL_H
-#define UTIL_H
+#pragma once
 
 #include <stdint.h>
 
@@ -46,5 +45,3 @@ uint32_t bitrev32(uint32_t bits);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
tmk_core/common/virtser.h

@@ -1,10 +1,7 @@
-#ifndef _VIRTSER_H_
-#define _VIRTSER_H_
+#pragma once
 
 /* Define this function in your code to process incoming bytes */
 void virtser_recv(const uint8_t ch);
 
 /* Call this to send a character over the Virtual Serial Device */
 void virtser_send(const uint8_t byte);
-
-#endif

+ 1 - 4
tmk_core/common/wait.h

@@ -1,5 +1,4 @@
-#ifndef WAIT_H
-#define WAIT_H
+#pragma once
 
 #include <inttypes.h>
 
@@ -41,5 +40,3 @@ void wait_ms(uint32_t ms);
 #ifdef __cplusplus
 }
 #endif
-
-#endif

+ 1 - 4
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 <stdint.h>
 #include <stdbool.h>
@@ -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

+ 20 - 23
tmk_core/protocol/chibios/usb_driver.h

@@ -22,10 +22,9 @@
  * @{
  */
 
-#ifndef USB_DRIVER_H
-#    define USB_DRIVER_H
+#pragma once
 
-#    include <hal_usb_cdc.h>
+#include <hal_usb_cdc.h>
 
 /*===========================================================================*/
 /* 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
 
 /** @} */

+ 1 - 4
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_ */

+ 2 - 4
tmk_core/protocol/ibm4704.h

@@ -1,8 +1,8 @@
 /*
 Copyright 2014 Jun WAKO <wakojun@gmail.com>
 */
-#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

+ 1 - 4
tmk_core/protocol/lufa/lufa.h

@@ -36,8 +36,7 @@
   this software.
 */
 
-#ifndef _LUFA_H_
-#define _LUFA_H_
+#pragma once
 
 #include <avr/io.h>
 #include <avr/wdt.h>
@@ -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

+ 1 - 4
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

+ 1 - 3
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

+ 1 - 4
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 <http://www.gnu.org/licenses/>.
 
-#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

+ 1 - 4
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 <http://www.gnu.org/licenses/>.
 
-#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

+ 1 - 4
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

+ 1 - 4
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

+ 1 - 4
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

+ 1 - 4
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 <http://www.gnu.org/licenses/>.
 
-#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

+ 2 - 4
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

+ 4 - 7
tmk_core/protocol/next_kbd.h

@@ -45,13 +45,12 @@ POSSIBILITY OF SUCH DAMAGE.
 
 */
 
-#include <stdbool.h>
+#pragma once
 
-#ifndef NEXT_KBD_H
-#    define NEXT_KBD_H
+#include <stdbool.h>
 
-#    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

+ 1 - 4
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 <stdbool.h>
 #include "wait.h"
@@ -138,5 +137,3 @@ static inline void inhibit(void) {
     clock_lo();
     data_hi();
 }
-
-#endif

+ 1 - 4
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

+ 1 - 4
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 <http://www.gnu.org/licenses/>.
 */
 
-#ifndef PS2_MOUSE_H
-#define PS2_MOUSE_H
+#pragma once
 
 #include <stdbool.h>
 #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

+ 1 - 4
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 <http://www.gnu.org/licenses/>.
 */
 
-#ifndef SERIAL_MOUSE_H
-#define SERIAL_MOUSE_H
+#pragma once
 
 #include <stdint.h>
 
@@ -28,5 +27,3 @@ static inline uint8_t serial_mouse_init(void) {
 }
 
 void serial_mouse_task(void);
-
-#endif

+ 2 - 3
tmk_core/protocol/usb_descriptor.h

@@ -40,8 +40,8 @@
  *
  *  Header file for Descriptors.c.
  */
-#ifndef _DESCRIPTORS_H_
-#define _DESCRIPTORS_H_
+
+#pragma once
 
 #include <LUFA/Drivers/USB/USB.h>
 
@@ -286,4 +286,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

+ 1 - 4
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

+ 2 - 4
tmk_core/ring_buffer.h

@@ -1,5 +1,5 @@
-#ifndef RING_BUFFER_H
-#define RING_BUFFER_H
+#pragma once
+
 /*--------------------------------------------------------------------
  * Ring buffer to store scan codes from keyboard
  *------------------------------------------------------------------*/
@@ -43,5 +43,3 @@ static inline bool rbuf_has_data(void) {
 static inline void rbuf_clear(void) {
     ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { rbuf_head = rbuf_tail = 0; }
 }
-
-#endif /* RING_BUFFER_H */