From 3aecdda231c0f154b4d707ff5310a2a9c3c3883d Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Sat, 6 Jul 2019 14:02:47 -0700 Subject: [PATCH] [includes] replace header guards with #pragma once --- include/app.h | 5 +---- include/arch.h | 4 +--- include/arch/ops.h | 4 +--- include/arch/thread.h | 4 +--- include/dev/accelerometer.h | 5 ++--- include/dev/class/block.h | 5 +---- include/dev/class/fb.h | 6 +----- include/dev/class/i2c.h | 4 +--- include/dev/class/netif.h | 5 +---- include/dev/class/spi.h | 5 +---- include/dev/class/uart.h | 5 +---- include/dev/display.h | 4 +--- include/dev/driver.h | 5 +---- include/dev/ethernet.h | 4 +--- include/dev/fbcon.h | 5 +---- include/dev/flash_nor.h | 5 +---- include/dev/gpio.h | 5 +---- include/dev/gpio_i2c.h | 4 +--- include/dev/gpio_keypad.h | 5 +---- include/dev/i2c.h | 5 +---- include/dev/keys.h | 4 +--- include/dev/pci.h | 4 +--- include/dev/uart.h | 5 +---- include/dev/udc.h | 4 +--- include/dev/usb.h | 5 +---- include/dev/usbc.h | 5 +---- include/hw/mii.h | 5 +---- include/hw/usb.h | 6 +----- include/lib/console.h | 4 +--- include/platform.h | 4 +--- include/platform/debug.h | 6 +----- include/platform/interrupts.h | 5 +---- include/platform/timer.h | 5 +---- include/sys/types.h | 4 +--- include/target.h | 4 +--- kernel/include/kernel/debug.h | 6 +----- kernel/include/kernel/event.h | 6 +----- kernel/include/kernel/mutex.h | 5 +---- kernel/include/kernel/novm.h | 5 +---- kernel/include/kernel/port.h | 6 +----- kernel/include/kernel/semaphore.h | 4 +--- kernel/include/kernel/thread.h | 5 +---- kernel/include/kernel/timer.h | 6 +----- kernel/include/kernel/wait.h | 6 +----- lib/buildsig/include/lib/buildsig.h | 5 +---- lib/bytes/include/lib/bytes.h | 5 +---- lib/devicetree/include/lib/devicetree.h | 6 +----- lib/dpc/include/lib/dpc.h | 5 +---- lib/evlog/include/lib/evlog.h | 5 +---- lib/font/font.h | 5 +---- lib/font/include/lib/font.h | 5 +---- lib/fs/ext2/ext2_priv.h | 6 +----- lib/fs/fat32/fat32_priv.h | 6 +----- lib/fs/fat32/fat_fs.h | 5 +---- lib/fs/include/lib/fs/spifs.h | 5 +---- lib/gfx/include/lib/gfx.h | 5 +---- lib/gfxconsole/include/lib/gfxconsole.h | 5 +---- lib/heap/include/lib/page_alloc.h | 5 +---- lib/libc/include/assert.h | 4 +--- lib/libc/include/ctype.h | 5 +---- lib/libc/include/endian.h | 5 +---- lib/libc/include/errno.h | 4 +--- lib/libc/include/inttypes.h | 5 +---- lib/libc/include/iovec.h | 5 +---- lib/libc/include/malloc.h | 5 +---- lib/libc/include/new.h | 4 +--- lib/libc/include/printf.h | 4 +--- lib/libc/include/rand.h | 5 +---- lib/libc/include/stdint.h | 5 +---- lib/libc/include/stdio.h | 5 +---- lib/libc/include/stdlib.h | 5 +---- lib/libc/include/string.h | 4 +--- lib/minip/include/lib/pktbuf.h | 5 +---- lib/norfs/include/lib/norfs.h | 4 +--- lib/norfs/include/lib/norfs_config.h | 4 +--- lib/norfs/include/lib/norfs_inode.h | 4 +--- lib/norfs/test/include/norfs_test_helper.h | 4 +--- lib/partition/include/lib/partition.h | 5 +---- lib/text/include/lib/text.h | 5 +---- lib/tga/include/lib/tga.h | 5 +---- lib/unittest/include/unittest.h | 5 +---- lib/version/include/lib/version.h | 5 +---- lib/watchdog/include/lib/watchdog.h | 6 +----- platform/armemu/include/platform/armemu.h | 5 +---- platform/armemu/include/platform/armemu/memmap.h | 4 +--- platform/armemu/platform_p.h | 5 +---- platform/lpc43xx/udc-common.h | 5 +---- platform/mediatek/common/gic/include/mt_gic.h | 5 +---- platform/mediatek/common/include/sync_write.h | 5 +---- platform/mediatek/mt6735/include/platform/mt_gpt.h | 5 ++--- platform/mediatek/mt6735/include/platform/mt_irq.h | 5 +---- platform/mediatek/mt6735/include/platform/mt_reg_base.h | 4 +--- platform/mediatek/mt6735/include/platform/mt_typedefs.h | 5 +---- platform/mediatek/mt6735/include/platform/mt_uart.h | 4 +--- platform/mediatek/mt6797/include/platform/mt_gpt.h | 5 ++--- platform/mediatek/mt6797/include/platform/mt_irq.h | 4 +--- platform/mediatek/mt6797/include/platform/mt_reg_base.h | 5 +---- platform/mediatek/mt6797/include/platform/mt_typedefs.h | 5 +---- platform/mediatek/mt6797/include/platform/mt_uart.h | 5 +---- platform/nrf51xxx/include/platform/gpio.h | 5 +---- platform/nrf51xxx/include/platform/nrf51.h | 5 +---- platform/nrf51xxx/include/platform/platform_cm.h | 5 +---- platform/nrf52xxx/include/platform/gpio.h | 5 +---- platform/nrf52xxx/include/platform/nrf52.h | 5 +---- platform/nrf52xxx/include/platform/platform_cm.h | 5 +---- platform/pc/include/pcnet.h | 5 +---- platform/pc/include/platform/console.h | 5 +---- platform/pc/include/platform/ide.h | 7 +------ platform/pc/include/platform/multiboot.h | 4 +--- platform/pc/include/platform/pc.h | 5 +---- platform/pc/include/platform/pc/iomap.h | 4 +--- platform/pc/include/platform/pc/memmap.h | 4 +--- platform/pc/include/platform/pcnet.h | 8 +------- platform/pc/include/platform/uart.h | 6 +----- platform/qemu-virt-arm/platform_p.h | 5 +---- platform/stellaris/include/platform/gpio.h | 5 +---- platform/stellaris/include/platform/platform_cm.h | 5 +---- platform/stellaris/include/stellaris.h | 4 +--- platform/stm32f0xx/include/platform/can.h | 4 +--- platform/stm32f0xx/include/platform/dma.h | 4 +--- platform/stm32f0xx/include/platform/exti.h | 4 +--- platform/stm32f0xx/include/platform/gpio.h | 5 +---- platform/stm32f0xx/include/platform/platform_cm.h | 5 +---- platform/stm32f0xx/include/platform/rcc.h | 4 +--- platform/stm32f0xx/include/platform/spi.h | 4 +--- platform/stm32f0xx/include/platform/stm32.h | 5 +---- platform/stm32f0xx/include/platform/timer_capture.h | 5 +---- platform/stm32f0xx/include/platform/usbc.h | 4 +--- platform/stm32f1xx/include/platform/gpio.h | 5 +---- platform/stm32f1xx/include/platform/platform_cm.h | 5 +---- platform/stm32f1xx/include/platform/stm32.h | 5 +---- platform/stm32f2xx/include/platform/gpio.h | 5 +---- platform/stm32f2xx/include/platform/platform_cm.h | 5 +---- platform/stm32f2xx/include/platform/stm32.h | 5 +---- platform/stm32f4xx/include/platform/gpio.h | 5 +---- platform/stm32f4xx/include/platform/platform_cm.h | 5 +---- platform/stm32f4xx/include/platform/stm32.h | 5 +---- platform/stm32f7xx/include/platform/gpio.h | 5 +---- platform/stm32f7xx/include/platform/platform_cm.h | 5 +---- platform/stm32f7xx/include/platform/qspi.h | 5 +---- platform/zynq/include/platform/gic.h | 4 +--- platform/zynq/include/platform/gpio.h | 1 + platform/zynq/platform_p.h | 5 +---- 143 files changed, 146 insertions(+), 544 deletions(-) diff --git a/include/app.h b/include/app.h index 422acd5a..8effc3d2 100644 --- a/include/app.h +++ b/include/app.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __APP_H -#define __APP_H +#pragma once #include #include @@ -40,5 +39,3 @@ struct app_descriptor { __END_CDECLS -#endif - diff --git a/include/arch.h b/include/arch.h index 9c5966c0..953a32f8 100644 --- a/include/arch.h +++ b/include/arch.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ARCH_H -#define __ARCH_H +#pragma once #include #include @@ -24,4 +23,3 @@ __END_CDECLS /* arch specific bits */ #include -#endif diff --git a/include/arch/ops.h b/include/arch/ops.h index b413e5e6..c47cced3 100644 --- a/include/arch/ops.h +++ b/include/arch/ops.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ARCH_OPS_H -#define __ARCH_OPS_H +#pragma once #ifndef ASSEMBLY @@ -57,4 +56,3 @@ __END_CDECLS #include -#endif diff --git a/include/arch/thread.h b/include/arch/thread.h index ca1e3b6f..e3266ee5 100644 --- a/include/arch/thread.h +++ b/include/arch/thread.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ARCH_THREAD_H -#define __ARCH_THREAD_H +#pragma once // give the arch code a chance to declare the arch_thread struct #include @@ -16,4 +15,3 @@ struct thread; void arch_thread_initialize(struct thread *); void arch_context_switch(struct thread *oldthread, struct thread *newthread); -#endif diff --git a/include/dev/accelerometer.h b/include/dev/accelerometer.h index 20bc4406..1b056b2f 100644 --- a/include/dev/accelerometer.h +++ b/include/dev/accelerometer.h @@ -5,8 +5,8 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_ACCELEROMETER_H -#define __DEV_ACCELEROMETER_H +#pragma once + typedef struct { double x; double y; @@ -15,4 +15,3 @@ typedef struct { status_t acc_read_xyz(position_vector_t *pos_vector); -#endif diff --git a/include/dev/class/block.h b/include/dev/class/block.h index 32b6b40c..dba1b534 100644 --- a/include/dev/class/block.h +++ b/include/dev/class/block.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_BLOCK_H -#define __DEV_CLASS_BLOCK_H +#pragma once #include #include @@ -34,5 +33,3 @@ status_t class_block_flush(struct device *dev); __END_CDECLS -#endif - diff --git a/include/dev/class/fb.h b/include/dev/class/fb.h index 285cc346..7dd3b208 100644 --- a/include/dev/class/fb.h +++ b/include/dev/class/fb.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_FB_H -#define __DEV_CLASS_FB_H +#pragma once #include #include @@ -38,6 +37,3 @@ status_t class_fb_update_region(struct device *dev, size_t x, size_t y, size_t w __END_CDECLS -#endif - - diff --git a/include/dev/class/i2c.h b/include/dev/class/i2c.h index c988c7d2..dceddd8f 100644 --- a/include/dev/class/i2c.h +++ b/include/dev/class/i2c.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_I2C_H -#define __DEV_CLASS_I2C_H +#pragma once #include #include @@ -31,4 +30,3 @@ status_t class_i2c_read_reg(struct device *dev, uint8_t addr, uint8_t reg, void __END_CDECLS -#endif diff --git a/include/dev/class/netif.h b/include/dev/class/netif.h index cf5198f6..05f99239 100644 --- a/include/dev/class/netif.h +++ b/include/dev/class/netif.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_NETIF_H -#define __DEV_CLASS_NETIF_H +#pragma once #include #include @@ -47,5 +46,3 @@ status_t class_netstack_wait_for_network(lk_time_t timeout); __END_CDECLS -#endif - diff --git a/include/dev/class/spi.h b/include/dev/class/spi.h index 6cbbe8bc..253cf2fc 100644 --- a/include/dev/class/spi.h +++ b/include/dev/class/spi.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_SPI_H -#define __DEV_CLASS_SPI_H +#pragma once #include #include @@ -40,5 +39,3 @@ ssize_t class_spi_transaction(struct device *dev, struct spi_transaction *txn, s __END_CDECLS -#endif - diff --git a/include/dev/class/uart.h b/include/dev/class/uart.h index aa5e0134..0501be99 100644 --- a/include/dev/class/uart.h +++ b/include/dev/class/uart.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_CLASS_UART_H -#define __DEV_CLASS_UART_H +#pragma once #include @@ -22,5 +21,3 @@ struct uart_ops { ssize_t class_uart_read(struct device *dev, void *buf, size_t len); ssize_t class_uart_write(struct device *dev, const void *buf, size_t len); -#endif - diff --git a/include/dev/display.h b/include/dev/display.h index eb7eb765..783b1f48 100644 --- a/include/dev/display.h +++ b/include/dev/display.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_DISPLAY_H -#define __DEV_DISPLAY_H +#pragma once #include #include @@ -73,4 +72,3 @@ __NONNULL((1)); __END_CDECLS -#endif diff --git a/include/dev/driver.h b/include/dev/driver.h index eeb7693b..5736f0f2 100644 --- a/include/dev/driver.h +++ b/include/dev/driver.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_DRIVER_H -#define __DEV_DRIVER_H +#pragma once #include #include // for containerof @@ -117,5 +116,3 @@ status_t device_resume(struct device *dev); __END_CDECLS -#endif - diff --git a/include/dev/ethernet.h b/include/dev/ethernet.h index 60b2babc..04526f71 100644 --- a/include/dev/ethernet.h +++ b/include/dev/ethernet.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_ETHERNET_H -#define __DEV_ETHERNET_H +#pragma once #include @@ -22,4 +21,3 @@ int ethernet_send(void *data, unsigned length); status_t ethernet_init(void); /* initialize the ethernet device */ -#endif diff --git a/include/dev/fbcon.h b/include/dev/fbcon.h index 809f5efa..29863d33 100644 --- a/include/dev/fbcon.h +++ b/include/dev/fbcon.h @@ -25,9 +25,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - -#ifndef __DEV_FBCON_H -#define __DEV_FBCON_H +#pragma once #define FB_FORMAT_RGB565 0 @@ -46,4 +44,3 @@ struct fbcon_config { void fbcon_setup(struct fbcon_config *cfg); void fbcon_putc(char c); -#endif /* __DEV_FBCON_H */ diff --git a/include/dev/flash_nor.h b/include/dev/flash_nor.h index cea18de3..e1854b50 100644 --- a/include/dev/flash_nor.h +++ b/include/dev/flash_nor.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_FLASH_NOR_H -#define __DEV_FLASH_NOR_H +#pragma once #include @@ -21,5 +20,3 @@ struct flash_nor_bank { const struct flash_nor_bank *flash_nor_get_bank(unsigned int bank); -#endif - diff --git a/include/dev/gpio.h b/include/dev/gpio.h index 0f2c972a..44395830 100644 --- a/include/dev/gpio.h +++ b/include/dev/gpio.h @@ -26,9 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - -#ifndef __DEV_GPIO_H -#define __DEV_GPIO_H +#pragma once enum gpio_flags { GPIO_INPUT = (1 << 0), @@ -50,4 +48,3 @@ int gpio_config(unsigned nr, unsigned flags); void gpio_set(unsigned nr, unsigned on); int gpio_get(unsigned nr); -#endif diff --git a/include/dev/gpio_i2c.h b/include/dev/gpio_i2c.h index 5397f4b3..e2f4a791 100644 --- a/include/dev/gpio_i2c.h +++ b/include/dev/gpio_i2c.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __GPIO_I2C__ -#define __GPIO_I2C__ +#pragma once #include #include @@ -38,4 +37,3 @@ status_t gpio_i2c_receive(int, uint8_t, void *, size_t); status_t gpio_i2c_write_reg_bytes(int, uint8_t, uint8_t, const uint8_t *, size_t); status_t gpio_i2c_read_reg_bytes(int, uint8_t, uint8_t, uint8_t *, size_t); -#endif // __GPIO_I2C__ diff --git a/include/dev/gpio_keypad.h b/include/dev/gpio_keypad.h index c24ebd4f..e61c8bcb 100644 --- a/include/dev/gpio_keypad.h +++ b/include/dev/gpio_keypad.h @@ -28,9 +28,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - -#ifndef __DEV_GPIO_KEYPAD_H -#define __DEV_GPIO_KEYPAD_H +#pragma once #include @@ -53,4 +51,3 @@ struct gpio_keypad_info { void gpio_keypad_init(struct gpio_keypad_info *kpinfo); -#endif /* __DEV_GPIO_KEYPAD_H */ diff --git a/include/dev/i2c.h b/include/dev/i2c.h index 5dcfbd35..8e0310e3 100644 --- a/include/dev/i2c.h +++ b/include/dev/i2c.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_I2C_H -#define __DEV_I2C_H +#pragma once #include @@ -40,5 +39,3 @@ static inline status_t i2c_write_reg(int bus, uint8_t address, uint8_t reg, uint static inline status_t i2c_read_reg(int bus, uint8_t address, uint8_t reg, uint8_t *val) { return i2c_read_reg_bytes(bus, address, reg, val, 1); } -#endif - diff --git a/include/dev/keys.h b/include/dev/keys.h index 165505a2..68ba17c6 100644 --- a/include/dev/keys.h +++ b/include/dev/keys.h @@ -29,8 +29,7 @@ * SUCH DAMAGE. */ -#ifndef __DEV_KEYS_H -#define __DEV_KEYS_H +#pragma once #include @@ -86,4 +85,3 @@ void keys_init(void); void keys_post_event(uint16_t code, int16_t value); int keys_get_state(uint16_t code); -#endif /* __DEV_KEYS_H */ diff --git a/include/dev/pci.h b/include/dev/pci.h index 296f2697..fccf224b 100644 --- a/include/dev/pci.h +++ b/include/dev/pci.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PCI_H -#define __PCI_H +#pragma once #include #include @@ -163,4 +162,3 @@ int pci_write_config_word(const pci_location_t *state, uint32_t reg, uint32_t va int pci_get_irq_routing_options(irq_routing_entry *entries, uint16_t *count, uint16_t *pci_irqs); int pci_set_irq_hw_int(const pci_location_t *state, uint8_t int_pin, uint8_t irq); -#endif diff --git a/include/dev/uart.h b/include/dev/uart.h index c66d6e61..799678b1 100644 --- a/include/dev/uart.h +++ b/include/dev/uart.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_UART_H -#define __DEV_UART_H +#pragma once #include #include @@ -24,5 +23,3 @@ void uart_init_port(int port, uint baud); int uart_pputc(int port, char c); int uart_pgetc(int port); -#endif - diff --git a/include/dev/udc.h b/include/dev/udc.h index 157ac8a7..06c764c9 100644 --- a/include/dev/udc.h +++ b/include/dev/udc.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __DEV_UDC_H -#define __DEV_UDC_H +#pragma once #include @@ -91,4 +90,3 @@ int udc_register_gadget(udc_gadget_t *gadget); int udc_start(void); int udc_stop(void); -#endif diff --git a/include/dev/usb.h b/include/dev/usb.h index 8d567b94..17fd4fcf 100644 --- a/include/dev/usb.h +++ b/include/dev/usb.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_USB_H -#define __DEV_USB_H +#pragma once #include #include @@ -82,5 +81,3 @@ status_t usb_register_callback(usb_callback_t, void *cookie); __END_CDECLS -#endif - diff --git a/include/dev/usbc.h b/include/dev/usbc.h index a5f0a81d..479226d1 100644 --- a/include/dev/usbc.h +++ b/include/dev/usbc.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __DEV_USBC_H -#define __DEV_USBC_H +#pragma once #include #include @@ -73,5 +72,3 @@ static inline void usbc_dump_transfer(const usbc_transfer_t *t) { __END_CDECLS -#endif - diff --git a/include/hw/mii.h b/include/hw/mii.h index ecb1ac7e..673a76f2 100644 --- a/include/hw/mii.h +++ b/include/hw/mii.h @@ -6,8 +6,7 @@ * https://opensource.org/licenses/MIT */ -#ifndef __HW_MII_H -#define __HW_MII_H +#pragma once #define MII_REG_BCR 0x00 #define MII_REG_BSR 0x01 @@ -56,5 +55,3 @@ #define MII_100TX_MODE_ISOLATE 0x001C #define MII_100TX_SQE_TEST 0x0002 #define MII_100TX_NO_SCRAMBLE 0x0001 - -#endif diff --git a/include/hw/usb.h b/include/hw/usb.h index 417a1d04..4a08e023 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __HW_USB_H -#define __HW_USB_H +#pragma once #include #include @@ -86,6 +85,3 @@ struct usb_setup { uint16_t index; uint16_t length; } __PACKED; - -#endif - diff --git a/include/lib/console.h b/include/lib/console.h index 9ee52b3a..39db7102 100644 --- a/include/lib/console.h +++ b/include/lib/console.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_CONSOLE_H -#define __LIB_CONSOLE_H +#pragma once #include #include @@ -91,4 +90,3 @@ void panic_shell_start(void); extern int lastresult; -#endif diff --git a/include/platform.h b/include/platform.h index d7dba217..7d9445a8 100644 --- a/include/platform.h +++ b/include/platform.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_H -#define __PLATFORM_H +#pragma once #include #include @@ -71,4 +70,3 @@ void platform_quiesce(void); __END_CDECLS -#endif diff --git a/include/platform/debug.h b/include/platform/debug.h index a521d2f8..c03f999a 100644 --- a/include/platform/debug.h +++ b/include/platform/debug.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_DEBUG_H -#define __PLATFORM_DEBUG_H +#pragma once #include #include @@ -23,6 +22,3 @@ void platform_pputc(char c); int platform_pgetc(char *c, bool wait); __END_CDECLS - -#endif - diff --git a/include/platform/interrupts.h b/include/platform/interrupts.h index 88988105..5d3c8b1f 100644 --- a/include/platform/interrupts.h +++ b/include/platform/interrupts.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_INTERRUPTS_H -#define __PLATFORM_INTERRUPTS_H +#pragma once #include @@ -16,5 +15,3 @@ status_t unmask_interrupt(unsigned int vector); typedef enum handler_return (*int_handler)(void *arg); void register_int_handler(unsigned int vector, int_handler handler, void *arg); - -#endif diff --git a/include/platform/timer.h b/include/platform/timer.h index 0b504489..7e3d1d46 100644 --- a/include/platform/timer.h +++ b/include/platform/timer.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_TIMER_H -#define __PLATFORM_TIMER_H +#pragma once #include @@ -19,5 +18,3 @@ status_t platform_set_oneshot_timer (platform_timer_callback callback, void *arg void platform_stop_timer(void); #endif -#endif - diff --git a/include/sys/types.h b/include/sys/types.h index 19f0145f..be9302de 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __SYS_TYPES_H -#define __SYS_TYPES_H +#pragma once #include #include @@ -62,4 +61,3 @@ typedef uint16_t u_int16_t; typedef uint32_t u_int32_t; typedef uint64_t u_int64_t; -#endif diff --git a/include/target.h b/include/target.h index e10f02aa..6abe548f 100644 --- a/include/target.h +++ b/include/target.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __TARGET_H -#define __TARGET_H +#pragma once #include #include @@ -33,4 +32,3 @@ void target_set_debug_led(unsigned int led, bool on); __END_CDECLS -#endif diff --git a/kernel/include/kernel/debug.h b/kernel/include/kernel/debug.h index 59313341..335f0827 100644 --- a/kernel/include/kernel/debug.h +++ b/kernel/include/kernel/debug.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_DEBUG_H -#define __KERNEL_DEBUG_H +#pragma once #include @@ -55,6 +54,3 @@ enum { #define KEVLOG_IRQ_EXIT(irqn) kernel_evlog_add(KERNEL_EVLOG_IRQ_EXIT, (uintptr_t)irqn, 0) __END_CDECLS - -#endif - diff --git a/kernel/include/kernel/event.h b/kernel/include/kernel/event.h index 2923ee7d..62c72d20 100644 --- a/kernel/include/kernel/event.h +++ b/kernel/include/kernel/event.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_EVENT_H -#define __KERNEL_EVENT_H +#pragma once #include #include @@ -65,6 +64,3 @@ static inline status_t event_wait(event_t *e) { } __END_CDECLS - -#endif - diff --git a/kernel/include/kernel/mutex.h b/kernel/include/kernel/mutex.h index 46e451e5..0b69e822 100644 --- a/kernel/include/kernel/mutex.h +++ b/kernel/include/kernel/mutex.h @@ -6,8 +6,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_MUTEX_H -#define __KERNEL_MUTEX_H +#pragma once #include #include @@ -53,5 +52,3 @@ static bool is_mutex_held(mutex_t *m) { } __END_CDECLS -#endif - diff --git a/kernel/include/kernel/novm.h b/kernel/include/kernel/novm.h index 010c4dea..00cd6e2f 100644 --- a/kernel/include/kernel/novm.h +++ b/kernel/include/kernel/novm.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_NOVM_H -#define __KERNEL_NOVM_H +#pragma once #include #include @@ -36,5 +35,3 @@ struct page_range { }; int novm_get_arenas(struct page_range *ranges, int number_of_ranges); - -#endif diff --git a/kernel/include/kernel/port.h b/kernel/include/kernel/port.h index 509d8cf4..868277ac 100644 --- a/kernel/include/kernel/port.h +++ b/kernel/include/kernel/port.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_PORT_H -#define __KERNEL_PORT_H +#pragma once #include #include @@ -89,6 +88,3 @@ status_t port_destroy(port_t port); status_t port_close(port_t port); __END_CDECLS - -#endif - diff --git a/kernel/include/kernel/semaphore.h b/kernel/include/kernel/semaphore.h index 17520484..ef987ea6 100644 --- a/kernel/include/kernel/semaphore.h +++ b/kernel/include/kernel/semaphore.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef __KERNEL_SEMAPHORE_H -#define __KERNEL_SEMAPHORE_H +#pragma once #include #include @@ -46,4 +45,3 @@ status_t sem_trywait(semaphore_t *); status_t sem_timedwait(semaphore_t *, lk_time_t); __END_CDECLS -#endif diff --git a/kernel/include/kernel/thread.h b/kernel/include/kernel/thread.h index e82d3670..8a6f24af 100644 --- a/kernel/include/kernel/thread.h +++ b/kernel/include/kernel/thread.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_THREAD_H -#define __KERNEL_THREAD_H +#pragma once #include #include @@ -234,5 +233,3 @@ extern struct thread_stats thread_stats[SMP_MAX_CPUS]; #endif __END_CDECLS - -#endif diff --git a/kernel/include/kernel/timer.h b/kernel/include/kernel/timer.h index 2abbcbf7..d90c461f 100644 --- a/kernel/include/kernel/timer.h +++ b/kernel/include/kernel/timer.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_TIMER_H -#define __KERNEL_TIMER_H +#pragma once #include #include @@ -54,6 +53,3 @@ void timer_set_periodic(timer_t *, lk_time_t period, timer_callback, void *arg); void timer_cancel(timer_t *); __END_CDECLS - -#endif - diff --git a/kernel/include/kernel/wait.h b/kernel/include/kernel/wait.h index 8dde263f..bdc2f2f2 100644 --- a/kernel/include/kernel/wait.h +++ b/kernel/include/kernel/wait.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_WAIT_H -#define __KERNEL_WAIT_H +#pragma once #include #include @@ -67,6 +66,3 @@ int wait_queue_wake_all(wait_queue_t *, bool reschedule, status_t wait_queue_err status_t thread_unblock_from_wait_queue(struct thread *t, status_t wait_queue_error); __END_CDECLS - -#endif - diff --git a/lib/buildsig/include/lib/buildsig.h b/lib/buildsig/include/lib/buildsig.h index 6469aa87..a0d285be 100644 --- a/lib/buildsig/include/lib/buildsig.h +++ b/lib/buildsig/include/lib/buildsig.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_BUILDSIG_H -#define __LIB_BUILDSIG_H +#pragma once #include #include @@ -18,5 +17,3 @@ status_t buildsig_search(const void *ptr, size_t search_len, size_t max_len, #define DEFAULT_BUILDSIG_SEARCH_LEN 1024 -#endif - diff --git a/lib/bytes/include/lib/bytes.h b/lib/bytes/include/lib/bytes.h index 11929d02..4b6e24c8 100644 --- a/lib/bytes/include/lib/bytes.h +++ b/lib/bytes/include/lib/bytes.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __BYTES_H -#define __BYTES_H +#pragma once #include #include @@ -54,5 +53,3 @@ uint16_t bytes_swap_bits_u16(uint16_t val); uint32_t bytes_swap_bits_u24(uint32_t val); uint32_t bytes_swap_bits_u32(uint32_t val); -#endif - diff --git a/lib/devicetree/include/lib/devicetree.h b/lib/devicetree/include/lib/devicetree.h index b6d8fe95..d53c574c 100644 --- a/lib/devicetree/include/lib/devicetree.h +++ b/lib/devicetree/include/lib/devicetree.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef _DEVICETREE_H_ -#define _DEVICETREE_H_ +#pragma once #include @@ -46,5 +44,3 @@ int dt_walk(devicetree_t *dt, dt_node_cb ncb, dt_prop_cb pcb, void *cookie); u32 dt_rd32(u8 *data); void dt_wr32(u32 n, u8 *data); -#endif - diff --git a/lib/dpc/include/lib/dpc.h b/lib/dpc/include/lib/dpc.h index eef646cd..97291433 100644 --- a/lib/dpc/include/lib/dpc.h +++ b/lib/dpc/include/lib/dpc.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __KERNEL_DPC_H -#define __KERNEL_DPC_H +#pragma once #include #include @@ -17,5 +16,3 @@ typedef void (*dpc_callback)(void *arg); status_t dpc_queue(dpc_callback, void *arg, uint flags); -#endif - diff --git a/lib/evlog/include/lib/evlog.h b/lib/evlog/include/lib/evlog.h index c0a976d5..d0266d28 100644 --- a/lib/evlog/include/lib/evlog.h +++ b/lib/evlog/include/lib/evlog.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_EVLOG_H -#define __LIB_EVLOG_H +#pragma once #include #include @@ -42,5 +41,3 @@ void evlog_add2(evlog_t *e, uintptr_t a, uintptr_t b) } */ -#endif - diff --git a/lib/font/font.h b/lib/font/font.h index 6e3e3852..f6d4f2c2 100644 --- a/lib/font/font.h +++ b/lib/font/font.h @@ -6,8 +6,7 @@ * https://opensource.org/licenses/MIT */ /* derived from a font by Brian Swetland ages ago */ -#ifndef __FONT_H -#define __FONT_H +#pragma once static const unsigned char FONT[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ' ' */ @@ -140,5 +139,3 @@ static const unsigned char FONT[] = { 0x00, 0x00, 0x00, 0x08, 0x08, 0x14, 0x14, 0x22, 0x3e, 0x00, 0x00, 0x00, /* '' */ }; -#endif - diff --git a/lib/font/include/lib/font.h b/lib/font/include/lib/font.h index aff25580..cf2b4622 100644 --- a/lib/font/include/lib/font.h +++ b/lib/font/include/lib/font.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_FONT_H -#define __LIB_FONT_H +#pragma once #include #include @@ -20,5 +19,3 @@ void font_draw_char(gfx_surface *surface, unsigned char c, int x, int y, uint32_ __END_CDECLS -#endif - diff --git a/lib/fs/ext2/ext2_priv.h b/lib/fs/ext2/ext2_priv.h index 5c7702fc..0f8ffe78 100644 --- a/lib/fs/ext2/ext2_priv.h +++ b/lib/fs/ext2/ext2_priv.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __EXT2_PRIV_H -#define __EXT2_PRIV_H +#pragma once #include #include @@ -80,5 +78,3 @@ status_t ext2_stat_file(filecookie *fcookie, struct file_stat *); #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) #define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) -#endif - diff --git a/lib/fs/fat32/fat32_priv.h b/lib/fs/fat32/fat32_priv.h index 03419d94..deec04fe 100644 --- a/lib/fs/fat32/fat32_priv.h +++ b/lib/fs/fat32/fat32_priv.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __FAT32_H -#define __FAT32_H +#pragma once #include #include @@ -23,5 +21,3 @@ ssize_t fat32_read_file(filecookie *fcookie, void *buf, off_t offset, size_t len status_t fat32_close_file(filecookie *fcookie); status_t fat32_stat_file(filecookie *fcookie, struct file_stat *stat); -#endif - diff --git a/lib/fs/fat32/fat_fs.h b/lib/fs/fat32/fat_fs.h index e352488e..df02d22c 100644 --- a/lib/fs/fat32/fat_fs.h +++ b/lib/fs/fat32/fat_fs.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef _FAT_FS_H -#define _FAT_FS_H +#pragma once #include #include @@ -58,4 +56,3 @@ typedef enum { #define fat_read16(buffer,off) \ (((uint8_t *)buffer)[(off)] + (((uint8_t *)buffer)[(off)+1] << 8)) -#endif \ No newline at end of file diff --git a/lib/fs/include/lib/fs/spifs.h b/lib/fs/include/lib/fs/spifs.h index 2c5918cc..88e58085 100644 --- a/lib/fs/include/lib/fs/spifs.h +++ b/lib/fs/include/lib/fs/spifs.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef LIB_FS_SPIFS_H_ -#define LIB_FS_SPIFS_H_ +#pragma once #include @@ -18,4 +16,3 @@ typedef struct { uint32_t toc_pages; } spifs_format_args_t; -#endif // LIB_FS_SPIFS_H_ diff --git a/lib/gfx/include/lib/gfx.h b/lib/gfx/include/lib/gfx.h index ea7d2da2..9455a1a2 100644 --- a/lib/gfx/include/lib/gfx.h +++ b/lib/gfx/include/lib/gfx.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_GFX_H -#define __LIB_GFX_H +#pragma once #include #include @@ -103,5 +102,3 @@ void gfx_draw_pattern(void); __END_CDECLS -#endif - diff --git a/lib/gfxconsole/include/lib/gfxconsole.h b/lib/gfxconsole/include/lib/gfxconsole.h index e762384c..4dd598ca 100644 --- a/lib/gfxconsole/include/lib/gfxconsole.h +++ b/lib/gfxconsole/include/lib/gfxconsole.h @@ -5,13 +5,10 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_GFXCONSOLE_H -#define __LIB_GFXCONSOLE_H +#pragma once #include void gfxconsole_start_on_display(void); void gfxconsole_start(gfx_surface *surface); -#endif - diff --git a/lib/heap/include/lib/page_alloc.h b/lib/heap/include/lib/page_alloc.h index 72f5c4eb..87a254eb 100644 --- a/lib/heap/include/lib/page_alloc.h +++ b/lib/heap/include/lib/page_alloc.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_PAGE_ALLOC_H -#define __LIB_PAGE_ALLOC_H +#pragma once #include #include @@ -50,5 +49,3 @@ int page_get_arenas(struct page_range *ranges, int number_of_ranges); void *page_first_alloc(size_t *size_return); __END_CDECLS - -#endif diff --git a/lib/libc/include/assert.h b/lib/libc/include/assert.h index 2c7b2ccb..4fa2e988 100644 --- a/lib/libc/include/assert.h +++ b/lib/libc/include/assert.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ASSERT_H -#define __ASSERT_H +#pragma once #include #include @@ -28,4 +27,3 @@ #define static_assert(e) STATIC_ASSERT(e) #endif -#endif diff --git a/lib/libc/include/ctype.h b/lib/libc/include/ctype.h index 91afc41a..f38f19c3 100644 --- a/lib/libc/include/ctype.h +++ b/lib/libc/include/ctype.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __CTYPE_H -#define __CTYPE_H +#pragma once #include @@ -30,5 +29,3 @@ int toupper(int c); __END_CDECLS -#endif - diff --git a/lib/libc/include/endian.h b/lib/libc/include/endian.h index 98e15f3a..25dea442 100644 --- a/lib/libc/include/endian.h +++ b/lib/libc/include/endian.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ENDIAN_H -#define __ENDIAN_H +#pragma once #include @@ -77,5 +76,3 @@ #define WRITE_MEM_BYTE(ptr, data) (*(byte *)(ptr) = (data)) #endif - -#endif diff --git a/lib/libc/include/errno.h b/lib/libc/include/errno.h index 6c94af9e..51c3c1cb 100644 --- a/lib/libc/include/errno.h +++ b/lib/libc/include/errno.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __ERRNO_H -#define __ERRNO_H +#pragma once #include @@ -145,4 +144,3 @@ extern int *__geterrno(void); __END_CDECLS -#endif diff --git a/lib/libc/include/inttypes.h b/lib/libc/include/inttypes.h index dc802863..4daedc51 100644 --- a/lib/libc/include/inttypes.h +++ b/lib/libc/include/inttypes.h @@ -5,13 +5,10 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __INTTYPES_H -#define __INTTYPES_H +#pragma once #define PRIu32 "u" #define PRIx32 "x" #include -#endif - diff --git a/lib/libc/include/iovec.h b/lib/libc/include/iovec.h index e144f935..863a5693 100644 --- a/lib/libc/include/iovec.h +++ b/lib/libc/include/iovec.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __IOVEC_H -#define __IOVEC_H +#pragma once #include #include @@ -26,5 +25,3 @@ ssize_t iovec_to_membuf(uint8_t *buf, uint buf_len, __END_CDECLS -#endif - diff --git a/lib/libc/include/malloc.h b/lib/libc/include/malloc.h index 15c7e4ef..07b9c181 100644 --- a/lib/libc/include/malloc.h +++ b/lib/libc/include/malloc.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MALLOC_H -#define __MALLOC_H +#pragma once #include #include @@ -15,5 +14,3 @@ /* lib/heap provides malloc/free definitions */ #include -#endif - diff --git a/lib/libc/include/new.h b/lib/libc/include/new.h index 7275e857..f14e5661 100644 --- a/lib/libc/include/new.h +++ b/lib/libc/include/new.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __NEW_H -#define __NEW_H +#pragma once #include @@ -17,4 +16,3 @@ void *operator new[](size_t, void *ptr); void operator delete (void *p); void operator delete[](void *p); -#endif diff --git a/lib/libc/include/printf.h b/lib/libc/include/printf.h index aec7dd39..10ca946a 100644 --- a/lib/libc/include/printf.h +++ b/lib/libc/include/printf.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_PRINTF_H -#define __LIB_PRINTF_H +#pragma once #include #include @@ -26,4 +25,3 @@ int _printf_engine(_printf_engine_output_func out, void *state, const char *fmt, __END_CDECLS -#endif diff --git a/lib/libc/include/rand.h b/lib/libc/include/rand.h index 33d56849..7b9ea674 100644 --- a/lib/libc/include/rand.h +++ b/lib/libc/include/rand.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __RAND_H -#define __RAND_H +#pragma once #include #include @@ -21,5 +20,3 @@ void rand_add_entropy(const void *buf, size_t len); __END_CDECLS -#endif - diff --git a/lib/libc/include/stdint.h b/lib/libc/include/stdint.h index 0b58997c..d241aec9 100644 --- a/lib/libc/include/stdint.h +++ b/lib/libc/include/stdint.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __STDINT_H -#define __STDINT_H +#pragma once #include // for ULONG_MAX @@ -124,5 +123,3 @@ typedef unsigned long long uintmax_t; #define INTMAX_C(c) INT64_C(c) #define UINTMAX_C(c) UINT64_C(c) -#endif - diff --git a/lib/libc/include/stdio.h b/lib/libc/include/stdio.h index 9a3a86ac..fff73c37 100644 --- a/lib/libc/include/stdio.h +++ b/lib/libc/include/stdio.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __STDIO_H -#define __STDIO_H +#pragma once #include #include @@ -71,5 +70,3 @@ int vsnprintf(char *str, size_t len, const char *fmt, va_list ap); __END_CDECLS -#endif - diff --git a/lib/libc/include/stdlib.h b/lib/libc/include/stdlib.h index 4a747ed4..37d18d5c 100644 --- a/lib/libc/include/stdlib.h +++ b/lib/libc/include/stdlib.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __STDLIB_H -#define __STDLIB_H +#pragma once #include #include @@ -48,5 +47,3 @@ char *getenv(const char *name); __END_CDECLS -#endif - diff --git a/lib/libc/include/string.h b/lib/libc/include/string.h index 2700c958..adccf85d 100644 --- a/lib/libc/include/string.h +++ b/lib/libc/include/string.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_STRING_H -#define __LIB_STRING_H +#pragma once #include #include @@ -49,4 +48,3 @@ size_t strnlen(char const *s, size_t count) __PURE; __END_CDECLS -#endif diff --git a/lib/minip/include/lib/pktbuf.h b/lib/minip/include/lib/pktbuf.h index b6a3c690..cdb1f6fc 100644 --- a/lib/minip/include/lib/pktbuf.h +++ b/lib/minip/include/lib/pktbuf.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef _NET_PKTBUF_H_ -#define _NET_PKTBUF_H_ +#pragma once #include #include @@ -106,4 +104,3 @@ void pktbuf_create(void *ptr, size_t size); void pktbuf_create_bufs(void *ptr, size_t size); void pktbuf_dump(pktbuf_t *p); -#endif diff --git a/lib/norfs/include/lib/norfs.h b/lib/norfs/include/lib/norfs.h index 2755f702..8d026b8f 100644 --- a/lib/norfs/include/lib/norfs.h +++ b/lib/norfs/include/lib/norfs.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __NORFS_H -#define __NORFS_H +#pragma once #include #include @@ -62,4 +61,3 @@ status_t norfs_read_obj(uint32_t key, unsigned char *buffer, uint16_t buffer_len */ void norfs_wipe_fs(void); -#endif diff --git a/lib/norfs/include/lib/norfs_config.h b/lib/norfs/include/lib/norfs_config.h index 235c2cec..eef7dbb8 100644 --- a/lib/norfs/include/lib/norfs_config.h +++ b/lib/norfs/include/lib/norfs_config.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __NORFS_CONFIG_H -#define __NORFS_CONFIG_H +#pragma once #include @@ -30,4 +29,3 @@ #define NORFS_DELETED_MASK 1 -#endif diff --git a/lib/norfs/include/lib/norfs_inode.h b/lib/norfs/include/lib/norfs_inode.h index beac869e..b73e3607 100644 --- a/lib/norfs/include/lib/norfs_inode.h +++ b/lib/norfs/include/lib/norfs_inode.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __NORFS_INODE_H -#define __NORFS_INODE_H +#pragma once #include #include @@ -17,4 +16,3 @@ struct norfs_inode { uint32_t reference_count; }; -#endif diff --git a/lib/norfs/test/include/norfs_test_helper.h b/lib/norfs/test/include/norfs_test_helper.h index e408acda..04f1b5f3 100644 --- a/lib/norfs/test/include/norfs_test_helper.h +++ b/lib/norfs/test/include/norfs_test_helper.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __NORFS_TEST_HELPER_H -#define __NORFS_TEST_HELPER_H +#pragma once #include #include @@ -24,4 +23,3 @@ void wipe_fs(void); status_t collect_block(uint32_t garbage_block, uint32_t *garbage_write_ptr); bool get_inode(uint32_t key, struct norfs_inode **inode); -#endif diff --git a/lib/partition/include/lib/partition.h b/lib/partition/include/lib/partition.h index 8f1df2b2..585a4e7a 100644 --- a/lib/partition/include/lib/partition.h +++ b/lib/partition/include/lib/partition.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_PARTITION_H -#define __LIB_PARTITION_H +#pragma once #include @@ -16,5 +15,3 @@ int partition_publish(const char *device, off_t offset); /* remove any published subdevices on this device */ int partition_unpublish(const char *device); -#endif - diff --git a/lib/text/include/lib/text.h b/lib/text/include/lib/text.h index 8dbdda86..c7f8d723 100644 --- a/lib/text/include/lib/text.h +++ b/lib/text/include/lib/text.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_TEXT_H -#define __LIB_TEXT_H +#pragma once #include @@ -17,5 +16,3 @@ void text_draw(int x, int y, const char *string); /* super dumb, someone has to call this to refresh everything */ void text_update(void); -#endif - diff --git a/lib/tga/include/lib/tga.h b/lib/tga/include/lib/tga.h index 0d4c44ac..0b95278c 100644 --- a/lib/tga/include/lib/tga.h +++ b/lib/tga/include/lib/tga.h @@ -5,13 +5,10 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_TGA_H -#define __LIB_TGA_H +#pragma once #include #include gfx_surface *tga_decode(const void *ptr, size_t len, gfx_format format); -#endif - diff --git a/lib/unittest/include/unittest.h b/lib/unittest/include/unittest.h index bad14038..13951af1 100644 --- a/lib/unittest/include/unittest.h +++ b/lib/unittest/include/unittest.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef _LIB_UNITTEST_INCLUDE_UNITTEST_H_ -#define _LIB_UNITTEST_INCLUDE_UNITTEST_H_ +#pragma once /* * Macros for writing unit tests. * @@ -286,5 +285,3 @@ bool run_all_tests(void); */ bool expect_bytes_eq(const uint8_t *expected, const uint8_t *actual, size_t len, const char *msg); - -#endif /* _LIB_UNITTEST_INCLUDE_UNITTEST_H_ */ diff --git a/lib/version/include/lib/version.h b/lib/version/include/lib/version.h index 01d10e2f..c5f12aaa 100644 --- a/lib/version/include/lib/version.h +++ b/lib/version/include/lib/version.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __LIB_VERSION_H -#define __LIB_VERSION_H +#pragma once #include @@ -29,5 +28,3 @@ void print_version(void); __END_CDECLS -#endif - diff --git a/lib/watchdog/include/lib/watchdog.h b/lib/watchdog/include/lib/watchdog.h index c6665007..d127ede3 100644 --- a/lib/watchdog/include/lib/watchdog.h +++ b/lib/watchdog/include/lib/watchdog.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __LIB_WATCHDOG_H__ -#define __LIB_WATCHDOG_H__ +#pragma once #include #include @@ -66,5 +64,3 @@ extern void platform_watchdog_pet(void); status_t watchdog_hw_init(lk_time_t timeout); void watchdog_hw_set_enabled(bool enabled); - -#endif // __LIB_WATCHDOG_H__ diff --git a/platform/armemu/include/platform/armemu.h b/platform/armemu/include/platform/armemu.h index c040597b..09c62b98 100644 --- a/platform/armemu/include/platform/armemu.h +++ b/platform/armemu/include/platform/armemu.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_ARMEMU_H -#define __PLATFORM_ARMEMU_H +#pragma once #include @@ -18,5 +17,3 @@ void debug_dump_memory_words(void *mem, int len); void debug_set_trace_level(int trace_type, int level); -#endif - diff --git a/platform/armemu/include/platform/armemu/memmap.h b/platform/armemu/include/platform/armemu/memmap.h index 2806a11b..1fb1c12c 100644 --- a/platform/armemu/include/platform/armemu/memmap.h +++ b/platform/armemu/include/platform/armemu/memmap.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MEMMAP_H -#define __MEMMAP_H +#pragma once #define MEMBANK_SIZE (4*1024*1024) @@ -157,4 +156,3 @@ #define BDEV_CMD_ERR_GENERAL (1 << BDEV_CMD_ERRSHIFT) #define BDEV_CMD_ERR_BAD_OFFSET (2 << BDEV_CMD_ERRSHIFT) -#endif diff --git a/platform/armemu/platform_p.h b/platform/armemu/platform_p.h index fec08ed9..cce1c4fd 100644 --- a/platform/armemu/platform_p.h +++ b/platform/armemu/platform_p.h @@ -5,13 +5,10 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_P_H -#define __PLATFORM_P_H +#pragma once void platform_init_interrupts(void); void platform_init_timer(void); void platform_init_blkdev(void); void platform_init_display(void); -#endif - diff --git a/platform/lpc43xx/udc-common.h b/platform/lpc43xx/udc-common.h index 7e486cef..1bc7bc52 100644 --- a/platform/lpc43xx/udc-common.h +++ b/platform/lpc43xx/udc-common.h @@ -6,9 +6,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PRIVATE_UDC_H__ -#define __PRIVATE_UDC_H__ +#pragma once #define GET_STATUS 0 #define CLEAR_FEATURE 1 @@ -71,4 +69,3 @@ udc_descriptor_t *udc_descriptor_find(unsigned tag); // driver provides this void udc_ept_desc_fill(udc_endpoint_t *ept, unsigned char *data); -#endif diff --git a/platform/mediatek/common/gic/include/mt_gic.h b/platform/mediatek/common/gic/include/mt_gic.h index 5e655564..8d47976b 100644 --- a/platform/mediatek/common/gic/include/mt_gic.h +++ b/platform/mediatek/common/gic/include/mt_gic.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef _MT_GIC_H_ -#define _MT_GIC_H_ +#pragma once #include "platform/mt_irq.h" @@ -33,5 +32,3 @@ void platform_init_interrupts(void); void platform_deinit_interrupts(void); void mt_irq_register_dump(void); -#endif /* !_MT_GIC_H_ */ - diff --git a/platform/mediatek/common/include/sync_write.h b/platform/mediatek/common/include/sync_write.h index ba4b6eb5..c67306cf 100644 --- a/platform/mediatek/common/include/sync_write.h +++ b/platform/mediatek/common/include/sync_write.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __SYNC_WRITE_H__ -#define __SYNC_WRITE_H__ +#pragma once #include @@ -30,5 +29,3 @@ dsb(); \ } while (0) -#endif /* !__SYNC_WRITE_H__ */ - diff --git a/platform/mediatek/mt6735/include/platform/mt_gpt.h b/platform/mediatek/mt6735/include/platform/mt_gpt.h index 20e97b03..30f01436 100644 --- a/platform/mediatek/mt6735/include/platform/mt_gpt.h +++ b/platform/mediatek/mt6735/include/platform/mt_gpt.h @@ -5,8 +5,8 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MT_GPT_H__ -#define __MT_GPT_H__ +#pragma once + #include #include #include @@ -53,4 +53,3 @@ extern void gpt_init(void); -#endif /* !__MT_GPT_H__ */ diff --git a/platform/mediatek/mt6735/include/platform/mt_irq.h b/platform/mediatek/mt6735/include/platform/mt_irq.h index cb2f2f24..2b5ca540 100644 --- a/platform/mediatek/mt6735/include/platform/mt_irq.h +++ b/platform/mediatek/mt6735/include/platform/mt_irq.h @@ -32,9 +32,7 @@ * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ - -#ifndef __MT_IRQ_H__ -#define __MT_IRQ_H__ +#pragma once #define GIC_CPU_CTRL 0x00 #define GIC_CPU_PRIMASK 0x04 @@ -116,4 +114,3 @@ void mt_irq_ack(unsigned int irq); void platform_init_interrupts(void); -#endif diff --git a/platform/mediatek/mt6735/include/platform/mt_reg_base.h b/platform/mediatek/mt6735/include/platform/mt_reg_base.h index 4b27de2c..da7adc33 100644 --- a/platform/mediatek/mt6735/include/platform/mt_reg_base.h +++ b/platform/mediatek/mt6735/include/platform/mt_reg_base.h @@ -11,8 +11,7 @@ * and * https://github.com/alexgoussev/AP7350_MDK-kernel */ -#ifndef __MT_REG_BASE_H__ -#define __MT_REG_BASE_H__ +#pragma once #define BOOTROM_BASE (0x00000000) #define BOOTSRAM_BASE (0x00100000) @@ -622,4 +621,3 @@ //////////////////////////////////////// -#endif /* !__MT_REG_BASE_H__ */ diff --git a/platform/mediatek/mt6735/include/platform/mt_typedefs.h b/platform/mediatek/mt6735/include/platform/mt_typedefs.h index 18e30883..772b504b 100644 --- a/platform/mediatek/mt6735/include/platform/mt_typedefs.h +++ b/platform/mediatek/mt6735/include/platform/mt_typedefs.h @@ -9,9 +9,7 @@ /* ------------ * Type definition. */ - -#ifndef __MT_TYPEDEFS_H__ -#define __MT_TYPEDEFS_H__ +#pragma once /*==== CONSTANTS ==================================================*/ @@ -145,4 +143,3 @@ typedef signed long long S64; #define DRV_SetReg32(addr, data) SETREG32(addr, data) #define DRV_ClrReg32(addr, data) CLRREG32(addr, data) -#endif /* !__MT_TYPEDEFS_H__ */ diff --git a/platform/mediatek/mt6735/include/platform/mt_uart.h b/platform/mediatek/mt6735/include/platform/mt_uart.h index d53c5110..029f853b 100644 --- a/platform/mediatek/mt6735/include/platform/mt_uart.h +++ b/platform/mediatek/mt6735/include/platform/mt_uart.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef ___MTK_UART_H__ -#define ___MTK_UART_H__ +#pragma once #include @@ -202,4 +201,3 @@ control */ extern void mtk_set_current_uart(MTK_UART uart_base); extern int mtk_get_current_uart(void); -#endif /* !___MTK_UART_H__ */ diff --git a/platform/mediatek/mt6797/include/platform/mt_gpt.h b/platform/mediatek/mt6797/include/platform/mt_gpt.h index 20e97b03..30f01436 100644 --- a/platform/mediatek/mt6797/include/platform/mt_gpt.h +++ b/platform/mediatek/mt6797/include/platform/mt_gpt.h @@ -5,8 +5,8 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MT_GPT_H__ -#define __MT_GPT_H__ +#pragma once + #include #include #include @@ -53,4 +53,3 @@ extern void gpt_init(void); -#endif /* !__MT_GPT_H__ */ diff --git a/platform/mediatek/mt6797/include/platform/mt_irq.h b/platform/mediatek/mt6797/include/platform/mt_irq.h index 2ce870c3..75118e94 100644 --- a/platform/mediatek/mt6797/include/platform/mt_irq.h +++ b/platform/mediatek/mt6797/include/platform/mt_irq.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MT_IRQ_H__ -#define __MT_IRQ_H__ +#pragma once #include @@ -55,4 +54,3 @@ #define MT65xx_POLARITY_LOW 0 #define MT65xx_POLARITY_HIGH 1 -#endif /* !__MT_IRQ_H__ */ diff --git a/platform/mediatek/mt6797/include/platform/mt_reg_base.h b/platform/mediatek/mt6797/include/platform/mt_reg_base.h index b883db5a..5ef4618b 100644 --- a/platform/mediatek/mt6797/include/platform/mt_reg_base.h +++ b/platform/mediatek/mt6797/include/platform/mt_reg_base.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MT_REG_BASE_H__ -#define __MT_REG_BASE_H__ +#pragma once #define BOOTROM_BASE (0x00000000) #define BOOTSRAM_BASE (0x00100000) @@ -494,5 +493,3 @@ //////////////////////////////////////// -#endif /* !__MT_REG_BASE_H__ */ - diff --git a/platform/mediatek/mt6797/include/platform/mt_typedefs.h b/platform/mediatek/mt6797/include/platform/mt_typedefs.h index 897dfdf1..1487bb7a 100644 --- a/platform/mediatek/mt6797/include/platform/mt_typedefs.h +++ b/platform/mediatek/mt6797/include/platform/mt_typedefs.h @@ -10,8 +10,7 @@ * Type definition. */ -#ifndef __MT_TYPEDEFS_H__ -#define __MT_TYPEDEFS_H__ +#pragma once /*==== CONSTANTS ==================================================*/ @@ -145,5 +144,3 @@ typedef signed long long S64; #define DRV_SetReg32(addr, data) SETREG32(addr, data) #define DRV_ClrReg32(addr, data) CLRREG32(addr, data) -#endif /* !__MT_TYPEDEFS_H__ */ - diff --git a/platform/mediatek/mt6797/include/platform/mt_uart.h b/platform/mediatek/mt6797/include/platform/mt_uart.h index 9bc451da..3f0934c5 100644 --- a/platform/mediatek/mt6797/include/platform/mt_uart.h +++ b/platform/mediatek/mt6797/include/platform/mt_uart.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef ___MTK_UART_H__ -#define ___MTK_UART_H__ +#pragma once #include @@ -202,5 +201,3 @@ control */ extern void mtk_set_current_uart(MTK_UART uart_base); extern int mtk_get_current_uart(void); -#endif /* !___MTK_UART_H__ */ - diff --git a/platform/nrf51xxx/include/platform/gpio.h b/platform/nrf51xxx/include/platform/gpio.h index 5a706fcc..83652141 100644 --- a/platform/nrf51xxx/include/platform/gpio.h +++ b/platform/nrf51xxx/include/platform/gpio.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_NRF51_GPIO_H -#define __PLATFORM_NRF51_GPIO_H +#pragma once #define NRF_MAX_PIN_NUMBER 31 -#endif diff --git a/platform/nrf51xxx/include/platform/nrf51.h b/platform/nrf51xxx/include/platform/nrf51.h index 15526043..40e33130 100644 --- a/platform/nrf51xxx/include/platform/nrf51.h +++ b/platform/nrf51xxx/include/platform/nrf51.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_NRF51_H -#define __PLATFORM_NRF51_H +#pragma once #include @@ -18,5 +17,3 @@ void nrf51_gpio_early_init(void); void nrf51_flash_nor_early_init(void); void nrf51_flash_nor_init(void); -#endif - diff --git a/platform/nrf51xxx/include/platform/platform_cm.h b/platform/nrf51xxx/include/platform/platform_cm.h index dbd33e12..0deb4e7a 100644 --- a/platform/nrf51xxx/include/platform/platform_cm.h +++ b/platform/nrf51xxx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/nrf52xxx/include/platform/gpio.h b/platform/nrf52xxx/include/platform/gpio.h index b7080de1..f1738dc5 100644 --- a/platform/nrf52xxx/include/platform/gpio.h +++ b/platform/nrf52xxx/include/platform/gpio.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_NRF52_GPIO_H -#define __PLATFORM_NRF52_GPIO_H +#pragma once #define NRF_MAX_PIN_NUMBER 31 -#endif diff --git a/platform/nrf52xxx/include/platform/nrf52.h b/platform/nrf52xxx/include/platform/nrf52.h index a1216060..4e5706c0 100644 --- a/platform/nrf52xxx/include/platform/nrf52.h +++ b/platform/nrf52xxx/include/platform/nrf52.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_NRF52_H -#define __PLATFORM_NRF52_H +#pragma once #include @@ -18,5 +17,3 @@ void nrf52_gpio_early_init(void); void nrf52_flash_nor_early_init(void); void nrf52_flash_nor_init(void); -#endif - diff --git a/platform/nrf52xxx/include/platform/platform_cm.h b/platform/nrf52xxx/include/platform/platform_cm.h index 5a17989b..191ad7be 100644 --- a/platform/nrf52xxx/include/platform/platform_cm.h +++ b/platform/nrf52xxx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/pc/include/pcnet.h b/platform/pc/include/pcnet.h index a29a221b..0f8630b0 100644 --- a/platform/pc/include/pcnet.h +++ b/platform/pc/include/pcnet.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_PC_PCNET_H -#define __PLATFORM_PC_PCNET_H +#pragma once #include #include @@ -112,5 +111,3 @@ struct rd_style3 { uint32_t reserved_1; } __PACKED; -#endif - diff --git a/platform/pc/include/platform/console.h b/platform/pc/include/platform/console.h index fb8ec5e5..0afb2f36 100644 --- a/platform/pc/include/platform/console.h +++ b/platform/pc/include/platform/console.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CONSOLE_H -#define __PLATFORM_CONSOLE_H +#pragma once #include @@ -66,5 +65,3 @@ int printf_xy(int x, int y, char attr, char *fmt, ...) __PRINTFLIKE(4, 5); __END_CDECLS -#endif - diff --git a/platform/pc/include/platform/ide.h b/platform/pc/include/platform/ide.h index ffbf3c0a..c22c083b 100644 --- a/platform/pc/include/platform/ide.h +++ b/platform/pc/include/platform/ide.h @@ -5,14 +5,9 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_IDE_H -#define __PLATFORM_IDE_H +#pragma once struct platform_ide_config { int legacy_index; // 0x80, 0x81 for pci detection channel 0 and 1, 0 or 1 for legacy ISA IDE }; -#endif - - diff --git a/platform/pc/include/platform/multiboot.h b/platform/pc/include/platform/multiboot.h index ace9fa47..4c887c1e 100644 --- a/platform/pc/include/platform/multiboot.h +++ b/platform/pc/include/platform/multiboot.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_MULTIBOOT_H -#define __PLATFORM_MULTIBOOT_H +#pragma once #include @@ -112,4 +111,3 @@ enum { #endif -#endif diff --git a/platform/pc/include/platform/pc.h b/platform/pc/include/platform/pc.h index 0c3411ac..c5ac69d4 100644 --- a/platform/pc/include/platform/pc.h +++ b/platform/pc/include/platform/pc.h @@ -6,8 +6,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_PC_H -#define __PLATFORM_PC_H +#pragma once #include #include @@ -38,5 +37,3 @@ #define PIC1_BASE 0x20 #define PIC2_BASE 0x28 -#endif - diff --git a/platform/pc/include/platform/pc/iomap.h b/platform/pc/include/platform/pc/iomap.h index ee18b45e..e4cb9379 100644 --- a/platform/pc/include/platform/pc/iomap.h +++ b/platform/pc/include/platform/pc/iomap.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __IOMAP_H -#define __IOMAP_H +#pragma once /* i8253/i8254 programmable interval timer registers */ #define I8253_CONTROL_REG 0x43 @@ -27,4 +26,3 @@ #define COM3_REG 0x3e8 #define COM4_REG 0x2e8 -#endif diff --git a/platform/pc/include/platform/pc/memmap.h b/platform/pc/include/platform/pc/memmap.h index 688a88e4..0f41c656 100644 --- a/platform/pc/include/platform/pc/memmap.h +++ b/platform/pc/include/platform/pc/memmap.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __MEMMAP_H -#define __MEMMAP_H +#pragma once /* some helpful macros */ #define REG(x) ((volatile unsigned int *)(x)) @@ -15,4 +14,3 @@ /* TODO: put fixed memory address definitions here */ -#endif diff --git a/platform/pc/include/platform/pcnet.h b/platform/pc/include/platform/pcnet.h index 4d0b982e..3214f820 100644 --- a/platform/pc/include/platform/pcnet.h +++ b/platform/pc/include/platform/pcnet.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_PCNET_H -#define __PLATFORM_PCNET_H +#pragma once #include @@ -17,7 +15,3 @@ struct platform_pcnet_config { int index; }; -#endif - - - diff --git a/platform/pc/include/platform/uart.h b/platform/pc/include/platform/uart.h index a2c60127..be61e2a0 100644 --- a/platform/pc/include/platform/uart.h +++ b/platform/pc/include/platform/uart.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_UART_H -#define __PLATFORM_UART_H +#pragma once struct platform_uart_config { int baud_rate; @@ -17,5 +15,3 @@ struct platform_uart_config { int tx_buf_len; }; -#endif - diff --git a/platform/qemu-virt-arm/platform_p.h b/platform/qemu-virt-arm/platform_p.h index 1730a264..d42abd81 100644 --- a/platform/qemu-virt-arm/platform_p.h +++ b/platform/qemu-virt-arm/platform_p.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_P_H -#define __PLATFORM_P_H +#pragma once void platform_init_timer(void); -#endif - diff --git a/platform/stellaris/include/platform/gpio.h b/platform/stellaris/include/platform/gpio.h index 75fa5156..a2e94ab2 100644 --- a/platform/stellaris/include/platform/gpio.h +++ b/platform/stellaris/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STELLARIS_GPIO_H -#define __PLATFORM_STELLARIS_GPIO_H +#pragma once /* helper defines for Stellaris platforms */ @@ -33,5 +32,3 @@ #define GPIO_PORT_P 13 #define GPIO_PORT_Q 14 -#endif - diff --git a/platform/stellaris/include/platform/platform_cm.h b/platform/stellaris/include/platform/platform_cm.h index 6c6bb8f8..a870cb49 100644 --- a/platform/stellaris/include/platform/platform_cm.h +++ b/platform/stellaris/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM3_H -#define __PLATFORM_CM3_H +#pragma once #include -#endif - diff --git a/platform/stellaris/include/stellaris.h b/platform/stellaris/include/stellaris.h index b6a4c1bc..54970590 100644 --- a/platform/stellaris/include/stellaris.h +++ b/platform/stellaris/include/stellaris.h @@ -1,5 +1,4 @@ -#ifndef __stellaris_h__ -#define __stellaris_h__ +#pragma once /* an attempt at a CMSIS compatibility layer for Stellaris */ @@ -21,4 +20,3 @@ typedef enum IRQn { // based on datasheet page 159? #define __NVIC_PRIO_BITS 3 -#endif diff --git a/platform/stm32f0xx/include/platform/can.h b/platform/stm32f0xx/include/platform/can.h index de3e3e6b..6496f148 100644 --- a/platform/stm32f0xx/include/platform/can.h +++ b/platform/stm32f0xx/include/platform/can.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_CAN_H -#define __PLATFORM_STM32_CAN_H +#pragma once #include #include @@ -49,4 +48,3 @@ ssize_t can_send(const can_msg_t *msg); */ ssize_t can_recv(can_msg_t *msg, bool block); -#endif // __PLATFORM_STM32_CAN_H diff --git a/platform/stm32f0xx/include/platform/dma.h b/platform/stm32f0xx/include/platform/dma.h index a7b289d7..05addc5b 100644 --- a/platform/stm32f0xx/include/platform/dma.h +++ b/platform/stm32f0xx/include/platform/dma.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_DMA_H -#define __PLATFORM_STM32_DMA_H +#pragma once #include @@ -70,4 +69,3 @@ void dma_transfer_start(dma_channel_t chan, */ void dma_wait(dma_channel_t chan); -#endif // __PLATFORM_STM32_DMA_H diff --git a/platform/stm32f0xx/include/platform/exti.h b/platform/stm32f0xx/include/platform/exti.h index 483a59c2..ab9e09b7 100644 --- a/platform/stm32f0xx/include/platform/exti.h +++ b/platform/stm32f0xx/include/platform/exti.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_EXTI_H -#define __PLATFORM_STM32_EXTI_H +#pragma once #include #include @@ -47,4 +46,3 @@ bool stm32_exti13_irq(void); bool stm32_exti14_irq(void); bool stm32_exti15_irq(void); -#endif // __PLATFORM_STM32_EXTI_H diff --git a/platform/stm32f0xx/include/platform/gpio.h b/platform/stm32f0xx/include/platform/gpio.h index 25d0b633..e3828edf 100644 --- a/platform/stm32f0xx/include/platform/gpio.h +++ b/platform/stm32f0xx/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_GPIO_H -#define __PLATFORM_STM32_GPIO_H +#pragma once #include @@ -36,5 +35,3 @@ #define GPIO_PORT_F 5 #endif -#endif - diff --git a/platform/stm32f0xx/include/platform/platform_cm.h b/platform/stm32f0xx/include/platform/platform_cm.h index 65ea610c..abb55a1d 100644 --- a/platform/stm32f0xx/include/platform/platform_cm.h +++ b/platform/stm32f0xx/include/platform/platform_cm.h @@ -5,11 +5,8 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include #define SVCall_IRQn SVC_IRQn -#endif - diff --git a/platform/stm32f0xx/include/platform/rcc.h b/platform/stm32f0xx/include/platform/rcc.h index bce87740..efc8699c 100644 --- a/platform/stm32f0xx/include/platform/rcc.h +++ b/platform/stm32f0xx/include/platform/rcc.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_RCC_H -#define __PLATFORM_STM32_RCC_H +#pragma once #include #include @@ -81,4 +80,3 @@ typedef enum { void stm32_rcc_set_enable(stm32_rcc_clk_t clock, bool enable); void stm32_rcc_set_reset(stm32_rcc_clk_t clock, bool reset); -#endif // __PLATFORM_STM32_RCC_H diff --git a/platform/stm32f0xx/include/platform/spi.h b/platform/stm32f0xx/include/platform/spi.h index c6482fce..63701719 100644 --- a/platform/stm32f0xx/include/platform/spi.h +++ b/platform/stm32f0xx/include/platform/spi.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_SPI_H -#define __PLATFORM_STM32_SPI_H +#pragma once #include @@ -89,4 +88,3 @@ void spi_init(spi_data_size_t data_size, */ ssize_t spi_xfer(const void *tx_buf, void *rx_buf, size_t len); -#endif // __PLATFORM_STM32_SPI_H diff --git a/platform/stm32f0xx/include/platform/stm32.h b/platform/stm32f0xx/include/platform/stm32.h index 71724ee4..412e59e3 100644 --- a/platform/stm32f0xx/include/platform/stm32.h +++ b/platform/stm32f0xx/include/platform/stm32.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_H -#define __PLATFORM_STM32_H +#pragma once void stm32_debug_early_init(void); void stm32_debug_init(void); @@ -16,5 +15,3 @@ void stm32_gpio_early_init(void); void stm32_flash_nor_early_init(void); void stm32_flash_nor_init(void); -#endif - diff --git a/platform/stm32f0xx/include/platform/timer_capture.h b/platform/stm32f0xx/include/platform/timer_capture.h index 822e7d77..a087a815 100644 --- a/platform/stm32f0xx/include/platform/timer_capture.h +++ b/platform/stm32f0xx/include/platform/timer_capture.h @@ -5,9 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_STM32_TIMER_CAPTURE_H -#define __PLATFORM_STM32_TIMER_CAPTURE_H +#pragma once #include #include @@ -39,4 +37,3 @@ status_t stm32_timer_capture_setup(stm32_timer_capture_t *tc, int timer, uint16_ uint64_t stm32_timer_capture_get_counter(stm32_timer_capture_t *tc); -#endif // __PLATFORM_STM32_TIMER_CAPTURE_H diff --git a/platform/stm32f0xx/include/platform/usbc.h b/platform/stm32f0xx/include/platform/usbc.h index 8f68622f..40508d9a 100644 --- a/platform/stm32f0xx/include/platform/usbc.h +++ b/platform/stm32f0xx/include/platform/usbc.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_USB_H -#define __PLATFORM_STM32_USB_H +#pragma once typedef enum { STM32_USB_CLK_PLL = 0, @@ -9,4 +8,3 @@ typedef enum { void stm32_usbc_early_init(stm32_usb_clk_t clock_source); void stm32_usbc_init(void); -#endif // __PLATFORM_STM32_USB_H diff --git a/platform/stm32f1xx/include/platform/gpio.h b/platform/stm32f1xx/include/platform/gpio.h index deb250e2..e6680277 100644 --- a/platform/stm32f1xx/include/platform/gpio.h +++ b/platform/stm32f1xx/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_GPIO_H -#define __PLATFORM_STM32_GPIO_H +#pragma once /* helper defines for STM32 platforms */ @@ -21,5 +20,3 @@ #define GPIO_PORT_F 5 #define GPIO_PORT_G 6 -#endif - diff --git a/platform/stm32f1xx/include/platform/platform_cm.h b/platform/stm32f1xx/include/platform/platform_cm.h index fdbc6544..778faeb2 100644 --- a/platform/stm32f1xx/include/platform/platform_cm.h +++ b/platform/stm32f1xx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/stm32f1xx/include/platform/stm32.h b/platform/stm32f1xx/include/platform/stm32.h index 71724ee4..412e59e3 100644 --- a/platform/stm32f1xx/include/platform/stm32.h +++ b/platform/stm32f1xx/include/platform/stm32.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_H -#define __PLATFORM_STM32_H +#pragma once void stm32_debug_early_init(void); void stm32_debug_init(void); @@ -16,5 +15,3 @@ void stm32_gpio_early_init(void); void stm32_flash_nor_early_init(void); void stm32_flash_nor_init(void); -#endif - diff --git a/platform/stm32f2xx/include/platform/gpio.h b/platform/stm32f2xx/include/platform/gpio.h index 0331dbe4..66264f9b 100644 --- a/platform/stm32f2xx/include/platform/gpio.h +++ b/platform/stm32f2xx/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_GPIO_H -#define __PLATFORM_STM32_GPIO_H +#pragma once /* helper defines for STM32 platforms */ @@ -25,5 +24,3 @@ #define GPIO_PORT_H 7 #define GPIO_PORT_I 8 -#endif - diff --git a/platform/stm32f2xx/include/platform/platform_cm.h b/platform/stm32f2xx/include/platform/platform_cm.h index 008fdae1..5877355c 100644 --- a/platform/stm32f2xx/include/platform/platform_cm.h +++ b/platform/stm32f2xx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/stm32f2xx/include/platform/stm32.h b/platform/stm32f2xx/include/platform/stm32.h index 71724ee4..412e59e3 100644 --- a/platform/stm32f2xx/include/platform/stm32.h +++ b/platform/stm32f2xx/include/platform/stm32.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_H -#define __PLATFORM_STM32_H +#pragma once void stm32_debug_early_init(void); void stm32_debug_init(void); @@ -16,5 +15,3 @@ void stm32_gpio_early_init(void); void stm32_flash_nor_early_init(void); void stm32_flash_nor_init(void); -#endif - diff --git a/platform/stm32f4xx/include/platform/gpio.h b/platform/stm32f4xx/include/platform/gpio.h index 0331dbe4..66264f9b 100644 --- a/platform/stm32f4xx/include/platform/gpio.h +++ b/platform/stm32f4xx/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_GPIO_H -#define __PLATFORM_STM32_GPIO_H +#pragma once /* helper defines for STM32 platforms */ @@ -25,5 +24,3 @@ #define GPIO_PORT_H 7 #define GPIO_PORT_I 8 -#endif - diff --git a/platform/stm32f4xx/include/platform/platform_cm.h b/platform/stm32f4xx/include/platform/platform_cm.h index 17b1dc8b..64d40ff1 100644 --- a/platform/stm32f4xx/include/platform/platform_cm.h +++ b/platform/stm32f4xx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/stm32f4xx/include/platform/stm32.h b/platform/stm32f4xx/include/platform/stm32.h index 71724ee4..412e59e3 100644 --- a/platform/stm32f4xx/include/platform/stm32.h +++ b/platform/stm32f4xx/include/platform/stm32.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_STM32_H -#define __PLATFORM_STM32_H +#pragma once void stm32_debug_early_init(void); void stm32_debug_init(void); @@ -16,5 +15,3 @@ void stm32_gpio_early_init(void); void stm32_flash_nor_early_init(void); void stm32_flash_nor_init(void); -#endif - diff --git a/platform/stm32f7xx/include/platform/gpio.h b/platform/stm32f7xx/include/platform/gpio.h index 4de7b53a..3ee01792 100644 --- a/platform/stm32f7xx/include/platform/gpio.h +++ b/platform/stm32f7xx/include/platform/gpio.h @@ -1,5 +1,4 @@ -#ifndef __PLATFORM_STM32_GPIO_H -#define __PLATFORM_STM32_GPIO_H +#pragma once /* helper defines for STM32 platforms */ @@ -29,5 +28,3 @@ #define GPIO_PORT_J 9 #define GPIO_PORT_K 10 -#endif - diff --git a/platform/stm32f7xx/include/platform/platform_cm.h b/platform/stm32f7xx/include/platform/platform_cm.h index c1280cf3..2b818754 100644 --- a/platform/stm32f7xx/include/platform/platform_cm.h +++ b/platform/stm32f7xx/include/platform/platform_cm.h @@ -5,10 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_CM_H -#define __PLATFORM_CM_H +#pragma once #include -#endif - diff --git a/platform/stm32f7xx/include/platform/qspi.h b/platform/stm32f7xx/include/platform/qspi.h index 1d8c668a..e0918ab9 100644 --- a/platform/stm32f7xx/include/platform/qspi.h +++ b/platform/stm32f7xx/include/platform/qspi.h @@ -5,13 +5,10 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ - -#ifndef __PLATFORM_STM32_QSPI_H -#define __PLATFORM_STM32_QSPI_H +#pragma once #include // Initialize the QSPI Flash device. status_t qspi_flash_init(size_t flash_size); -#endif // __PLATFORM_STM32_QSPI_H diff --git a/platform/zynq/include/platform/gic.h b/platform/zynq/include/platform/gic.h index 74d54b90..a3b95c2e 100644 --- a/platform/zynq/include/platform/gic.h +++ b/platform/zynq/include/platform/gic.h @@ -5,8 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_GIC_H -#define __PLATFORM_GIC_H +#pragma once #include @@ -14,4 +13,3 @@ #define GICC_OFFSET (0x0100) #define GICD_OFFSET (0x1000) -#endif diff --git a/platform/zynq/include/platform/gpio.h b/platform/zynq/include/platform/gpio.h index 44edd2a5..b53a01a8 100644 --- a/platform/zynq/include/platform/gpio.h +++ b/platform/zynq/include/platform/gpio.h @@ -5,6 +5,7 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ +#pragma once #include #include diff --git a/platform/zynq/platform_p.h b/platform/zynq/platform_p.h index 41711d59..5ec92287 100644 --- a/platform/zynq/platform_p.h +++ b/platform/zynq/platform_p.h @@ -5,12 +5,9 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ -#ifndef __PLATFORM_P_H -#define __PLATFORM_P_H +#pragma once void platform_init_interrupts(void); void platform_init_timer(uint32_t freq); void zynq_gpio_init(void); -#endif -