From 7586104ffcf4b92ac0aaeb4fdfe49b359b651129 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Wed, 11 Oct 2017 16:53:18 +0100 Subject: [PATCH] added ifndefs to header files --- inc/debug.h | 8 +++++++- inc/disk.h | 2 -- inc/errors.h | 2 +- inc/everdrive.h | 3 ++- inc/fat.h | 3 ++- inc/hashtable.h | 7 ++++++- inc/main.h | 4 ++++ inc/mem.h | 1 + inc/rom.h | 7 ++++++- inc/sound.h | 6 +++++- inc/sram.h | 5 +++++ inc/strlib.h | 4 +++- inc/sys.h | 3 ++- inc/types.h | 1 - inc/usb.h | 7 +++---- inc/utils.h | 5 +++++ 16 files changed, 52 insertions(+), 16 deletions(-) diff --git a/inc/debug.h b/inc/debug.h index 5cde5c6..97ba183 100644 --- a/inc/debug.h +++ b/inc/debug.h @@ -3,6 +3,9 @@ // See LICENSE file in the project root for full license information. // +#ifndef _DEBUG_H +#define _DEBUG_H + #ifdef DEBUG #define TRACEF(disp, text, ...) dbg_printf(disp, text, __VA_ARGS__); #define TRACE(disp, text) printText(text, 3, -1, disp); @@ -27,4 +30,7 @@ void dbg_printf(display_context_t disp, const char *fmt, ...) u8 tmp[32]; sprintf(tmp, "%s", buf); printText(tmp, 3, -1, disp); -} \ No newline at end of file +} + + +#endif diff --git a/inc/disk.h b/inc/disk.h index 5c0b747..ca65b7e 100644 --- a/inc/disk.h +++ b/inc/disk.h @@ -23,6 +23,4 @@ void diskSetInterface(u32 interface); #define DISK_IFACE_SD 1 - #endif /* _DISK_H */ - diff --git a/inc/errors.h b/inc/errors.h index 4c9d23c..4a8733e 100644 --- a/inc/errors.h +++ b/inc/errors.h @@ -65,5 +65,5 @@ #define SD_INIT_ERROR 80 -#endif /* _ERRORS_H */ +#endif /* _ERRORS_H */ diff --git a/inc/everdrive.h b/inc/everdrive.h index ec3c4a0..143a3a8 100644 --- a/inc/everdrive.h +++ b/inc/everdrive.h @@ -121,5 +121,6 @@ u8 evd_mmcOpenRead(u32 addr); u8 evd_mmcReadNextBlock(void *dat); void evd_mmcCloseRW(); */ -#endif /* _EVERDRIVE_H */ + +#endif /* _EVERDRIVE_H */ diff --git a/inc/fat.h b/inc/fat.h index a29ea0b..5f2b1d4 100644 --- a/inc/fat.h +++ b/inc/fat.h @@ -119,5 +119,6 @@ u8 fatGetFullName(u8 *name, u32 dir_entry, u32 rec_entry); u8 fatOpenDirByName(u8 *name); void fatInitRam(); void fatSortRecords(); -#endif /* _FAT_H */ + +#endif /* _FAT_H */ diff --git a/inc/hashtable.h b/inc/hashtable.h index b16c723..4654bef 100644 --- a/inc/hashtable.h +++ b/inc/hashtable.h @@ -4,6 +4,9 @@ // See LICENSE file in the project root for full license information. // +#ifndef _HASHTABLE_H +#define _HASHTABLE_H + typedef struct hashtable hashtable; void hashtable_destroy(hashtable *t); typedef struct hashtable_entry hashtable_entry; @@ -23,4 +26,6 @@ struct hashtable { struct hashtable_entry { char* key; void* value; -}; \ No newline at end of file +}; + +#endif diff --git a/inc/main.h b/inc/main.h index e724ca3..7e17406 100644 --- a/inc/main.h +++ b/inc/main.h @@ -3,6 +3,8 @@ // Portions (c) 2013 saturnu (Alt64) based on libdragon, Neo64Menu, ED64IO, libn64-hkz, libmikmod // See LICENSE file in the project root for full license information. // +#ifndef MAIN_H +#define MAIN_H //TODO: some of these should probably be includes not protos in main void bootRom(display_context_t disp, int silent); @@ -39,3 +41,5 @@ void drawTextInput(display_context_t disp,char *msg); * @return An aligned address guaranteed to be >= the unaligned address */ //#define ALIGN_16BYTE(x) ((void *)(((uint32_t)(x)+15) & 0xFFFFFFF0)) + +#endif diff --git a/inc/mem.h b/inc/mem.h index ba3d275..b5f0661 100644 --- a/inc/mem.h +++ b/inc/mem.h @@ -6,6 +6,7 @@ #ifndef _MEM_H #define _MEM_H + #include "types.h" #define SPI_SPEED_INIT 2 diff --git a/inc/rom.h b/inc/rom.h index db334e6..46dff4d 100644 --- a/inc/rom.h +++ b/inc/rom.h @@ -4,6 +4,9 @@ // See LICENSE file in the project root for full license information. // +#ifndef _ROM_H +#define _ROM_H + /* * 0000h (1 byte): initial PI_BSB_DOM1_LAT_REG value (0x80) @@ -159,4 +162,6 @@ int is_valid_rom(unsigned char *buffer); void swap_header(unsigned char* header, int loadlength); u8 getCicType(u8 bios_cic); -int get_cic(unsigned char *buffer); \ No newline at end of file +int get_cic(unsigned char *buffer); + +#endif diff --git a/inc/sound.h b/inc/sound.h index a60002f..b97cfe8 100644 --- a/inc/sound.h +++ b/inc/sound.h @@ -2,9 +2,13 @@ // Copyright (c) 2017 The Altra64 project contributors // See LICENSE file in the project root for full license information. // +#ifndef _SOUND_H +#define _SOUND_H void sndInit(void); void sndPlayBGM(char* filename); void sndStopAll(void); void sndPlaySFX(char* filename); -void sndUpdate(void); \ No newline at end of file +void sndUpdate(void); + +#endif diff --git a/inc/sram.h b/inc/sram.h index 4b82e5f..a8f4c32 100644 --- a/inc/sram.h +++ b/inc/sram.h @@ -4,6 +4,9 @@ // See LICENSE file in the project root for full license information. // +#ifndef _SRAM_H +#define _SRAM_H + #include #include #include "types.h" @@ -35,3 +38,5 @@ void *safe_malloc(size_t size); void safe_free(void *ptr); void *safe_memset(void *s, int c, size_t n); void *safe_memcpy(void *dest, const void *src, size_t n); + +#endif diff --git a/inc/strlib.h b/inc/strlib.h index daeac7a..5020426 100644 --- a/inc/strlib.h +++ b/inc/strlib.h @@ -4,7 +4,8 @@ // See LICENSE file in the project root for full license information. // -#ifndef STRLIB_H_ +#ifndef _STRLIB_H +#define _STRLIB_H #include "types.h" @@ -40,4 +41,5 @@ u8 streq(u8 *str1, u8 *str2); u8 streql(u8 *str1, u8 *str2, u8 len); u16 strContain(u8 *target, u8 *str); + #endif diff --git a/inc/sys.h b/inc/sys.h index 14ab3a8..a2e5ded 100644 --- a/inc/sys.h +++ b/inc/sys.h @@ -6,6 +6,7 @@ #ifndef _SYS_H #define _SYS_H + #include "types.h" #include "utils.h" #include @@ -51,5 +52,5 @@ typedef struct { extern Options_st options; extern u32 asm_date; -#endif /* _TOOLS_H */ +#endif /* _SYS_H */ diff --git a/inc/types.h b/inc/types.h index 9668fa6..b8e481f 100644 --- a/inc/types.h +++ b/inc/types.h @@ -32,4 +32,3 @@ typedef uint64_t sim_u64; #endif /* _TYPES_H */ - diff --git a/inc/usb.h b/inc/usb.h index 5eac290..93f962f 100644 --- a/inc/usb.h +++ b/inc/usb.h @@ -4,12 +4,11 @@ // See LICENSE file in the project root for full license information. // -#ifndef _FIFO_H -#define _FIFO_H +#ifndef _USB_H +#define _USB_H #include "types.h" u8 usbListener(); -#endif /* _FIFO_H */ - +#endif /* _USB_H */ diff --git a/inc/utils.h b/inc/utils.h index ba248be..9cb60ff 100644 --- a/inc/utils.h +++ b/inc/utils.h @@ -4,6 +4,9 @@ // See LICENSE file in the project root for full license information. // + +#ifndef _UTILS_H +#define _UTILS_H // rom.h // rom tools - header inspect #include @@ -67,3 +70,5 @@ int setSRAM128( uint8_t *buffer); int setEeprom4k( uint8_t *buffer); int setEeprom16k( uint8_t *buffer); int setFlashRAM( uint8_t *buffer); + +#endif