From 1b29ea6dde54b76a31ba19b2da818ccc61b849b3 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Fri, 20 Dec 2024 23:06:42 +0100 Subject: [PATCH] pragma once --- src/kb/kb.h | 5 +---- src/keyboards/example/kbdef.h | 5 +---- src/keyboards/eyooso-z11/kbdef.h | 5 +---- src/keyboards/nuphy-air60/kbdef.h | 5 +---- src/platform/bb_spi.h | 5 +---- src/platform/bk3632/rf_controller.h | 5 +---- src/platform/sh68f90a/clock.h | 5 +---- src/platform/sh68f90a/delay.h | 5 +---- src/platform/sh68f90a/isp.h | 5 +---- src/platform/sh68f90a/ldo.h | 5 +---- src/platform/sh68f90a/pwm.h | 5 +---- src/platform/sh68f90a/sh68f90a.h | 5 +---- src/platform/sh68f90a/uart.h | 5 +---- src/platform/sh68f90a/usb.h | 5 +---- src/platform/sh68f90a/usbregs.h | 5 +---- src/platform/sh68f90a/watchdog.h | 5 +---- src/smk/debug.h | 5 +---- src/smk/host.h | 5 +---- src/smk/keyboard.h | 5 +---- src/smk/keycodes.h | 5 +---- src/smk/layout.h | 5 +---- src/smk/matrix.h | 5 +---- src/smk/report.h | 5 +---- src/smk/usbdef.h | 5 +---- src/smk/usbhidreport.h | 5 +---- src/smk/utils.h | 5 +---- src/user/indicators.h | 5 +---- src/user/user_init.h | 5 +---- src/user/user_layout.h | 5 +---- src/user/user_matrix.h | 5 +---- 30 files changed, 30 insertions(+), 120 deletions(-) diff --git a/src/kb/kb.h b/src/kb/kb.h index 86aa26a..099c028 100644 --- a/src/kb/kb.h +++ b/src/kb/kb.h @@ -1,5 +1,4 @@ -#ifndef KB_H -#define KB_H +#pragma once #include "report.h" #include @@ -10,5 +9,3 @@ void kb_send_report(report_keyboard_t *report); bool kb_process_record(uint16_t keycode, bool key_pressed); void kb_update_switches(); void kb_update(); - -#endif diff --git a/src/keyboards/example/kbdef.h b/src/keyboards/example/kbdef.h index c5632aa..167a7a9 100644 --- a/src/keyboards/example/kbdef.h +++ b/src/keyboards/example/kbdef.h @@ -1,5 +1,4 @@ -#ifndef KBDEF_H -#define KBDEF_H +#pragma once #include "sh68f90a.h" @@ -19,5 +18,3 @@ // Column Pins #define KB_C0 P5_0 #define KB_C1 P5_1 - -#endif diff --git a/src/keyboards/eyooso-z11/kbdef.h b/src/keyboards/eyooso-z11/kbdef.h index c1b7717..5ac4275 100644 --- a/src/keyboards/eyooso-z11/kbdef.h +++ b/src/keyboards/eyooso-z11/kbdef.h @@ -1,5 +1,4 @@ -#ifndef KBDEF_H -#define KBDEF_H +#pragma once #include "sh68f90a.h" @@ -87,5 +86,3 @@ // KC_CAPS LED Pin Bit #define LED_CAPS_P0_3 _P0_3 - -#endif diff --git a/src/keyboards/nuphy-air60/kbdef.h b/src/keyboards/nuphy-air60/kbdef.h index 7f8032c..870ae90 100644 --- a/src/keyboards/nuphy-air60/kbdef.h +++ b/src/keyboards/nuphy-air60/kbdef.h @@ -1,5 +1,4 @@ -#ifndef KBDEF_H -#define KBDEF_H +#pragma once #include "sh68f90a.h" #include "keycodes.h" @@ -143,5 +142,3 @@ enum custom_keycodes { KB_SAFE_RANGE, }; - -#endif diff --git a/src/platform/bb_spi.h b/src/platform/bb_spi.h index b02a4cb..b5ac3e4 100644 --- a/src/platform/bb_spi.h +++ b/src/platform/bb_spi.h @@ -1,8 +1,5 @@ -#ifndef BB_SPI_H -#define BB_SPI_H +#pragma once #include void bb_spi_xfer(uint8_t *data, int len); - -#endif diff --git a/src/platform/bk3632/rf_controller.h b/src/platform/bk3632/rf_controller.h index 0f454a7..ee4255d 100644 --- a/src/platform/bk3632/rf_controller.h +++ b/src/platform/bk3632/rf_controller.h @@ -1,5 +1,4 @@ -#ifndef RF_CONTROLLER_H -#define RF_CONTROLLER_H +#pragma once #include "report.h" #include "keyboard.h" @@ -7,5 +6,3 @@ void rf_init(); void rf_send_report(report_keyboard_t *report); void rf_update_keyboard_state(keyboard_state_t *keyboard); - -#endif diff --git a/src/platform/sh68f90a/clock.h b/src/platform/sh68f90a/clock.h index 683ee81..042301b 100644 --- a/src/platform/sh68f90a/clock.h +++ b/src/platform/sh68f90a/clock.h @@ -1,6 +1,3 @@ -#ifndef CLOCK_H -#define CLOCK_H +#pragma once void clock_init(); - -#endif diff --git a/src/platform/sh68f90a/delay.h b/src/platform/sh68f90a/delay.h index f1b0fed..23a322e 100644 --- a/src/platform/sh68f90a/delay.h +++ b/src/platform/sh68f90a/delay.h @@ -1,9 +1,6 @@ -#ifndef DELAY_H -#define DELAY_H +#pragma once #include void delay_ms(uint16_t cnt); void delay_us(uint16_t cnt); - -#endif diff --git a/src/platform/sh68f90a/isp.h b/src/platform/sh68f90a/isp.h index 1a8c910..a06fccb 100644 --- a/src/platform/sh68f90a/isp.h +++ b/src/platform/sh68f90a/isp.h @@ -1,6 +1,3 @@ -#ifndef ISP_H -#define ISP_H +#pragma once void isp_jump(); - -#endif diff --git a/src/platform/sh68f90a/ldo.h b/src/platform/sh68f90a/ldo.h index bb5058d..8094b2c 100644 --- a/src/platform/sh68f90a/ldo.h +++ b/src/platform/sh68f90a/ldo.h @@ -1,6 +1,3 @@ -#ifndef LDO_H -#define LDO_H +#pragma once void ldo_init(); - -#endif diff --git a/src/platform/sh68f90a/pwm.h b/src/platform/sh68f90a/pwm.h index 2f228e5..86f7c75 100644 --- a/src/platform/sh68f90a/pwm.h +++ b/src/platform/sh68f90a/pwm.h @@ -1,5 +1,4 @@ -#ifndef PWM_H -#define PWM_H +#pragma once #include "sh68f90a.h" #include @@ -22,5 +21,3 @@ } while (0) void pwm_interrupt_handler() __interrupt(_INT_PWM0); - -#endif diff --git a/src/platform/sh68f90a/sh68f90a.h b/src/platform/sh68f90a/sh68f90a.h index 16f0d69..b00ba11 100644 --- a/src/platform/sh68f90a/sh68f90a.h +++ b/src/platform/sh68f90a/sh68f90a.h @@ -1,5 +1,4 @@ -#ifndef SH68F90A_H -#define SH68F90A_H +#pragma once #include #include @@ -803,5 +802,3 @@ enum interrupt_index { _INT_PWM4 = 12, _INT_EUART0 = 13, }; - -#endif diff --git a/src/platform/sh68f90a/uart.h b/src/platform/sh68f90a/uart.h index 1a985fb..ccd8087 100644 --- a/src/platform/sh68f90a/uart.h +++ b/src/platform/sh68f90a/uart.h @@ -1,5 +1,4 @@ -#ifndef UART_H -#define UART_H +#pragma once #include "sh68f90a.h" @@ -7,5 +6,3 @@ void uart_init(); void uart_putc(unsigned char c); unsigned char uart_getc(); void uart_interrupt_handler() __interrupt(_INT_EUART0); - -#endif diff --git a/src/platform/sh68f90a/usb.h b/src/platform/sh68f90a/usb.h index faef226..249fef9 100644 --- a/src/platform/sh68f90a/usb.h +++ b/src/platform/sh68f90a/usb.h @@ -1,5 +1,4 @@ -#ifndef USB_H -#define USB_H +#pragma once #include "sh68f90a.h" #include "report.h" @@ -9,5 +8,3 @@ void usb_init(); void usb_send_report(report_keyboard_t *report); void usb_interrupt_handler() __interrupt(_INT_USB); - -#endif diff --git a/src/platform/sh68f90a/usbregs.h b/src/platform/sh68f90a/usbregs.h index d239d09..3e2d89d 100644 --- a/src/platform/sh68f90a/usbregs.h +++ b/src/platform/sh68f90a/usbregs.h @@ -1,5 +1,4 @@ -#ifndef USBREGS_H -#define USBREGS_H +#pragma once /** * Indicate an error in response to a EP0 transfer. @@ -117,5 +116,3 @@ CLEAR_EP2_CNT; \ IEP2CNT |= COUNT; \ } while (0) - -#endif diff --git a/src/platform/sh68f90a/watchdog.h b/src/platform/sh68f90a/watchdog.h index ffac045..04c6134 100644 --- a/src/platform/sh68f90a/watchdog.h +++ b/src/platform/sh68f90a/watchdog.h @@ -1,5 +1,4 @@ -#ifndef WATCHDOG_H -#define WATCHDOG_H +#pragma once #include "sh68f90a.h" @@ -9,5 +8,3 @@ # define CLR_WDT() (RSTSTAT = WDT_INIT) #endif - -#endif diff --git a/src/smk/debug.h b/src/smk/debug.h index dd4bbe4..351abba 100644 --- a/src/smk/debug.h +++ b/src/smk/debug.h @@ -1,5 +1,4 @@ -#ifndef DEBUG_H -#define DEBUG_H +#pragma once #include @@ -7,5 +6,3 @@ do { \ if (DEBUG) printf(__VA_ARGS__); \ } while (0) - -#endif diff --git a/src/smk/host.h b/src/smk/host.h index acac60d..be45319 100644 --- a/src/smk/host.h +++ b/src/smk/host.h @@ -1,9 +1,6 @@ -#ifndef HOST_H -#define HOST_H +#pragma once #include #include "report.h" void host_keyboard_send(report_keyboard_t *report); - -#endif diff --git a/src/smk/keyboard.h b/src/smk/keyboard.h index 2abec0a..43ec16c 100644 --- a/src/smk/keyboard.h +++ b/src/smk/keyboard.h @@ -1,5 +1,4 @@ -#ifndef KEYBOARD_H -#define KEYBOARD_H +#pragma once #include @@ -10,5 +9,3 @@ typedef struct { extern volatile __xdata keyboard_state_t keyboard_state; void keyboard_init(); - -#endif diff --git a/src/smk/keycodes.h b/src/smk/keycodes.h index 574b238..50221ed 100644 --- a/src/smk/keycodes.h +++ b/src/smk/keycodes.h @@ -1,5 +1,4 @@ -#ifndef KEYCODES_H -#define KEYCODES_H +#pragma once // clang-format off @@ -1442,5 +1441,3 @@ enum keycode_aliases { #define MODS_SHIFT_MASK (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) // clang-format on - -#endif diff --git a/src/smk/layout.h b/src/smk/layout.h index 6d31a52..7114520 100644 --- a/src/smk/layout.h +++ b/src/smk/layout.h @@ -1,9 +1,6 @@ -#ifndef LAYOUT_H -#define LAYOUT_H +#pragma once #include "kbdef.h" #include extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; - -#endif diff --git a/src/smk/matrix.h b/src/smk/matrix.h index 868e885..c3c7a69 100644 --- a/src/smk/matrix.h +++ b/src/smk/matrix.h @@ -1,10 +1,7 @@ -#ifndef MATRIX_H -#define MATRIX_H +#pragma once #include void matrix_init(); uint8_t matrix_task(); void matrix_scan_step(); - -#endif diff --git a/src/smk/report.h b/src/smk/report.h index 644481e..6a00abc 100644 --- a/src/smk/report.h +++ b/src/smk/report.h @@ -1,5 +1,4 @@ -#ifndef REPORT_H -#define REPORT_H +#pragma once #include #include @@ -62,5 +61,3 @@ void add_mods(uint8_t mods); void del_mods(uint8_t mods); void set_mods(uint8_t mods); void clear_mods(void); - -#endif diff --git a/src/smk/usbdef.h b/src/smk/usbdef.h index 32962f6..9a30884 100644 --- a/src/smk/usbdef.h +++ b/src/smk/usbdef.h @@ -1,5 +1,4 @@ -#ifndef USBDEF_H -#define USBDEF_H +#pragma once #include @@ -307,5 +306,3 @@ typedef enum { USB_DEVICE_STATE_CONFIGURED = 2, USB_DEVICE_STATE_SUSPENDED = 3, } usb_device_state_t; - -#endif diff --git a/src/smk/usbhidreport.h b/src/smk/usbhidreport.h index 7029d6e..b6dc281 100644 --- a/src/smk/usbhidreport.h +++ b/src/smk/usbhidreport.h @@ -43,8 +43,7 @@ * @{ */ -#ifndef USBHIDREPORT_H -#define USBHIDREPORT_H +#pragma once // clang-format off @@ -145,5 +144,3 @@ // clang-format on /** @} */ - -#endif diff --git a/src/smk/utils.h b/src/smk/utils.h index 8175209..ef40c00 100644 --- a/src/smk/utils.h +++ b/src/smk/utils.h @@ -1,5 +1,4 @@ -#ifndef UTILS_H -#define UTILS_H +#pragma once // clang-format off @@ -25,5 +24,3 @@ #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) - -#endif diff --git a/src/user/indicators.h b/src/user/indicators.h index 475a46d..d59bbc0 100644 --- a/src/user/indicators.h +++ b/src/user/indicators.h @@ -1,5 +1,4 @@ -#ifndef INDICATORS_H -#define INDICATORS_H +#pragma once #include "keyboard.h" #include @@ -9,5 +8,3 @@ void indicators_start(); void indicators_pre_update(); bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step); void indicators_post_update(); - -#endif diff --git a/src/user/user_init.h b/src/user/user_init.h index 0a5f07e..5f3bd15 100644 --- a/src/user/user_init.h +++ b/src/user/user_init.h @@ -1,8 +1,5 @@ -#ifndef USER_INIT_H -#define USER_INIT_H +#pragma once #include void user_init(); - -#endif diff --git a/src/user/user_layout.h b/src/user/user_layout.h index 0b3f477..a64d1bc 100644 --- a/src/user/user_layout.h +++ b/src/user/user_layout.h @@ -1,5 +1,4 @@ -#ifndef USER_LAYOUT_H -#define USER_LAYOUT_H +#pragma once #include "keycodes.h" #include @@ -9,5 +8,3 @@ returns a boolean value to instruct whether further key process should continue or end here */ bool layout_process_record(uint16_t keycode, bool key_pressed); - -#endif diff --git a/src/user/user_matrix.h b/src/user/user_matrix.h index 04280f3..25b25d5 100644 --- a/src/user/user_matrix.h +++ b/src/user/user_matrix.h @@ -1,10 +1,7 @@ -#ifndef USER_MATRIX_H -#define USER_MATRIX_H +#pragma once #include void user_matrix_pre_scan(uint8_t col); uint8_t user_matrix_scan_col(uint8_t col); void user_matrix_post_scan(); - -#endif