From a2ff3dcb0aff4afac613de06ff80bdeaa05ad14f Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Tue, 3 May 2016 00:34:46 -0700 Subject: [PATCH] Eliminate all warnings in HighlyComplete and child frameworks. --- .../HighlyAdvanced/vbam/apu/Blip_Buffer.cpp | 2 +- .../HighlyAdvanced/vbam/gba/GBA.cpp | 4 +- .../HighlyTheoretical/Core/arm.c | 4 ++ Frameworks/SSEQPlayer/SSEQPlayer/Channel.cpp | 2 +- Frameworks/SSEQPlayer/SSEQPlayer/SWAV.cpp | 2 +- Frameworks/SSEQPlayer/SSEQPlayer/consts.h | 2 +- .../lazyusf/lazyusf.xcodeproj/project.pbxproj | 4 -- .../lazyusf/debugger/dbg_decoder_local.h | 2 + Frameworks/lazyusf/lazyusf/main/savestates.c | 2 +- Frameworks/lazyusf/lazyusf/memory/memory.c | 4 +- Frameworks/lazyusf/lazyusf/pi/pi_controller.c | 2 +- .../lazyusf/lazyusf/r4300/interpreter_tlb.def | 4 +- Frameworks/lazyusf/lazyusf/r4300/r4300.c | 2 +- .../lazyusf/lazyusf/r4300/x86_64/gspecial.c | 8 ++-- .../lazyusf/lazyusf/r4300/x86_64/rjump.c | 2 +- .../lazyusf/lazyusf/ri/rdram_detection_hack.c | 2 +- Frameworks/lazyusf/lazyusf/rsp_hle/alist.c | 4 +- .../lazyusf/lazyusf/rsp_hle/arithmetics.h | 4 +- Frameworks/lazyusf/lazyusf/rsp_hle/common.h | 4 +- Frameworks/lazyusf/lazyusf/rsp_hle/jpeg.c | 2 +- Frameworks/lazyusf/lazyusf/rsp_hle/memory.h | 44 +++++++++---------- Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c | 2 +- Frameworks/lazyusf/lazyusf/rsp_lle/su.h | 2 +- Frameworks/lazyusf/lazyusf/rsp_lle/vu/clamp.h | 2 +- .../lazyusf/lazyusf/si/game_controller.c | 6 +-- .../vio2sf/vio2sf.xcodeproj/project.pbxproj | 10 +---- .../vio2sf/vio2sf/src/vio2sf/desmume/armcpu.c | 2 +- .../vio2sf/vio2sf/src/vio2sf/desmume/armcpu.h | 2 +- .../vio2sf/src/vio2sf/desmume/resampler.c | 6 +-- 29 files changed, 67 insertions(+), 71 deletions(-) diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Blip_Buffer.cpp b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Blip_Buffer.cpp index b27e6bf00..4fea95532 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Blip_Buffer.cpp +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/apu/Blip_Buffer.cpp @@ -447,7 +447,7 @@ void Blip_Buffer::mix_samples( blip_sample_t const* in, long count ) *out -= prev; } -blip_ulong const subsample_mask = (1L << BLIP_BUFFER_ACCURACY) - 1; +/*blip_ulong const subsample_mask = (1L << BLIP_BUFFER_ACCURACY) - 1;*/ void Blip_Buffer::save_state( blip_buffer_state_t* out ) { diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/GBA.cpp b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/GBA.cpp index 6807d9e23..95231fbea 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/GBA.cpp +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/vbam/gba/GBA.cpp @@ -252,9 +252,9 @@ const u8 gamepakWaitState[4] = { 4, 3, 2, 8 }; const u8 gamepakWaitState0[2] = { 2, 1 }; const u8 gamepakWaitState1[2] = { 4, 1 }; const u8 gamepakWaitState2[2] = { 8, 1 }; -const bool isInRom [16]= +/*const bool isInRom [16]= { false, false, false, false, false, false, false, false, - true, true, true, true, true, true, false, false }; + true, true, true, true, true, true, false, false };*/ const u32 myROM[] = { 0xEA000006, diff --git a/Frameworks/HighlyTheoretical/HighlyTheoretical/Core/arm.c b/Frameworks/HighlyTheoretical/HighlyTheoretical/Core/arm.c index 2d280927a..b06f3c61b 100644 --- a/Frameworks/HighlyTheoretical/HighlyTheoretical/Core/arm.c +++ b/Frameworks/HighlyTheoretical/HighlyTheoretical/Core/arm.c @@ -349,6 +349,7 @@ static EMU_INLINE uint32 lb(struct ARM_STATE *state, uint32 a) { } } +#if 0 static EMU_INLINE uint32 lh(struct ARM_STATE *state, uint32 a) { struct ARM_MEMORY_TYPE *t; uint32 sh; @@ -366,6 +367,7 @@ static EMU_INLINE uint32 lh(struct ARM_STATE *state, uint32 a) { //armsubtimeoff(); return a & 0xFFFF; } +#endif static EMU_INLINE uint32 lw(struct ARM_STATE *state, uint32 a) { struct ARM_MEMORY_TYPE *t; @@ -401,6 +403,7 @@ static EMU_INLINE void sb(struct ARM_STATE *state, uint32 a, uint32 d) { //armsubtimeoff(); } +#if 0 static EMU_INLINE void sh(struct ARM_STATE *state, uint32 a, uint32 d) { struct ARM_MEMORY_TYPE *t; uint32 sh; @@ -418,6 +421,7 @@ static EMU_INLINE void sh(struct ARM_STATE *state, uint32 a, uint32 d) { } //armsubtimeoff(); } +#endif static EMU_INLINE void sw(struct ARM_STATE *state, uint32 a, uint32 d) { struct ARM_MEMORY_TYPE *t; diff --git a/Frameworks/SSEQPlayer/SSEQPlayer/Channel.cpp b/Frameworks/SSEQPlayer/SSEQPlayer/Channel.cpp index 091964bc8..4a378252b 100644 --- a/Frameworks/SSEQPlayer/SSEQPlayer/Channel.cpp +++ b/Frameworks/SSEQPlayer/SSEQPlayer/Channel.cpp @@ -544,7 +544,7 @@ void Channel::Update() modParam = Cnv_Sine(this->modCounter >> 8) * this->modRange * this->modDepth; if (!this->modType) - modParam = static_cast(modParam * 60) >> 14; + modParam = static_cast(static_cast(modParam * 60) >> 14); else // This ugly formula whose exact meaning and workings I cannot figure out is used for volume/pan modulation. modParam = ((modParam & ~0xFC000000) >> 8) | ((((modParam < 0 ? -1 : 0) << 6) | (static_cast(modParam) >> 26)) << 18); diff --git a/Frameworks/SSEQPlayer/SSEQPlayer/SWAV.cpp b/Frameworks/SSEQPlayer/SSEQPlayer/SWAV.cpp index d16702a7e..b8229c52b 100644 --- a/Frameworks/SSEQPlayer/SSEQPlayer/SWAV.cpp +++ b/Frameworks/SSEQPlayer/SSEQPlayer/SWAV.cpp @@ -115,7 +115,7 @@ void SWAV::Read(PseudoFile &file) { // IMA ADPCM -> PCM signed 16-bit this->data.resize((origData.size() - 4) * 2, 0); - this->DecodeADPCM(&origData[0], origData.size() - 4); + this->DecodeADPCM(&origData[0], (uint32_t)(origData.size() - 4)); --this->loopOffset; this->loopOffset *= 8; this->nonLoopLength *= 8; diff --git a/Frameworks/SSEQPlayer/SSEQPlayer/consts.h b/Frameworks/SSEQPlayer/SSEQPlayer/consts.h index be1cc9a3d..a9533d46b 100644 --- a/Frameworks/SSEQPlayer/SSEQPlayer/consts.h +++ b/Frameworks/SSEQPlayer/SSEQPlayer/consts.h @@ -35,7 +35,7 @@ const int FSS_MAXTRACKS = 32; const int FSS_TRACKSTACKSIZE = 3; const int AMPL_K = 723; const int AMPL_MIN = -AMPL_K; -const int AMPL_THRESHOLD = AMPL_MIN << 7; +const int AMPL_THRESHOLD = AMPL_MIN * 128; inline int SOUND_FREQ(int n) { return -0x1000000 / n; } diff --git a/Frameworks/lazyusf/lazyusf.xcodeproj/project.pbxproj b/Frameworks/lazyusf/lazyusf.xcodeproj/project.pbxproj index fbc63b674..2a60c9ae4 100644 --- a/Frameworks/lazyusf/lazyusf.xcodeproj/project.pbxproj +++ b/Frameworks/lazyusf/lazyusf.xcodeproj/project.pbxproj @@ -53,7 +53,6 @@ 83CA15861A988138005E7ED4 /* exception.c in Sources */ = {isa = PBXBuildFile; fileRef = 83CA14A31A988138005E7ED4 /* exception.c */; }; 83CA15871A988138005E7ED4 /* exception.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CA14A41A988138005E7ED4 /* exception.h */; }; 83CA15881A988138005E7ED4 /* fpu.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CA14A51A988138005E7ED4 /* fpu.h */; }; - 83CA15891A988138005E7ED4 /* instr_counters.c in Sources */ = {isa = PBXBuildFile; fileRef = 83CA14A61A988138005E7ED4 /* instr_counters.c */; }; 83CA158A1A988138005E7ED4 /* instr_counters.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CA14A71A988138005E7ED4 /* instr_counters.h */; }; 83CA158B1A988138005E7ED4 /* interpreter.def in Resources */ = {isa = PBXBuildFile; fileRef = 83CA14A81A988138005E7ED4 /* interpreter.def */; }; 83CA158C1A988138005E7ED4 /* interpreter_cop0.def in Resources */ = {isa = PBXBuildFile; fileRef = 83CA14A91A988138005E7ED4 /* interpreter_cop0.def */; }; @@ -250,7 +249,6 @@ 83CA14A31A988138005E7ED4 /* exception.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = exception.c; sourceTree = ""; }; 83CA14A41A988138005E7ED4 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; 83CA14A51A988138005E7ED4 /* fpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fpu.h; sourceTree = ""; }; - 83CA14A61A988138005E7ED4 /* instr_counters.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = instr_counters.c; sourceTree = ""; }; 83CA14A71A988138005E7ED4 /* instr_counters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = instr_counters.h; sourceTree = ""; }; 83CA14A81A988138005E7ED4 /* interpreter.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = interpreter.def; sourceTree = ""; }; 83CA14A91A988138005E7ED4 /* interpreter_cop0.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = interpreter_cop0.def; sourceTree = ""; }; @@ -570,7 +568,6 @@ 83CA14A31A988138005E7ED4 /* exception.c */, 83CA14A41A988138005E7ED4 /* exception.h */, 83CA14A51A988138005E7ED4 /* fpu.h */, - 83CA14A61A988138005E7ED4 /* instr_counters.c */, 83CA14A71A988138005E7ED4 /* instr_counters.h */, 83CA14A81A988138005E7ED4 /* interpreter.def */, 83CA14A91A988138005E7ED4 /* interpreter_cop0.def */, @@ -1024,7 +1021,6 @@ 83CA15DE1A988138005E7ED4 /* alist_audio.c in Sources */, 83CA15D81A988138005E7ED4 /* ri_controller.c in Sources */, 83CA15861A988138005E7ED4 /* exception.c in Sources */, - 83CA15891A988138005E7ED4 /* instr_counters.c in Sources */, 83CA15C61A988138005E7ED4 /* gcop1_d.c in Sources */, 83CA16291A988138005E7ED4 /* cic.c in Sources */, 83CA15A11A988138005E7ED4 /* pure_interp.c in Sources */, diff --git a/Frameworks/lazyusf/lazyusf/debugger/dbg_decoder_local.h b/Frameworks/lazyusf/lazyusf/debugger/dbg_decoder_local.h index 5ec6372ff..6a7128d17 100644 --- a/Frameworks/lazyusf/lazyusf/debugger/dbg_decoder_local.h +++ b/Frameworks/lazyusf/lazyusf/debugger/dbg_decoder_local.h @@ -600,8 +600,10 @@ /* * The floating point version and status registers. */ +#if 0 #define MIPS_FPU_ID $0 #define MIPS_FPU_CSR $31 +#endif /* * The floating point coprocessor status register bits. diff --git a/Frameworks/lazyusf/lazyusf/main/savestates.c b/Frameworks/lazyusf/lazyusf/main/savestates.c index a689adb23..a15f114e2 100644 --- a/Frameworks/lazyusf/lazyusf/main/savestates.c +++ b/Frameworks/lazyusf/lazyusf/main/savestates.c @@ -58,7 +58,7 @@ #include "vi/vi_controller.h" static const char* savestate_magic = "M64+SAVE"; -static const int savestate_latest_version = 0x00010000; /* 1.0 */ +/*static const int savestate_latest_version = 0x00010000; */ /* 1.0 */ static const unsigned char pj64_magic[4] = { 0xC8, 0xA6, 0xD8, 0x23 }; #define GETARRAY(buff, type, count) \ diff --git a/Frameworks/lazyusf/lazyusf/memory/memory.c b/Frameworks/lazyusf/lazyusf/memory/memory.c index 6cb530f66..8c559a55a 100644 --- a/Frameworks/lazyusf/lazyusf/memory/memory.c +++ b/Frameworks/lazyusf/lazyusf/memory/memory.c @@ -142,8 +142,8 @@ static int writew(writefn write_word, void* opaque, uint32_t address, uint32_t v static int writed(writefn write_word, void* opaque, uint32_t address, uint64_t value) { int result = - write_word(opaque, address , value >> 32, ~0U); - write_word(opaque, address + 4, value , ~0U); + write_word(opaque, address , (uint32_t)(value >> 32), ~0U); + write_word(opaque, address + 4, (uint32_t) value , ~0U); return result; } diff --git a/Frameworks/lazyusf/lazyusf/pi/pi_controller.c b/Frameworks/lazyusf/lazyusf/pi/pi_controller.c index c4884dddf..ea109828d 100644 --- a/Frameworks/lazyusf/lazyusf/pi/pi_controller.c +++ b/Frameworks/lazyusf/lazyusf/pi/pi_controller.c @@ -100,7 +100,7 @@ static void dma_pi_write(usf_state_t * state, struct pi_controller* pi) longueur = (pi->regs[PI_WR_LEN_REG] & 0xFFFFFF)+1; i = (pi->regs[PI_CART_ADDR_REG]-0x10000000)&0x3FFFFFF; longueur = (i + (int) longueur) > pi->cart_rom.rom_size ? - (pi->cart_rom.rom_size - i) : longueur; + (unsigned int)(pi->cart_rom.rom_size - i) : longueur; longueur = (pi->regs[PI_DRAM_ADDR_REG] + longueur) > 0x7FFFFF ? (0x7FFFFF - pi->regs[PI_DRAM_ADDR_REG]) : longueur; diff --git a/Frameworks/lazyusf/lazyusf/r4300/interpreter_tlb.def b/Frameworks/lazyusf/lazyusf/r4300/interpreter_tlb.def index b67eb85bc..0d181184d 100644 --- a/Frameworks/lazyusf/lazyusf/r4300/interpreter_tlb.def +++ b/Frameworks/lazyusf/lazyusf/r4300/interpreter_tlb.def @@ -60,7 +60,7 @@ static void TLBWrite(usf_state_t * state, unsigned int idx) md5_finish(&state, digest); for (j=0; j<16; j++) state->blocks[i]->md5[j] = digest[j];*/ - state->blocks[i]->adler32 = adler32(0, (const unsigned char *)&state->g_rdram[(state->tlb_LUT_r[i]&0x7FF000)/4], 0x1000); + state->blocks[i]->adler32 = (unsigned int) adler32(0, (const unsigned char *)&state->g_rdram[(state->tlb_LUT_r[i]&0x7FF000)/4], 0x1000); state->invalid_code[i] = 1; } @@ -91,7 +91,7 @@ static void TLBWrite(usf_state_t * state, unsigned int idx) md5_finish(&state, digest); for (j=0; j<16; j++) state->blocks[i]->md5[j] = digest[j];*/ - state->blocks[i]->adler32 = adler32(0, (const unsigned char *)&state->g_rdram[(state->tlb_LUT_r[i]&0x7FF000)/4], 0x1000); + state->blocks[i]->adler32 = (unsigned int) adler32(0, (const unsigned char *)&state->g_rdram[(state->tlb_LUT_r[i]&0x7FF000)/4], 0x1000); state->invalid_code[i] = 1; } diff --git a/Frameworks/lazyusf/lazyusf/r4300/r4300.c b/Frameworks/lazyusf/lazyusf/r4300/r4300.c index e4d0cd29a..9ccc09964 100644 --- a/Frameworks/lazyusf/lazyusf/r4300/r4300.c +++ b/Frameworks/lazyusf/lazyusf/r4300/r4300.c @@ -216,7 +216,7 @@ static void dynarec_setup_code() mov state, esi } #else - asm volatile + __asm __volatile #ifdef __x86_64__ (" mov %%r15, (%[state]) \n" #else diff --git a/Frameworks/lazyusf/lazyusf/r4300/x86_64/gspecial.c b/Frameworks/lazyusf/lazyusf/r4300/x86_64/gspecial.c index bdfe3aa53..3289449ef 100644 --- a/Frameworks/lazyusf/lazyusf/r4300/x86_64/gspecial.c +++ b/Frameworks/lazyusf/lazyusf/r4300/x86_64/gspecial.c @@ -192,8 +192,8 @@ void genjr(usf_state_t * state) gencallinterp(state, (unsigned long long)state->current_instruction_table.JR, 1); #else unsigned int diff = (unsigned int) offsetof(precomp_instr, local_addr); - unsigned int diff_need = (unsigned int) offsetof(precomp_instr, reg_cache_infos.need_map); - unsigned int diff_wrap = (unsigned int) offsetof(precomp_instr, reg_cache_infos.jump_wrapper); + unsigned int diff_need = (unsigned int) (offsetof(precomp_instr, reg_cache_infos) + offsetof(reg_cache_struct, need_map)); + unsigned int diff_wrap = (unsigned int) (offsetof(precomp_instr, reg_cache_infos) + offsetof(reg_cache_struct, jump_wrapper)); if (((state->dst->addr & 0xFFF) == 0xFFC && (state->dst->addr < 0x80000000 || state->dst->addr >= 0xC0000000))||state->no_compiled_jump) @@ -261,8 +261,8 @@ void genjalr(usf_state_t * state) gencallinterp(state, (unsigned long long)state->current_instruction_table.JALR, 0); #else unsigned int diff = (unsigned int) offsetof(precomp_instr, local_addr); - unsigned int diff_need = (unsigned int) offsetof(precomp_instr, reg_cache_infos.need_map); - unsigned int diff_wrap = (unsigned int) offsetof(precomp_instr, reg_cache_infos.jump_wrapper); + unsigned int diff_need = (unsigned int) (offsetof(precomp_instr, reg_cache_infos) + offsetof(reg_cache_struct, need_map)); + unsigned int diff_wrap = (unsigned int) (offsetof(precomp_instr, reg_cache_infos) + offsetof(reg_cache_struct, jump_wrapper)); if (((state->dst->addr & 0xFFF) == 0xFFC && (state->dst->addr < 0x80000000 || state->dst->addr >= 0xC0000000))||state->no_compiled_jump) diff --git a/Frameworks/lazyusf/lazyusf/r4300/x86_64/rjump.c b/Frameworks/lazyusf/lazyusf/r4300/x86_64/rjump.c index 5ea2680a0..4007b2d2e 100644 --- a/Frameworks/lazyusf/lazyusf/r4300/x86_64/rjump.c +++ b/Frameworks/lazyusf/lazyusf/r4300/x86_64/rjump.c @@ -58,7 +58,7 @@ void dyna_start(usf_state_t * state, void *code) /* It will jump to label 2, restore the base and stack pointers, and exit this function */ DebugMessage(state, M64MSG_INFO, "R4300: starting 64-bit dynamic recompiler at: %p", code); #if defined(__GNUC__) && defined(__x86_64__) - asm volatile + __asm __volatile (" push %%rbx \n" /* we must push an even # of registers to keep stack 16-byte aligned */ " push %%r12 \n" " push %%r13 \n" diff --git a/Frameworks/lazyusf/lazyusf/ri/rdram_detection_hack.c b/Frameworks/lazyusf/lazyusf/ri/rdram_detection_hack.c index 82c16bb4c..8c5100ea1 100644 --- a/Frameworks/lazyusf/lazyusf/ri/rdram_detection_hack.c +++ b/Frameworks/lazyusf/lazyusf/ri/rdram_detection_hack.c @@ -42,6 +42,6 @@ void force_detected_rdram_size_hack(usf_state_t * state) ? 0x318 : 0x3f0; - state->g_ri.rdram.dram[address/4] = state->g_ri.rdram.dram_size; + state->g_ri.rdram.dram[address/4] = (uint32_t) state->g_ri.rdram.dram_size; } diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c index 55279e6e8..21e9d9a5a 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/alist.c @@ -312,13 +312,13 @@ void alist_envmix_exp( if (ramps[0].step != 0) { - exp_seq[0] = ((int64_t)exp_seq[0]*(int64_t)exp_rates[0]) >> 16; + exp_seq[0] = (int32_t)(((int64_t)exp_seq[0]*(int64_t)exp_rates[0]) >> 16); ramps[0].step = (exp_seq[0] - ramps[0].value) >> 3; } if (ramps[1].step != 0) { - exp_seq[1] = ((int64_t)exp_seq[1]*(int64_t)exp_rates[1]) >> 16; + exp_seq[1] = (int32_t)(((int64_t)exp_seq[1]*(int64_t)exp_rates[1]) >> 16); ramps[1].step = (exp_seq[1] - ramps[1].value) >> 3; } diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h b/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h index 529293d25..a6ac36484 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/arithmetics.h @@ -26,7 +26,7 @@ #include "common.h" -static inline int16_t clamp_s16(int_fast32_t x) +static INLINE int16_t clamp_s16(int_fast32_t x) { x = (x < INT16_MIN) ? INT16_MIN: x; x = (x > INT16_MAX) ? INT16_MAX: x; @@ -34,7 +34,7 @@ static inline int16_t clamp_s16(int_fast32_t x) return x; } -static inline int32_t vmulf(int16_t x, int16_t y) +static INLINE int32_t vmulf(int16_t x, int16_t y) { return (((int32_t)(x))*((int32_t)(y))+0x4000)>>15; } diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/common.h b/Frameworks/lazyusf/lazyusf/rsp_hle/common.h index 195b8641a..904c5197c 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/common.h +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/common.h @@ -30,9 +30,9 @@ #endif #ifdef _MSC_VER -# define inline __forceinline +# define INLINE __forceinline #elif defined __GNUC__ -# define inline inline __attribute__((always_inline)) +# define INLINE inline __attribute__((always_inline)) #endif #endif diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/jpeg.c b/Frameworks/lazyusf/lazyusf/rsp_hle/jpeg.c index bde1d6b69..6def24b1d 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/jpeg.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/jpeg.c @@ -474,7 +474,7 @@ static void ReorderSubBlock(int16_t *dst, const int16_t *src, const unsigned int unsigned int i; /* source and destination sublocks cannot overlap */ - assert(abs(dst - src) > SUBBLOCK_SIZE); + assert(labs(dst - src) > SUBBLOCK_SIZE); for (i = 0; i < SUBBLOCK_SIZE; ++i) dst[i] = src[table[i]]; diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/memory.h b/Frameworks/lazyusf/lazyusf/rsp_hle/memory.h index 91a747b16..46b02a884 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/memory.h +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/memory.h @@ -57,24 +57,24 @@ enum { TASK_YIELD_DATA_SIZE = 0xffc }; -static inline unsigned int align(unsigned int x, unsigned amount) +static INLINE unsigned int align(unsigned int x, unsigned amount) { --amount; return (x + amount) & ~amount; } -static inline uint8_t* u8(const unsigned char* buffer, unsigned address) +static INLINE uint8_t* u8(const unsigned char* buffer, unsigned address) { return (uint8_t*)(buffer + (address ^ S8)); } -static inline uint16_t* u16(const unsigned char* buffer, unsigned address) +static INLINE uint16_t* u16(const unsigned char* buffer, unsigned address) { assert((address & 1) == 0); return (uint16_t*)(buffer + (address ^ S16)); } -static inline uint32_t* u32(const unsigned char* buffer, unsigned address) +static INLINE uint32_t* u32(const unsigned char* buffer, unsigned address) { assert((address & 3) == 0); return (uint32_t*)(buffer + address); @@ -89,93 +89,93 @@ void store_u32(unsigned char* buffer, unsigned address, const uint32_t* src, siz /* convenient functions for DMEM access */ -static inline uint8_t* dmem_u8(struct hle_t* hle, uint16_t address) +static INLINE uint8_t* dmem_u8(struct hle_t* hle, uint16_t address) { return u8(hle->dmem, address & 0xfff); } -static inline uint16_t* dmem_u16(struct hle_t* hle, uint16_t address) +static INLINE uint16_t* dmem_u16(struct hle_t* hle, uint16_t address) { return u16(hle->dmem, address & 0xfff); } -static inline uint32_t* dmem_u32(struct hle_t* hle, uint16_t address) +static INLINE uint32_t* dmem_u32(struct hle_t* hle, uint16_t address) { return u32(hle->dmem, address & 0xfff); } -static inline void dmem_load_u8(struct hle_t* hle, uint8_t* dst, uint16_t address, size_t count) +static INLINE void dmem_load_u8(struct hle_t* hle, uint8_t* dst, uint16_t address, size_t count) { load_u8(dst, hle->dmem, address & 0xfff, count); } -static inline void dmem_load_u16(struct hle_t* hle, uint16_t* dst, uint16_t address, size_t count) +static INLINE void dmem_load_u16(struct hle_t* hle, uint16_t* dst, uint16_t address, size_t count) { load_u16(dst, hle->dmem, address & 0xfff, count); } -static inline void dmem_load_u32(struct hle_t* hle, uint32_t* dst, uint16_t address, size_t count) +static INLINE void dmem_load_u32(struct hle_t* hle, uint32_t* dst, uint16_t address, size_t count) { load_u32(dst, hle->dmem, address & 0xfff, count); } -static inline void dmem_store_u8(struct hle_t* hle, const uint8_t* src, uint16_t address, size_t count) +static INLINE void dmem_store_u8(struct hle_t* hle, const uint8_t* src, uint16_t address, size_t count) { store_u8(hle->dmem, address & 0xfff, src, count); } -static inline void dmem_store_u16(struct hle_t* hle, const uint16_t* src, uint16_t address, size_t count) +static INLINE void dmem_store_u16(struct hle_t* hle, const uint16_t* src, uint16_t address, size_t count) { store_u16(hle->dmem, address & 0xfff, src, count); } -static inline void dmem_store_u32(struct hle_t* hle, const uint32_t* src, uint16_t address, size_t count) +static INLINE void dmem_store_u32(struct hle_t* hle, const uint32_t* src, uint16_t address, size_t count) { store_u32(hle->dmem, address & 0xfff, src, count); } /* convenient functions DRAM access */ -static inline uint8_t* dram_u8(struct hle_t* hle, uint32_t address) +static INLINE uint8_t* dram_u8(struct hle_t* hle, uint32_t address) { return u8(hle->dram, address & 0xffffff); } -static inline uint16_t* dram_u16(struct hle_t* hle, uint32_t address) +static INLINE uint16_t* dram_u16(struct hle_t* hle, uint32_t address) { return u16(hle->dram, address & 0xffffff); } -static inline uint32_t* dram_u32(struct hle_t* hle, uint32_t address) +static INLINE uint32_t* dram_u32(struct hle_t* hle, uint32_t address) { return u32(hle->dram, address & 0xffffff); } -static inline void dram_load_u8(struct hle_t* hle, uint8_t* dst, uint32_t address, size_t count) +static INLINE void dram_load_u8(struct hle_t* hle, uint8_t* dst, uint32_t address, size_t count) { load_u8(dst, hle->dram, address & 0xffffff, count); } -static inline void dram_load_u16(struct hle_t* hle, uint16_t* dst, uint32_t address, size_t count) +static INLINE void dram_load_u16(struct hle_t* hle, uint16_t* dst, uint32_t address, size_t count) { load_u16(dst, hle->dram, address & 0xffffff, count); } -static inline void dram_load_u32(struct hle_t* hle, uint32_t* dst, uint32_t address, size_t count) +static INLINE void dram_load_u32(struct hle_t* hle, uint32_t* dst, uint32_t address, size_t count) { load_u32(dst, hle->dram, address & 0xffffff, count); } -static inline void dram_store_u8(struct hle_t* hle, const uint8_t* src, uint32_t address, size_t count) +static INLINE void dram_store_u8(struct hle_t* hle, const uint8_t* src, uint32_t address, size_t count) { store_u8(hle->dram, address & 0xffffff, src, count); } -static inline void dram_store_u16(struct hle_t* hle, const uint16_t* src, uint32_t address, size_t count) +static INLINE void dram_store_u16(struct hle_t* hle, const uint16_t* src, uint32_t address, size_t count) { store_u16(hle->dram, address & 0xffffff, src, count); } -static inline void dram_store_u32(struct hle_t* hle, const uint32_t* src, uint32_t address, size_t count) +static INLINE void dram_store_u32(struct hle_t* hle, const uint32_t* src, uint32_t address, size_t count) { store_u32(hle->dram, address & 0xffffff, src, count); } diff --git a/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c b/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c index 36b7b7c5f..6243b2efd 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c +++ b/Frameworks/lazyusf/lazyusf/rsp_hle/musyx.c @@ -727,7 +727,7 @@ static void mix_voice_samples(struct hle_t* hle, musyx_t *musyx, pitch_accu += pitch_step; /* handle end/restart points */ - dist = sample - sample_end; + dist = (int)(sample - sample_end); if (dist >= 0) sample = sample_restart + dist; diff --git a/Frameworks/lazyusf/lazyusf/rsp_lle/su.h b/Frameworks/lazyusf/lazyusf/rsp_lle/su.h index 20ee96800..4abc8706f 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_lle/su.h +++ b/Frameworks/lazyusf/lazyusf/rsp_lle/su.h @@ -73,7 +73,7 @@ static void set_PC(usf_state_t * state, int address) #define SR_B(s, i) (*(byte *)(((byte *)(state->SR + s)) + BES(i))) #define SR_S(s, i) (*(short *)(((byte *)(state->SR + s)) + HES(i))) #define SE(x, b) (-((signed int)x & (1 << b)) | (x & ~(~0 << b))) -#define ZE(x, b) (+(x & (1 << b)) | (x & ~(~0 << b))) +#define ZE(x, b) (+(x & (1 << b)) | (x & ~(~0UL << b))) static void ULW(usf_state_t *, int rd, uint32_t addr); static void USW(usf_state_t *, int rs, uint32_t addr); diff --git a/Frameworks/lazyusf/lazyusf/rsp_lle/vu/clamp.h b/Frameworks/lazyusf/lazyusf/rsp_lle/vu/clamp.h index d238931af..d4db20308 100644 --- a/Frameworks/lazyusf/lazyusf/rsp_lle/vu/clamp.h +++ b/Frameworks/lazyusf/lazyusf/rsp_lle/vu/clamp.h @@ -251,7 +251,7 @@ static INLINE void SIGNED_CLAMP_AM(usf_state_t * state, short* VD) * just one extra scalar x86 instruction for every RSP vector op-code when we * use SSE2 explicitly for this particular goal instead of letting GCC do it. */ -static INLINE void vector_copy(short* VD, short* VS) +INLINE void vector_copy(short* VD, short* VS) { __m128i xmm; diff --git a/Frameworks/lazyusf/lazyusf/si/game_controller.c b/Frameworks/lazyusf/lazyusf/si/game_controller.c index 377ccc00f..d4175c2f2 100644 --- a/Frameworks/lazyusf/lazyusf/si/game_controller.c +++ b/Frameworks/lazyusf/lazyusf/si/game_controller.c @@ -33,7 +33,7 @@ #include - +#if 0 static uint8_t pak_data_crc(const uint8_t* data) { size_t i; @@ -52,7 +52,7 @@ static uint8_t pak_data_crc(const uint8_t* data) } return crc; } - +#endif static void read_controller_read_buttons(struct game_controller* cont, uint8_t* cmd) { @@ -75,7 +75,7 @@ static void controller_status_command(struct game_controller* cont, uint8_t* cmd static void controller_read_buttons_command(struct game_controller* cont, uint8_t* cmd) { - enum pak_type pak; + /*enum pak_type pak;*/ int connected = 0; if (!connected) diff --git a/Frameworks/vio2sf/vio2sf.xcodeproj/project.pbxproj b/Frameworks/vio2sf/vio2sf.xcodeproj/project.pbxproj index c60c8576d..b6ab1628a 100644 --- a/Frameworks/vio2sf/vio2sf.xcodeproj/project.pbxproj +++ b/Frameworks/vio2sf/vio2sf.xcodeproj/project.pbxproj @@ -32,7 +32,6 @@ 83DE0C90180A9CA400269051 /* FIFO.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C55180A9CA400269051 /* FIFO.h */; }; 83DE0C91180A9CA400269051 /* GPU.c in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C56180A9CA400269051 /* GPU.c */; }; 83DE0C92180A9CA400269051 /* GPU.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C57180A9CA400269051 /* GPU.h */; }; - 83DE0C93180A9CA400269051 /* instruction_tabdef.inc in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C58180A9CA400269051 /* instruction_tabdef.inc */; }; 83DE0C94180A9CA400269051 /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C59180A9CA400269051 /* matrix.c */; }; 83DE0C95180A9CA400269051 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C5A180A9CA400269051 /* matrix.h */; }; 83DE0C96180A9CA400269051 /* mc.c in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C5B180A9CA400269051 /* mc.c */; }; @@ -48,7 +47,6 @@ 83DE0CA3180A9CA400269051 /* spu_exports.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C68180A9CA400269051 /* spu_exports.h */; settings = {ATTRIBUTES = (Public, ); }; }; 83DE0CA4180A9CA400269051 /* thumb_instructions.c in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C69180A9CA400269051 /* thumb_instructions.c */; }; 83DE0CA5180A9CA400269051 /* thumb_instructions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C6A180A9CA400269051 /* thumb_instructions.h */; }; - 83DE0CA6180A9CA400269051 /* thumb_tabdef.inc in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0C6B180A9CA400269051 /* thumb_tabdef.inc */; }; 83DE0CA7180A9CA400269051 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0C6C180A9CA400269051 /* types.h */; settings = {ATTRIBUTES = (Public, ); }; }; 83DE0CB8180A9FD000269051 /* state.c in Sources */ = {isa = PBXBuildFile; fileRef = 83DE0CB7180A9FD000269051 /* state.c */; }; 83DE0CBE180B21DD00269051 /* state.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DE0CB9180A9FE300269051 /* state.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -82,7 +80,6 @@ 83DE0C55180A9CA400269051 /* FIFO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIFO.h; sourceTree = ""; }; 83DE0C56180A9CA400269051 /* GPU.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GPU.c; sourceTree = ""; }; 83DE0C57180A9CA400269051 /* GPU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPU.h; sourceTree = ""; }; - 83DE0C58180A9CA400269051 /* instruction_tabdef.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = instruction_tabdef.inc; sourceTree = ""; }; 83DE0C59180A9CA400269051 /* matrix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = matrix.c; sourceTree = ""; }; 83DE0C5A180A9CA400269051 /* matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = matrix.h; sourceTree = ""; }; 83DE0C5B180A9CA400269051 /* mc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mc.c; sourceTree = ""; }; @@ -98,7 +95,6 @@ 83DE0C68180A9CA400269051 /* spu_exports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spu_exports.h; sourceTree = ""; }; 83DE0C69180A9CA400269051 /* thumb_instructions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = thumb_instructions.c; sourceTree = ""; }; 83DE0C6A180A9CA400269051 /* thumb_instructions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thumb_instructions.h; sourceTree = ""; }; - 83DE0C6B180A9CA400269051 /* thumb_tabdef.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = thumb_tabdef.inc; sourceTree = ""; }; 83DE0C6C180A9CA400269051 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; 83DE0CB7180A9FD000269051 /* state.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = state.c; sourceTree = ""; }; 83DE0CB9180A9FE300269051 /* state.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = state.h; sourceTree = ""; }; @@ -201,7 +197,6 @@ 83DE0C55180A9CA400269051 /* FIFO.h */, 83DE0C56180A9CA400269051 /* GPU.c */, 83DE0C57180A9CA400269051 /* GPU.h */, - 83DE0C58180A9CA400269051 /* instruction_tabdef.inc */, 83DE0C59180A9CA400269051 /* matrix.c */, 83DE0C5A180A9CA400269051 /* matrix.h */, 83DE0C5B180A9CA400269051 /* mc.c */, @@ -217,7 +212,6 @@ 83DE0C68180A9CA400269051 /* spu_exports.h */, 83DE0C69180A9CA400269051 /* thumb_instructions.c */, 83DE0C6A180A9CA400269051 /* thumb_instructions.h */, - 83DE0C6B180A9CA400269051 /* thumb_tabdef.inc */, 83DE0C6C180A9CA400269051 /* types.h */, 83DE0CB7180A9FD000269051 /* state.c */, 83DE0CB9180A9FE300269051 /* state.h */, @@ -329,7 +323,6 @@ 83DE0C8F180A9CA400269051 /* FIFO.c in Sources */, 83DE0CA1180A9CA400269051 /* SPU.cpp in Sources */, 83DE0C86180A9CA400269051 /* bios.c in Sources */, - 83DE0CA6180A9CA400269051 /* thumb_tabdef.inc in Sources */, 83DE0C96180A9CA400269051 /* mc.c in Sources */, 83DE0C91180A9CA400269051 /* GPU.c in Sources */, 83699ABA1AB3D8EB00F5A6E3 /* barray.c in Sources */, @@ -337,7 +330,6 @@ 83DE0C84180A9CA400269051 /* armcpu.c in Sources */, 83DE0C94180A9CA400269051 /* matrix.c in Sources */, 833B1A3E180BAD0200414852 /* isqrt.c in Sources */, - 83DE0C93180A9CA400269051 /* instruction_tabdef.inc in Sources */, 83DE0C9B180A9CA400269051 /* NDSSystem.c in Sources */, 83DE0CB8180A9FD000269051 /* state.c in Sources */, 83DD1A0318EA634F00DADA1A /* resampler.c in Sources */, @@ -434,6 +426,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = c11; INFOPLIST_FILE = "vio2sf/vio2sf-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -451,6 +444,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = c11; INFOPLIST_FILE = "vio2sf/vio2sf-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.c b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.c index 07e9767a5..381c4f519 100755 --- a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.c +++ b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.c @@ -356,7 +356,7 @@ u32 armcpu_switchMode(armcpu_t *armcpu, u8 mode) return oldmode; } -static u32 +u32 armcpu_prefetch(armcpu_t *armcpu) { #ifdef GDB_STUB diff --git a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.h b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.h index 9c0d17304..5b220e190 100755 --- a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.h +++ b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/armcpu.h @@ -236,7 +236,7 @@ int armcpu_new( NDS_state *, armcpu_t *armcpu, u32 id); void armcpu_init(armcpu_t *armcpu, u32 adr); u32 armcpu_switchMode(armcpu_t *armcpu, u8 mode); #ifndef GDB_STUB -static u32 armcpu_prefetch(armcpu_t *armcpu); +u32 armcpu_prefetch(armcpu_t *armcpu); #endif u32 armcpu_exec(armcpu_t *armcpu); BOOL armcpu_irqExeption(armcpu_t *armcpu); diff --git a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/resampler.c b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/resampler.c index 377d4265c..86d326808 100644 --- a/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/resampler.c +++ b/Frameworks/vio2sf/vio2sf/src/vio2sf/desmume/resampler.c @@ -63,21 +63,21 @@ static inline void __cpuid(int *data, int selector) { #if defined(__PIC__) && defined(__i386__) - asm("xchgl %%ebx, %%esi; cpuid; xchgl %%ebx, %%esi" + __asm("xchgl %%ebx, %%esi; cpuid; xchgl %%ebx, %%esi" : "=a" (data[0]), "=S" (data[1]), "=c" (data[2]), "=d" (data[3]) : "0" (selector)); #elif defined(__PIC__) && defined(__amd64__) - asm("xchg{q} {%%}rbx, %q1; cpuid; xchg{q} {%%}rbx, %q1" + __asm("xchg{q} {%%}rbx, %q1; cpuid; xchg{q} {%%}rbx, %q1" : "=a" (data[0]), "=&r" (data[1]), "=c" (data[2]), "=d" (data[3]) : "0" (selector)); #else - asm("cpuid" + __asm("cpuid" : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]),