Fix warnings for most recent devKitArm

This commit is contained in:
d0k3 2017-02-17 15:54:37 +01:00
parent 1129c710d7
commit 1348b7ca03
13 changed files with 87 additions and 88 deletions

View File

@ -30,9 +30,8 @@ INCLUDES := source source/common source/font source/fs source/crypto source/fatf
#---------------------------------------------------------------------------------
ARCH := -mthumb -mthumb-interwork -flto
CFLAGS := -g -Wall -Wextra -Wpedantic -Wcast-align -pedantic -O2\
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer\
-ffast-math -std=c99\
CFLAGS := -g -Wall -Wextra -Wpedantic -Wcast-align -Wno-misleading-identation -O2\
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=gnu99\
$(ARCH)
CFLAGS += $(INCLUDE) -DEXEC_$(EXEC_METHOD) -DARM9

View File

@ -2,26 +2,26 @@
#include "common.h"
#define IMG_FAT (1<<0)
#define IMG_NAND (1<<1)
#define GAME_CIA (1<<2)
#define GAME_NCSD (1<<3)
#define GAME_NCCH (1<<4)
#define GAME_TMD (1<<5)
#define GAME_EXEFS (1<<6)
#define GAME_ROMFS (1<<7)
#define GAME_BOSS (1<<8)
#define GAME_NUSCDN (1<<9)
#define GAME_TICKET (1<<10)
#define SYS_FIRM (1<<11)
#define SYS_TICKDB (1<<12)
#define BIN_NCCHNFO (1<<13)
#define BIN_LAUNCH (1<<14)
#define BIN_SUPPORT (1<<15)
#define IMG_FAT (1UL<<0)
#define IMG_NAND (1UL<<1)
#define GAME_CIA (1UL<<2)
#define GAME_NCSD (1UL<<3)
#define GAME_NCCH (1UL<<4)
#define GAME_TMD (1UL<<5)
#define GAME_EXEFS (1UL<<6)
#define GAME_ROMFS (1UL<<7)
#define GAME_BOSS (1UL<<8)
#define GAME_NUSCDN (1UL<<9)
#define GAME_TICKET (1UL<<10)
#define SYS_FIRM (1UL<<11)
#define SYS_TICKDB (1UL<<12)
#define BIN_NCCHNFO (1UL<<13)
#define BIN_LAUNCH (1UL<<14)
#define BIN_SUPPORT (1UL<<15)
#define TYPE_BASE 0x00FFFFFF // 24 bit reserved for base types
#define FLAG_NUSCDN (1<<30)
#define FLAG_CXI (1<<31)
#define FLAG_NUSCDN (1UL<<30)
#define FLAG_CXI (1UL<<31)
#define FTYPE_MOUNTABLE(tp) (tp&(IMG_FAT|IMG_NAND|GAME_CIA|GAME_NCSD|GAME_NCCH|GAME_EXEFS|GAME_ROMFS|SYS_FIRM|SYS_TICKDB))
#define FYTPE_VERIFICABLE(tp) (tp&(IMG_NAND|GAME_CIA|GAME_NCSD|GAME_NCCH|GAME_TMD|GAME_BOSS|SYS_FIRM))

View File

@ -9,23 +9,23 @@
// primary drive types
#define DRV_UNKNOWN (0<<0)
#define DRV_FAT (1<<0)
#define DRV_VIRTUAL (1<<1)
#define DRV_FAT (1UL<<0)
#define DRV_VIRTUAL (1UL<<1)
// secondary drive types
#define DRV_SDCARD (1<<2)
#define DRV_SYSNAND (1<<3)
#define DRV_EMUNAND (1<<4)
#define DRV_CTRNAND (1<<5)
#define DRV_TWLNAND (1<<6)
#define DRV_IMAGE (1<<7)
#define DRV_XORPAD (1<<8)
#define DRV_RAMDRIVE (1<<9)
#define DRV_MEMORY (1<<10)
#define DRV_GAME (1<<11)
#define DRV_CART (1<<12)
#define DRV_ALIAS (1<<13)
#define DRV_SEARCH (1<<14)
#define DRV_STDFAT (1<<15) // standard FAT drive without limitations
#define DRV_SDCARD (1UL<<2)
#define DRV_SYSNAND (1UL<<3)
#define DRV_EMUNAND (1UL<<4)
#define DRV_CTRNAND (1UL<<5)
#define DRV_TWLNAND (1UL<<6)
#define DRV_IMAGE (1UL<<7)
#define DRV_XORPAD (1UL<<8)
#define DRV_RAMDRIVE (1UL<<9)
#define DRV_MEMORY (1UL<<10)
#define DRV_GAME (1UL<<11)
#define DRV_CART (1UL<<12)
#define DRV_ALIAS (1UL<<13)
#define DRV_SEARCH (1UL<<14)
#define DRV_STDFAT (1UL<<15) // standard FAT drive without limitations
#define FS_DRVNAME \
"SDCARD", \

View File

@ -3,20 +3,20 @@
#include "common.h"
// permission types
#define PERM_SDCARD (1<<0)
#define PERM_IMAGE (1<<1)
#define PERM_RAMDRIVE (1<<2)
#define PERM_EMU_LVL0 (1<<3)
#define PERM_EMU_LVL1 (PERM_EMU_LVL0|(1<<4))
#define PERM_SYS_LVL0 (1<<5)
#define PERM_SYS_LVL1 (PERM_SYS_LVL0|(1<<6))
#define PERM_SYS_LVL2 (PERM_SYS_LVL1|(1<<7))
#define PERM_SYS_LVL3 (PERM_SYS_LVL2|(1<<8))
#define PERM_SDDATA (PERM_SDCARD|(1<<9))
#define PERM_MEMORY (1<<10)
#define PERM_GAME (1<<11) // can't be enabled, placeholder
#define PERM_XORPAD (1<<12) // can't be enabled, placeholder
#define PERM_CART (1<<13) // can't be enabled, placeholder
#define PERM_SDCARD (1UL<<0)
#define PERM_IMAGE (1UL<<1)
#define PERM_RAMDRIVE (1UL<<2)
#define PERM_EMU_LVL0 (1UL<<3)
#define PERM_EMU_LVL1 (PERM_EMU_LVL0|(1UL<<4))
#define PERM_SYS_LVL0 (1UL<<5)
#define PERM_SYS_LVL1 (PERM_SYS_LVL0|(1UL<<6))
#define PERM_SYS_LVL2 (PERM_SYS_LVL1|(1UL<<7))
#define PERM_SYS_LVL3 (PERM_SYS_LVL2|(1UL<<8))
#define PERM_SDDATA (PERM_SDCARD|(1UL<<9))
#define PERM_MEMORY (1UL<<10)
#define PERM_GAME (1UL<<11) // can't be enabled, placeholder
#define PERM_XORPAD (1UL<<12) // can't be enabled, placeholder
#define PERM_CART (1UL<<13) // can't be enabled, placeholder
#define PERM_BASE (PERM_SDCARD | PERM_IMAGE | PERM_RAMDRIVE | PERM_EMU_LVL0 | PERM_SYS_LVL0)
#ifndef SAFEMODE
#define PERM_ALL (PERM_BASE | PERM_SDDATA | PERM_EMU_LVL1 | PERM_SYS_LVL2 | PERM_MEMORY)

View File

@ -11,8 +11,8 @@
#include "ff.h"
#include "ui.h"
#define SKIP_CUR (1<<3)
#define OVERWRITE_CUR (1<<4)
#define SKIP_CUR (1UL<<3)
#define OVERWRITE_CUR (1UL<<4)
// Volume2Partition resolution table
PARTITION VolToPart[] = {

View File

@ -7,9 +7,9 @@
// #include "fsperm.h"
// move / copy flags
#define ASK_ALL (1<<0)
#define SKIP_ALL (1<<1)
#define OVERWRITE_ALL (1<<2)
#define ASK_ALL (1UL<<0)
#define SKIP_ALL (1UL<<1)
#define OVERWRITE_ALL (1UL<<2)
/** Return total size of SD card **/
uint64_t GetSDCardSize();

View File

@ -2,13 +2,13 @@
#include "common.h"
#define NAND_SYSNAND (1<<0)
#define NAND_EMUNAND (1<<1)
#define NAND_IMGNAND (1<<2)
#define NAND_ZERONAND (1<<3)
#define NAND_TYPE_O3DS (1<<4)
#define NAND_TYPE_N3DS (1<<5)
#define NAND_TYPE_NO3DS (1<<6)
#define NAND_SYSNAND (1UL<<0)
#define NAND_EMUNAND (1UL<<1)
#define NAND_IMGNAND (1UL<<2)
#define NAND_ZERONAND (1UL<<3)
#define NAND_TYPE_O3DS (1UL<<4)
#define NAND_TYPE_N3DS (1UL<<5)
#define NAND_TYPE_NO3DS (1UL<<6)
// minimum size of NAND memory
#define NAND_MIN_SECTORS_O3DS 0x1D7800

View File

@ -2,7 +2,7 @@
#include "gamecart.h"
#define FAT_LIMIT 0x100000000
#define VFLAG_PRIV_HDR (1<<31)
#define VFLAG_PRIV_HDR (1UL<<31)
static CartData* cdata = (CartData*) VCART_BUFFER; // 128kB reserved (~64kB required)
static bool cart_init = false;

View File

@ -3,16 +3,16 @@
#include "game.h"
#include "aes.h"
#define VFLAG_FIRM_SECTION (1<<22)
#define VFLAG_FIRM_ARM9 (1<<23)
#define VFLAG_FIRM (1<<24)
#define VFLAG_EXEFS_FILE (1<<25)
#define VFLAG_EXTHDR (1<<26)
#define VFLAG_CIA (1<<27)
#define VFLAG_NCSD (1<<28)
#define VFLAG_NCCH (1<<29)
#define VFLAG_EXEFS (1<<30)
#define VFLAG_ROMFS (1<<31)
#define VFLAG_FIRM_SECTION (1UL<<22)
#define VFLAG_FIRM_ARM9 (1UL<<23)
#define VFLAG_FIRM (1UL<<24)
#define VFLAG_EXEFS_FILE (1UL<<25)
#define VFLAG_EXTHDR (1UL<<26)
#define VFLAG_CIA (1UL<<27)
#define VFLAG_NCSD (1UL<<28)
#define VFLAG_NCCH (1UL<<29)
#define VFLAG_EXEFS (1UL<<30)
#define VFLAG_ROMFS (1UL<<31)
#define VFLAG_GAMEDIR (VFLAG_FIRM|VFLAG_CIA|VFLAG_NCSD|VFLAG_NCCH|VFLAG_EXEFS|VFLAG_ROMFS|VFLAG_LV3)
#define NAME_FIRM_HEADER "header.bin"

View File

@ -8,16 +8,16 @@
#define VRT_EMUNAND NAND_EMUNAND
#define VRT_IMGNAND NAND_IMGNAND
#define VRT_XORPAD NAND_ZERONAND
#define VRT_MEMORY (1<<10)
#define VRT_GAME (1<<11)
#define VRT_TICKDB (1<<12)
#define VRT_CART (1<<13)
#define VRT_MEMORY (1UL<<10)
#define VRT_GAME (1UL<<11)
#define VRT_TICKDB (1UL<<12)
#define VRT_CART (1UL<<13)
#define VRT_SOURCE (VRT_SYSNAND|VRT_EMUNAND|VRT_IMGNAND|VRT_XORPAD|VRT_MEMORY|VRT_GAME|VRT_TICKDB|VRT_CART)
#define VFLAG_DIR (1<<16)
#define VFLAG_ROOT (1<<17)
#define VFLAG_LV3 (1<<18)
#define VFLAG_DIR (1UL<<16)
#define VFLAG_ROOT (1UL<<17)
#define VFLAG_LV3 (1UL<<18)
#define VRT_DRIVES {'S', VRT_SYSNAND}, {'E', VRT_EMUNAND}, {'I', VRT_IMGNAND}, {'X', VRT_XORPAD }, \
{'M', VRT_MEMORY}, {'G', VRT_GAME}, {'T', VRT_TICKDB}, {'C', VRT_CART}

View File

@ -1,7 +1,7 @@
#include "vmem.h"
#include "platform.h"
#define VFLAG_N3DS_ONLY (1<<31)
#define VFLAG_N3DS_ONLY (1UL<<31)
// see: http://3dbrew.org/wiki/Memory_layout#ARM9
static const VirtualFile vMemFileTemplates[] = {

View File

@ -7,9 +7,9 @@
#define VFLAG_ON_N3DS NAND_TYPE_N3DS
#define VFLAG_ON_NO3DS NAND_TYPE_NO3DS
#define VFLAG_ON_NAND (VFLAG_ON_O3DS | VFLAG_ON_N3DS | VFLAG_ON_NO3DS)
#define VFLAG_GBA_VC (1<<29)
#define VFLAG_NEEDS_OTP (1<<30)
#define VFLAG_NAND_SIZE (1<<31)
#define VFLAG_GBA_VC (1UL<<29)
#define VFLAG_NEEDS_OTP (1UL<<30)
#define VFLAG_NAND_SIZE (1UL<<31)
// see: http://3dbrew.org/wiki/Flash_Filesystem#NAND_structure
// too much hardcoding, but more readable this way

View File

@ -2,9 +2,9 @@
#include "image.h"
#include "ticket.h"
#define VFLAG_UNKNOWN (1<<29)
#define VFLAG_ESHOP (1<<30)
#define VFLAG_SYSTEM (1<<31)
#define VFLAG_UNKNOWN (1UL<<29)
#define VFLAG_ESHOP (1UL<<30)
#define VFLAG_SYSTEM (1UL<<31)
#define VFLAG_TICKDIR (VFLAG_UNKNOWN|VFLAG_ESHOP|VFLAG_SYSTEM)
#define NAME_TIK "%02lX.%016llX.%08lX" // index / title id / console id