From 27ebb27db7b4acaad4e5525305f600d43d620778 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 17 Nov 2022 22:44:06 +0100 Subject: [PATCH] Makefile.mingw corrections and made the code pass much stricter checks (now mandated by Makefile.mignw) to ensure GCC 14 readiness. --- src/86box.c | 2 +- src/acpi.c | 2 +- src/codegen/codegen.c | 8 +- src/codegen/codegen.h | 40 +-- src/codegen/codegen_accumulate.h | 2 +- src/codegen/codegen_accumulate_x86-64.c | 2 +- src/codegen/codegen_accumulate_x86.c | 2 +- src/codegen/codegen_ops_x86-64.h | 388 +++++++++++------------ src/codegen/codegen_ops_x86.h | 352 ++++++++++---------- src/codegen/codegen_x86-64.c | 16 +- src/codegen/codegen_x86.c | 50 +-- src/codegen_new/codegen.c | 10 +- src/codegen_new/codegen.h | 54 ++-- src/codegen_new/codegen_accumulate.c | 2 +- src/codegen_new/codegen_accumulate.h | 2 +- src/codegen_new/codegen_allocator.c | 2 +- src/codegen_new/codegen_allocator.h | 2 +- src/codegen_new/codegen_backend.h | 4 +- src/codegen_new/codegen_backend_arm.c | 2 +- src/codegen_new/codegen_backend_arm64.c | 2 +- src/codegen_new/codegen_backend_x86-64.c | 2 +- src/codegen_new/codegen_backend_x86.c | 2 +- src/codegen_new/codegen_block.c | 24 +- src/codegen_new/codegen_ir.c | 2 +- src/codegen_new/codegen_ir.h | 2 +- src/codegen_new/codegen_ops_branch.c | 4 +- src/codegen_new/codegen_reg.c | 4 +- src/codegen_new/codegen_reg.h | 4 +- src/cpu/386_common.c | 6 +- src/cpu/386_common.h | 22 +- src/cpu/386_dynarec.c | 4 +- src/cpu/386_ops.h | 4 +- src/cpu/808x.c | 4 +- src/cpu/codegen_public.h | 6 +- src/cpu/codegen_timing_486.c | 6 +- src/cpu/codegen_timing_686.c | 6 +- src/cpu/codegen_timing_k6.c | 10 +- src/cpu/codegen_timing_p6.c | 10 +- src/cpu/codegen_timing_pentium.c | 6 +- src/cpu/codegen_timing_winchip.c | 6 +- src/cpu/codegen_timing_winchip2.c | 6 +- src/cpu/cpu.h | 4 +- src/cpu/x86.h | 4 +- src/cpu/x86_flags.h | 24 +- src/cpu/x86seg.c | 6 +- src/cpu/x87.c | 6 +- src/cpu/x87.h | 6 +- src/cpu/x87_ops.h | 6 +- src/cpu/x87_ops_misc.h | 8 +- src/device/hwm.c | 2 +- src/device/keyboard_xt.c | 4 +- src/device/mouse.c | 2 +- src/discord.c | 8 +- src/disk/hdd.c | 2 +- src/include/86box/86box.h | 2 +- src/include/86box/discord.h | 8 +- src/include/86box/hdd.h | 2 +- src/include/86box/hwm.h | 2 +- src/include/86box/i2c.h | 2 +- src/include/86box/i8080.h | 8 +- src/include/86box/m_xt_xi8088.h | 4 +- src/include/86box/machine_status.h | 2 +- src/include/86box/midi.h | 10 +- src/include/86box/mo.h | 2 +- src/include/86box/nvr.h | 2 +- src/include/86box/pci.h | 2 +- src/include/86box/plat.h | 2 +- src/include/86box/snd_resid.h | 2 +- src/include/86box/snd_speaker.h | 2 +- src/include/86box/vid_nga.h | 2 +- src/include/86box/vid_ogc.h | 2 +- src/include/86box/vid_svga.h | 2 +- src/include/86box/win.h | 14 +- src/include/86box/win_opengl_glslp.h | 2 +- src/include/86box/zip.h | 2 +- src/ini.c | 2 +- src/machine/m_at_commodore.c | 2 +- src/machine/m_at_t3100e.c | 4 +- src/machine/m_at_t3100e_vid.c | 2 +- src/machine/m_ps2_mca.c | 2 +- src/machine/m_xt_olivetti.c | 2 +- src/machine/m_xt_t1000_vid.c | 2 +- src/machine/m_xt_xi8088.c | 2 +- src/machine_status.c | 2 +- src/pci.c | 2 +- src/pic.c | 4 +- src/sound/midi.c | 4 +- src/sound/midi_mt32.c | 10 +- src/sound/snd_adlibgold.c | 2 +- src/sound/snd_sb.c | 12 +- src/sound/xaudio2.c | 4 +- src/video/vid_f82c425.c | 2 +- src/video/vid_genius.c | 2 +- src/video/vid_im1024.c | 2 +- src/video/vid_ogc.c | 2 +- src/video/vid_svga.c | 5 +- src/video/vid_voodoo.c | 4 +- src/win/Makefile.mingw | 11 +- src/win/win.c | 2 +- src/win/win_icon.c | 6 +- src/win/win_joystick_rawinput.c | 4 +- src/win/win_media_menu.c | 8 +- src/win/win_opengl.c | 2 +- src/win/win_opengl_glslp.c | 2 +- src/win/win_settings.c | 4 +- src/win/win_stbar.c | 2 +- src/win/win_toolbar.c | 2 +- src/win/win_ui.c | 2 +- 108 files changed, 682 insertions(+), 680 deletions(-) diff --git a/src/86box.c b/src/86box.c index 6be333253..62520be88 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1121,7 +1121,7 @@ pc_reset_hard_init(void) } void -update_mouse_msg() +update_mouse_msg(void) { wchar_t wcpufamily[2048], wcpu[2048], wmachine[2048], *wcp; diff --git a/src/acpi.c b/src/acpi.c index 4923e3d9b..5f9db8d05 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -63,7 +63,7 @@ acpi_log(const char *fmt, ...) #endif static uint64_t -acpi_clock_get() +acpi_clock_get(void) { return tsc * cpu_to_acpi; } diff --git a/src/codegen/codegen.c b/src/codegen/codegen.c index f633243ca..355653e63 100644 --- a/src/codegen/codegen.c +++ b/src/codegen/codegen.c @@ -9,12 +9,12 @@ #include "x86_ops.h" #include "codegen.h" -void (*codegen_timing_start)(); +void (*codegen_timing_start)(void); void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat); void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); -void (*codegen_timing_block_start)(); -void (*codegen_timing_block_end)(); -int (*codegen_timing_jump_cycles)(); +void (*codegen_timing_block_start)(void); +void (*codegen_timing_block_end)(void); +int (*codegen_timing_jump_cycles)(void); void codegen_timing_set(codegen_timing_t *timing) { diff --git a/src/codegen/codegen.h b/src/codegen/codegen.h index 4a154be2d..a0740e27d 100644 --- a/src/codegen/codegen.h +++ b/src/codegen/codegen.h @@ -292,39 +292,39 @@ extern codeblock_t *codeblock; extern codeblock_t **codeblock_hash; -void codegen_init(); -void codegen_reset(); -void codegen_block_init(uint32_t phys_addr); -void codegen_block_remove(); -void codegen_block_start_recompile(codeblock_t *block); -void codegen_block_end_recompile(codeblock_t *block); -void codegen_block_end(); -void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc); -void codegen_generate_seg_restore(); -void codegen_set_op32(); -void codegen_flush(); -void codegen_check_flush(page_t *page, uint64_t mask, uint32_t phys_addr); +extern void codegen_init(void); +extern void codegen_reset(void); +extern void codegen_block_init(uint32_t phys_addr); +extern void codegen_block_remove(void); +extern void codegen_block_start_recompile(codeblock_t *block); +extern void codegen_block_end_recompile(codeblock_t *block); +extern void codegen_block_end(void); +extern void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc); +extern void codegen_generate_seg_restore(void); +extern void codegen_set_op32(void); +extern void codegen_flush(void); +extern void codegen_check_flush(page_t *page, uint64_t mask, uint32_t phys_addr); extern int cpu_block_end; extern uint32_t codegen_endpc; extern int codegen_block_cycles; -extern void (*codegen_timing_start)(); +extern void (*codegen_timing_start)(void); extern void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat); extern void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); -extern void (*codegen_timing_block_start)(); -extern void (*codegen_timing_block_end)(); -extern int (*codegen_timing_jump_cycles)(); +extern void (*codegen_timing_block_start)(void); +extern void (*codegen_timing_block_end)(void); +extern int (*codegen_timing_jump_cycles)(void); typedef struct codegen_timing_t { - void (*start)(); + void (*start)(void); void (*prefix)(uint8_t prefix, uint32_t fetchdat); void (*opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); - void (*block_start)(); - void (*block_end)(); - int (*jump_cycles)(); + void (*block_start)(void); + void (*block_end)(void); + int (*jump_cycles)(void); } codegen_timing_t; extern codegen_timing_t codegen_timing_pentium; diff --git a/src/codegen/codegen_accumulate.h b/src/codegen/codegen_accumulate.h index b1e64db18..4d85ec0b4 100644 --- a/src/codegen/codegen_accumulate.h +++ b/src/codegen/codegen_accumulate.h @@ -9,4 +9,4 @@ struct ir_data_t; void codegen_accumulate(int acc_reg, int delta); void codegen_accumulate_flush(void); -void codegen_accumulate_reset(); +void codegen_accumulate_reset(void); diff --git a/src/codegen/codegen_accumulate_x86-64.c b/src/codegen/codegen_accumulate_x86-64.c index ceb751a95..e7f584f29 100644 --- a/src/codegen/codegen_accumulate_x86-64.c +++ b/src/codegen/codegen_accumulate_x86-64.c @@ -61,7 +61,7 @@ void codegen_accumulate_flush(void) acc_regs[0].count = 0; } -void codegen_accumulate_reset() +void codegen_accumulate_reset(void) { acc_regs[0].count = 0; } diff --git a/src/codegen/codegen_accumulate_x86.c b/src/codegen/codegen_accumulate_x86.c index b47c643d2..fb383846d 100644 --- a/src/codegen/codegen_accumulate_x86.c +++ b/src/codegen/codegen_accumulate_x86.c @@ -58,7 +58,7 @@ void codegen_accumulate_flush(void) acc_regs[0].count = 0; } -void codegen_accumulate_reset() +void codegen_accumulate_reset(void) { acc_regs[0].count = 0; } diff --git a/src/codegen/codegen_ops_x86-64.h b/src/codegen/codegen_ops_x86-64.h index 9184b4bff..67c24c99c 100644 --- a/src/codegen/codegen_ops_x86-64.h +++ b/src/codegen/codegen_ops_x86-64.h @@ -8,7 +8,7 @@ #define IS_32_ADDR(x) !(((uintptr_t)x) & 0xffffffff00000000) -static inline int find_host_xmm_reg() +static __inline int find_host_xmm_reg(void) { int c; for (c = HOST_REG_XMM_START; c < HOST_REG_XMM_END; c++) @@ -21,7 +21,7 @@ static inline int find_host_xmm_reg() fatal("Out of host XMM regs!\n"); return c; } -static inline void call(codeblock_t *block, uintptr_t func) +static __inline void call(codeblock_t *block, uintptr_t func) { intptr_t diff = (intptr_t)(func - (uintptr_t)&block->data[block_pos + 5]); @@ -43,7 +43,7 @@ static inline void call(codeblock_t *block, uintptr_t func) } } -static inline void call_long(uintptr_t func) +static __inline void call_long(uintptr_t func) { codegen_reg_loaded[0] = codegen_reg_loaded[1] = codegen_reg_loaded[2] = codegen_reg_loaded[3] = 0; codegen_reg_loaded[4] = codegen_reg_loaded[5] = codegen_reg_loaded[6] = codegen_reg_loaded[7] = 0; @@ -55,7 +55,7 @@ static inline void call_long(uintptr_t func) addbyte(0xd0); } -static inline void load_param_1_32(codeblock_t *block, uint32_t param) +static __inline void load_param_1_32(codeblock_t *block, uint32_t param) { #if _WIN64 addbyte(0xb9); /*MOVL $fetchdat,%ecx*/ @@ -64,7 +64,7 @@ static inline void load_param_1_32(codeblock_t *block, uint32_t param) #endif addlong(param); } -static inline void load_param_1_reg_32(int reg) +static __inline void load_param_1_reg_32(int reg) { #if _WIN64 if (reg & 8) @@ -79,7 +79,7 @@ static inline void load_param_1_reg_32(int reg) #endif } #if 0 -static inline void load_param_1_64(codeblock_t *block, uint64_t param) +static __inline void load_param_1_64(codeblock_t *block, uint64_t param) { addbyte(0x48); #if _WIN64 @@ -91,7 +91,7 @@ static inline void load_param_1_64(codeblock_t *block, uint64_t param) } #endif -static inline void load_param_2_32(codeblock_t *block, uint32_t param) +static __inline void load_param_2_32(codeblock_t *block, uint32_t param) { #if _WIN64 addbyte(0xba); /*MOVL $fetchdat,%edx*/ @@ -100,7 +100,7 @@ static inline void load_param_2_32(codeblock_t *block, uint32_t param) #endif addlong(param); } -static inline void load_param_2_reg_32(int reg) +static __inline void load_param_2_reg_32(int reg) { #if _WIN64 if (reg & 8) @@ -114,7 +114,7 @@ static inline void load_param_2_reg_32(int reg) addbyte(0xc0 | REG_ESI | (reg << 3)); #endif } -static inline void load_param_2_64(codeblock_t *block, uint64_t param) +static __inline void load_param_2_64(codeblock_t *block, uint64_t param) { addbyte(0x48); #if _WIN64 @@ -124,7 +124,7 @@ static inline void load_param_2_64(codeblock_t *block, uint64_t param) #endif addquad(param); } -static inline void load_param_2_reg_64(int reg) +static __inline void load_param_2_reg_64(int reg) { if (reg & 8) { @@ -152,7 +152,7 @@ static inline void load_param_2_reg_64(int reg) } } -static inline void load_param_3_reg_32(int reg) +static __inline void load_param_3_reg_32(int reg) { if (reg & 8) { @@ -179,7 +179,7 @@ static inline void load_param_3_reg_32(int reg) #endif } } -static inline void load_param_3_reg_64(int reg) +static __inline void load_param_3_reg_64(int reg) { if (reg & 8) { @@ -207,7 +207,7 @@ static inline void load_param_3_reg_64(int reg) } } -static inline void CALL_FUNC(uintptr_t func) +static __inline void CALL_FUNC(uintptr_t func) { codegen_reg_loaded[0] = codegen_reg_loaded[1] = codegen_reg_loaded[2] = codegen_reg_loaded[3] = 0; codegen_reg_loaded[4] = codegen_reg_loaded[5] = codegen_reg_loaded[6] = codegen_reg_loaded[7] = 0; @@ -219,11 +219,11 @@ static inline void CALL_FUNC(uintptr_t func) addbyte(0xd0); } -static inline void RELEASE_REG(int host_reg) +static __inline void RELEASE_REG(int host_reg) { } -static inline int LOAD_REG_B(int reg) +static __inline int LOAD_REG_B(int reg) { int host_reg = reg & 3; @@ -242,7 +242,7 @@ static inline int LOAD_REG_B(int reg) return host_reg | 8; } -static inline int LOAD_REG_W(int reg) +static __inline int LOAD_REG_W(int reg) { int host_reg = reg; @@ -258,7 +258,7 @@ static inline int LOAD_REG_W(int reg) return host_reg | 8; } -static inline int LOAD_REG_L(int reg) +static __inline int LOAD_REG_L(int reg) { int host_reg = reg; @@ -275,7 +275,7 @@ static inline int LOAD_REG_L(int reg) return host_reg | 8; } -static inline int LOAD_REG_IMM(uint32_t imm) +static __inline int LOAD_REG_IMM(uint32_t imm) { int host_reg = REG_EBX; @@ -285,7 +285,7 @@ static inline int LOAD_REG_IMM(uint32_t imm) return host_reg; } -static inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) { int dest_reg = LOAD_REG_L(guest_reg & 3) & 7; @@ -379,7 +379,7 @@ static inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) } } } -static inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) { int dest_reg = LOAD_REG_L(guest_reg & 7) & 7; @@ -407,7 +407,7 @@ static inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) addbyte(cpu_state_offset(regs[guest_reg & 7].w)); } } -static inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) { if (host_reg & 8) { @@ -430,7 +430,7 @@ static inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) } } -static inline void STORE_REG_B_RELEASE(int host_reg) +static __inline void STORE_REG_B_RELEASE(int host_reg) { if (host_reg & 0x10) { @@ -448,7 +448,7 @@ static inline void STORE_REG_B_RELEASE(int host_reg) addbyte(cpu_state_offset(regs[host_reg & 7].b)); } } -static inline void STORE_REG_W_RELEASE(int host_reg) +static __inline void STORE_REG_W_RELEASE(int host_reg) { addbyte(0x66); /*MOVW [reg],host_reg*/ addbyte(0x44); @@ -456,7 +456,7 @@ static inline void STORE_REG_W_RELEASE(int host_reg) addbyte(0x45 | ((host_reg & 7) << 3)); addbyte(cpu_state_offset(regs[host_reg & 7].w)); } -static inline void STORE_REG_L_RELEASE(int host_reg) +static __inline void STORE_REG_L_RELEASE(int host_reg) { addbyte(0x44); /*MOVL [reg],host_reg*/ addbyte(0x89); @@ -464,7 +464,7 @@ static inline void STORE_REG_L_RELEASE(int host_reg) addbyte(cpu_state_offset(regs[host_reg & 7].l)); } -static inline void STORE_IMM_REG_B(int reg, uint8_t val) +static __inline void STORE_IMM_REG_B(int reg, uint8_t val) { if (reg & 4) { @@ -496,7 +496,7 @@ static inline void STORE_IMM_REG_B(int reg, uint8_t val) addbyte(cpu_state_offset(regs[reg & 7].b)); } } -static inline void STORE_IMM_REG_W(int reg, uint16_t val) +static __inline void STORE_IMM_REG_W(int reg, uint16_t val) { addbyte(0x66); /*MOVW reg, imm*/ addbyte(0x41); @@ -508,7 +508,7 @@ static inline void STORE_IMM_REG_W(int reg, uint16_t val) addbyte(0x45 | (reg << 3)); addbyte(cpu_state_offset(regs[reg & 7].w)); } -static inline void STORE_IMM_REG_L(int reg, uint32_t val) +static __inline void STORE_IMM_REG_L(int reg, uint32_t val) { addbyte(0x41); /*MOVL reg, imm*/ addbyte(0xb8 | reg); @@ -519,7 +519,7 @@ static inline void STORE_IMM_REG_L(int reg, uint32_t val) addbyte(cpu_state_offset(regs[reg & 7].l)); } -static inline void STORE_IMM_ADDR_L(uintptr_t addr, uint32_t val) +static __inline void STORE_IMM_ADDR_L(uintptr_t addr, uint32_t val) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -865,7 +865,7 @@ static x86seg *FETCH_EA_32(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, u return op_ea_seg; } -static inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32) +static __inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32) { if (op_32 & 0x200) return FETCH_EA_32(op_ea_seg, fetchdat, op_ssegs, op_pc, 0); @@ -874,7 +874,7 @@ static inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_sseg -static inline void CHECK_SEG_READ(x86seg *seg) +static __inline void CHECK_SEG_READ(x86seg *seg) { /*Segments always valid in real/V86 mode*/ if (!(cr0 & 1) || (cpu_state.eflags & VM_FLAG)) @@ -910,7 +910,7 @@ static inline void CHECK_SEG_READ(x86seg *seg) seg->checked = 1; } -static inline void CHECK_SEG_WRITE(x86seg *seg) +static __inline void CHECK_SEG_WRITE(x86seg *seg) { /*Segments always valid in real/V86 mode*/ if (!(cr0 & 1) || (cpu_state.eflags & VM_FLAG)) @@ -946,7 +946,7 @@ static inline void CHECK_SEG_WRITE(x86seg *seg) seg->checked = 1; } -static inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) +static __inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) return; @@ -985,7 +985,7 @@ static inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) } } -static inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1059,7 +1059,7 @@ static inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1139,14 +1139,14 @@ static inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_LOAD_ADDR_EA_W_OFFSET(x86seg *seg, int offset) +static __inline void MEM_LOAD_ADDR_EA_W_OFFSET(x86seg *seg, int offset) { addbyte(0x83); /*ADD EAX, offset*/ addbyte(0xc0); addbyte(offset); MEM_LOAD_ADDR_EA_W(seg); } -static inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1225,7 +1225,7 @@ static inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1306,26 +1306,26 @@ static inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) /*done:*/ } -static inline void MEM_LOAD_ADDR_IMM_B(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_B(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_B(seg); } -static inline void MEM_LOAD_ADDR_IMM_W(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_W(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_W(seg); } -static inline void MEM_LOAD_ADDR_IMM_L(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_L(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_L(seg); } -static inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) { if (host_reg & 0x10) { @@ -1436,7 +1436,7 @@ static inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1532,7 +1532,7 @@ static inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1626,7 +1626,7 @@ static inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); /*done:*/ } -static inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) +static __inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1718,26 +1718,26 @@ static inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) /*done:*/ } -static inline void MEM_STORE_ADDR_IMM_B(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_B(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_STORE_ADDR_EA_B(seg, host_reg); } -static inline void MEM_STORE_ADDR_IMM_W(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_W(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_STORE_ADDR_EA_W(seg, host_reg); } -static inline void MEM_STORE_ADDR_IMM_L(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_L(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_STORE_ADDR_EA_L(seg, host_reg); } -static inline void STORE_HOST_REG_ADDR_BL(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR_BL(uintptr_t addr, int host_reg) { int temp_reg = REG_ECX; @@ -1785,7 +1785,7 @@ static inline void STORE_HOST_REG_ADDR_BL(uintptr_t addr, int host_reg) addbyte(0x06 | (temp_reg << 3)); } } -static inline void STORE_HOST_REG_ADDR_WL(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR_WL(uintptr_t addr, int host_reg) { int temp_reg = REG_ECX; @@ -1819,7 +1819,7 @@ static inline void STORE_HOST_REG_ADDR_WL(uintptr_t addr, int host_reg) addbyte(0x06 | (temp_reg << 3)); } } -static inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -1853,7 +1853,7 @@ static inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) addbyte(0x06 | ((host_reg & 7) << 3)); } } -static inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -1885,7 +1885,7 @@ static inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) } } -static inline void AND_HOST_REG_B(int dst_reg, int src_reg) +static __inline void AND_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2008,7 +2008,7 @@ static inline void AND_HOST_REG_B(int dst_reg, int src_reg) } } } -static inline void AND_HOST_REG_W(int dst_reg, int src_reg) +static __inline void AND_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2038,7 +2038,7 @@ static inline void AND_HOST_REG_W(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void AND_HOST_REG_L(int dst_reg, int src_reg) +static __inline void AND_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2064,7 +2064,7 @@ static inline void AND_HOST_REG_L(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 0x10) { @@ -2085,7 +2085,7 @@ static inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline int TEST_HOST_REG_B(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2100,7 +2100,7 @@ static inline int TEST_HOST_REG_B(int dst_reg, int src_reg) return dst_reg & ~0x10; } -static inline int TEST_HOST_REG_W(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2115,7 +2115,7 @@ static inline int TEST_HOST_REG_W(int dst_reg, int src_reg) return dst_reg; } -static inline int TEST_HOST_REG_L(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2130,7 +2130,7 @@ static inline int TEST_HOST_REG_L(int dst_reg, int src_reg) return dst_reg; } -static inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 8) { @@ -2156,7 +2156,7 @@ static inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) return host_reg; } -static inline void OR_HOST_REG_B(int dst_reg, int src_reg) +static __inline void OR_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2278,7 +2278,7 @@ static inline void OR_HOST_REG_B(int dst_reg, int src_reg) } } } -static inline void OR_HOST_REG_W(int dst_reg, int src_reg) +static __inline void OR_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2308,7 +2308,7 @@ static inline void OR_HOST_REG_W(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void OR_HOST_REG_L(int dst_reg, int src_reg) +static __inline void OR_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2334,7 +2334,7 @@ static inline void OR_HOST_REG_L(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 0x10) { @@ -2359,7 +2359,7 @@ static inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline void XOR_HOST_REG_B(int dst_reg, int src_reg) +static __inline void XOR_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2481,7 +2481,7 @@ static inline void XOR_HOST_REG_B(int dst_reg, int src_reg) } } } -static inline void XOR_HOST_REG_W(int dst_reg, int src_reg) +static __inline void XOR_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2511,7 +2511,7 @@ static inline void XOR_HOST_REG_W(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void XOR_HOST_REG_L(int dst_reg, int src_reg) +static __inline void XOR_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2537,7 +2537,7 @@ static inline void XOR_HOST_REG_L(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 0x10) { @@ -2562,7 +2562,7 @@ static inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline void ADD_HOST_REG_B(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2656,7 +2656,7 @@ static inline void ADD_HOST_REG_B(int dst_reg, int src_reg) else fatal("!(dst_reg & src_reg & 8)\n"); } -static inline void ADD_HOST_REG_W(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2682,7 +2682,7 @@ static inline void ADD_HOST_REG_W(int dst_reg, int src_reg) else fatal("!(dst_reg & src_reg & 8)\n"); } -static inline void ADD_HOST_REG_L(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2706,7 +2706,7 @@ static inline void ADD_HOST_REG_L(int dst_reg, int src_reg) fatal("!(dst_reg & src_reg & 8)\n"); } -static inline void SUB_HOST_REG_B(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2828,7 +2828,7 @@ static inline void SUB_HOST_REG_B(int dst_reg, int src_reg) } } } -static inline void SUB_HOST_REG_W(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2858,7 +2858,7 @@ static inline void SUB_HOST_REG_W(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3)); } } -static inline void SUB_HOST_REG_L(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & src_reg & 8) { @@ -2885,7 +2885,7 @@ static inline void SUB_HOST_REG_L(int dst_reg, int src_reg) } } -static inline int CMP_HOST_REG_B(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_B(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2900,7 +2900,7 @@ static inline int CMP_HOST_REG_B(int dst_reg, int src_reg) return dst_reg & ~0x10; } -static inline int CMP_HOST_REG_W(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_W(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2915,7 +2915,7 @@ static inline int CMP_HOST_REG_W(int dst_reg, int src_reg) return dst_reg; } -static inline int CMP_HOST_REG_L(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_L(int dst_reg, int src_reg) { if (dst_reg & 8) { @@ -2931,7 +2931,7 @@ static inline int CMP_HOST_REG_L(int dst_reg, int src_reg) return dst_reg; } -static inline void ADD_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline void ADD_HOST_REG_IMM_B(int host_reg, uint8_t imm) { if (host_reg & 0x10) { @@ -2951,7 +2951,7 @@ static inline void ADD_HOST_REG_IMM_B(int host_reg, uint8_t imm) addbyte(imm); } } -static inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) { addbyte(0x66); /*ADDW host_reg, imm*/ if (host_reg & 8) @@ -2960,7 +2960,7 @@ static inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) addbyte(0xC0 | (host_reg & 7)); addword(imm); } -static inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 8) addbyte(0x41); @@ -2969,7 +2969,7 @@ static inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) addlong(imm); } -static inline void SUB_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline void SUB_HOST_REG_IMM_B(int host_reg, uint8_t imm) { if (host_reg & 0x10) { @@ -2989,7 +2989,7 @@ static inline void SUB_HOST_REG_IMM_B(int host_reg, uint8_t imm) addbyte(imm); } } -static inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) { addbyte(0x66); /*SUBW host_reg, imm*/ if (host_reg & 8) @@ -2998,7 +2998,7 @@ static inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) addbyte(0xE8 | (host_reg & 7)); addword(imm); } -static inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) { if (host_reg & 8) addbyte(0x41); @@ -3007,7 +3007,7 @@ static inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) addlong(imm); } -static inline void INC_HOST_REG_W(int host_reg) +static __inline void INC_HOST_REG_W(int host_reg) { addbyte(0x66); /*INCW host_reg*/ if (host_reg & 8) @@ -3015,14 +3015,14 @@ static inline void INC_HOST_REG_W(int host_reg) addbyte(0xff); addbyte(0xc0 | (host_reg & 7)); } -static inline void INC_HOST_REG(int host_reg) +static __inline void INC_HOST_REG(int host_reg) { if (host_reg & 8) addbyte(0x41); addbyte(0xff); /*INCL host_reg*/ addbyte(0xc0 | (host_reg & 7)); } -static inline void DEC_HOST_REG_W(int host_reg) +static __inline void DEC_HOST_REG_W(int host_reg) { addbyte(0x66); /*DECW host_reg*/ if (host_reg & 8) @@ -3030,7 +3030,7 @@ static inline void DEC_HOST_REG_W(int host_reg) addbyte(0xff); addbyte(0xc8 | (host_reg & 7)); } -static inline void DEC_HOST_REG(int host_reg) +static __inline void DEC_HOST_REG(int host_reg) { if (host_reg & 8) addbyte(0x41); @@ -3038,7 +3038,7 @@ static inline void DEC_HOST_REG(int host_reg) addbyte(0xc8 | (host_reg & 7)); } -static inline int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) { if (host_reg & 8) { @@ -3053,7 +3053,7 @@ static inline int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) return host_reg; } -static inline int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) { if (host_reg & 8) { @@ -3068,7 +3068,7 @@ static inline int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) return host_reg; } -static inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) +static __inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) { if (host_reg & 8) { @@ -3084,7 +3084,7 @@ static inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) return host_reg; } -static inline void LOAD_STACK_TO_EA(int off) +static __inline void LOAD_STACK_TO_EA(int off) { if (stack32) { @@ -3112,7 +3112,7 @@ static inline void LOAD_STACK_TO_EA(int off) } } } -static inline void LOAD_EBP_TO_EA(int off) +static __inline void LOAD_EBP_TO_EA(int off) { if (stack32) { @@ -3141,7 +3141,7 @@ static inline void LOAD_EBP_TO_EA(int off) } } -static inline void SP_MODIFY(int off) +static __inline void SP_MODIFY(int off) { if (stack32) { @@ -3181,7 +3181,7 @@ static inline void SP_MODIFY(int off) } } -static inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x66); /*CMPW host_reg, 0*/ if (host_reg & 8) @@ -3205,7 +3205,7 @@ static inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cyc addbyte(0xe9); /*JMP end*/ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) { if (host_reg & 8) addbyte(0x41); @@ -3229,7 +3229,7 @@ static inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cyc addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x66); /*CMPW host_reg, 0*/ if (host_reg & 8) @@ -3253,7 +3253,7 @@ static inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_ addbyte(0xe9); /*JMP end*/ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) { if (host_reg & 8) addbyte(0x41); @@ -3277,7 +3277,7 @@ static inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { uint8_t *jump1; @@ -3326,7 +3326,7 @@ static inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset *jump1 = (uintptr_t)&codeblock[block_current].data[block_pos] - (uintptr_t)jump1 - 1; } -static inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { CALL_FUNC((uintptr_t)NF_SET); addbyte(0x85); /*TEST EAX,EAX*/ @@ -3362,7 +3362,7 @@ static inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { uint8_t *jump1; if (codegen_flags_changed && cpu_state.flags_op != FLAGS_UNKNOWN) @@ -3420,7 +3420,7 @@ static inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset *jump1 = (uintptr_t)&codeblock[block_current].data[block_pos] - (uintptr_t)jump1 - 1; } -static inline int LOAD_VAR_W(uintptr_t addr) +static __inline int LOAD_VAR_W(uintptr_t addr) { int host_reg = REG_EBX; @@ -3451,11 +3451,11 @@ static inline int LOAD_VAR_W(uintptr_t addr) return host_reg; } -static inline int LOAD_VAR_WL(uintptr_t addr) +static __inline int LOAD_VAR_WL(uintptr_t addr) { return LOAD_VAR_W(addr); } -static inline int LOAD_VAR_L(uintptr_t addr) +static __inline int LOAD_VAR_L(uintptr_t addr) { int host_reg = REG_EBX; @@ -3484,7 +3484,7 @@ static inline int LOAD_VAR_L(uintptr_t addr) return host_reg; } -static inline int COPY_REG(int src_reg) +static __inline int COPY_REG(int src_reg) { if (src_reg & 8) addbyte(0x44); @@ -3494,7 +3494,7 @@ static inline int COPY_REG(int src_reg) return REG_ECX | (src_reg & 0x10); } -static inline int LOAD_HOST_REG(int host_reg) +static __inline int LOAD_HOST_REG(int host_reg) { if (host_reg & 8) addbyte(0x44); @@ -3504,7 +3504,7 @@ static inline int LOAD_HOST_REG(int host_reg) return REG_EBX | (host_reg & 0x10); } -static inline int ZERO_EXTEND_W_B(int reg) +static __inline int ZERO_EXTEND_W_B(int reg) { if (reg & 0x10) { @@ -3526,7 +3526,7 @@ static inline int ZERO_EXTEND_W_B(int reg) return REG_EAX; } -static inline int ZERO_EXTEND_L_B(int reg) +static __inline int ZERO_EXTEND_L_B(int reg) { if (reg & 0x10) { @@ -3548,7 +3548,7 @@ static inline int ZERO_EXTEND_L_B(int reg) return REG_EAX; } -static inline int ZERO_EXTEND_L_W(int reg) +static __inline int ZERO_EXTEND_L_W(int reg) { if (reg & 8) addbyte(0x41); @@ -3559,7 +3559,7 @@ static inline int ZERO_EXTEND_L_W(int reg) return REG_EAX; } -static inline int SIGN_EXTEND_W_B(int reg) +static __inline int SIGN_EXTEND_W_B(int reg) { if (reg & 0x10) { @@ -3581,7 +3581,7 @@ static inline int SIGN_EXTEND_W_B(int reg) return REG_EAX; } -static inline int SIGN_EXTEND_L_B(int reg) +static __inline int SIGN_EXTEND_L_B(int reg) { if (reg & 0x10) { @@ -3603,7 +3603,7 @@ static inline int SIGN_EXTEND_L_B(int reg) return REG_EAX; } -static inline int SIGN_EXTEND_L_W(int reg) +static __inline int SIGN_EXTEND_L_W(int reg) { if (reg & 8) addbyte(0x41); @@ -3614,7 +3614,7 @@ static inline int SIGN_EXTEND_L_W(int reg) return REG_EAX; } -static inline void SHL_B_IMM(int reg, int count) +static __inline void SHL_B_IMM(int reg, int count) { if (reg & 0x10) { @@ -3637,7 +3637,7 @@ static inline void SHL_B_IMM(int reg, int count) addbyte(count); } } -static inline void SHL_W_IMM(int reg, int count) +static __inline void SHL_W_IMM(int reg, int count) { addbyte(0x66); /*SHL reg, count*/ if (reg & 8) @@ -3646,7 +3646,7 @@ static inline void SHL_W_IMM(int reg, int count) addbyte(0xc0 | (reg & 7) | 0x20); addbyte(count); } -static inline void SHL_L_IMM(int reg, int count) +static __inline void SHL_L_IMM(int reg, int count) { if (reg & 8) addbyte(0x41); @@ -3654,7 +3654,7 @@ static inline void SHL_L_IMM(int reg, int count) addbyte(0xc0 | (reg & 7) | 0x20); addbyte(count); } -static inline void SHR_B_IMM(int reg, int count) +static __inline void SHR_B_IMM(int reg, int count) { if (reg & 0x10) { @@ -3677,7 +3677,7 @@ static inline void SHR_B_IMM(int reg, int count) addbyte(count); } } -static inline void SHR_W_IMM(int reg, int count) +static __inline void SHR_W_IMM(int reg, int count) { addbyte(0x66); /*SHR reg, count*/ if (reg & 8) @@ -3686,7 +3686,7 @@ static inline void SHR_W_IMM(int reg, int count) addbyte(0xc0 | (reg & 7) | 0x28); addbyte(count); } -static inline void SHR_L_IMM(int reg, int count) +static __inline void SHR_L_IMM(int reg, int count) { if (reg & 8) addbyte(0x41); @@ -3694,7 +3694,7 @@ static inline void SHR_L_IMM(int reg, int count) addbyte(0xc0 | (reg & 7) | 0x28); addbyte(count); } -static inline void SAR_B_IMM(int reg, int count) +static __inline void SAR_B_IMM(int reg, int count) { if (reg & 0x10) { @@ -3717,7 +3717,7 @@ static inline void SAR_B_IMM(int reg, int count) addbyte(count); } } -static inline void SAR_W_IMM(int reg, int count) +static __inline void SAR_W_IMM(int reg, int count) { addbyte(0x66); /*SAR reg, count*/ if (reg & 8) @@ -3726,7 +3726,7 @@ static inline void SAR_W_IMM(int reg, int count) addbyte(0xc0 | (reg & 7) | 0x38); addbyte(count); } -static inline void SAR_L_IMM(int reg, int count) +static __inline void SAR_L_IMM(int reg, int count) { if (reg & 8) addbyte(0x41); @@ -3735,7 +3735,7 @@ static inline void SAR_L_IMM(int reg, int count) addbyte(count); } -static inline void NEG_HOST_REG_B(int reg) +static __inline void NEG_HOST_REG_B(int reg) { if (reg & 0x10) { @@ -3758,7 +3758,7 @@ static inline void NEG_HOST_REG_B(int reg) addbyte(0xd8 | (reg & 7)); } } -static inline void NEG_HOST_REG_W(int reg) +static __inline void NEG_HOST_REG_W(int reg) { addbyte(0x66); if (reg & 8) @@ -3766,7 +3766,7 @@ static inline void NEG_HOST_REG_W(int reg) addbyte(0xf7); addbyte(0xd8 | (reg & 7)); } -static inline void NEG_HOST_REG_L(int reg) +static __inline void NEG_HOST_REG_L(int reg) { if (reg & 8) addbyte(0x41); @@ -3775,7 +3775,7 @@ static inline void NEG_HOST_REG_L(int reg) } -static inline void FP_ENTER() +static __inline void FP_ENTER(void) { if (codegen_fpu_entered) return; @@ -3810,7 +3810,7 @@ static inline void FP_ENTER() codegen_fpu_entered = 1; } -static inline void FP_FXCH(int reg) +static __inline void FP_FXCH(int reg) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -3886,7 +3886,7 @@ static inline void FP_FXCH(int reg) -static inline void FP_FLD(int reg) +static __inline void FP_FLD(int reg) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -3949,7 +3949,7 @@ static inline void FP_FLD(int reg) addbyte((uint8_t)cpu_state_offset(TOP)); } -static inline void FP_FST(int reg) +static __inline void FP_FST(int reg) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -3985,7 +3985,7 @@ static inline void FP_FST(int reg) addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_POP() +static __inline void FP_POP(void) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4005,7 +4005,7 @@ static inline void FP_POP() addbyte(0x45); addbyte((uint8_t)cpu_state_offset(TOP)); } -static inline void FP_POP2() +static __inline void FP_POP2(void) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4026,7 +4026,7 @@ static inline void FP_POP2() addbyte((uint8_t)cpu_state_offset(TOP)); } -static inline void FP_LOAD_S() +static __inline void FP_LOAD_S(void) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4062,7 +4062,7 @@ static inline void FP_LOAD_S() addbyte(0x1d); addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_LOAD_D() +static __inline void FP_LOAD_D(void) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4091,7 +4091,7 @@ static inline void FP_LOAD_D() addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_LOAD_IW() +static __inline void FP_LOAD_IW(void) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4126,7 +4126,7 @@ static inline void FP_LOAD_IW() addbyte(0x1d); addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_LOAD_IL() +static __inline void FP_LOAD_IL(void) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4158,7 +4158,7 @@ static inline void FP_LOAD_IL() addbyte(0x1d); addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_LOAD_IQ() +static __inline void FP_LOAD_IQ(void) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4202,7 +4202,7 @@ static inline void FP_LOAD_IQ() addbyte((uint8_t)cpu_state_offset(tag)); } -static inline void FP_LOAD_IMM_Q(uint64_t v) +static __inline void FP_LOAD_IMM_Q(uint64_t v) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4233,7 +4233,7 @@ static inline void FP_LOAD_IMM_Q(uint64_t v) addbyte(v ? 0 : 1); } -static inline void FP_FCHS() +static __inline void FP_FCHS(void) { addbyte(0x8b); /*MOV EAX, TOP*/ addbyte(0x45); @@ -4261,7 +4261,7 @@ static inline void FP_FCHS() addbyte((uint8_t)cpu_state_offset(ST)); } -static inline int FP_LOAD_REG(int reg) +static __inline int FP_LOAD_REG(int reg) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4292,7 +4292,7 @@ static inline int FP_LOAD_REG(int reg) return REG_EBX; } -static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) +static __inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4314,7 +4314,7 @@ static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) *host_reg1 = REG_EBX; } -static inline int64_t x87_fround16_64(double b) +static __inline int64_t x87_fround16_64(double b) { int16_t a, c; @@ -4339,7 +4339,7 @@ static inline int64_t x87_fround16_64(double b) return 0; } -static inline int64_t x87_fround32_64(double b) +static __inline int64_t x87_fround32_64(double b) { int32_t a, c; @@ -4364,7 +4364,7 @@ static inline int64_t x87_fround32_64(double b) return 0; } -static inline int64_t x87_fround(double b) +static __inline int64_t x87_fround(double b) { int64_t a, c; @@ -4389,7 +4389,7 @@ static inline int64_t x87_fround(double b) return 0; } -static inline int FP_LOAD_REG_INT_W(int reg) +static __inline int FP_LOAD_REG_INT_W(int reg) { addbyte(0x89); /*MOV EBX, EAX*/ addbyte(0xc3); @@ -4419,7 +4419,7 @@ static inline int FP_LOAD_REG_INT_W(int reg) return REG_EBX; } -static inline int FP_LOAD_REG_INT(int reg) +static __inline int FP_LOAD_REG_INT(int reg) { addbyte(0x89); /*MOV EBX, EAX*/ addbyte(0xc3); @@ -4449,7 +4449,7 @@ static inline int FP_LOAD_REG_INT(int reg) return REG_EBX; } -static inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) +static __inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) { addbyte(0x89); /*MOV EBX, EAX*/ addbyte(0xc3); @@ -4526,7 +4526,7 @@ static inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) #define FPU_SUB 2 #define FPU_SUBR 3 -static inline void FP_OP_REG(int op, int dst, int src) +static __inline void FP_OP_REG(int op, int dst, int src) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4633,7 +4633,7 @@ static inline void FP_OP_REG(int op, int dst, int src) addbyte((uint8_t)cpu_state_offset(ST)); } -static inline void FP_OP_MEM(int op) +static __inline void FP_OP_MEM(int op) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4709,7 +4709,7 @@ static inline void FP_OP_MEM(int op) } } -static inline void FP_OP_S(int op) +static __inline void FP_OP_S(int op) { addbyte(0x66); /*MOVD XMM1, EAX*/ addbyte(0x0f); @@ -4721,7 +4721,7 @@ static inline void FP_OP_S(int op) addbyte(0xc9); FP_OP_MEM(op); } -static inline void FP_OP_D(int op) +static __inline void FP_OP_D(int op) { addbyte(0x66); /*MOVQ XMM1, RAX*/ addbyte(0x48); @@ -4763,7 +4763,7 @@ static inline void FP_OP_D(int op) addbyte(0x08); } } -static inline void FP_OP_IW(int op) +static __inline void FP_OP_IW(int op) { addbyte(0x0f); /*MOVSX EAX, AX*/ addbyte(0xbf); @@ -4774,7 +4774,7 @@ static inline void FP_OP_IW(int op) addbyte(0xc8); FP_OP_MEM(op); } -static inline void FP_OP_IL(int op) +static __inline void FP_OP_IL(int op) { addbyte(0xf2); /*CVTSI2SD XMM1, EAX*/ addbyte(0x0f); @@ -4783,7 +4783,7 @@ static inline void FP_OP_IL(int op) FP_OP_MEM(op); } -static inline void FP_COMPARE_REG(int dst, int src) +static __inline void FP_COMPARE_REG(int dst, int src) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4849,7 +4849,7 @@ static inline void FP_COMPARE_REG(int dst, int src) addbyte((uint8_t)cpu_state_offset(npxs) + 1); } -static inline void FP_COMPARE_MEM() +static __inline void FP_COMPARE_MEM(void) { addbyte(0x8b); /*MOV EAX, [TOP]*/ addbyte(0x45); @@ -4881,7 +4881,7 @@ static inline void FP_COMPARE_MEM() addbyte(0x4d); addbyte((uint8_t)cpu_state_offset(npxs) + 1); } -static inline void FP_COMPARE_S() +static __inline void FP_COMPARE_S(void) { addbyte(0x66); /*MOVD XMM1, EAX*/ addbyte(0x0f); @@ -4893,7 +4893,7 @@ static inline void FP_COMPARE_S() addbyte(0xc9); FP_COMPARE_MEM(); } -static inline void FP_COMPARE_D() +static __inline void FP_COMPARE_D(void) { addbyte(0x66); /*MOVQ XMM1, RAX*/ addbyte(0x48); @@ -4902,7 +4902,7 @@ static inline void FP_COMPARE_D() addbyte(0xc8); FP_COMPARE_MEM(); } -static inline void FP_COMPARE_IW() +static __inline void FP_COMPARE_IW(void) { addbyte(0x0f); /*MOVSX EAX, AX*/ addbyte(0xbf); @@ -4913,7 +4913,7 @@ static inline void FP_COMPARE_IW() addbyte(0xc8); FP_COMPARE_MEM(); } -static inline void FP_COMPARE_IL() +static __inline void FP_COMPARE_IL(void) { addbyte(0xf2); /*CVTSI2SD XMM1, EAX*/ addbyte(0x0f); @@ -4922,11 +4922,11 @@ static inline void FP_COMPARE_IL() FP_COMPARE_MEM(); } -static inline void UPDATE_NPXC(int reg) +static __inline void UPDATE_NPXC(int reg) { } -static inline void SET_BITS(uintptr_t addr, uint32_t val) +static __inline void SET_BITS(uintptr_t addr, uint32_t val) { if (IS_32_ADDR(addr)) { @@ -4967,7 +4967,7 @@ static inline void SET_BITS(uintptr_t addr, uint32_t val) } } -static inline void CLEAR_BITS(uintptr_t addr, uint32_t val) +static __inline void CLEAR_BITS(uintptr_t addr, uint32_t val) { if (IS_32_ADDR(addr)) { @@ -5011,7 +5011,7 @@ static inline void CLEAR_BITS(uintptr_t addr, uint32_t val) #define LOAD_Q_REG_1 REG_EAX #define LOAD_Q_REG_2 REG_EDX -static inline void MMX_ENTER() +static __inline void MMX_ENTER(void) { if (codegen_mmx_entered) return; @@ -5066,7 +5066,7 @@ static inline void MMX_ENTER() extern int mmx_ebx_ecx_loaded; -static inline int LOAD_MMX_D(int guest_reg) +static __inline int LOAD_MMX_D(int guest_reg) { int host_reg = REG_EBX; @@ -5077,7 +5077,7 @@ static inline int LOAD_MMX_D(int guest_reg) return host_reg; } -static inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) +static __inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) { int host_reg = REG_EBX; @@ -5092,7 +5092,7 @@ static inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) *host_reg1 = host_reg; } -static inline int LOAD_MMX_Q_MMX(int guest_reg) +static __inline int LOAD_MMX_Q_MMX(int guest_reg) { int dst_reg = find_host_xmm_reg(); host_reg_xmm_mapping[dst_reg] = 100; @@ -5107,7 +5107,7 @@ static inline int LOAD_MMX_Q_MMX(int guest_reg) return dst_reg; } -static inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) +static __inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) { int dst_reg = find_host_xmm_reg(); host_reg_xmm_mapping[dst_reg] = 100; @@ -5124,7 +5124,7 @@ static inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) return dst_reg; } -static inline void STORE_MMX_LQ(int guest_reg, int host_reg1) +static __inline void STORE_MMX_LQ(int guest_reg, int host_reg1) { addbyte(0xC7); /*MOVL [reg],0*/ addbyte(0x44); @@ -5138,7 +5138,7 @@ static inline void STORE_MMX_LQ(int guest_reg, int host_reg1) addbyte(0x25); addbyte((uint8_t)cpu_state_offset(MM[guest_reg].l[0])); } -static inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) +static __inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) { if (host_reg1 & 8) addbyte(0x4c); @@ -5149,7 +5149,7 @@ static inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) addbyte(0x25); addbyte((uint8_t)cpu_state_offset(MM[guest_reg].l[0])); } -static inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) +static __inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) { addbyte(0x66); /*MOVQ [guest_reg],host_reg*/ addbyte(0x0f); @@ -5160,7 +5160,7 @@ static inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) } #define MMX_x86_OP(name, opcode) \ -static inline void MMX_ ## name(int dst_reg, int src_reg) \ +static __inline void MMX_ ## name(int dst_reg, int src_reg) \ { \ addbyte(0x66); /*op dst_reg, src_reg*/ \ addbyte(0x0f); \ @@ -5213,7 +5213,7 @@ MMX_x86_OP(PMULLW, 0xd5); MMX_x86_OP(PMULHW, 0xe5); MMX_x86_OP(PMADDWD, 0xf5); -static inline void MMX_PACKSSWB(int dst_reg, int src_reg) +static __inline void MMX_PACKSSWB(int dst_reg, int src_reg) { addbyte(0x66); /*PACKSSWB dst_reg, src_reg*/ addbyte(0x0f); @@ -5225,7 +5225,7 @@ static inline void MMX_PACKSSWB(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PACKUSWB(int dst_reg, int src_reg) +static __inline void MMX_PACKUSWB(int dst_reg, int src_reg) { addbyte(0x66); /*PACKUSWB dst_reg, src_reg*/ addbyte(0x0f); @@ -5237,7 +5237,7 @@ static inline void MMX_PACKUSWB(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PACKSSDW(int dst_reg, int src_reg) +static __inline void MMX_PACKSSDW(int dst_reg, int src_reg) { addbyte(0x66); /*PACKSSDW dst_reg, src_reg*/ addbyte(0x0f); @@ -5249,7 +5249,7 @@ static inline void MMX_PACKSSDW(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLBW dst_reg, src_reg*/ addbyte(0x0f); @@ -5261,7 +5261,7 @@ static inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x0e); } -static inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLWD dst_reg, src_reg*/ addbyte(0x0f); @@ -5273,7 +5273,7 @@ static inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x0e); } -static inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLDQ dst_reg, src_reg*/ addbyte(0x0f); @@ -5286,7 +5286,7 @@ static inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) addbyte(0x0e); } -static inline void MMX_PSRLW_imm(int dst_reg, int amount) +static __inline void MMX_PSRLW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLW dst_reg, amount*/ addbyte(0x0f); @@ -5294,7 +5294,7 @@ static inline void MMX_PSRLW_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAW_imm(int dst_reg, int amount) +static __inline void MMX_PSRAW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAW dst_reg, amount*/ addbyte(0x0f); @@ -5302,7 +5302,7 @@ static inline void MMX_PSRAW_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLW_imm(int dst_reg, int amount) +static __inline void MMX_PSLLW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLW dst_reg, amount*/ addbyte(0x0f); @@ -5311,7 +5311,7 @@ static inline void MMX_PSLLW_imm(int dst_reg, int amount) addbyte(amount); } -static inline void MMX_PSRLD_imm(int dst_reg, int amount) +static __inline void MMX_PSRLD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLD dst_reg, amount*/ addbyte(0x0f); @@ -5319,7 +5319,7 @@ static inline void MMX_PSRLD_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAD_imm(int dst_reg, int amount) +static __inline void MMX_PSRAD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAD dst_reg, amount*/ addbyte(0x0f); @@ -5327,7 +5327,7 @@ static inline void MMX_PSRAD_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLD_imm(int dst_reg, int amount) +static __inline void MMX_PSLLD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLD dst_reg, amount*/ addbyte(0x0f); @@ -5336,7 +5336,7 @@ static inline void MMX_PSLLD_imm(int dst_reg, int amount) addbyte(amount); } -static inline void MMX_PSRLQ_imm(int dst_reg, int amount) +static __inline void MMX_PSRLQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLQ dst_reg, amount*/ addbyte(0x0f); @@ -5344,7 +5344,7 @@ static inline void MMX_PSRLQ_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAQ_imm(int dst_reg, int amount) +static __inline void MMX_PSRAQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAQ dst_reg, amount*/ addbyte(0x0f); @@ -5352,7 +5352,7 @@ static inline void MMX_PSRAQ_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLQ_imm(int dst_reg, int amount) +static __inline void MMX_PSLLQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLQ dst_reg, amount*/ addbyte(0x0f); @@ -5362,14 +5362,14 @@ static inline void MMX_PSLLQ_imm(int dst_reg, int amount) } -static inline void SAVE_EA() +static __inline void SAVE_EA(void) { addbyte(0x89); /*MOV [ESP+0x24], EAX*/ addbyte(0x44); addbyte(0x24); addbyte(0x24); } -static inline void LOAD_EA() +static __inline void LOAD_EA(void) { addbyte(0x8b); /*MOV EAX, [ESP+0x24]*/ addbyte(0x44); @@ -5379,7 +5379,7 @@ static inline void LOAD_EA() #define MEM_CHECK_WRITE_B MEM_CHECK_WRITE -static inline void MEM_CHECK_WRITE(x86seg *seg) +static __inline void MEM_CHECK_WRITE(x86seg *seg) { uint8_t *jump1, *jump2, *jump3 = NULL; @@ -5493,7 +5493,7 @@ static inline void MEM_CHECK_WRITE(x86seg *seg) LOAD_EA(); } -static inline void MEM_CHECK_WRITE_W(x86seg *seg) +static __inline void MEM_CHECK_WRITE_W(x86seg *seg) { uint8_t *jump1, *jump2, *jump3, *jump4 = NULL; int jump_pos; @@ -5642,7 +5642,7 @@ static inline void MEM_CHECK_WRITE_W(x86seg *seg) LOAD_EA(); } -static inline void MEM_CHECK_WRITE_L(x86seg *seg) +static __inline void MEM_CHECK_WRITE_L(x86seg *seg) { uint8_t *jump1, *jump2, *jump3, *jump4 = NULL; int jump_pos; @@ -5791,7 +5791,7 @@ static inline void MEM_CHECK_WRITE_L(x86seg *seg) LOAD_EA(); } -static inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -5864,7 +5864,7 @@ static inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -5943,7 +5943,7 @@ static inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -6022,7 +6022,7 @@ static inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) { if (host_reg & 0x10) { @@ -6126,7 +6126,7 @@ static inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) call_long((uintptr_t)writemembl); /*done:*/ } -static inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -6215,7 +6215,7 @@ static inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) call_long((uintptr_t)writememwl); /*done:*/ } -static inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -6303,7 +6303,7 @@ static inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) /*done:*/ } -static inline void LOAD_SEG(int host_reg, void *seg) +static __inline void LOAD_SEG(int host_reg, void *seg) { load_param_2_64(&codeblock[block_current], (uint64_t)seg); load_param_1_reg_32(host_reg); diff --git a/src/codegen/codegen_ops_x86.h b/src/codegen/codegen_ops_x86.h index 35bdeb5ff..28fa33bd7 100644 --- a/src/codegen/codegen_ops_x86.h +++ b/src/codegen/codegen_ops_x86.h @@ -8,7 +8,7 @@ #define HOST_REG_END 4 #define HOST_REG_XMM_START 0 #define HOST_REG_XMM_END 7 -static inline int find_host_reg() +static __inline int find_host_reg(void) { int c; for (c = HOST_REG_START; c < HOST_REG_END; c++) @@ -21,7 +21,7 @@ static inline int find_host_reg() fatal("Out of host regs!\n"); return c; } -static inline int find_host_xmm_reg() +static __inline int find_host_xmm_reg(void) { int c; for (c = HOST_REG_XMM_START; c < HOST_REG_XMM_END; c++) @@ -36,14 +36,14 @@ static inline int find_host_xmm_reg() } #if 0 -static inline void STORE_IMM_ADDR_B(uintptr_t addr, uint8_t val) +static __inline void STORE_IMM_ADDR_B(uintptr_t addr, uint8_t val) { addbyte(0xC6); /*MOVB [addr],val*/ addbyte(0x05); addlong(addr); addbyte(val); } -static inline void STORE_IMM_ADDR_W(uintptr_t addr, uint16_t val) +static __inline void STORE_IMM_ADDR_W(uintptr_t addr, uint16_t val) { addbyte(0x66); /*MOVW [addr],val*/ addbyte(0xC7); @@ -52,7 +52,7 @@ static inline void STORE_IMM_ADDR_W(uintptr_t addr, uint16_t val) addword(val); } #endif -static inline void STORE_IMM_ADDR_L(uintptr_t addr, uint32_t val) +static __inline void STORE_IMM_ADDR_L(uintptr_t addr, uint32_t val) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -70,7 +70,7 @@ static inline void STORE_IMM_ADDR_L(uintptr_t addr, uint32_t val) } } -static inline void STORE_IMM_REG_B(int reg, uint8_t val) +static __inline void STORE_IMM_REG_B(int reg, uint8_t val) { addbyte(0xC6); /*MOVB [addr],val*/ addbyte(0x45); @@ -80,7 +80,7 @@ static inline void STORE_IMM_REG_B(int reg, uint8_t val) addbyte((uint8_t)cpu_state_offset(regs[reg & 3].b.l)); addbyte(val); } -static inline void STORE_IMM_REG_W(int reg, uint16_t val) +static __inline void STORE_IMM_REG_W(int reg, uint16_t val) { addbyte(0x66); /*MOVW [addr],val*/ addbyte(0xC7); @@ -88,7 +88,7 @@ static inline void STORE_IMM_REG_W(int reg, uint16_t val) addbyte((uint8_t)cpu_state_offset(regs[reg & 7].w)); addword(val); } -static inline void STORE_IMM_REG_L(int reg, uint32_t val) +static __inline void STORE_IMM_REG_L(int reg, uint32_t val) { addbyte(0xC7); /*MOVL [addr],val*/ addbyte(0x45); @@ -96,7 +96,7 @@ static inline void STORE_IMM_REG_L(int reg, uint32_t val) addlong(val); } -static inline int LOAD_REG_B(int reg) +static __inline int LOAD_REG_B(int reg) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = reg; @@ -111,7 +111,7 @@ static inline int LOAD_REG_B(int reg) return host_reg; } -static inline int LOAD_REG_W(int reg) +static __inline int LOAD_REG_W(int reg) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = reg; @@ -123,7 +123,7 @@ static inline int LOAD_REG_W(int reg) return host_reg; } -static inline int LOAD_REG_L(int reg) +static __inline int LOAD_REG_L(int reg) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = reg; @@ -135,7 +135,7 @@ static inline int LOAD_REG_L(int reg) return host_reg; } -static inline int LOAD_VAR_W(uintptr_t addr) +static __inline int LOAD_VAR_W(uintptr_t addr) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = 0; @@ -147,7 +147,7 @@ static inline int LOAD_VAR_W(uintptr_t addr) return host_reg; } -static inline int LOAD_VAR_WL(uintptr_t addr) +static __inline int LOAD_VAR_WL(uintptr_t addr) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = 0; @@ -159,7 +159,7 @@ static inline int LOAD_VAR_WL(uintptr_t addr) return host_reg; } -static inline int LOAD_VAR_L(uintptr_t addr) +static __inline int LOAD_VAR_L(uintptr_t addr) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = 0; @@ -171,7 +171,7 @@ static inline int LOAD_VAR_L(uintptr_t addr) return host_reg; } -static inline int LOAD_REG_IMM(uint32_t imm) +static __inline int LOAD_REG_IMM(uint32_t imm) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = 0; @@ -183,7 +183,7 @@ static inline int LOAD_REG_IMM(uint32_t imm) return host_reg; } -static inline int LOAD_HOST_REG(int host_reg) +static __inline int LOAD_HOST_REG(int host_reg) { int new_host_reg = find_host_reg(); host_reg_mapping[new_host_reg] = 0; @@ -194,7 +194,7 @@ static inline int LOAD_HOST_REG(int host_reg) return new_host_reg; } -static inline void STORE_REG_B_RELEASE(int host_reg) +static __inline void STORE_REG_B_RELEASE(int host_reg) { addbyte(0x88); /*MOVB [reg],host_reg*/ addbyte(0x45 | (host_reg << 3)); @@ -204,7 +204,7 @@ static inline void STORE_REG_B_RELEASE(int host_reg) addbyte((uint8_t)cpu_state_offset(regs[host_reg_mapping[host_reg] & 3].b.l)); host_reg_mapping[host_reg] = -1; } -static inline void STORE_REG_W_RELEASE(int host_reg) +static __inline void STORE_REG_W_RELEASE(int host_reg) { addbyte(0x66); /*MOVW [reg],host_reg*/ addbyte(0x89); @@ -212,7 +212,7 @@ static inline void STORE_REG_W_RELEASE(int host_reg) addbyte((uint8_t)cpu_state_offset(regs[host_reg_mapping[host_reg]].w)); host_reg_mapping[host_reg] = -1; } -static inline void STORE_REG_L_RELEASE(int host_reg) +static __inline void STORE_REG_L_RELEASE(int host_reg) { addbyte(0x89); /*MOVL [reg],host_reg*/ addbyte(0x45 | (host_reg << 3)); @@ -220,7 +220,7 @@ static inline void STORE_REG_L_RELEASE(int host_reg) host_reg_mapping[host_reg] = -1; } -static inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) { addbyte(0x88); /*MOVB [guest_reg],host_reg*/ addbyte(0x45 | (host_reg << 3)); @@ -230,7 +230,7 @@ static inline void STORE_REG_TARGET_B_RELEASE(int host_reg, int guest_reg) addbyte((uint8_t)cpu_state_offset(regs[guest_reg & 3].b.l)); host_reg_mapping[host_reg] = -1; } -static inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) { addbyte(0x66); /*MOVW [guest_reg],host_reg*/ addbyte(0x89); @@ -238,7 +238,7 @@ static inline void STORE_REG_TARGET_W_RELEASE(int host_reg, int guest_reg) addbyte((uint8_t)cpu_state_offset(regs[guest_reg & 7].w)); host_reg_mapping[host_reg] = -1; } -static inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) +static __inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) { addbyte(0x89); /*MOVL [guest_reg],host_reg*/ addbyte(0x45 | (host_reg << 3)); @@ -246,12 +246,12 @@ static inline void STORE_REG_TARGET_L_RELEASE(int host_reg, int guest_reg) host_reg_mapping[host_reg] = -1; } -static inline void RELEASE_REG(int host_reg) +static __inline void RELEASE_REG(int host_reg) { host_reg_mapping[host_reg] = -1; } -static inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -268,7 +268,7 @@ static inline void STORE_HOST_REG_ADDR_W(uintptr_t addr, int host_reg) addlong(addr); } } -static inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) +static __inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) { if (addr >= (uintptr_t)&cpu_state && addr < ((uintptr_t)&cpu_state)+0x100) { @@ -286,29 +286,29 @@ static inline void STORE_HOST_REG_ADDR(uintptr_t addr, int host_reg) #define STORE_HOST_REG_ADDR_BL STORE_HOST_REG_ADDR #define STORE_HOST_REG_ADDR_WL STORE_HOST_REG_ADDR -static inline void ADD_HOST_REG_B(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_B(int dst_reg, int src_reg) { addbyte(0x00); /*ADDB dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void ADD_HOST_REG_W(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_W(int dst_reg, int src_reg) { addbyte(0x66); /*ADDW dst_reg, src_reg*/ addbyte(0x01); addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void ADD_HOST_REG_L(int dst_reg, int src_reg) +static __inline void ADD_HOST_REG_L(int dst_reg, int src_reg) { addbyte(0x01); /*ADDL dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void ADD_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline void ADD_HOST_REG_IMM_B(int host_reg, uint8_t imm) { addbyte(0x80); /*ADDB host_reg, imm*/ addbyte(0xC0 | host_reg); addbyte(imm); } -static inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) { if (imm < 0x80 || imm >= 0xff80) { @@ -325,7 +325,7 @@ static inline void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) addword(imm); } } -static inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) { if (imm < 0x80 || imm >= 0xffffff80) { @@ -343,12 +343,12 @@ static inline void ADD_HOST_REG_IMM(int host_reg, uint32_t imm) #define AND_HOST_REG_B AND_HOST_REG_L #define AND_HOST_REG_W AND_HOST_REG_L -static inline void AND_HOST_REG_L(int dst_reg, int src_reg) +static __inline void AND_HOST_REG_L(int dst_reg, int src_reg) { addbyte(0x21); /*ANDL dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) { if (imm < 0x80 || imm >= 0xffffff80) { @@ -363,25 +363,25 @@ static inline void AND_HOST_REG_IMM(int host_reg, uint32_t imm) addlong(imm); } } -static inline int TEST_HOST_REG_B(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_B(int dst_reg, int src_reg) { AND_HOST_REG_B(dst_reg, src_reg); return dst_reg; } -static inline int TEST_HOST_REG_W(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_W(int dst_reg, int src_reg) { AND_HOST_REG_W(dst_reg, src_reg); return dst_reg; } -static inline int TEST_HOST_REG_L(int dst_reg, int src_reg) +static __inline int TEST_HOST_REG_L(int dst_reg, int src_reg) { AND_HOST_REG_L(dst_reg, src_reg); return dst_reg; } -static inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) { AND_HOST_REG_IMM(host_reg, imm); @@ -390,12 +390,12 @@ static inline int TEST_HOST_REG_IMM(int host_reg, uint32_t imm) #define OR_HOST_REG_B OR_HOST_REG_L #define OR_HOST_REG_W OR_HOST_REG_L -static inline void OR_HOST_REG_L(int dst_reg, int src_reg) +static __inline void OR_HOST_REG_L(int dst_reg, int src_reg) { addbyte(0x09); /*ORL dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) { if (imm < 0x80 || imm >= 0xffffff80) { @@ -411,46 +411,46 @@ static inline void OR_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline void NEG_HOST_REG_B(int reg) +static __inline void NEG_HOST_REG_B(int reg) { addbyte(0xf6); addbyte(0xd8 | reg); } -static inline void NEG_HOST_REG_W(int reg) +static __inline void NEG_HOST_REG_W(int reg) { addbyte(0x66); addbyte(0xf7); addbyte(0xd8 | reg); } -static inline void NEG_HOST_REG_L(int reg) +static __inline void NEG_HOST_REG_L(int reg) { addbyte(0xf7); addbyte(0xd8 | reg); } -static inline void SUB_HOST_REG_B(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_B(int dst_reg, int src_reg) { addbyte(0x28); /*SUBB dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void SUB_HOST_REG_W(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_W(int dst_reg, int src_reg) { addbyte(0x66); /*SUBW dst_reg, src_reg*/ addbyte(0x29); addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void SUB_HOST_REG_L(int dst_reg, int src_reg) +static __inline void SUB_HOST_REG_L(int dst_reg, int src_reg) { addbyte(0x29); /*SUBL dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void SUB_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline void SUB_HOST_REG_IMM_B(int host_reg, uint8_t imm) { addbyte(0x80); /*SUBB host_reg, imm*/ addbyte(0xE8 | host_reg); addbyte(imm); } -static inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) { if (imm < 0x80 || imm >= 0xff80) { @@ -467,7 +467,7 @@ static inline void SUB_HOST_REG_IMM_W(int host_reg, uint16_t imm) addword(imm); } } -static inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) { if (imm < 0x80 || imm >= 0xffffff80) { @@ -483,56 +483,56 @@ static inline void SUB_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline void INC_HOST_REG_W(int host_reg) +static __inline void INC_HOST_REG_W(int host_reg) { addbyte(0x66); /*INCW host_reg*/ addbyte(0x40 | host_reg); } -static inline void INC_HOST_REG(int host_reg) +static __inline void INC_HOST_REG(int host_reg) { addbyte(0x40 | host_reg); /*DECL host_reg*/ } -static inline void DEC_HOST_REG_W(int host_reg) +static __inline void DEC_HOST_REG_W(int host_reg) { addbyte(0x66); /*DECW host_reg*/ addbyte(0x48 | host_reg); } -static inline void DEC_HOST_REG(int host_reg) +static __inline void DEC_HOST_REG(int host_reg) { addbyte(0x48 | host_reg); /*DECL host_reg*/ } -static inline int CMP_HOST_REG_B(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_B(int dst_reg, int src_reg) { SUB_HOST_REG_B(dst_reg, src_reg); return dst_reg; } -static inline int CMP_HOST_REG_W(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_W(int dst_reg, int src_reg) { SUB_HOST_REG_W(dst_reg, src_reg); return dst_reg; } -static inline int CMP_HOST_REG_L(int dst_reg, int src_reg) +static __inline int CMP_HOST_REG_L(int dst_reg, int src_reg) { SUB_HOST_REG_L(dst_reg, src_reg); return dst_reg; } -static inline int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) +static __inline int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) { SUB_HOST_REG_IMM_B(host_reg, imm); return host_reg; } -static inline int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) +static __inline int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) { SUB_HOST_REG_IMM_W(host_reg, imm); return host_reg; } -static inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) +static __inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) { SUB_HOST_REG_IMM(host_reg, imm); @@ -541,12 +541,12 @@ static inline int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) #define XOR_HOST_REG_B XOR_HOST_REG_L #define XOR_HOST_REG_W XOR_HOST_REG_L -static inline void XOR_HOST_REG_L(int dst_reg, int src_reg) +static __inline void XOR_HOST_REG_L(int dst_reg, int src_reg) { addbyte(0x31); /*XORL dst_reg, src_reg*/ addbyte(0xc0 | dst_reg | (src_reg << 3)); } -static inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) +static __inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) { if (imm < 0x80 || imm >= 0xffffff80) { @@ -562,64 +562,64 @@ static inline void XOR_HOST_REG_IMM(int host_reg, uint32_t imm) } } -static inline void CALL_FUNC(uintptr_t dest) +static __inline void CALL_FUNC(uintptr_t dest) { addbyte(0xE8); /*CALL*/ addlong(((uintptr_t)dest - (uintptr_t)(&codeblock[block_current].data[block_pos + 4]))); } -static inline void SHL_B_IMM(int reg, int count) +static __inline void SHL_B_IMM(int reg, int count) { addbyte(0xc0); /*SHL reg, count*/ addbyte(0xc0 | reg | 0x20); addbyte(count); } -static inline void SHL_W_IMM(int reg, int count) +static __inline void SHL_W_IMM(int reg, int count) { addbyte(0x66); /*SHL reg, count*/ addbyte(0xc1); addbyte(0xc0 | reg | 0x20); addbyte(count); } -static inline void SHL_L_IMM(int reg, int count) +static __inline void SHL_L_IMM(int reg, int count) { addbyte(0xc1); /*SHL reg, count*/ addbyte(0xc0 | reg | 0x20); addbyte(count); } -static inline void SHR_B_IMM(int reg, int count) +static __inline void SHR_B_IMM(int reg, int count) { addbyte(0xc0); /*SHR reg, count*/ addbyte(0xc0 | reg | 0x28); addbyte(count); } -static inline void SHR_W_IMM(int reg, int count) +static __inline void SHR_W_IMM(int reg, int count) { addbyte(0x66); /*SHR reg, count*/ addbyte(0xc1); addbyte(0xc0 | reg | 0x28); addbyte(count); } -static inline void SHR_L_IMM(int reg, int count) +static __inline void SHR_L_IMM(int reg, int count) { addbyte(0xc1); /*SHR reg, count*/ addbyte(0xc0 | reg | 0x28); addbyte(count); } -static inline void SAR_B_IMM(int reg, int count) +static __inline void SAR_B_IMM(int reg, int count) { addbyte(0xc0); /*SAR reg, count*/ addbyte(0xc0 | reg | 0x38); addbyte(count); } -static inline void SAR_W_IMM(int reg, int count) +static __inline void SAR_W_IMM(int reg, int count) { addbyte(0x66); /*SAR reg, count*/ addbyte(0xc1); addbyte(0xc0 | reg | 0x38); addbyte(count); } -static inline void SAR_L_IMM(int reg, int count) +static __inline void SAR_L_IMM(int reg, int count) { addbyte(0xc1); /*SAR reg, count*/ addbyte(0xc0 | reg | 0x38); @@ -627,7 +627,7 @@ static inline void SAR_L_IMM(int reg, int count) } -static inline void CHECK_SEG_READ(x86seg *seg) +static __inline void CHECK_SEG_READ(x86seg *seg) { /*Segments always valid in real/V86 mode*/ if (!(cr0 & 1) || (cpu_state.eflags & VM_FLAG)) @@ -650,7 +650,7 @@ static inline void CHECK_SEG_READ(x86seg *seg) seg->checked = 1; } -static inline void CHECK_SEG_WRITE(x86seg *seg) +static __inline void CHECK_SEG_WRITE(x86seg *seg) { /*Segments always valid in real/V86 mode*/ if (!(cr0 & 1) || (cpu_state.eflags & VM_FLAG)) @@ -673,7 +673,7 @@ static inline void CHECK_SEG_WRITE(x86seg *seg) seg->checked = 1; } -static inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) +static __inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) return; @@ -701,7 +701,7 @@ static inline void CHECK_SEG_LIMITS(x86seg *seg, int end_offset) } } -static inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -719,7 +719,7 @@ static inline void MEM_LOAD_ADDR_EA_B(x86seg *seg) host_reg_mapping[0] = 8; } -static inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -739,7 +739,7 @@ static inline int MEM_LOAD_ADDR_EA_B_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -757,7 +757,7 @@ static inline void MEM_LOAD_ADDR_EA_W(x86seg *seg) host_reg_mapping[0] = 8; } -static inline void MEM_LOAD_ADDR_EA_W_OFFSET(x86seg *seg, int offset) +static __inline void MEM_LOAD_ADDR_EA_W_OFFSET(x86seg *seg, int offset) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -778,7 +778,7 @@ static inline void MEM_LOAD_ADDR_EA_W_OFFSET(x86seg *seg, int offset) host_reg_mapping[0] = 8; } -static inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -798,7 +798,7 @@ static inline int MEM_LOAD_ADDR_EA_W_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -817,7 +817,7 @@ static inline void MEM_LOAD_ADDR_EA_L(x86seg *seg) host_reg_mapping[0] = 8; } -static inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) +static __inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -838,7 +838,7 @@ static inline int MEM_LOAD_ADDR_EA_L_NO_ABRT(x86seg *seg) return REG_ECX; } -static inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) +static __inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -857,26 +857,26 @@ static inline void MEM_LOAD_ADDR_EA_Q(x86seg *seg) host_reg_mapping[0] = 8; } -static inline void MEM_LOAD_ADDR_IMM_B(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_B(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_B(seg); } -static inline void MEM_LOAD_ADDR_IMM_W(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_W(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_W(seg); } -static inline void MEM_LOAD_ADDR_IMM_L(x86seg *seg, uint32_t addr) +static __inline void MEM_LOAD_ADDR_IMM_L(x86seg *seg, uint32_t addr) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_LOAD_ADDR_EA_L(seg); } -static inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -897,7 +897,7 @@ static inline void MEM_STORE_ADDR_EA_B(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_b*/ addlong(mem_store_addr_ea_b - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -918,7 +918,7 @@ static inline void MEM_STORE_ADDR_EA_B_NO_ABRT(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_b_no_abrt*/ addlong(mem_store_addr_ea_b_no_abrt - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -939,7 +939,7 @@ static inline void MEM_STORE_ADDR_EA_W(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_w*/ addlong(mem_store_addr_ea_w - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -960,7 +960,7 @@ static inline void MEM_STORE_ADDR_EA_W_NO_ABRT(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_w_no_abrt*/ addlong(mem_store_addr_ea_w_no_abrt - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -981,7 +981,7 @@ static inline void MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_l*/ addlong(mem_store_addr_ea_l - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) +static __inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { @@ -1002,7 +1002,7 @@ static inline void MEM_STORE_ADDR_EA_L_NO_ABRT(x86seg *seg, int host_reg) addbyte(0xe8); /*CALL mem_store_addr_ea_l_no_abrt*/ addlong(mem_store_addr_ea_l_no_abrt - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) +static __inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) { if (host_reg != REG_EBX) { @@ -1029,19 +1029,19 @@ static inline void MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) addlong(mem_store_addr_ea_q - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); } -static inline void MEM_STORE_ADDR_IMM_B(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_B(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_STORE_ADDR_EA_B(seg, host_reg); } -static inline void MEM_STORE_ADDR_IMM_L(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_L(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); MEM_STORE_ADDR_EA_L(seg, host_reg); } -static inline void MEM_STORE_ADDR_IMM_W(x86seg *seg, uint32_t addr, int host_reg) +static __inline void MEM_STORE_ADDR_IMM_W(x86seg *seg, uint32_t addr, int host_reg) { addbyte(0xb8); /*MOV EAX, addr*/ addlong(addr); @@ -1049,7 +1049,7 @@ static inline void MEM_STORE_ADDR_IMM_W(x86seg *seg, uint32_t addr, int host_reg } -static inline x86seg *FETCH_EA_16(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc) +static __inline x86seg *FETCH_EA_16(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc) { int mod = (fetchdat >> 6) & 3; int rm = fetchdat & 7; @@ -1111,7 +1111,7 @@ static inline x86seg *FETCH_EA_16(x86seg *op_ea_seg, uint32_t fetchdat, int op_s return op_ea_seg; } -static inline x86seg *FETCH_EA_32(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, int stack_offset) +static __inline x86seg *FETCH_EA_32(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, int stack_offset) { uint32_t new_eaaddr; int mod = (fetchdat >> 6) & 3; @@ -1238,7 +1238,7 @@ static inline x86seg *FETCH_EA_32(x86seg *op_ea_seg, uint32_t fetchdat, int op_s return op_ea_seg; } -static inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32) +static __inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32) { if (op_32 & 0x200) return FETCH_EA_32(op_ea_seg, fetchdat, op_ssegs, op_pc, 0); @@ -1246,7 +1246,7 @@ static inline x86seg *FETCH_EA(x86seg *op_ea_seg, uint32_t fetchdat, int op_sseg } -static inline void LOAD_STACK_TO_EA(int off) +static __inline void LOAD_STACK_TO_EA(int off) { if (stack32) { @@ -1275,7 +1275,7 @@ static inline void LOAD_STACK_TO_EA(int off) } } -static inline void LOAD_EBP_TO_EA(int off) +static __inline void LOAD_EBP_TO_EA(int off) { if (stack32) { @@ -1304,7 +1304,7 @@ static inline void LOAD_EBP_TO_EA(int off) } } -static inline void SP_MODIFY(int off) +static __inline void SP_MODIFY(int off) { if (stack32) { @@ -1345,7 +1345,7 @@ static inline void SP_MODIFY(int off) } -static inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x66); /*CMPW host_reg, 0*/ addbyte(0x83); @@ -1367,7 +1367,7 @@ static inline void TEST_ZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cyc addbyte(0xe9); /*JMP end*/ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x83); /*CMPW host_reg, 0*/ addbyte(0xc0 | 0x38 | host_reg); @@ -1389,7 +1389,7 @@ static inline void TEST_ZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cyc addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x66); /*CMPW host_reg, 0*/ addbyte(0x83); @@ -1411,7 +1411,7 @@ static inline void TEST_NONZERO_JUMP_W(int host_reg, uint32_t new_pc, int taken_ addbyte(0xe9); /*JMP end*/ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) +static __inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_cycles) { addbyte(0x83); /*CMPW host_reg, 0*/ addbyte(0xc0 | 0x38 | host_reg); @@ -1433,7 +1433,7 @@ static inline void TEST_NONZERO_JUMP_L(int host_reg, uint32_t new_pc, int taken_ addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { switch (codegen_flags_changed ? cpu_state.flags_op : FLAGS_UNKNOWN) { @@ -1521,7 +1521,7 @@ static inline void BRANCH_COND_BE(int pc_offset, uint32_t op_pc, uint32_t offset addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { switch (codegen_flags_changed ? cpu_state.flags_op : FLAGS_UNKNOWN) { @@ -1601,7 +1601,7 @@ static inline void BRANCH_COND_L(int pc_offset, uint32_t op_pc, uint32_t offset, addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); } -static inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) +static __inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset, int not) { switch (codegen_flags_changed ? cpu_state.flags_op : FLAGS_UNKNOWN) { @@ -1702,7 +1702,7 @@ static inline void BRANCH_COND_LE(int pc_offset, uint32_t op_pc, uint32_t offset } -static inline void FP_ENTER() +static __inline void FP_ENTER(void) { if (codegen_fpu_entered) return; @@ -1729,7 +1729,7 @@ static inline void FP_ENTER() codegen_fpu_entered = 1; } -static inline void FP_FLD(int reg) +static __inline void FP_FLD(int reg) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -1832,7 +1832,7 @@ static inline void FP_FLD(int reg) } } -static inline void FP_FST(int reg) +static __inline void FP_FST(int reg) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -1888,7 +1888,7 @@ static inline void FP_FST(int reg) } } -static inline void FP_FXCH(int reg) +static __inline void FP_FXCH(int reg) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2025,7 +2025,7 @@ static inline void FP_FXCH(int reg) } -static inline void FP_LOAD_S() +static __inline void FP_LOAD_S(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2082,7 +2082,7 @@ static inline void FP_LOAD_S() addbyte((uint8_t)cpu_state_offset(tag[0])); } } -static inline void FP_LOAD_D() +static __inline void FP_LOAD_D(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2143,7 +2143,7 @@ static inline void FP_LOAD_D() addbyte((uint8_t)cpu_state_offset(tag[0])); } } -static inline void FP_LOAD_IW() +static __inline void FP_LOAD_IW(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2203,7 +2203,7 @@ static inline void FP_LOAD_IW() addbyte((uint8_t)cpu_state_offset(tag[0])); } } -static inline void FP_LOAD_IL() +static __inline void FP_LOAD_IL(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2261,7 +2261,7 @@ static inline void FP_LOAD_IL() addbyte((uint8_t)cpu_state_offset(tag[0])); } } -static inline void FP_LOAD_IQ() +static __inline void FP_LOAD_IQ(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2339,7 +2339,7 @@ static inline void FP_LOAD_IQ() } } -static inline void FP_LOAD_IMM_Q(uint64_t v) +static __inline void FP_LOAD_IMM_Q(uint64_t v) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2392,7 +2392,7 @@ static inline void FP_LOAD_IMM_Q(uint64_t v) } } -static inline int FP_LOAD_REG(int reg) +static __inline int FP_LOAD_REG(int reg) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2429,7 +2429,7 @@ static inline int FP_LOAD_REG(int reg) return REG_EBX; } -static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) +static __inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2471,7 +2471,7 @@ static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) *host_reg2 = REG_ECX; } -static inline int FP_LOAD_REG_INT_W(int reg) +static __inline int FP_LOAD_REG_INT_W(int reg) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -2505,7 +2505,7 @@ static inline int FP_LOAD_REG_INT_W(int reg) return REG_EBX; } -static inline int FP_LOAD_REG_INT(int reg) +static __inline int FP_LOAD_REG_INT(int reg) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -2539,7 +2539,7 @@ static inline int FP_LOAD_REG_INT(int reg) return REG_EBX; } -static inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) +static __inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -2616,7 +2616,7 @@ static inline void FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) *host_reg2 = REG_ECX; } -static inline void FP_POP() +static __inline void FP_POP(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2648,7 +2648,7 @@ static inline void FP_POP() addbyte((uint8_t)cpu_state_offset(TOP)); } } -static inline void FP_POP2() +static __inline void FP_POP2(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2692,7 +2692,7 @@ static inline void FP_POP2() #define FPU_SUB 0x20 #define FPU_SUBR 0x28 -static inline void FP_OP_S(int op) +static __inline void FP_OP_S(int op) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2739,7 +2739,7 @@ static inline void FP_OP_S(int op) addbyte((uint8_t)cpu_state_offset(ST)); } } -static inline void FP_OP_D(int op) +static __inline void FP_OP_D(int op) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2818,7 +2818,7 @@ static inline void FP_OP_D(int op) } } } -static inline void FP_OP_IW(int op) +static __inline void FP_OP_IW(int op) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2866,7 +2866,7 @@ static inline void FP_OP_IW(int op) addbyte((uint8_t)cpu_state_offset(ST)); } } -static inline void FP_OP_IL(int op) +static __inline void FP_OP_IL(int op) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2914,7 +2914,7 @@ static inline void FP_OP_IL(int op) } } #if 0 -static inline void FP_OP_IQ(int op) +static __inline void FP_OP_IQ(int op) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -2971,7 +2971,7 @@ static inline void FP_OP_IQ(int op) } #endif -static inline void FP_COMPARE_S() +static __inline void FP_COMPARE_S(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3038,7 +3038,7 @@ static inline void FP_COMPARE_S() addbyte((uint8_t)cpu_state_offset(npxs) + 1); } } -static inline void FP_COMPARE_D() +static __inline void FP_COMPARE_D(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3113,7 +3113,7 @@ static inline void FP_COMPARE_D() addbyte((uint8_t)cpu_state_offset(npxs) + 1); } } -static inline void FP_COMPARE_IW() +static __inline void FP_COMPARE_IW(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3181,7 +3181,7 @@ static inline void FP_COMPARE_IW() addbyte((uint8_t)cpu_state_offset(npxs) + 1); } } -static inline void FP_COMPARE_IL() +static __inline void FP_COMPARE_IL(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3249,7 +3249,7 @@ static inline void FP_COMPARE_IL() } } -static inline void FP_OP_REG(int op, int dst, int src) +static __inline void FP_OP_REG(int op, int dst, int src) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3327,7 +3327,7 @@ static inline void FP_OP_REG(int op, int dst, int src) } } -static inline void FP_COMPARE_REG(int dst, int src) +static __inline void FP_COMPARE_REG(int dst, int src) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3418,7 +3418,7 @@ static inline void FP_COMPARE_REG(int dst, int src) } } -static inline void FP_FCHS() +static __inline void FP_FCHS(void) { if (codeblock[block_current].flags & CODEBLOCK_STATIC_TOP) { @@ -3459,7 +3459,7 @@ static inline void FP_FCHS() } } -static inline void UPDATE_NPXC(int reg) +static __inline void UPDATE_NPXC(int reg) { addbyte(0x66); /*AND cpu_state.new_npxc, ~0xc00*/ addbyte(0x81); @@ -3485,21 +3485,21 @@ static inline void UPDATE_NPXC(int reg) addbyte((uint8_t)cpu_state_offset(new_npxc)); } -static inline int ZERO_EXTEND_W_B(int reg) +static __inline int ZERO_EXTEND_W_B(int reg) { addbyte(0x0f); /*MOVZX regl, regb*/ addbyte(0xb6); addbyte(0xc0 | reg | (reg << 3)); return reg; } -static inline int ZERO_EXTEND_L_B(int reg) +static __inline int ZERO_EXTEND_L_B(int reg) { addbyte(0x0f); /*MOVZX regl, regb*/ addbyte(0xb6); addbyte(0xc0 | reg | (reg << 3)); return reg; } -static inline int ZERO_EXTEND_L_W(int reg) +static __inline int ZERO_EXTEND_L_W(int reg) { addbyte(0x0f); /*MOVZX regl, regw*/ addbyte(0xb7); @@ -3507,21 +3507,21 @@ static inline int ZERO_EXTEND_L_W(int reg) return reg; } -static inline int SIGN_EXTEND_W_B(int reg) +static __inline int SIGN_EXTEND_W_B(int reg) { addbyte(0x0f); /*MOVSX regl, regb*/ addbyte(0xbe); addbyte(0xc0 | reg | (reg << 3)); return reg; } -static inline int SIGN_EXTEND_L_B(int reg) +static __inline int SIGN_EXTEND_L_B(int reg) { addbyte(0x0f); /*MOVSX regl, regb*/ addbyte(0xbe); addbyte(0xc0 | reg | (reg << 3)); return reg; } -static inline int SIGN_EXTEND_L_W(int reg) +static __inline int SIGN_EXTEND_L_W(int reg) { addbyte(0x0f); /*MOVSX regl, regw*/ addbyte(0xbf); @@ -3529,12 +3529,12 @@ static inline int SIGN_EXTEND_L_W(int reg) return reg; } -static inline int COPY_REG(int src_reg) +static __inline int COPY_REG(int src_reg) { return src_reg; } -static inline void SET_BITS(uintptr_t addr, uint32_t val) +static __inline void SET_BITS(uintptr_t addr, uint32_t val) { if (val & ~0xff) { @@ -3551,7 +3551,7 @@ static inline void SET_BITS(uintptr_t addr, uint32_t val) addbyte(val); } } -static inline void CLEAR_BITS(uintptr_t addr, uint32_t val) +static __inline void CLEAR_BITS(uintptr_t addr, uint32_t val) { if (val & ~0xff) { @@ -3572,7 +3572,7 @@ static inline void CLEAR_BITS(uintptr_t addr, uint32_t val) #define LOAD_Q_REG_1 REG_EAX #define LOAD_Q_REG_2 REG_EDX -static inline void MMX_ENTER() +static __inline void MMX_ENTER(void) { if (codegen_mmx_entered) return; @@ -3617,7 +3617,7 @@ static inline void MMX_ENTER() extern int mmx_ebx_ecx_loaded; -static inline int LOAD_MMX_D(int guest_reg) +static __inline int LOAD_MMX_D(int guest_reg) { int host_reg = find_host_reg(); host_reg_mapping[host_reg] = 100; @@ -3628,7 +3628,7 @@ static inline int LOAD_MMX_D(int guest_reg) return host_reg; } -static inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) +static __inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) { if (!mmx_ebx_ecx_loaded) { @@ -3649,7 +3649,7 @@ static inline void LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) addbyte(0x45 | ((*host_reg2) << 3)); addbyte((uint8_t)cpu_state_offset(MM[guest_reg].l[1])); } -static inline int LOAD_MMX_Q_MMX(int guest_reg) +static __inline int LOAD_MMX_Q_MMX(int guest_reg) { int dst_reg = find_host_xmm_reg(); host_reg_xmm_mapping[dst_reg] = guest_reg; @@ -3663,7 +3663,7 @@ static inline int LOAD_MMX_Q_MMX(int guest_reg) return dst_reg; } -static inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) +static __inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) { int dst_reg = find_host_xmm_reg(); host_reg_xmm_mapping[dst_reg] = 100; @@ -3684,7 +3684,7 @@ static inline int LOAD_INT_TO_MMX(int src_reg1, int src_reg2) return dst_reg; } -static inline void STORE_MMX_LQ(int guest_reg, int host_reg1) +static __inline void STORE_MMX_LQ(int guest_reg, int host_reg1) { addbyte(0xC7); /*MOVL [reg],0*/ addbyte(0x45); @@ -3694,7 +3694,7 @@ static inline void STORE_MMX_LQ(int guest_reg, int host_reg1) addbyte(0x45 | (host_reg1 << 3)); addbyte((uint8_t)cpu_state_offset(MM[guest_reg].l[0])); } -static inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) +static __inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) { addbyte(0x89); /*MOVL [reg],host_reg*/ addbyte(0x45 | (host_reg1 << 3)); @@ -3703,7 +3703,7 @@ static inline void STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) addbyte(0x45 | (host_reg2 << 3)); addbyte((uint8_t)cpu_state_offset(MM[guest_reg].l[1])); } -static inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) +static __inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) { addbyte(0x66); /*MOVQ [guest_reg],host_reg*/ addbyte(0x0f); @@ -3713,7 +3713,7 @@ static inline void STORE_MMX_Q_MMX(int guest_reg, int host_reg) } #define MMX_x86_OP(name, opcode) \ -static inline void MMX_ ## name(int dst_reg, int src_reg) \ +static __inline void MMX_ ## name(int dst_reg, int src_reg) \ { \ addbyte(0x66); /*op dst_reg, src_reg*/ \ addbyte(0x0f); \ @@ -3766,7 +3766,7 @@ MMX_x86_OP(PMULLW, 0xd5); MMX_x86_OP(PMULHW, 0xe5); MMX_x86_OP(PMADDWD, 0xf5); -static inline void MMX_PACKSSWB(int dst_reg, int src_reg) +static __inline void MMX_PACKSSWB(int dst_reg, int src_reg) { addbyte(0x66); /*PACKSSWB dst_reg, src_reg*/ addbyte(0x0f); @@ -3778,7 +3778,7 @@ static inline void MMX_PACKSSWB(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PACKUSWB(int dst_reg, int src_reg) +static __inline void MMX_PACKUSWB(int dst_reg, int src_reg) { addbyte(0x66); /*PACKUSWB dst_reg, src_reg*/ addbyte(0x0f); @@ -3790,7 +3790,7 @@ static inline void MMX_PACKUSWB(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PACKSSDW(int dst_reg, int src_reg) +static __inline void MMX_PACKSSDW(int dst_reg, int src_reg) { addbyte(0x66); /*PACKSSDW dst_reg, src_reg*/ addbyte(0x0f); @@ -3802,7 +3802,7 @@ static inline void MMX_PACKSSDW(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x08); } -static inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLBW dst_reg, src_reg*/ addbyte(0x0f); @@ -3814,7 +3814,7 @@ static inline void MMX_PUNPCKHBW(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x0e); } -static inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLWD dst_reg, src_reg*/ addbyte(0x0f); @@ -3826,7 +3826,7 @@ static inline void MMX_PUNPCKHWD(int dst_reg, int src_reg) addbyte(0xc0 | (dst_reg << 3) | dst_reg); addbyte(0x0e); } -static inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) +static __inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) { addbyte(0x66); /*PUNPCKLDQ dst_reg, src_reg*/ addbyte(0x0f); @@ -3839,7 +3839,7 @@ static inline void MMX_PUNPCKHDQ(int dst_reg, int src_reg) addbyte(0x0e); } -static inline void MMX_PSRLW_imm(int dst_reg, int amount) +static __inline void MMX_PSRLW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLW dst_reg, amount*/ addbyte(0x0f); @@ -3847,7 +3847,7 @@ static inline void MMX_PSRLW_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAW_imm(int dst_reg, int amount) +static __inline void MMX_PSRAW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAW dst_reg, amount*/ addbyte(0x0f); @@ -3855,7 +3855,7 @@ static inline void MMX_PSRAW_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLW_imm(int dst_reg, int amount) +static __inline void MMX_PSLLW_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLW dst_reg, amount*/ addbyte(0x0f); @@ -3864,7 +3864,7 @@ static inline void MMX_PSLLW_imm(int dst_reg, int amount) addbyte(amount); } -static inline void MMX_PSRLD_imm(int dst_reg, int amount) +static __inline void MMX_PSRLD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLD dst_reg, amount*/ addbyte(0x0f); @@ -3872,7 +3872,7 @@ static inline void MMX_PSRLD_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAD_imm(int dst_reg, int amount) +static __inline void MMX_PSRAD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAD dst_reg, amount*/ addbyte(0x0f); @@ -3880,7 +3880,7 @@ static inline void MMX_PSRAD_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLD_imm(int dst_reg, int amount) +static __inline void MMX_PSLLD_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLD dst_reg, amount*/ addbyte(0x0f); @@ -3889,7 +3889,7 @@ static inline void MMX_PSLLD_imm(int dst_reg, int amount) addbyte(amount); } -static inline void MMX_PSRLQ_imm(int dst_reg, int amount) +static __inline void MMX_PSRLQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRLQ dst_reg, amount*/ addbyte(0x0f); @@ -3897,7 +3897,7 @@ static inline void MMX_PSRLQ_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x10); addbyte(amount); } -static inline void MMX_PSRAQ_imm(int dst_reg, int amount) +static __inline void MMX_PSRAQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSRAQ dst_reg, amount*/ addbyte(0x0f); @@ -3905,7 +3905,7 @@ static inline void MMX_PSRAQ_imm(int dst_reg, int amount) addbyte(0xc0 | dst_reg | 0x20); addbyte(amount); } -static inline void MMX_PSLLQ_imm(int dst_reg, int amount) +static __inline void MMX_PSLLQ_imm(int dst_reg, int amount) { addbyte(0x66); /*PSLLQ dst_reg, amount*/ addbyte(0x0f); @@ -3915,14 +3915,14 @@ static inline void MMX_PSLLQ_imm(int dst_reg, int amount) } -static inline void SAVE_EA() +static __inline void SAVE_EA(void) { addbyte(0x89); /*MOV [ESP+12], EAX*/ addbyte(0x44); addbyte(0x24); addbyte(12); } -static inline void LOAD_EA() +static __inline void LOAD_EA(void) { addbyte(0x8b); /*MOV EAX, [ESP+12]*/ addbyte(0x44); @@ -3931,7 +3931,7 @@ static inline void LOAD_EA() } #define MEM_CHECK_WRITE_B MEM_CHECK_WRITE -static inline void MEM_CHECK_WRITE(x86seg *seg) +static __inline void MEM_CHECK_WRITE(x86seg *seg) { CHECK_SEG_WRITE(seg); if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) @@ -3949,7 +3949,7 @@ static inline void MEM_CHECK_WRITE(x86seg *seg) addlong(mem_check_write - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); LOAD_EA(); } -static inline void MEM_CHECK_WRITE_W(x86seg *seg) +static __inline void MEM_CHECK_WRITE_W(x86seg *seg) { CHECK_SEG_WRITE(seg); if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) @@ -3967,7 +3967,7 @@ static inline void MEM_CHECK_WRITE_W(x86seg *seg) addlong(mem_check_write_w - (uint32_t)(&codeblock[block_current].data[block_pos + 4])); LOAD_EA(); } -static inline void MEM_CHECK_WRITE_L(x86seg *seg) +static __inline void MEM_CHECK_WRITE_L(x86seg *seg) { CHECK_SEG_WRITE(seg); if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) @@ -3986,7 +3986,7 @@ static inline void MEM_CHECK_WRITE_L(x86seg *seg) LOAD_EA(); } -static inline void LOAD_SEG(int host_reg, void *seg) +static __inline void LOAD_SEG(int host_reg, void *seg) { addbyte(0xc7); /*MOV [ESP+4], seg*/ addbyte(0x44); diff --git a/src/codegen/codegen_x86-64.c b/src/codegen/codegen_x86-64.c index 7a9c00519..6ee277f72 100644 --- a/src/codegen/codegen_x86-64.c +++ b/src/codegen/codegen_x86-64.c @@ -60,7 +60,7 @@ static uint32_t last_op32; static x86seg *last_ea_seg; static int last_ssegs; -void codegen_init() +void codegen_init(void) { int c; @@ -80,7 +80,7 @@ void codegen_init() codeblock[c].valid = 0; } -void codegen_reset() +void codegen_reset(void) { int c; @@ -92,7 +92,7 @@ void codegen_reset() codeblock[c].valid = 0; } -void dump_block() +void dump_block(void) { } @@ -381,7 +381,7 @@ void codegen_block_start_recompile(codeblock_t *block) codegen_flat_ss = !(cpu_cur_status & CPU_STATUS_NOTFLATSS); } -void codegen_block_remove() +void codegen_block_remove(void) { codeblock_t *block = &codeblock[block_current]; @@ -390,7 +390,7 @@ void codegen_block_remove() recomp_page = -1; } -void codegen_block_generate_end_mask() +void codegen_block_generate_end_mask(void) { codeblock_t *block = &codeblock[block_current]; uint32_t start_pc; @@ -448,7 +448,7 @@ void codegen_block_generate_end_mask() recomp_page = -1; } -void codegen_block_end() +void codegen_block_end(void) { codeblock_t *block = &codeblock[block_current]; @@ -491,7 +491,7 @@ void codegen_block_end_recompile(codeblock_t *block) add_to_block_list(block); } -void codegen_flush() +void codegen_flush(void) { return; } @@ -541,7 +541,7 @@ int opcode_0f_modrm[256] = 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ }; -void codegen_debug() +void codegen_debug(void) { } diff --git a/src/codegen/codegen_x86.c b/src/codegen/codegen_x86.c index 492328e17..fe4703ea7 100644 --- a/src/codegen/codegen_x86.c +++ b/src/codegen/codegen_x86.c @@ -120,7 +120,7 @@ uint32_t mem_check_write; uint32_t mem_check_write_w; uint32_t mem_check_write_l; -static uint32_t gen_MEM_LOAD_ADDR_EA_B() +static uint32_t gen_MEM_LOAD_ADDR_EA_B(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -171,7 +171,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_B() return addr; } -static uint32_t gen_MEM_LOAD_ADDR_EA_W() +static uint32_t gen_MEM_LOAD_ADDR_EA_W(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -227,7 +227,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_W() return addr; } -static uint32_t gen_MEM_LOAD_ADDR_EA_L() +static uint32_t gen_MEM_LOAD_ADDR_EA_L(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -279,7 +279,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_L() return addr; } -static uint32_t gen_MEM_LOAD_ADDR_EA_Q() +static uint32_t gen_MEM_LOAD_ADDR_EA_Q(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -335,7 +335,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_Q() return addr; } -static uint32_t gen_MEM_STORE_ADDR_EA_B() +static uint32_t gen_MEM_STORE_ADDR_EA_B(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -384,7 +384,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_B() return addr; } -static uint32_t gen_MEM_STORE_ADDR_EA_W() +static uint32_t gen_MEM_STORE_ADDR_EA_W(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -439,7 +439,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_W() return addr; } -static uint32_t gen_MEM_STORE_ADDR_EA_L() +static uint32_t gen_MEM_STORE_ADDR_EA_L(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -493,7 +493,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_L() return addr; } -static uint32_t gen_MEM_STORE_ADDR_EA_Q() +static uint32_t gen_MEM_STORE_ADDR_EA_Q(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -555,7 +555,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_Q() #ifndef RELEASE_BUILD static char gen_MEM_LOAD_ADDR_EA_B_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_B_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT() +static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -620,7 +620,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT() #ifndef RELEASE_BUILD static char gen_MEM_LOAD_ADDR_EA_W_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_W_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT() +static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -690,7 +690,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT() #ifndef RELEASE_BUILD static char gen_MEM_LOAD_ADDR_EA_L_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_L_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT() +static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -759,7 +759,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT() #ifndef RELEASE_BUILD static char gen_MEM_STORE_ADDR_EA_B_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_B_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT() +static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -820,7 +820,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT() #ifndef RELEASE_BUILD static char gen_MEM_STORE_ADDR_EA_W_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_W_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT() +static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -887,7 +887,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT() #ifndef RELEASE_BUILD static char gen_MEM_STORE_ADDR_EA_L_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_L_NO_ABRT aborted\n"; #endif -static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT() +static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -950,7 +950,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT() return addr; } -static uint32_t gen_MEM_CHECK_WRITE() +static uint32_t gen_MEM_CHECK_WRITE(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -1007,7 +1007,7 @@ static uint32_t gen_MEM_CHECK_WRITE() return addr; } -static uint32_t gen_MEM_CHECK_WRITE_W() +static uint32_t gen_MEM_CHECK_WRITE_W(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -1089,7 +1089,7 @@ static uint32_t gen_MEM_CHECK_WRITE_W() return addr; } -static uint32_t gen_MEM_CHECK_WRITE_L() +static uint32_t gen_MEM_CHECK_WRITE_L(void) { uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos]; @@ -1171,7 +1171,7 @@ static uint32_t gen_MEM_CHECK_WRITE_L() return addr; } -void codegen_init() +void codegen_init(void) { #ifdef _WIN32 codeblock = VirtualAlloc(NULL, (BLOCK_SIZE+1) * sizeof(codeblock_t), MEM_COMMIT, PAGE_EXECUTE_READWRITE); @@ -1244,14 +1244,14 @@ void codegen_init() #endif } -void codegen_reset() +void codegen_reset(void) { memset(codeblock, 0, BLOCK_SIZE * sizeof(codeblock_t)); memset(codeblock_hash, 0, HASH_SIZE * sizeof(codeblock_t *)); mem_reset_page_blocks(); } -void dump_block() +void dump_block(void) { } @@ -1512,7 +1512,7 @@ void codegen_block_start_recompile(codeblock_t *block) codegen_accumulate_reset(); } -void codegen_block_remove() +void codegen_block_remove(void) { codeblock_t *block = &codeblock[block_current]; @@ -1521,7 +1521,7 @@ void codegen_block_remove() recomp_page = -1; } -void codegen_block_generate_end_mask() +void codegen_block_generate_end_mask(void) { codeblock_t *block = &codeblock[block_current]; uint32_t start_pc; @@ -1581,7 +1581,7 @@ void codegen_block_generate_end_mask() recomp_page = -1; } -void codegen_block_end() +void codegen_block_end(void) { codeblock_t *block = &codeblock[block_current]; @@ -1618,7 +1618,7 @@ void codegen_block_end_recompile(codeblock_t *block) block->flags &= ~CODEBLOCK_STATIC_TOP; } -void codegen_flush() +void codegen_flush(void) { return; } @@ -1668,7 +1668,7 @@ int opcode_0f_modrm[256] = 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ }; -void codegen_debug() +void codegen_debug(void) { } diff --git a/src/codegen_new/codegen.c b/src/codegen_new/codegen.c index ef928dd51..eb3c7f5eb 100644 --- a/src/codegen_new/codegen.c +++ b/src/codegen_new/codegen.c @@ -58,12 +58,12 @@ int has_ea; codeblock_t *codeblock; uint16_t *codeblock_hash; -void (*codegen_timing_start)(); +void (*codegen_timing_start)(void); void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat); void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); -void (*codegen_timing_block_start)(); -void (*codegen_timing_block_end)(); -int (*codegen_timing_jump_cycles)(); +void (*codegen_timing_block_start)(void); +void (*codegen_timing_block_end)(void); +int (*codegen_timing_jump_cycles)(void); void codegen_timing_set(codegen_timing_t *timing) { @@ -81,7 +81,7 @@ static int last_op_ssegs; static x86seg *last_op_ea_seg; static uint32_t last_op_32; -void codegen_generate_reset() +void codegen_generate_reset(void) { last_op_ssegs = -1; last_op_ea_seg = NULL; diff --git a/src/codegen_new/codegen.h b/src/codegen_new/codegen.h index 082874f28..c6fbac2a9 100644 --- a/src/codegen_new/codegen.h +++ b/src/codegen_new/codegen.h @@ -314,29 +314,29 @@ static inline void codegen_mark_code_present(codeblock_t *block, uint32_t start_ codegen_mark_code_present_multibyte(block, start_pc, len); } -void codegen_init(); -void codegen_close(); -void codegen_reset(); -void codegen_block_init(uint32_t phys_addr); -void codegen_block_remove(); -void codegen_block_start_recompile(codeblock_t *block); -void codegen_block_end_recompile(codeblock_t *block); -void codegen_block_end(); -void codegen_delete_block(codeblock_t *block); -void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc); -void codegen_generate_seg_restore(); -void codegen_set_op32(); -void codegen_flush(); -void codegen_check_flush(struct page_t *page, uint64_t mask, uint32_t phys_addr); +extern void codegen_init(void); +extern void codegen_close(void); +extern void codegen_reset(void); +extern void codegen_block_init(uint32_t phys_addr); +extern void codegen_block_remove(void); +extern void codegen_block_start_recompile(codeblock_t *block); +extern void codegen_block_end_recompile(codeblock_t *block); +extern void codegen_block_end(void); +extern void codegen_delete_block(codeblock_t *block); +extern void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc); +extern void codegen_generate_seg_restore(void); +extern void codegen_set_op32(void); +extern void codegen_flush(void); +extern void codegen_check_flush(struct page_t *page, uint64_t mask, uint32_t phys_addr); struct ir_data_t; x86seg *codegen_generate_ea(struct ir_data_t *ir, x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32, int stack_offset); -void codegen_check_seg_read(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); -void codegen_check_seg_write(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); +extern void codegen_check_seg_read(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); +extern void codegen_check_seg_write(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); -int codegen_purge_purgable_list(); +extern int codegen_purge_purgable_list(void); /*Delete a random code block to free memory. This is obviously quite expensive, and will only be called when the allocator is out of memory*/ -void codegen_delete_random_block(int required_mem_block); +extern void codegen_delete_random_block(int required_mem_block); extern int cpu_block_end; extern uint32_t codegen_endpc; @@ -346,21 +346,21 @@ extern int cpu_notreps; extern int codegen_block_cycles; -extern void (*codegen_timing_start)(); +extern void (*codegen_timing_start)(void); extern void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat); extern void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); -extern void (*codegen_timing_block_start)(); -extern void (*codegen_timing_block_end)(); -extern int (*codegen_timing_jump_cycles)(); +extern void (*codegen_timing_block_start)(void); +extern void (*codegen_timing_block_end)(void); +extern int (*codegen_timing_jump_cycles)(void); typedef struct codegen_timing_t { - void (*start)(); + void (*start)(void); void (*prefix)(uint8_t prefix, uint32_t fetchdat); void (*opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc); - void (*block_start)(); - void (*block_end)(); - int (*jump_cycles)(); + void (*block_start)(void); + void (*block_end)(void); + int (*jump_cycles)(void); } codegen_timing_t; extern codegen_timing_t codegen_timing_pentium; @@ -398,7 +398,7 @@ extern int codegen_reg_loaded[8]; extern int codegen_in_recompile; -void codegen_generate_reset(); +void codegen_generate_reset(void); int codegen_get_instruction_uop(codeblock_t *block, uint32_t pc, int *first_instruction, int *TOP); void codegen_set_loop_start(struct ir_data_t *ir, int first_instruction); diff --git a/src/codegen_new/codegen_accumulate.c b/src/codegen_new/codegen_accumulate.c index f15776b74..b9ec78577 100644 --- a/src/codegen_new/codegen_accumulate.c +++ b/src/codegen_new/codegen_accumulate.c @@ -36,7 +36,7 @@ void codegen_accumulate_flush(ir_data_t *ir) acc_regs[0].count = 0; } -void codegen_accumulate_reset() +void codegen_accumulate_reset(void) { acc_regs[0].count = 0; } diff --git a/src/codegen_new/codegen_accumulate.h b/src/codegen_new/codegen_accumulate.h index 908dba2e2..ccbed2afa 100644 --- a/src/codegen_new/codegen_accumulate.h +++ b/src/codegen_new/codegen_accumulate.h @@ -9,4 +9,4 @@ struct ir_data_t; void codegen_accumulate(struct ir_data_t *ir, int acc_reg, int delta); void codegen_accumulate_flush(struct ir_data_t *ir); -void codegen_accumulate_reset(); +void codegen_accumulate_reset(void); diff --git a/src/codegen_new/codegen_allocator.c b/src/codegen_new/codegen_allocator.c index baeea52b6..84f837a97 100644 --- a/src/codegen_new/codegen_allocator.c +++ b/src/codegen_new/codegen_allocator.c @@ -30,7 +30,7 @@ static uint8_t *mem_block_alloc = NULL; int codegen_allocator_usage = 0; -void codegen_allocator_init() +void codegen_allocator_init(void) { int c; diff --git a/src/codegen_new/codegen_allocator.h b/src/codegen_new/codegen_allocator.h index f9e70d248..1b808f127 100644 --- a/src/codegen_new/codegen_allocator.h +++ b/src/codegen_new/codegen_allocator.h @@ -22,7 +22,7 @@ #define MEM_BLOCK_MASK (MEM_BLOCK_NR-1) #define MEM_BLOCK_SIZE 0x3c0 -void codegen_allocator_init(); +void codegen_allocator_init(void); /*Allocate a mem_block_t, and the associated backing memory. If parent is non-NULL, then the new block will be added to the list in parent->next*/ diff --git a/src/codegen_new/codegen_backend.h b/src/codegen_new/codegen_backend.h index 56884c84b..c45e0be88 100644 --- a/src/codegen_new/codegen_backend.h +++ b/src/codegen_new/codegen_backend.h @@ -13,14 +13,14 @@ #error Dynamic recompiler not implemented on your platform #endif -void codegen_backend_init(); +void codegen_backend_init(void); void codegen_backend_prologue(codeblock_t *block); void codegen_backend_epilogue(codeblock_t *block); struct ir_data_t; struct uop_t; -struct ir_data_t *codegen_get_ir_data(); +struct ir_data_t *codegen_get_ir_data(void); typedef int (*uOpFn)(codeblock_t *codeblock, struct uop_t *uop); diff --git a/src/codegen_new/codegen_backend_arm.c b/src/codegen_new/codegen_backend_arm.c index 7030c401a..478a97f0d 100644 --- a/src/codegen_new/codegen_backend_arm.c +++ b/src/codegen_new/codegen_backend_arm.c @@ -290,7 +290,7 @@ static void build_fp_round_routine(codeblock_t *block) host_arm_MOV_REG(block, REG_PC, REG_LR); } -void codegen_backend_init() +void codegen_backend_init(void) { codeblock_t *block; int c; diff --git a/src/codegen_new/codegen_backend_arm64.c b/src/codegen_new/codegen_backend_arm64.c index ce1082d0a..8941285cd 100644 --- a/src/codegen_new/codegen_backend_arm64.c +++ b/src/codegen_new/codegen_backend_arm64.c @@ -277,7 +277,7 @@ static void build_fp_round_routine(codeblock_t *block, int is_quad) host_arm64_RET(block, REG_X30); } -void codegen_backend_init() +void codegen_backend_init(void) { codeblock_t *block; int c; diff --git a/src/codegen_new/codegen_backend_x86-64.c b/src/codegen_new/codegen_backend_x86-64.c index 8411ca8da..eadf6b941 100644 --- a/src/codegen_new/codegen_backend_x86-64.c +++ b/src/codegen_new/codegen_backend_x86-64.c @@ -290,7 +290,7 @@ static void build_loadstore_routines(codeblock_t *block) build_store_routine(block, 8, 1); } -void codegen_backend_init() +void codegen_backend_init(void) { codeblock_t *block; int c; diff --git a/src/codegen_new/codegen_backend_x86.c b/src/codegen_new/codegen_backend_x86.c index 14327607b..03c9b2a34 100644 --- a/src/codegen_new/codegen_backend_x86.c +++ b/src/codegen_new/codegen_backend_x86.c @@ -264,7 +264,7 @@ static void build_loadstore_routines(codeblock_t *block) build_store_routine(block, 8, 1); } -void codegen_backend_init() +void codegen_backend_init(void) { codeblock_t *block; int c; diff --git a/src/codegen_new/codegen_block.c b/src/codegen_new/codegen_block.c index e2aaddb5c..283faf140 100644 --- a/src/codegen_new/codegen_block.c +++ b/src/codegen_new/codegen_block.c @@ -154,7 +154,7 @@ static void block_dirty_list_remove(codeblock_t *block) block->flags &= ~CODEBLOCK_IN_DIRTY_LIST; } -int codegen_purge_purgable_list() +int codegen_purge_purgable_list(void) { if (purgable_page_list_head) { @@ -171,7 +171,7 @@ int codegen_purge_purgable_list() return 0; } -static codeblock_t *block_free_list_get() +static codeblock_t *block_free_list_get(void) { codeblock_t *block = NULL; @@ -210,7 +210,7 @@ static codeblock_t *block_free_list_get() return block; } -void codegen_init() +void codegen_init(void) { int c; @@ -227,7 +227,7 @@ void codegen_init() #endif } -void codegen_close() +void codegen_close(void) { #ifdef DEBUG_EXTRA pclog("Instruction counts :\n"); @@ -256,7 +256,7 @@ void codegen_close() #endif } -void codegen_reset() +void codegen_reset(void) { int c; @@ -284,7 +284,7 @@ void codegen_reset() } } -void dump_block() +void dump_block(void) { /* codeblock_t *block = pages[0x119000 >> 12].block; @@ -574,7 +574,7 @@ void codegen_block_init(uint32_t phys_addr) static ir_data_t *ir_data; -ir_data_t *codegen_get_ir_data() +ir_data_t *codegen_get_ir_data(void) { return ir_data; } @@ -645,7 +645,7 @@ void codegen_block_start_recompile(codeblock_t *block) } -void codegen_block_remove() +void codegen_block_remove(void) { codeblock_t *block = &codeblock[block_current]; @@ -654,7 +654,7 @@ void codegen_block_remove() recomp_page = -1; } -void codegen_block_generate_end_mask_recompile() +void codegen_block_generate_end_mask_recompile(void) { codeblock_t *block = &codeblock[block_current]; page_t *p; @@ -721,7 +721,7 @@ void codegen_block_generate_end_mask_recompile() recomp_page = -1; } -void codegen_block_generate_end_mask_mark() +void codegen_block_generate_end_mask_mark(void) { codeblock_t *block = &codeblock[block_current]; uint32_t start_pc; @@ -799,7 +799,7 @@ void codegen_block_generate_end_mask_mark() recomp_page = -1; } -void codegen_block_end() +void codegen_block_end(void) { codeblock_t *block = &codeblock[block_current]; @@ -828,7 +828,7 @@ void codegen_block_end_recompile(codeblock_t *block) codegen_ir_compile(ir_data, block); } -void codegen_flush() +void codegen_flush(void) { return; } diff --git a/src/codegen_new/codegen_ir.c b/src/codegen_new/codegen_ir.c index 49a7adac5..09c593f08 100644 --- a/src/codegen_new/codegen_ir.c +++ b/src/codegen_new/codegen_ir.c @@ -15,7 +15,7 @@ static ir_data_t ir_block; static int codegen_unroll_start, codegen_unroll_count; static int codegen_unroll_first_instruction; -ir_data_t *codegen_ir_init() +ir_data_t *codegen_ir_init(void) { ir_block.wr_pos = 0; diff --git a/src/codegen_new/codegen_ir.h b/src/codegen_new/codegen_ir.h index 60e75cfc9..ffae3eb75 100644 --- a/src/codegen_new/codegen_ir.h +++ b/src/codegen_new/codegen_ir.h @@ -1,6 +1,6 @@ #include "codegen_ir_defs.h" -ir_data_t *codegen_ir_init(); +ir_data_t *codegen_ir_init(void); void codegen_ir_set_unroll(int count, int start, int first_instruction); void codegen_ir_compile(ir_data_t *ir, codeblock_t *block); diff --git a/src/codegen_new/codegen_ops_branch.c b/src/codegen_new/codegen_ops_branch.c index b05ce5bac..70bfc1b10 100644 --- a/src/codegen_new/codegen_ops_branch.c +++ b/src/codegen_new/codegen_ops_branch.c @@ -13,11 +13,11 @@ #include "codegen_ops_helpers.h" #include "codegen_ops_mov.h" -static int NF_SET_01() +static int NF_SET_01(void) { return NF_SET() ? 1 : 0; } -static int VF_SET_01() +static int VF_SET_01(void) { return VF_SET() ? 1 : 0; } diff --git a/src/codegen_new/codegen_reg.c b/src/codegen_new/codegen_reg.c index 6b0cc0fd3..a62121af7 100644 --- a/src/codegen_new/codegen_reg.c +++ b/src/codegen_new/codegen_reg.c @@ -184,7 +184,7 @@ struct [IREG_temp1d] = {REG_DOUBLE, (void *)48, REG_FP, REG_VOLATILE}, }; -void codegen_reg_mark_as_required() +void codegen_reg_mark_as_required(void) { int reg; @@ -224,7 +224,7 @@ int reg_is_native_size(ir_reg_t ir_reg) return 0; } -void codegen_reg_reset() +void codegen_reg_reset(void) { int c; diff --git a/src/codegen_new/codegen_reg.h b/src/codegen_new/codegen_reg.h index d822a950f..fb8789474 100644 --- a/src/codegen_new/codegen_reg.h +++ b/src/codegen_new/codegen_reg.h @@ -395,7 +395,7 @@ static inline int ir_reg_is_invalid(ir_reg_t ir_reg) struct ir_data_t; -void codegen_reg_reset(); +void codegen_reg_reset(void); /*Write back all dirty registers*/ void codegen_reg_flush(struct ir_data_t *ir, codeblock_t *block); /*Write back and evict all registers*/ @@ -414,6 +414,6 @@ ir_host_reg_t codegen_reg_alloc_write_reg(codeblock_t *block, ir_reg_t ir_reg); void codegen_reg_rename(codeblock_t *block, ir_reg_t src, ir_reg_t dst); -void codegen_reg_mark_as_required(); +void codegen_reg_mark_as_required(void); void codegen_reg_process_dead_list(struct ir_data_t *ir); #endif diff --git a/src/cpu/386_common.c b/src/cpu/386_common.c index 3c0cd168a..24875ee4e 100644 --- a/src/cpu/386_common.c +++ b/src/cpu/386_common.c @@ -1452,7 +1452,7 @@ x86_int_sw_rm(int num) void -x86illegal() +x86illegal(void) { x86_int(6); } @@ -1550,14 +1550,14 @@ idivl(int32_t val) void -cpu_386_flags_extract() +cpu_386_flags_extract(void) { flags_extract(); } void -cpu_386_flags_rebuild() +cpu_386_flags_rebuild(void) { flags_rebuild(); } diff --git a/src/cpu/386_common.h b/src/cpu/386_common.h index 4ffdceac6..f99c143d9 100644 --- a/src/cpu/386_common.h +++ b/src/cpu/386_common.h @@ -225,25 +225,25 @@ static __inline void *get_ram_ptr(uint32_t a) } } -static __inline uint8_t getbyte() +static __inline uint8_t getbyte(void) { cpu_state.pc++; return fastreadb(cs + (cpu_state.pc - 1)); } -static __inline uint16_t getword() +static __inline uint16_t getword(void) { cpu_state.pc+=2; return fastreadw(cs+(cpu_state.pc-2)); } -static __inline uint32_t getlong() +static __inline uint32_t getlong(void) { cpu_state.pc+=4; return fastreadl(cs+(cpu_state.pc-4)); } -static __inline uint64_t getquad() +static __inline uint64_t getquad(void) { cpu_state.pc+=8; return fastreadl(cs+(cpu_state.pc-8)) | ((uint64_t)fastreadl(cs+(cpu_state.pc-4)) << 32); @@ -251,7 +251,7 @@ static __inline uint64_t getquad() -static __inline uint8_t geteab() +static __inline uint8_t geteab(void) { if (cpu_mod == 3) return (cpu_rm & 4) ? cpu_state.regs[cpu_rm & 3].b.h : cpu_state.regs[cpu_rm&3].b.l; @@ -260,7 +260,7 @@ static __inline uint8_t geteab() return readmemb(easeg, cpu_state.eaaddr); } -static __inline uint16_t geteaw() +static __inline uint16_t geteaw(void) { if (cpu_mod == 3) return cpu_state.regs[cpu_rm].w; @@ -269,7 +269,7 @@ static __inline uint16_t geteaw() return readmemw(easeg, cpu_state.eaaddr); } -static __inline uint32_t geteal() +static __inline uint32_t geteal(void) { if (cpu_mod == 3) return cpu_state.regs[cpu_rm].l; @@ -278,22 +278,22 @@ static __inline uint32_t geteal() return readmeml(easeg, cpu_state.eaaddr); } -static __inline uint64_t geteaq() +static __inline uint64_t geteaq(void) { return readmemq(easeg, cpu_state.eaaddr); } -static __inline uint8_t geteab_mem() +static __inline uint8_t geteab_mem(void) { if (eal_r) return *(uint8_t *)eal_r; return readmemb(easeg,cpu_state.eaaddr); } -static __inline uint16_t geteaw_mem() +static __inline uint16_t geteaw_mem(void) { if (eal_r) return *(uint16_t *)eal_r; return readmemw(easeg,cpu_state.eaaddr); } -static __inline uint32_t geteal_mem() +static __inline uint32_t geteal_mem(void) { if (eal_r) return *eal_r; return readmeml(easeg,cpu_state.eaaddr); diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index ca7b94647..fb3534c9a 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -260,7 +260,7 @@ static void prefetch_run(int instr_cycles, int bytes, int modrm, int reads, int prefetch_bytes = 16; } -static void prefetch_flush() +static void prefetch_flush(void) { prefetch_bytes = 0; } @@ -541,7 +541,7 @@ exec386_dynarec_dyn(void) if (valid_block && block->was_recompiled) #endif { - void (*code)() = (void *)&block->data[BLOCK_START]; + void (*code)(void) = (void *)&block->data[BLOCK_START]; #ifndef USE_NEW_DYNAREC codeblock_hash[hash] = block; diff --git a/src/cpu/386_ops.h b/src/cpu/386_ops.h index fe16858f7..d5f62f74f 100644 --- a/src/cpu/386_ops.h +++ b/src/cpu/386_ops.h @@ -80,7 +80,7 @@ static __inline void PUSH_L(uint32_t val) } } -static __inline uint16_t POP_W() +static __inline uint16_t POP_W(void) { uint16_t ret; if (stack32) @@ -96,7 +96,7 @@ static __inline uint16_t POP_W() return ret; } -static __inline uint32_t POP_L() +static __inline uint32_t POP_L(void) { uint32_t ret; if (stack32) diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 32a09eb98..cc8cbc903 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -494,7 +494,7 @@ pfq_fetchw(void) } static uint16_t -pfq_fetch() +pfq_fetch(void) { if (opcode & 1) return pfq_fetchw(); @@ -520,7 +520,7 @@ pfq_add(int c, int add) /* Clear the prefetch queue - called on reset and on anything that affects either CS or IP. */ static void -pfq_clear() +pfq_clear(void) { pfq_pos = 0; prefetching = 0; diff --git a/src/cpu/codegen_public.h b/src/cpu/codegen_public.h index 18f0618b8..fa7dad8a5 100644 --- a/src/cpu/codegen_public.h +++ b/src/cpu/codegen_public.h @@ -50,11 +50,11 @@ #endif -extern void codegen_init(); +extern void codegen_init(void); #ifdef USE_NEW_DYNAREC -extern void codegen_close(); +extern void codegen_close(void); #endif -extern void codegen_flush(); +extern void codegen_flush(void); /*Current physical page of block being recompiled. -1 if no recompilation taking place */ diff --git a/src/cpu/codegen_timing_486.c b/src/cpu/codegen_timing_486.c index ce451421d..2fe5ce417 100644 --- a/src/cpu/codegen_timing_486.c +++ b/src/cpu/codegen_timing_486.c @@ -283,12 +283,12 @@ static inline int COUNT(int *c, int op_32) return *c; } -void codegen_timing_486_block_start() +void codegen_timing_486_block_start(void) { regmask_modified = 0; } -void codegen_timing_486_start() +void codegen_timing_486_start(void) { timing_count = 0; last_prefix = 0; @@ -406,7 +406,7 @@ void codegen_timing_486_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uin regmask_modified = get_dstdep_mask(deps[opcode], fetchdat, bit8); } -void codegen_timing_486_block_end() +void codegen_timing_486_block_end(void) { } diff --git a/src/cpu/codegen_timing_686.c b/src/cpu/codegen_timing_686.c index cde59d9cb..9752b24c4 100644 --- a/src/cpu/codegen_timing_686.c +++ b/src/cpu/codegen_timing_686.c @@ -774,13 +774,13 @@ static inline int COUNT(uint32_t c, int op_32) return c & CYCLES_MASK; } -void codegen_timing_686_block_start() +void codegen_timing_686_block_start(void) { prev_full = decode_delay = 0; regmask_modified = last_regmask_modified = 0; } -void codegen_timing_686_start() +void codegen_timing_686_start(void) { decode_delay = 0; last_prefix = 0; @@ -1036,7 +1036,7 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uin } } -void codegen_timing_686_block_end() +void codegen_timing_686_block_end(void) { if (prev_full) { diff --git a/src/cpu/codegen_timing_k6.c b/src/cpu/codegen_timing_k6.c index 66ec33052..6bb472144 100644 --- a/src/cpu/codegen_timing_k6.c +++ b/src/cpu/codegen_timing_k6.c @@ -1858,7 +1858,7 @@ static int fpu_st_timestamp[8]; dependent uop chains*/ static int last_uop_timestamp = 0; -void decode_flush() +void decode_flush(void) { int c; int uop_timestamp = 0; @@ -2112,7 +2112,7 @@ static void decode_instruction(const risc86_instruction_t *ins, uint64_t deps, u } } -void codegen_timing_k6_block_start() +void codegen_timing_k6_block_start(void) { int c; @@ -2136,7 +2136,7 @@ void codegen_timing_k6_block_start() fpu_st_timestamp[c] = 0; } -void codegen_timing_k6_start() +void codegen_timing_k6_start(void) { if (cpu_s->cpu_type == CPU_K6) { @@ -2324,7 +2324,7 @@ void codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint codegen_block_cycles += (last_complete_timestamp - old_last_complete_timestamp); } -void codegen_timing_k6_block_end() +void codegen_timing_k6_block_end(void) { if (decode_buffer.nr_uops) { @@ -2334,7 +2334,7 @@ void codegen_timing_k6_block_end() } } -int codegen_timing_k6_jump_cycles() +int codegen_timing_k6_jump_cycles(void) { if (decode_buffer.nr_uops) return 1; diff --git a/src/cpu/codegen_timing_p6.c b/src/cpu/codegen_timing_p6.c index 00f5bfb24..19fa07de1 100644 --- a/src/cpu/codegen_timing_p6.c +++ b/src/cpu/codegen_timing_p6.c @@ -1691,7 +1691,7 @@ static int fpu_st_timestamp[8]; dependent uop chains*/ static int last_uop_timestamp = 0; -void decode_flush_p6() +void decode_flush_p6(void) { int c; int start_timestamp, uop_timestamp = 0; @@ -1926,7 +1926,7 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe } } -void codegen_timing_p6_block_start() +void codegen_timing_p6_block_start(void) { int c; @@ -1946,7 +1946,7 @@ void codegen_timing_p6_block_start() fpu_st_timestamp[c] = 0; } -void codegen_timing_p6_start() +void codegen_timing_p6_start(void) { if (cpu_s->cpu_type == CPU_PENTIUMPRO) { @@ -2083,7 +2083,7 @@ void codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint codegen_block_cycles += (last_complete_timestamp - old_last_complete_timestamp); } -void codegen_timing_p6_block_end() +void codegen_timing_p6_block_end(void) { if (decode_buffer.nr_uops) { @@ -2093,7 +2093,7 @@ void codegen_timing_p6_block_end() } } -int codegen_timing_p6_jump_cycles() +int codegen_timing_p6_jump_cycles(void) { if (decode_buffer.nr_uops) return 1; diff --git a/src/cpu/codegen_timing_pentium.c b/src/cpu/codegen_timing_pentium.c index 263608682..232455f6d 100644 --- a/src/cpu/codegen_timing_pentium.c +++ b/src/cpu/codegen_timing_pentium.c @@ -931,12 +931,12 @@ static inline int codegen_timing_instr_length(uint64_t timing, uint32_t fetchdat return len; } -void codegen_timing_pentium_block_start() +void codegen_timing_pentium_block_start(void) { u_pipe_full = decode_delay = decode_delay_offset = 0; } -void codegen_timing_pentium_start() +void codegen_timing_pentium_start(void) { last_prefix = 0; prefixes = 0; @@ -1296,7 +1296,7 @@ nopair: addr_regmask = 0; } -void codegen_timing_pentium_block_end() +void codegen_timing_pentium_block_end(void) { if (u_pipe_full) { diff --git a/src/cpu/codegen_timing_winchip.c b/src/cpu/codegen_timing_winchip.c index c945d7f21..a1ee02b63 100644 --- a/src/cpu/codegen_timing_winchip.c +++ b/src/cpu/codegen_timing_winchip.c @@ -283,12 +283,12 @@ static inline int COUNT(int *c, int op_32) return *c; } -void codegen_timing_winchip_block_start() +void codegen_timing_winchip_block_start(void) { regmask_modified = 0; } -void codegen_timing_winchip_start() +void codegen_timing_winchip_start(void) { timing_count = 0; last_prefix = 0; @@ -406,7 +406,7 @@ void codegen_timing_winchip_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, regmask_modified = get_dstdep_mask(deps[opcode], fetchdat, bit8); } -void codegen_timing_winchip_block_end() +void codegen_timing_winchip_block_end(void) { } diff --git a/src/cpu/codegen_timing_winchip2.c b/src/cpu/codegen_timing_winchip2.c index 38c8924d4..f96304072 100644 --- a/src/cpu/codegen_timing_winchip2.c +++ b/src/cpu/codegen_timing_winchip2.c @@ -541,14 +541,14 @@ static void codegen_instruction(uint32_t *timings, uint64_t *deps, uint8_t opcod } } -static void codegen_timing_winchip2_block_start() +static void codegen_timing_winchip2_block_start(void) { regmask_modified = 0; decode_delay = decode_delay_offset = 0; u_pipe_full = 0; } -static void codegen_timing_winchip2_start() +static void codegen_timing_winchip2_start(void) { timing_count = 0; last_prefix = 0; @@ -719,7 +719,7 @@ static void codegen_timing_winchip2_opcode(uint8_t opcode, uint32_t fetchdat, in regmask_modified = get_dstdep_mask(deps[opcode], fetchdat, bit8); } -static void codegen_timing_winchip2_block_end() +static void codegen_timing_winchip2_block_end(void) { if (u_pipe_full) { diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index ae24c44d5..8ddf101c2 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -740,7 +740,7 @@ extern void cpu_fast_off_advance(void); extern void cpu_fast_off_period_set(uint16_t vla, double period); extern void cpu_fast_off_reset(void); -extern void smi_raise(); -extern void nmi_raise(); +extern void smi_raise(void); +extern void nmi_raise(void); #endif /*EMU_CPU_H*/ diff --git a/src/cpu/x86.h b/src/cpu/x86.h index 32a3317ea..b468ba4aa 100644 --- a/src/cpu/x86.h +++ b/src/cpu/x86.h @@ -77,7 +77,7 @@ enum extern void x86_doabrt(int x86_abrt); -extern void x86illegal(); -extern void x86seg_reset(); +extern void x86illegal(void); +extern void x86seg_reset(void); extern void x86gpf(char *s, uint16_t error); extern void x86gpf_expected(char *s, uint16_t error); diff --git a/src/cpu/x86_flags.h b/src/cpu/x86_flags.h index b46755e90..6b2293322 100644 --- a/src/cpu/x86_flags.h +++ b/src/cpu/x86_flags.h @@ -58,7 +58,7 @@ enum #endif }; -static __inline int ZF_SET() +static __inline int ZF_SET(void) { switch (cpu_state.flags_op) { @@ -117,7 +117,7 @@ static __inline int ZF_SET() #endif } -static __inline int NF_SET() +static __inline int NF_SET(void) { switch (cpu_state.flags_op) { @@ -184,7 +184,7 @@ static __inline int NF_SET() #endif } -static __inline int PF_SET() +static __inline int PF_SET(void) { switch (cpu_state.flags_op) { @@ -243,7 +243,7 @@ static __inline int PF_SET() #endif } -static __inline int VF_SET() +static __inline int VF_SET(void) { switch (cpu_state.flags_op) { @@ -336,7 +336,7 @@ static __inline int VF_SET() #endif } -static __inline int AF_SET() +static __inline int AF_SET(void) { switch (cpu_state.flags_op) { @@ -409,7 +409,7 @@ static __inline int AF_SET() #endif } -static __inline int CF_SET() +static __inline int CF_SET(void) { switch (cpu_state.flags_op) { @@ -502,7 +502,7 @@ static __inline int CF_SET() #endif } -static __inline void flags_rebuild() +static __inline void flags_rebuild(void) { if (cpu_state.flags_op != FLAGS_UNKNOWN) { @@ -518,12 +518,12 @@ static __inline void flags_rebuild() } } -static __inline void flags_extract() +static __inline void flags_extract(void) { cpu_state.flags_op = FLAGS_UNKNOWN; } -static __inline void flags_rebuild_c() +static __inline void flags_rebuild_c(void) { if (cpu_state.flags_op != FLAGS_UNKNOWN) { @@ -535,7 +535,7 @@ static __inline void flags_rebuild_c() } #ifdef USE_NEW_DYNAREC -static __inline int flags_res_valid() +static __inline int flags_res_valid(void) { if (cpu_state.flags_op == FLAGS_UNKNOWN || (cpu_state.flags_op >= FLAGS_ROL8 && cpu_state.flags_op <= FLAGS_ROR32)) @@ -779,5 +779,5 @@ static __inline void setsbc32(uint32_t a, uint32_t b) } #endif -extern void cpu_386_flags_extract(); -extern void cpu_386_flags_rebuild(); +extern void cpu_386_flags_extract(void); +extern void cpu_386_flags_rebuild(void); diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index e3866324c..74539c067 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -94,7 +94,7 @@ seg_reset(x86seg *s) void -x86seg_reset() +x86seg_reset(void) { seg_reset(&cpu_state.seg_cs); seg_reset(&cpu_state.seg_ds); @@ -838,7 +838,7 @@ PUSHL(uint32_t v) uint16_t -POPW() +POPW(void) { uint16_t tempw; if (stack32) { @@ -857,7 +857,7 @@ POPW() uint32_t -POPL() +POPL(void) { uint32_t templ; diff --git a/src/cpu/x87.c b/src/cpu/x87.c index cf92788fb..1f05e8762 100644 --- a/src/cpu/x87.c +++ b/src/cpu/x87.c @@ -47,7 +47,7 @@ fpu_log(const char *fmt, ...) #define X87_TAG_EMPTY 3 #ifdef USE_NEW_DYNAREC -uint16_t x87_gettag() +uint16_t x87_gettag(void) { uint16_t ret = 0; int c; @@ -84,7 +84,7 @@ void x87_settag(uint16_t new_tag) } } #else -uint16_t x87_gettag() +uint16_t x87_gettag(void) { uint16_t ret = 0; int c; @@ -115,7 +115,7 @@ void x87_settag(uint16_t new_tag) #ifdef ENABLE_808X_LOG -void x87_dumpregs() +void x87_dumpregs(void) { if (cpu_state.ismmx) { diff --git a/src/cpu/x87.h b/src/cpu/x87.h index 9436d0447..48106c2e3 100644 --- a/src/cpu/x87.h +++ b/src/cpu/x87.h @@ -6,7 +6,7 @@ extern uint32_t x87_pc_off,x87_op_off; extern uint16_t x87_pc_seg,x87_op_seg; -static __inline void x87_set_mmx() +static __inline void x87_set_mmx(void) { uint64_t *p; cpu_state.TOP = 0; @@ -15,7 +15,7 @@ static __inline void x87_set_mmx() cpu_state.ismmx = 1; } -static __inline void x87_emms() +static __inline void x87_emms(void) { uint64_t *p; p = (uint64_t *)cpu_state.tag; @@ -24,7 +24,7 @@ static __inline void x87_emms() } -uint16_t x87_gettag(); +uint16_t x87_gettag(void); void x87_settag(uint16_t new_tag); #define TAG_EMPTY 0 diff --git a/src/cpu/x87_ops.h b/src/cpu/x87_ops.h index e9dfe6ba3..64ea50a33 100644 --- a/src/cpu/x87_ops.h +++ b/src/cpu/x87_ops.h @@ -97,7 +97,7 @@ static int rounding_modes[4] = {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZ } while (0) #endif -static __inline void x87_checkexceptions() +static __inline void x87_checkexceptions(void) { } @@ -139,7 +139,7 @@ static __inline void x87_push_u64(uint64_t i) #endif } -static __inline double x87_pop() +static __inline double x87_pop(void) { double t = cpu_state.ST[cpu_state.TOP&7]; cpu_state.tag[cpu_state.TOP&7] = TAG_EMPTY; @@ -242,7 +242,7 @@ static __inline int64_t x87_fround(double b) #include "x87_ops_conv.h" -static __inline double x87_ld80() +static __inline double x87_ld80(void) { x87_conv_t test; test.eind.ll = readmeml(easeg,cpu_state.eaaddr); diff --git a/src/cpu/x87_ops_misc.h b/src/cpu/x87_ops_misc.h index 7e27cc287..3e09cac22 100644 --- a/src/cpu/x87_ops_misc.h +++ b/src/cpu/x87_ops_misc.h @@ -119,7 +119,7 @@ static int opFSTP(uint32_t fetchdat) -static int FSTOR() +static int FSTOR(void) { uint64_t *p; FP_ENTER(); @@ -191,7 +191,7 @@ static int opFSTOR_a32(uint32_t fetchdat) } #endif -static int FSAVE() +static int FSAVE(void) { uint64_t *p; @@ -751,7 +751,7 @@ static int opFCOS(uint32_t fetchdat) #endif -static int FLDENV() +static int FLDENV(void) { FP_ENTER(); switch ((cr0 & 1) | (cpu_state.op32 & 0x100)) @@ -828,7 +828,7 @@ static int opFLDCW_a32(uint32_t fetchdat) } #endif -static int FSTENV() +static int FSTENV(void) { FP_ENTER(); cpu_state.npxs = (cpu_state.npxs & ~(7 << 11)) | ((cpu_state.TOP & 7) << 11); diff --git a/src/device/hwm.c b/src/device/hwm.c index 95a667f94..85c689740 100644 --- a/src/device/hwm.c +++ b/src/device/hwm.c @@ -31,7 +31,7 @@ hwm_values_t hwm_values; uint16_t -hwm_get_vcore() +hwm_get_vcore(void) { /* Determine Vcore for the active CPU. */ return cpu_s->voltage; diff --git a/src/device/keyboard_xt.c b/src/device/keyboard_xt.c index 59bcbc150..c1237e97e 100644 --- a/src/device/keyboard_xt.c +++ b/src/device/keyboard_xt.c @@ -367,7 +367,7 @@ kbd_log(const char *fmt, ...) #endif static uint8_t -get_fdd_switch_settings() +get_fdd_switch_settings(void) { int i, fdd_count = 0; @@ -384,7 +384,7 @@ get_fdd_switch_settings() } static uint8_t -get_videomode_switch_settings() +get_videomode_switch_settings(void) { if (video_is_mda()) diff --git a/src/device/mouse.c b/src/device/mouse.c index 72c5845f1..422161a83 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -87,7 +87,7 @@ static mouse_t mouse_devices[] = { static const device_t *mouse_curr; static void *mouse_priv; static int mouse_nbut; -static int (*mouse_dev_poll)(); +static int (*mouse_dev_poll)(int x, int y, int z, int b, void *priv); #ifdef ENABLE_MOUSE_LOG int mouse_do_log = ENABLE_MOUSE_LOG; diff --git a/src/discord.c b/src/discord.c index 5b90afa4f..55f6d1544 100644 --- a/src/discord.c +++ b/src/discord.c @@ -132,7 +132,7 @@ discord_update_activity(int paused) } int -discord_load() +discord_load(void) { if (discord_handle != NULL) return (1); @@ -152,7 +152,7 @@ discord_load() } void -discord_init() +discord_init(void) { enum EDiscordResult result; struct DiscordCreateParams params; @@ -177,7 +177,7 @@ discord_init() } void -discord_close() +discord_close(void) { if (discord_core != NULL) discord_core->destroy(discord_core); @@ -187,7 +187,7 @@ discord_close() } void -discord_run_callbacks() +discord_run_callbacks(void) { if (discord_core == NULL) return; diff --git a/src/disk/hdd.c b/src/disk/hdd.c index 6ad55feed..2e769dbdf 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -437,7 +437,7 @@ static hdd_preset_t hdd_speed_presets[] = { }; int -hdd_preset_get_num() +hdd_preset_get_num(void) { return sizeof(hdd_speed_presets) / sizeof(hdd_preset_t); } diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index fc4aeecb0..1db37f1a4 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -162,7 +162,7 @@ extern void set_screen_size_monitor(int x, int y, int monitor_index); extern void reset_screen_size(void); extern void reset_screen_size_monitor(int monitor_index); extern void set_screen_size_natural(void); -extern void update_mouse_msg(); +extern void update_mouse_msg(void); #if 0 extern void pc_reload(wchar_t *fn); #endif diff --git a/src/include/86box/discord.h b/src/include/86box/discord.h index f04370143..9a1467e08 100644 --- a/src/include/86box/discord.h +++ b/src/include/86box/discord.h @@ -23,11 +23,11 @@ extern "C" { extern int discord_loaded; -extern int discord_load(); -extern void discord_init(); -extern void discord_close(); +extern int discord_load(void); +extern void discord_init(void); +extern void discord_close(void); extern void discord_update_activity(int paused); -extern void discord_run_callbacks(); +extern void discord_run_callbacks(void); #ifdef __cplusplus } diff --git a/src/include/86box/hdd.h b/src/include/86box/hdd.h index d779fbb9a..3774f6f37 100644 --- a/src/include/86box/hdd.h +++ b/src/include/86box/hdd.h @@ -213,7 +213,7 @@ extern int image_is_vhd(const char *s, int check_signature); extern double hdd_timing_write(hard_disk_t *hdd, uint32_t addr, uint32_t len); extern double hdd_timing_read(hard_disk_t *hdd, uint32_t addr, uint32_t len); extern double hdd_seek_get_time(hard_disk_t *hdd, uint32_t dst_addr, uint8_t operation, uint8_t continuous, double max_seek_time); -int hdd_preset_get_num(); +int hdd_preset_get_num(void); const char *hdd_preset_getname(int preset); extern const char *hdd_preset_get_internal_name(int preset); extern int hdd_preset_get_from_internal_name(char *s); diff --git a/src/include/86box/hwm.h b/src/include/86box/hwm.h index a752b1689..e0410b3a0 100644 --- a/src/include/86box/hwm.h +++ b/src/include/86box/hwm.h @@ -38,7 +38,7 @@ typedef struct { } lm75_t; /* hwm.c */ -extern uint16_t hwm_get_vcore(); +extern uint16_t hwm_get_vcore(void); /* hwm_lm75.c */ extern void lm75_remap(lm75_t *dev, uint8_t addr); diff --git a/src/include/86box/i2c.h b/src/include/86box/i2c.h index 545f2b9ed..071e57729 100644 --- a/src/include/86box/i2c.h +++ b/src/include/86box/i2c.h @@ -62,6 +62,6 @@ extern void i2c_gpio_close(void *dev_handle); extern void i2c_gpio_set(void *dev_handle, uint8_t scl, uint8_t sda); extern uint8_t i2c_gpio_get_scl(void *dev_handle); extern uint8_t i2c_gpio_get_sda(void *dev_handle); -extern void *i2c_gpio_get_bus(); +extern void *i2c_gpio_get_bus(void *dev_handle); #endif /*EMU_I2C_H*/ diff --git a/src/include/86box/i8080.h b/src/include/86box/i8080.h index 05d227da8..1fa01b998 100644 --- a/src/include/86box/i8080.h +++ b/src/include/86box/i8080.h @@ -43,10 +43,10 @@ typedef struct i8080 uint16_t* cpu_flags; void (*writemembyte)(uint32_t, uint8_t); uint8_t (*readmembyte)(uint32_t); - void (*startclock)(); - void (*endclock)(); - void (*checkinterrupts)(); - uint8_t (*fetchinstruction)(); + void (*startclock)(void); + void (*endclock)(void); + void (*checkinterrupts)(void); + uint8_t (*fetchinstruction)(void *); } i8080; #define C_FLAG_I8080 (1 << 0) diff --git a/src/include/86box/m_xt_xi8088.h b/src/include/86box/m_xt_xi8088.h index 99e8826ac..d9c963047 100644 --- a/src/include/86box/m_xt_xi8088.h +++ b/src/include/86box/m_xt_xi8088.h @@ -5,9 +5,9 @@ extern const device_t xi8088_device; -uint8_t xi8088_turbo_get(); +uint8_t xi8088_turbo_get(void); void xi8088_turbo_set(uint8_t value); void xi8088_bios_128kb_set(int val); -int xi8088_bios_128kb(); +int xi8088_bios_128kb(void); #endif /*MACHINE_XI80888_H*/ diff --git a/src/include/86box/machine_status.h b/src/include/86box/machine_status.h index 9e33c293a..6948dc556 100644 --- a/src/include/86box/machine_status.h +++ b/src/include/86box/machine_status.h @@ -27,6 +27,6 @@ typedef struct { extern machine_status_t machine_status; -extern void machine_status_init(); +extern void machine_status_init(void); #endif /*EMU_MACHINE_STATUS_H*/ \ No newline at end of file diff --git a/src/include/86box/midi.h b/src/include/86box/midi.h index d3ed78af4..e2b8c2626 100644 --- a/src/include/86box/midi.h +++ b/src/include/86box/midi.h @@ -25,13 +25,13 @@ extern char *midi_out_device_get_internal_name(int card); extern char *midi_in_device_get_internal_name(int card); extern int midi_out_device_get_from_internal_name(char *s); extern int midi_in_device_get_from_internal_name(char *s); -extern void midi_out_device_init(); -extern void midi_in_device_init(); +extern void midi_out_device_init(void); +extern void midi_in_device_init(void); typedef struct midi_device_t { void (*play_sysex)(uint8_t *sysex, unsigned int len); void (*play_msg)(uint8_t *msg); - void (*poll)(); + void (*poll)(void); int (*write)(uint8_t val); } midi_device_t; @@ -60,13 +60,13 @@ extern midi_t *midi_out, *midi_in; extern void midi_out_init(midi_device_t *device); extern void midi_in_init(midi_device_t *device, midi_t **mididev); -extern void midi_out_close(); +extern void midi_out_close(void); extern void midi_in_close(void); extern void midi_raw_out_rt_byte(uint8_t val); extern void midi_raw_out_thru_rt_byte(uint8_t val); extern void midi_raw_out_byte(uint8_t val); extern void midi_clear_buffer(void); -extern void midi_poll(); +extern void midi_poll(void); extern void midi_in_handler(int set, void (*msg)(void *p, uint8_t *msg, uint32_t len), int (*sysex)(void *p, uint8_t *buffer, uint32_t len, int abort), void *p); extern void midi_in_handlers_clear(void); diff --git a/src/include/86box/mo.h b/src/include/86box/mo.h index e1ec25c8a..ea22f8f29 100644 --- a/src/include/86box/mo.h +++ b/src/include/86box/mo.h @@ -168,7 +168,7 @@ extern void mo_hard_reset(void); extern void mo_reset(scsi_common_t *sc); extern int mo_load(mo_t *dev, char *fn); -extern void mo_close(); +extern void mo_close(void); #ifdef __cplusplus } diff --git a/src/include/86box/nvr.h b/src/include/86box/nvr.h index 8b59c0883..47e52c95b 100644 --- a/src/include/86box/nvr.h +++ b/src/include/86box/nvr.h @@ -111,7 +111,7 @@ extern int nvr_save(void); extern int nvr_is_leap(int year); extern int nvr_get_days(int month, int year); -extern void nvr_time_sync(); +extern void nvr_time_sync(void); extern void nvr_time_get(struct tm *); extern void nvr_time_set(struct tm *); diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 9f45aa0a0..2379496dc 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -113,7 +113,7 @@ extern uint8_t pci_get_int(uint8_t card, uint8_t pci_int); extern void pci_reset(void); extern void pci_init(int type); -extern uint8_t pci_register_bus(); +extern uint8_t pci_register_bus(void); extern void pci_set_pmc(uint8_t pmc); extern void pci_remap_bus(uint8_t bus_index, uint8_t bus_number); extern void pci_relocate_slot(int type, int new_slot); diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index c48b8a5f0..ce058cb24 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -106,7 +106,7 @@ extern int plat_getcwd(char *bufp, int max); extern int plat_chdir(char *path); extern void plat_tempfile(char *bufp, char *prefix, char *suffix); extern void plat_get_exe_name(char *s, int size); -extern void plat_init_rom_paths(); +extern void plat_init_rom_paths(void); extern int plat_dir_check(char *path); extern int plat_dir_create(char *path); extern void *plat_mmap(size_t size, uint8_t executable); diff --git a/src/include/86box/snd_resid.h b/src/include/86box/snd_resid.h index b8763ad15..710ff4a61 100644 --- a/src/include/86box/snd_resid.h +++ b/src/include/86box/snd_resid.h @@ -4,7 +4,7 @@ #ifdef __cplusplus extern "C" { #endif -void *sid_init(); +void *sid_init(void); void sid_close(void *p); void sid_reset(void *p); uint8_t sid_read(uint16_t addr, void *p); diff --git a/src/include/86box/snd_speaker.h b/src/include/86box/snd_speaker.h index 0b368268e..922603d98 100644 --- a/src/include/86box/snd_speaker.h +++ b/src/include/86box/snd_speaker.h @@ -25,7 +25,7 @@ extern int speaker_mute; extern int speaker_gated; extern int speaker_enable, was_speaker_enable; -extern void speaker_init(); +extern void speaker_init(void); extern void speaker_set_count(uint8_t new_m, int new_count); extern void speaker_update(void); diff --git a/src/include/86box/vid_nga.h b/src/include/86box/vid_nga.h index ebde4978b..8dc0ad881 100644 --- a/src/include/86box/vid_nga.h +++ b/src/include/86box/vid_nga.h @@ -42,7 +42,7 @@ void nga_write(uint32_t addr, uint8_t val, void *priv); uint8_t nga_read(uint32_t addr, void *priv); void nga_poll(void *priv); void nga_close(void *priv); -void nga_mdaattr_rebuild(); +void nga_mdaattr_rebuild(void); #ifdef EMU_DEVICE_H extern const device_config_t nga_config[]; diff --git a/src/include/86box/vid_ogc.h b/src/include/86box/vid_ogc.h index 368f43a34..6e6447694 100644 --- a/src/include/86box/vid_ogc.h +++ b/src/include/86box/vid_ogc.h @@ -42,7 +42,7 @@ void ogc_write(uint32_t addr, uint8_t val, void *priv); uint8_t ogc_read(uint32_t addr, void *priv); void ogc_poll(void *priv); void ogc_close(void *priv); -void ogc_mdaattr_rebuild(); +void ogc_mdaattr_rebuild(void); #ifdef EMU_DEVICE_H extern const device_config_t ogc_config[]; diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 87de63a55..3781d5530 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -211,7 +211,7 @@ extern uint8_t svga_rotate[8][256]; void svga_out(uint16_t addr, uint8_t val, void *p); uint8_t svga_in(uint16_t addr, void *p); -svga_t *svga_get_pri(); +svga_t *svga_get_pri(void); void svga_set_override(svga_t *svga, int val); void svga_set_ramdac_type(svga_t *svga, int type); diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 8e205b4f5..3174e24b2 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -148,9 +148,9 @@ extern int win_get_system_metrics(int i, int dpi); extern LPARAM win_get_string(int id); -extern void win_clear_icon_set(); -extern void win_system_icon_set(); -extern void win_load_icon_set(); +extern void win_clear_icon_set(void); +extern void win_system_icon_set(void); +extern void win_load_icon_set(void); extern void win_get_icons_path(char *path_root); extern intptr_t fdd_type_to_icon(int type); @@ -209,7 +209,7 @@ extern int MediaMenuHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar /* Functions in win_toolbar.c */ extern HWND hwndRebar; extern void ToolBarCreate(HWND hwndParent, HINSTANCE hInst); -extern void ToolBarLoadIcons(); +extern void ToolBarLoadIcons(void); extern void ToolBarUpdatePause(int paused); /* Functions in win_dialog.c: */ @@ -223,8 +223,8 @@ extern int file_dlg_st(HWND hwnd, int i, char *fn, char *title, int save); extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title); /* Functions in win_media_menu.c */ -extern void media_menu_init(); -extern void media_menu_reset(); +extern void media_menu_init(void); +extern void media_menu_reset(void); extern int media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); extern HMENU media_menu_get_cassette(void); extern HMENU media_menu_get_cartridge(int id); @@ -241,7 +241,7 @@ extern void media_menu_update_mo(int id); /* Functions in win_ui.c */ extern HMENU menuMain; -extern void ResetAllMenus(); +extern void ResetAllMenus(void); #ifdef __cplusplus } diff --git a/src/include/86box/win_opengl_glslp.h b/src/include/86box/win_opengl_glslp.h index 83c14aaf9..caf86a04f 100644 --- a/src/include/86box/win_opengl_glslp.h +++ b/src/include/86box/win_opengl_glslp.h @@ -19,6 +19,6 @@ #include GLuint load_custom_shaders(const char *path); -GLuint load_default_shaders(); +GLuint load_default_shaders(void); #endif /*!WIN_OPENGL_GLSLP_H*/ diff --git a/src/include/86box/zip.h b/src/include/86box/zip.h index 46745ff06..910436410 100644 --- a/src/include/86box/zip.h +++ b/src/include/86box/zip.h @@ -113,7 +113,7 @@ extern void zip_hard_reset(void); extern void zip_reset(scsi_common_t *sc); extern int zip_load(zip_t *dev, char *fn); -extern void zip_close(); +extern void zip_close(void); #ifdef __cplusplus } diff --git a/src/ini.c b/src/ini.c index 920d53cb4..59a3dc629 100644 --- a/src/ini.c +++ b/src/ini.c @@ -492,7 +492,7 @@ ini_write(ini_t ini, char *fn) } ini_t -ini_new() +ini_new(void) { ini_t ini = malloc(sizeof(list_t)); memset(ini, 0, sizeof(list_t)); diff --git a/src/machine/m_at_commodore.c b/src/machine/m_at_commodore.c index a83fda08e..8eeabab19 100644 --- a/src/machine/m_at_commodore.c +++ b/src/machine/m_at_commodore.c @@ -84,7 +84,7 @@ cbm_io_write(uint16_t port, uint8_t val, void *p) } static void -cbm_io_init() +cbm_io_init(void) { io_sethandler(0x0230, 0x0001, NULL, NULL, NULL, cbm_io_write, NULL, NULL, NULL); } diff --git a/src/machine/m_at_t3100e.c b/src/machine/m_at_t3100e.c index dbfcb2604..6b09b1e02 100644 --- a/src/machine/m_at_t3100e.c +++ b/src/machine/m_at_t3100e.c @@ -169,7 +169,7 @@ extern uint8_t *ram; /* Physical RAM */ -void at_init(); +void at_init(void); /* The T3100e motherboard can (and does) dynamically reassign RAM between * conventional, XMS and EMS. This translates to monkeying with the mappings. @@ -336,7 +336,7 @@ port_to_page(uint16_t addr) } /* Used to dump the memory mapping table, for debugging -void dump_mappings() +void dump_mappings(void) { mem_mapping_t *mm = base_mapping.next; diff --git a/src/machine/m_at_t3100e_vid.c b/src/machine/m_at_t3100e_vid.c index 7579f3892..30bbc488b 100644 --- a/src/machine/m_at_t3100e_vid.c +++ b/src/machine/m_at_t3100e_vid.c @@ -102,7 +102,7 @@ t3100e_display_set(uint8_t internal) } uint8_t -t3100e_display_get() +t3100e_display_get(void) { return st_display_internal; } diff --git a/src/machine/m_ps2_mca.c b/src/machine/m_ps2_mca.c index 4a3139a03..90c69aa3c 100644 --- a/src/machine/m_ps2_mca.c +++ b/src/machine/m_ps2_mca.c @@ -806,7 +806,7 @@ ps2_mca_write(uint16_t port, uint8_t val, void *p) } static void -ps2_mca_board_common_init() +ps2_mca_board_common_init(void) { io_sethandler(0x0091, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL); io_sethandler(0x0094, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL); diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 95f752cf8..9ad782a14 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -201,7 +201,7 @@ mm58174_time_get(uint8_t *regs, struct tm *tm) /* One more second has passed, update the internal clock. */ static void -mm58x74_recalc() +mm58x74_recalc(void) { /* Ping the internal clock. */ if (++intclk.tm_sec == 60) { diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index 86efdc74a..40110ce47 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -94,7 +94,7 @@ t1000_display_set(uint8_t internal) } uint8_t -t1000_display_get() +t1000_display_get(void) { return (uint8_t) st_display_internal; } diff --git a/src/machine/m_xt_xi8088.c b/src/machine/m_xt_xi8088.c index 6d64fe438..c27631869 100644 --- a/src/machine/m_xt_xi8088.c +++ b/src/machine/m_xt_xi8088.c @@ -37,7 +37,7 @@ typedef struct xi8088_t { static xi8088_t xi8088; uint8_t -xi8088_turbo_get() +xi8088_turbo_get(void) { return xi8088.turbo; } diff --git a/src/machine_status.c b/src/machine_status.c index 47541d3ef..65f4704b4 100644 --- a/src/machine_status.c +++ b/src/machine_status.c @@ -26,7 +26,7 @@ machine_status_t machine_status; void -machine_status_init() +machine_status_init(void) { for (size_t i = 0; i < FDD_NUM; ++i) { machine_status.fdd[i].empty = (strlen(floppyfns[i]) == 0); diff --git a/src/pci.c b/src/pci.c index 5e7eaf744..f8119a55e 100644 --- a/src/pci.c +++ b/src/pci.c @@ -1044,7 +1044,7 @@ pci_init(int type) } uint8_t -pci_register_bus() +pci_register_bus(void) { return last_pci_bus++; } diff --git a/src/pic.c b/src/pic.c index 50186e132..b7ff54e37 100644 --- a/src/pic.c +++ b/src/pic.c @@ -249,7 +249,7 @@ pic_callback(void *priv) } void -pic_reset() +pic_reset(void) { int is_at = IS_AT(machine); is_at = is_at || !strcmp(machine_get_internal_name(), "xi8088"); @@ -709,7 +709,7 @@ pic_irq_ack(void) } int -picinterrupt() +picinterrupt(void) { int i, ret = -1; diff --git a/src/sound/midi.c b/src/sound/midi.c index d64c8c268..93fa62891 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -172,7 +172,7 @@ midi_out_device_get_from_internal_name(char *s) } void -midi_out_device_init() +midi_out_device_init(void) { if (devices[midi_output_device_current].device) device_add(devices[midi_output_device_current].device); @@ -290,7 +290,7 @@ midi_in_device_get_from_internal_name(char *s) } void -midi_in_device_init() +midi_in_device_init(void) { if (midi_in_devices[midi_input_device_current].device) device_add(midi_in_devices[midi_input_device_current].device); diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index 79590230f..6a917bc19 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -119,7 +119,7 @@ mt32_check(const char *func, mt32emu_return_code ret, mt32emu_return_code expect } int -mt32_old_available() +mt32_old_available(void) { if (roms_present[0] < 0) roms_present[0] = (rom_present(MT32_OLD_CTRL_ROM) && rom_present(MT32_OLD_PCM_ROM)); @@ -127,7 +127,7 @@ mt32_old_available() } int -mt32_new_available() +mt32_new_available(void) { if (roms_present[0] < 0) roms_present[0] = (rom_present(MT32_NEW_CTRL_ROM) && rom_present(MT32_NEW_PCM_ROM)); @@ -135,7 +135,7 @@ mt32_new_available() } int -cm32l_available() +cm32l_available(void) { if (roms_present[1] < 0) roms_present[1] = (rom_present(CM32L_CTRL_ROM) && rom_present(CM32L_PCM_ROM)); @@ -143,7 +143,7 @@ cm32l_available() } int -cm32ln_available() +cm32ln_available(void) { if (roms_present[1] < 0) roms_present[1] = (rom_present(CM32LN_CTRL_ROM) && rom_present(CM32LN_PCM_ROM)); @@ -199,7 +199,7 @@ mt32_stream_int16(int16_t *stream, int len) } void -mt32_poll() +mt32_poll(void) { midi_pos++; if (midi_pos == 48000 / RENDER_RATE) { diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index c07bc52e4..9f5a6edc5 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -131,7 +131,7 @@ static int treble_cut[6] = { (int) (0.354 * 16384) /*-3 dB - filter output is at +6 dB*/ }; -void adgold_timer_poll(); +void adgold_timer_poll(void *p); void adgold_update(adgold_t *adgold); void diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 53b360386..1c3b97756 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2035,37 +2035,37 @@ sb_16_compat_init(const device_t *info) } static int -sb_awe32_available() +sb_awe32_available(void) { return rom_present("roms/sound/awe32.raw"); } static int -sb_32_pnp_available() +sb_32_pnp_available(void) { return sb_awe32_available() && rom_present("roms/sound/CT3600 PnP.BIN"); } static int -sb_awe32_pnp_available() +sb_awe32_pnp_available(void) { return sb_awe32_available() && rom_present("roms/sound/CT3980 PnP.BIN"); } static int -sb_awe64_value_available() +sb_awe64_value_available(void) { return sb_awe32_available() && rom_present("roms/sound/CT4520 PnP.BIN"); } static int -sb_awe64_available() +sb_awe64_available(void) { return sb_awe32_available() && rom_present("roms/sound/CT4520 PnP.BIN"); } static int -sb_awe64_gold_available() +sb_awe64_gold_available(void) { return sb_awe32_available() && rom_present("roms/sound/CT4540 PnP.BIN"); } diff --git a/src/sound/xaudio2.c b/src/sound/xaudio2.c index b26bb9c9f..dbe0215eb 100644 --- a/src/sound/xaudio2.c +++ b/src/sound/xaudio2.c @@ -107,7 +107,7 @@ static IXAudio2VoiceCallback callbacks = { &callbacksVtbl }; #endif void -inital() +inital(void) { #if defined(_WIN32) && !defined(USE_FAUDIO) if (xaudio2_handle == NULL) { @@ -182,7 +182,7 @@ inital() } void -closeal() +closeal(void) { if (!initialized) return; diff --git a/src/video/vid_f82c425.c b/src/video/vid_f82c425.c index 0d1b9f1d7..3fea0c1bd 100644 --- a/src/video/vid_f82c425.c +++ b/src/video/vid_f82c425.c @@ -96,7 +96,7 @@ f82c425_display_set(uint8_t internal) } uint8_t -f82c425_display_get() +f82c425_display_get(void) { return (uint8_t) st_display_internal; } diff --git a/src/video/vid_genius.c b/src/video/vid_genius.c index 57e9735bd..5c13e3415 100644 --- a/src/video/vid_genius.c +++ b/src/video/vid_genius.c @@ -783,7 +783,7 @@ genius_close(void *p) } static int -genius_available() +genius_available(void) { return rom_present(BIOS_ROM_PATH); } diff --git a/src/video/vid_im1024.c b/src/video/vid_im1024.c index 15aab0cb8..9e08ce583 100644 --- a/src/video/vid_im1024.c +++ b/src/video/vid_im1024.c @@ -1034,7 +1034,7 @@ im1024_close(void *priv) } static int -im1024_available() +im1024_available(void) { return rom_present(BIOS_ROM_PATH); } diff --git a/src/video/vid_ogc.c b/src/video/vid_ogc.c index f5e5c1911..67a278561 100644 --- a/src/video/vid_ogc.c +++ b/src/video/vid_ogc.c @@ -535,7 +535,7 @@ ogc_speed_changed(void *priv) } void -ogc_mdaattr_rebuild() +ogc_mdaattr_rebuild(void) { int c; diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 905d4f83d..2c37e526e 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -74,9 +74,8 @@ svga_log(const char *fmt, ...) # define svga_log(fmt, ...) #endif -svga_t - * - svga_get_pri() +svga_t * +svga_get_pri(void) { return svga_pri; } diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 2d61c47f1..43754d508 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -876,7 +876,7 @@ voodoo_force_blit(void *p) } void * -voodoo_card_init() +voodoo_card_init(void) { int c; voodoo_t *voodoo = malloc(sizeof(voodoo_t)); @@ -1152,7 +1152,7 @@ voodoo_2d3d_card_init(int type) } void * -voodoo_init() +voodoo_init(const device_t *info) { voodoo_set_t *voodoo_set = malloc(sizeof(voodoo_set_t)); uint32_t tmuConfig = 1; diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 8e78f25ca..7d5621a8e 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -177,7 +177,7 @@ ifndef FAUDIO FAUDIO := n endif ifndef OPENAL - OPENAL := n + OPENAL := y endif ifndef FLUIDSYNTH FLUIDSYNTH := y @@ -519,6 +519,9 @@ CFLAGS := $(CFLAGS) `pkg-config --cflags freetype2` CXXFLAGS := $(CFLAGS) +CFLAGS += -Werror=implicit-int -Werror=implicit-function-declaration \ + -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition + ######################################################################### # Create the (final) list of objects to build. # @@ -669,15 +672,15 @@ SNDOBJ := sound.o \ snd_lpt_dac.o snd_lpt_dss.o \ snd_adlib.o snd_adlibgold.o snd_ad1848.o snd_audiopci.o \ snd_ac97_codec.o snd_ac97_via.o \ - snd_azt2316a.o snd_cs423x.o snd_cmi8x38.o \ + snd_azt2316a.o snd_cs423x.o \ + snd_optimc.o snd_cmi8x38.o \ snd_cms.o \ snd_gus.o \ snd_sb.o snd_sb_dsp.o \ snd_emu8k.o snd_mpu401.o \ snd_sn76489.o snd_ssi2001.o \ snd_wss.o \ - snd_ym7128.o \ - snd_optimc.o + snd_ym7128.o VIDOBJ := agpgart.o video.o \ vid_table.o \ diff --git a/src/win/win.c b/src/win/win.c index f9fa4aea0..547ab4bcd 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -883,7 +883,7 @@ plat_mmap(size_t size, uint8_t executable) } void -plat_init_rom_paths() +plat_init_rom_paths(void) { wchar_t appdata_dir[1024] = { L'\0' }; diff --git a/src/win/win_icon.c b/src/win/win_icon.c index 89fb6a972..d23a325ff 100644 --- a/src/win/win_icon.c +++ b/src/win/win_icon.c @@ -32,7 +32,7 @@ HICON hIcon[256]; /* icon data loaded from resources */ char icon_set[256] = ""; /* name of the iconset to be used */ void -win_clear_icon_set() +win_clear_icon_set(void) { int i; @@ -44,7 +44,7 @@ win_clear_icon_set() } void -win_system_icon_set() +win_system_icon_set(void) { int i, x = win_get_system_metrics(SM_CXSMICON, dpi), y = win_get_system_metrics(SM_CYSMICON, dpi); @@ -125,7 +125,7 @@ win_get_icons_path(char *path_root) } void -win_load_icon_set() +win_load_icon_set(void) { win_clear_icon_set(); win_system_icon_set(); diff --git a/src/win/win_joystick_rawinput.c b/src/win/win_joystick_rawinput.c index 5c3598c83..efaf76f01 100644 --- a/src/win/win_joystick_rawinput.c +++ b/src/win/win_joystick_rawinput.c @@ -246,7 +246,7 @@ joystick_get_device_name(raw_joystick_t *rawjoy, plat_joystick_t *joy, PRID_DEVI } void -joystick_init() +joystick_init(void) { UINT size = 0; atexit(joystick_close); @@ -316,7 +316,7 @@ end_loop: } void -joystick_close() +joystick_close(void) { RAWINPUTDEVICE ridev[2]; ridev[0].dwFlags = RIDEV_REMOVE; diff --git a/src/win/win_media_menu.c b/src/win/win_media_menu.c index 2703b6d82..8d8de6f53 100644 --- a/src/win/win_media_menu.c +++ b/src/win/win_media_menu.c @@ -350,7 +350,7 @@ media_menu_update_mo(int id) } static void -media_menu_load_submenus() +media_menu_load_submenus(void) { memset(index_map, -1, sizeof(index_map)); @@ -428,7 +428,7 @@ is_valid_mo(int i) } void -media_menu_reset() +media_menu_reset(void) { /* Remove existing entries. */ int c = GetMenuItemCount(media_menu); @@ -488,7 +488,7 @@ media_menu_reset() /* Initializes the Media menu in the main menu bar. */ static void -media_menu_main_init() +media_menu_main_init(void) { HMENU hMenu; LPWSTR lpMenuName; @@ -510,7 +510,7 @@ media_menu_main_init() } void -media_menu_init() +media_menu_init(void) { /* Initialize the main menu bar menu */ media_menu_main_init(); diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 3cd8d8c93..d9a492927 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -438,7 +438,7 @@ render_and_swap(gl_identifiers *gl) * Keeps the thread sleeping until closing. */ static void -opengl_fail() +opengl_fail(void) { if (window != NULL) { SDL_DestroyWindow(window); diff --git a/src/win/win_opengl_glslp.c b/src/win/win_opengl_glslp.c index 59f04f5a1..c3d40a56e 100644 --- a/src/win/win_opengl_glslp.c +++ b/src/win/win_opengl_glslp.c @@ -240,7 +240,7 @@ load_custom_shaders(const char *path) * @return Shader program identifier. */ GLuint -load_default_shaders() +load_default_shaders(void) { GLuint vertex_id = glCreateShader(GL_VERTEX_SHADER); GLuint fragment_id = glCreateShader(GL_FRAGMENT_SHADER); diff --git a/src/win/win_settings.c b/src/win/win_settings.c index bde2eec9a..d1a28bb29 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -230,7 +230,7 @@ settings_listview_select(HWND hdlg, int id, int selection) } static void -settings_process_messages() +settings_process_messages(void) { MSG msg; while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) { @@ -1963,7 +1963,7 @@ win_settings_network_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } static void -normalize_hd_list() +normalize_hd_list(void) { hard_disk_t ihdd[HDD_NUM]; int i, j; diff --git a/src/win/win_stbar.c b/src/win/win_stbar.c index e9de1d3a9..5586f9d15 100644 --- a/src/win/win_stbar.c +++ b/src/win/win_stbar.c @@ -995,7 +995,7 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst) } void -ui_sb_update_text() +ui_sb_update_text(void) { uint8_t part = 0xff; diff --git a/src/win/win_toolbar.c b/src/win/win_toolbar.c index 59c471f8a..fade8d25e 100644 --- a/src/win/win_toolbar.c +++ b/src/win/win_toolbar.c @@ -28,7 +28,7 @@ enum image_index { }; void -ToolBarLoadIcons() +ToolBarLoadIcons(void) { if (!hwndToolbar) return; diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 0d282659e..a68cd5808 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -200,7 +200,7 @@ static int menu_vidapi = -1; static HMENU cur_menu = NULL; static void -show_render_options_menu() +show_render_options_menu(void) { if (vid_api == menu_vidapi) return;