diff --git a/include/arm11/config.h b/include/arm11/config.h index aa76faf..c071865 100644 --- a/include/arm11/config.h +++ b/include/arm11/config.h @@ -69,11 +69,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - bool loadConfigFile(); bool configIsLoaded(); bool configHasChanged(); @@ -88,7 +83,3 @@ bool configDeleteKey(int key); bool configDevModeEnabled(); bool configRamFirmBootEnabled(); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/debug.h b/include/arm11/debug.h index efc3af8..f5c7f70 100644 --- a/include/arm11/debug.h +++ b/include/arm11/debug.h @@ -22,20 +22,11 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void debugHashCodeRoData(); noreturn void panic(); noreturn void panicMsg(const char *msg); void debugMemdump(const char *filepath, void *mem, size_t size); -#ifdef __cplusplus -} -#endif - // Exception tests /*static inline regTest(void) { diff --git a/include/arm11/firm.h b/include/arm11/firm.h index 7675f94..ca4aed8 100644 --- a/include/arm11/firm.h +++ b/include/arm11/firm.h @@ -22,14 +22,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - s32 loadVerifyFirm(const char *const path, bool skipHashCheck); noreturn void firmLaunch(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/fmt.h b/include/arm11/fmt.h index 827d46b..bc34a6e 100644 --- a/include/arm11/fmt.h +++ b/include/arm11/fmt.h @@ -31,18 +31,9 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - u32 ee_vsnprintf(char *const buf, u32 size, const char *const fmt, va_list arg); u32 ee_vsprintf(char *const buf, const char *const fmt, va_list arg); __attribute__ ((format (printf, 2, 3))) u32 ee_sprintf(char *const buf, const char *const fmt, ...); __attribute__ ((format (printf, 3, 4))) u32 ee_snprintf(char *const buf, u32 size, const char *const fmt, ...); __attribute__ ((format (printf, 1, 2))) u32 ee_printf(const char *const fmt, ...); u32 ee_puts(const char *const str); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/hardware/cpu.h b/include/arm11/hardware/cpu.h index fdec5fc..85a7005 100644 --- a/include/arm11/hardware/cpu.h +++ b/include/arm11/hardware/cpu.h @@ -22,14 +22,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void CPU_setClock(u16 clk); void CPU_poweroffCore23(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/hardware/gpio.h b/include/arm11/hardware/gpio.h index 90d4b84..538365f 100644 --- a/include/arm11/hardware/gpio.h +++ b/include/arm11/hardware/gpio.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Sets a bit in the specified GPIO register. * @@ -42,7 +37,3 @@ * @param[in] bitNum The bit number. */ void GPIO_clearBit(u16 reg, u8 bitNum); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/hardware/hid.h b/include/arm11/hardware/hid.h index 50ac2fe..8cffbd8 100644 --- a/include/arm11/hardware/hid.h +++ b/include/arm11/hardware/hid.h @@ -51,11 +51,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void hidInit(void); u32 hidGetPowerButton(bool resetState); u32 hidGetWifiButton(bool resetState); @@ -64,7 +59,3 @@ u32 hidKeysHeld(void); u32 hidKeysDown(void); u32 hidKeysUp(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/hardware/i2c.h b/include/arm11/hardware/i2c.h index 8aa5d01..dd7472a 100644 --- a/include/arm11/hardware/i2c.h +++ b/include/arm11/hardware/i2c.h @@ -50,11 +50,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Initializes the I2C buses. Call this only once. */ @@ -105,10 +100,6 @@ */ bool I2C_writeReg(I2cDevice devId, u8 regAddr, u8 data); -#ifdef __cplusplus -} -#endif - static inline u8 i2cmcu_readreg_hid_irq(void) { diff --git a/include/arm11/hardware/interrupt.h b/include/arm11/hardware/interrupt.h index f0374b1..4569ba3 100644 --- a/include/arm11/hardware/interrupt.h +++ b/include/arm11/hardware/interrupt.h @@ -106,11 +106,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Initializes the generic interrupt controller. */ @@ -164,10 +159,6 @@ */ void IRQ_softwareInterrupt(Interrupt id, u8 cpuMask); -#ifdef __cplusplus -} -#endif - static inline u32 enterCriticalSection(void) { diff --git a/include/arm11/hardware/mcu.h b/include/arm11/hardware/mcu.h index fd0d2f0..d4dde5b 100644 --- a/include/arm11/hardware/mcu.h +++ b/include/arm11/hardware/mcu.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void MCU_init(void); void MCU_disableLEDs(void); void MCU_powerOnLCDs(void); @@ -37,7 +32,3 @@ bool MCU_readBatteryChargeState(void); u8 MCU_readSystemModel(void); void MCU_readRTC(void *rtc); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/hardware/timer.h b/include/arm11/hardware/timer.h index bc0f196..9e5c07c 100644 --- a/include/arm11/hardware/timer.h +++ b/include/arm11/hardware/timer.h @@ -33,11 +33,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Resets/initializes the timer hardware. Should not be called manually. */ @@ -76,10 +71,6 @@ */ void TIMER_sleepTicks(u32 ticks); -#ifdef __cplusplus -} -#endif - // Sleeps ms milliseconds. ms can be up to 32000. static inline void TIMER_sleepMs(u32 ms) diff --git a/include/arm11/lz11.h b/include/arm11/lz11.h index 8ab8c03..095a623 100644 --- a/include/arm11/lz11.h +++ b/include/arm11/lz11.h @@ -22,13 +22,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void lz11Decompress(const void *in, void *out, u32 size); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/battery.h b/include/arm11/menu/battery.h index ea0809a..08f13b8 100644 --- a/include/arm11/menu/battery.h +++ b/include/arm11/menu/battery.h @@ -31,13 +31,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void getBatteryState(BatteryState *battery); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/bootinfo.h b/include/arm11/menu/bootinfo.h index 3833763..1a17138 100644 --- a/include/arm11/menu/bootinfo.h +++ b/include/arm11/menu/bootinfo.h @@ -29,13 +29,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void getBootInfo(bootInfo* info); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/bootslot.h b/include/arm11/menu/bootslot.h index 54b8046..7bbb16e 100644 --- a/include/arm11/menu/bootslot.h +++ b/include/arm11/menu/bootslot.h @@ -25,14 +25,6 @@ #define INVALID_BOOT_SLOT 0xFF -#ifdef __cplusplus -extern "C" -{ -#endif u8 readStoredBootslot(void); bool storeBootslot(u8 slot); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/menu.h b/include/arm11/menu/menu.h index 2456fa9..88e2d9a 100644 --- a/include/arm11/menu/menu.h +++ b/include/arm11/menu/menu.h @@ -73,13 +73,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - u32 menuProcess(PrintConsole* menu_con, PrintConsole* desc_con, MenuInfo* info); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/menu_fsel.h b/include/arm11/menu/menu_fsel.h index f324480..ce73870 100644 --- a/include/arm11/menu/menu_fsel.h +++ b/include/arm11/menu/menu_fsel.h @@ -29,13 +29,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - bool menuFileSelector(char* res_path, PrintConsole* menu_con, const char* start, const char* pattern, bool allow_root, bool select_dirs); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/menu_func.h b/include/arm11/menu/menu_func.h index 34abf93..742105c 100644 --- a/include/arm11/menu/menu_func.h +++ b/include/arm11/menu/menu_func.h @@ -21,6 +21,7 @@ #include "types.h" #include "mem_map.h" #include "arm11/hardware/cfg11.h" +#include "arm11/console.h" #define NAND_BACKUP_PATH "sdmc:/3DS" // NAND backups standard path @@ -29,11 +30,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - u32 menuPresetNandTools(void); u32 menuPresetBootMenu(void); u32 menuPresetBootConfig(void); @@ -65,7 +61,3 @@ u32 menuDummyFunc(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 debugSettingsView(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 debugEscapeTest(PrintConsole* term_con, PrintConsole* menu_con, u32 param); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/menu_util.h b/include/arm11/menu/menu_util.h index 6ca129e..c254b2b 100644 --- a/include/arm11/menu/menu_util.h +++ b/include/arm11/menu/menu_util.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - char* mallocpyString(const char* str); void truncateString(char* dest, const char* orig, int nsize, int tpos); void formatBytes(char* str, u64 bytes); @@ -49,7 +44,3 @@ void outputEndWait(void); bool userCancelHandler(bool cancelAllowed); void sleepmode(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/menu/splash.h b/include/arm11/menu/splash.h index 401f3df..ad17e42 100644 --- a/include/arm11/menu/splash.h +++ b/include/arm11/menu/splash.h @@ -47,14 +47,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void getSplashDimensions(const void *const data, u32 *const width, u32 *const height); bool drawSplashscreen(const void *const data, s32 startX, s32 startY, u8 screen); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/power.h b/include/arm11/power.h index ac8954b..c01b56b 100644 --- a/include/arm11/power.h +++ b/include/arm11/power.h @@ -20,14 +20,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - noreturn void power_off(void); noreturn void power_reboot(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm11/start.h b/include/arm11/start.h index a5e4ca9..dae0809 100644 --- a/include/arm11/start.h +++ b/include/arm11/start.h @@ -22,15 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - noreturn void _start(void); void clearMem(u32 *adr, u32 size); void deinitCpu(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/debug.h b/include/arm9/debug.h index 617015a..b8fde2c 100644 --- a/include/arm9/debug.h +++ b/include/arm9/debug.h @@ -22,16 +22,7 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void debugHashCodeRoData(); noreturn void panic(); noreturn void panicMsg(const char *msg); void dumpMem(u8 *mem, u32 size, char *filepath); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/firm.h b/include/arm9/firm.h index 1d91cf4..39d718c 100644 --- a/include/arm9/firm.h +++ b/include/arm9/firm.h @@ -47,15 +47,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - bool firm_size(size_t *size, const firm_header *const hdr); s32 loadVerifyFirm(const char *const path, bool skipHashCheck, bool installMode); noreturn void firmLaunch(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/hardware/crypto.h b/include/arm9/hardware/crypto.h index 6d158e5..704fa58 100644 --- a/include/arm9/hardware/crypto.h +++ b/include/arm9/hardware/crypto.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - ////////////////////////////////// // AES // ////////////////////////////////// @@ -327,7 +322,3 @@ * @return Returns true if the signature is valid, false otherwise. */ bool RSA_verify2048(const u32 *const encSig, const u32 *const data, u32 size); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/hardware/hid.h b/include/arm9/hardware/hid.h index 32c5b5b..e107224 100644 --- a/include/arm9/hardware/hid.h +++ b/include/arm9/hardware/hid.h @@ -28,16 +28,7 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void hidScanInput(void); u32 hidKeysHeld(void); u32 hidKeysDown(void); u32 hidKeysUp(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/hardware/interrupt.h b/include/arm9/hardware/interrupt.h index e03ce83..aa5fb43 100644 --- a/include/arm9/hardware/interrupt.h +++ b/include/arm9/hardware/interrupt.h @@ -63,11 +63,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Initializes interrupts. */ @@ -88,10 +83,6 @@ */ void IRQ_unregisterHandler(Interrupt id); -#ifdef __cplusplus -} -#endif - static inline u32 enterCriticalSection(void) { diff --git a/include/arm9/hardware/ndma.h b/include/arm9/hardware/ndma.h index 302c309..574919e 100644 --- a/include/arm9/hardware/ndma.h +++ b/include/arm9/hardware/ndma.h @@ -147,11 +147,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Initializes all NDMA channels. */ @@ -192,7 +187,3 @@ * @param[in] size The size of the memory to fill. Must be multiple of 4. */ void NDMA_fill(u32 *dest, u32 value, u32 size); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/hardware/spiflash.h b/include/arm9/hardware/spiflash.h index e148ac8..d935be1 100644 --- a/include/arm9/hardware/spiflash.h +++ b/include/arm9/hardware/spiflash.h @@ -26,15 +26,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - // true if spiflash is installed, false otherwise bool spiflash_get_status(); void spiflash_read(u32 offset, u32 size, u8 *buf); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/hardware/timer.h b/include/arm9/hardware/timer.h index 777f626..fbb32ef 100644 --- a/include/arm9/hardware/timer.h +++ b/include/arm9/hardware/timer.h @@ -52,11 +52,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - /** * @brief Resets/initializes the timer hardware. Should not be called manually. */ @@ -97,7 +92,3 @@ * @param[in] ms The number of milliseconds to sleep. */ void TIMER_sleep(u32 ms); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/partitions.h b/include/arm9/partitions.h index 7cda5f6..075a9d7 100644 --- a/include/arm9/partitions.h +++ b/include/arm9/partitions.h @@ -18,6 +18,8 @@ * along with this program. If not, see . */ +#include "types.h" + #define MAX_PARTITIONS 8 #define MAX_PARTITION_NAME 10 @@ -33,11 +35,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - size_t partitionAdd(u32 sector, u32 count, u8 type); bool partitionSetName(size_t index, const char *name); bool partitionFind(u32 sector, u32 count, size_t *index); @@ -47,7 +44,3 @@ bool partitionGetKeyslot(size_t index, u8 *keyslot); bool partitionGetInfo(size_t index, partitionStruct *info); void partitionsReset(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/arm9/start.h b/include/arm9/start.h index 0353bd6..53fab51 100644 --- a/include/arm9/start.h +++ b/include/arm9/start.h @@ -22,14 +22,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void clearMem(u32 *adr, u32 size); void deinitCpu(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/fb_assert.h b/include/fb_assert.h index 10b9d56..86b2617 100644 --- a/include/fb_assert.h +++ b/include/fb_assert.h @@ -21,20 +21,12 @@ #include "types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -noreturn void __fb_assert(const char *const str, u32 line); - #ifdef NDEBUG #define fb_assert(c) ((void)0) #else #define fb_assert(c) ((c) ? ((void)0) : __fb_assert(#c ", " __FILE__, __LINE__)) #endif -#ifdef __cplusplus -} -#endif + + +noreturn void __fb_assert(const char *const str, u32 line); diff --git a/include/firmwriter.h b/include/firmwriter.h index 8f37031..1d6c02a 100644 --- a/include/firmwriter.h +++ b/include/firmwriter.h @@ -34,14 +34,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - s32 writeFirmPartition(const char *const part, bool replaceSig); s32 loadVerifyUpdate(const char *const path, u32 *const version); - -#ifdef __cplusplus -} -#endif diff --git a/include/fs.h b/include/fs.h index c5ff08f..d2c9296 100644 --- a/include/fs.h +++ b/include/fs.h @@ -60,11 +60,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - s32 fMount(FsDrive drive); s32 fUnmount(FsDrive drive); bool fIsDriveMounted(FsDrive drive); @@ -99,7 +94,3 @@ #ifdef ARM9 void fsDeinit(void); #endif - -#ifdef __cplusplus -} -#endif diff --git a/include/fsutils.h b/include/fsutils.h index 7ba8125..70fd493 100644 --- a/include/fsutils.h +++ b/include/fsutils.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - bool fsEnsureMounted(const char *path); void fsUnmountAll(); u32 fsMountNandFilesystems(); @@ -34,7 +29,3 @@ bool fsMountSdmc(); bool fsCreateFileWithPath(const char *filepath); bool fsQuickRead(const char* filepath, void* buff, u32 len, u32 off); - -#ifdef __cplusplus -} -#endif diff --git a/include/hardware/cache.h b/include/hardware/cache.h index f3f6e56..a2f511b 100644 --- a/include/hardware/cache.h +++ b/include/hardware/cache.h @@ -22,11 +22,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void invalidateICache(void); void invalidateICacheRange(const void *const base, u32 size); void flushDCache(void); @@ -35,7 +30,3 @@ void flushInvalidateDCacheRange(const void *const base, u32 size); void invalidateDCache(void); void invalidateDCacheRange(const void *const base, u32 size); - -#ifdef __cplusplus -} -#endif diff --git a/include/hardware/gfx.h b/include/hardware/gfx.h index eea777b..ffb13d3 100644 --- a/include/hardware/gfx.h +++ b/include/hardware/gfx.h @@ -59,11 +59,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void GX_memoryFill(u64 *buf0a, u32 buf0v, u32 buf0Sz, u32 val0, u64 *buf1a, u32 buf1v, u32 buf1Sz, u32 val1); void GX_displayTransfer(u64 *in, u32 indim, u64 *out, u32 outdim, u32 flags); void GX_textureCopy(u64 *in, u32 indim, u64 *out, u32 outdim, u32 size); @@ -76,8 +71,4 @@ void GFX_returnFromLowPowerState(void); void GFX_deinit(bool keepLcdsOn); -#ifdef __cplusplus -} -#endif - #endif diff --git a/include/hardware/pxi.h b/include/hardware/pxi.h index da78f55..e13338d 100644 --- a/include/hardware/pxi.h +++ b/include/hardware/pxi.h @@ -58,14 +58,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void PXI_init(void); u32 PXI_sendCmd(u32 cmd, const u32 *const buf, u32 words); - -#ifdef __cplusplus -} -#endif diff --git a/include/ipc_handler.h b/include/ipc_handler.h index 92c0350..d14643c 100644 --- a/include/ipc_handler.h +++ b/include/ipc_handler.h @@ -96,13 +96,4 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - u32 IPC_handleCmd(u8 cmdId, u32 inBufs, u32 outBufs, const u32 *const buf); - -#ifdef __cplusplus -} -#endif diff --git a/include/system.h b/include/system.h index bbb4ff2..3435ffc 100644 --- a/include/system.h +++ b/include/system.h @@ -22,14 +22,5 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - //void WEAK __systemInit(void); void WEAK __systemDeinit(void); - -#ifdef __cplusplus -} -#endif diff --git a/include/util.h b/include/util.h index 36ca619..e4da19d 100644 --- a/include/util.h +++ b/include/util.h @@ -26,11 +26,6 @@ -#ifdef __cplusplus -extern "C" -{ -#endif - void wait(u32 cycles); __attribute__ ((format (scanf, 2, 3))) int fb_sscanf(const char *s, const char *fmt, ...); @@ -47,7 +42,3 @@ u32 getleu32(const void* ptr); u32 swap32(u32 val); - -#ifdef __cplusplus -} -#endif