diff options
author | 2009-12-29 14:35:54 +0000 | |
---|---|---|
committer | 2009-12-29 14:35:54 +0000 | |
commit | 81523f2e101d3ffea62041420c244030e9d572e7 (patch) | |
tree | 8b1727ae32b7f89ce1a9cffbbea6605a9100dd64 /src | |
parent | bee6282e99533a240a386f67a203e6ae043aa20e (diff) |
gcc 4.5.0 compilation fixes.
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/cpu/e132xs/e132xs.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/h6280/h6280ops.h | 12 | ||||
-rw-r--r-- | src/emu/cpu/i4004/i4004.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/m6502/opsc02.h | 4 | ||||
-rw-r--r-- | src/emu/cpu/m6502/opsce02.h | 8 | ||||
-rw-r--r-- | src/emu/cpu/mcs51/mcs51.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/spc700/spc700.c | 12 | ||||
-rw-r--r-- | src/emu/cpu/z8/z8ops.c | 2 | ||||
-rw-r--r-- | src/emu/machine/pic8259.c | 6 | ||||
-rw-r--r-- | src/mame/drivers/megadriv.c | 2 | ||||
-rw-r--r-- | src/mame/drivers/spdodgeb.c | 2 | ||||
-rw-r--r-- | src/mame/video/atari.c | 10 | ||||
-rw-r--r-- | src/mame/video/seta2.c | 4 | ||||
-rw-r--r-- | src/osd/windows/d3dintf.h | 2 | ||||
-rw-r--r-- | src/osd/windows/input.c | 8 | ||||
-rw-r--r-- | src/osd/windows/winalloc.c | 2 | ||||
-rw-r--r-- | src/osd/windows/winmain.c | 6 |
17 files changed, 47 insertions, 39 deletions
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index 8cefc686cc5..8a70742ea1d 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -1739,7 +1739,7 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco old_l = GET_L; PPC = PC; - PC = SET_PC(SREG); + SET_PC(SREG); SR = (SREGF & 0xffe00000) | ((SREG & 0x01) << 18 ) | (SREGF & 0x3ffff); if (cpustate->intblock < 1) cpustate->intblock = 1; diff --git a/src/emu/cpu/h6280/h6280ops.h b/src/emu/cpu/h6280/h6280ops.h index d9decec0ec7..823f5dd4ae6 100644 --- a/src/emu/cpu/h6280/h6280ops.h +++ b/src/emu/cpu/h6280/h6280ops.h @@ -673,7 +673,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define DEA \ CLEAR_T; \ - A = (UINT8)--A; \ + A = (UINT8)(A - 1); \ SET_NZ(A) /* 6280 ******************************************************** @@ -689,7 +689,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define DEX \ CLEAR_T; \ - X = (UINT8)--X; \ + X = (UINT8)(X - 1); \ SET_NZ(X) /* 6280 ******************************************************** @@ -697,7 +697,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define DEY \ CLEAR_T; \ - Y = (UINT8)--Y; \ + Y = (UINT8)(Y - 1); \ SET_NZ(Y) /* 6280 ******************************************************** @@ -727,7 +727,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define INA \ CLEAR_T; \ - A = (UINT8)++A; \ + A = (UINT8)(A + 1); \ SET_NZ(A) /* 6280 ******************************************************** @@ -743,7 +743,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define INX \ CLEAR_T; \ - X = (UINT8)++X; \ + X = (UINT8)(X + 1); \ SET_NZ(X) /* 6280 ******************************************************** @@ -751,7 +751,7 @@ INLINE void WRMEM(h6280_Regs* cpustate, offs_t addr, UINT8 data) { ***************************************************************/ #define INY \ CLEAR_T; \ - Y = (UINT8)++Y; \ + Y = (UINT8)(Y + 1); \ SET_NZ(Y) /* 6280 ******************************************************** diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c index f894fd4cebd..ed88991b53b 100644 --- a/src/emu/cpu/i4004/i4004.c +++ b/src/emu/cpu/i4004/i4004.c @@ -395,7 +395,7 @@ static void execute_one(i4004_state *cpustate, int opcode) cpustate->C = 0; break; case 0xf2: /* IAC */ - cpustate->A = cpustate->A++; + cpustate->A += 1; cpustate->C = cpustate->A >> 4; cpustate->A &= 0x0f; break; diff --git a/src/emu/cpu/m6502/opsc02.h b/src/emu/cpu/m6502/opsc02.h index 2b4977ed7df..7ea4cdedc0f 100644 --- a/src/emu/cpu/m6502/opsc02.h +++ b/src/emu/cpu/m6502/opsc02.h @@ -258,14 +258,14 @@ * DEA Decrement accumulator ***************************************************************/ #define DEA \ - A = (UINT8)--A; \ + A = (UINT8)(A - 1); \ SET_NZ(A) /* 65C02 ******************************************************* * INA Increment accumulator ***************************************************************/ #define INA \ - A = (UINT8)++A; \ + A = (UINT8)(A + 1); \ SET_NZ(A) /* 65C02 ******************************************************* diff --git a/src/emu/cpu/m6502/opsce02.h b/src/emu/cpu/m6502/opsce02.h index 84eb1063a02..91a481f0755 100644 --- a/src/emu/cpu/m6502/opsce02.h +++ b/src/emu/cpu/m6502/opsce02.h @@ -441,7 +441,7 @@ * DEA Decrement accumulator ***************************************************************/ #define DEA \ - A = (UINT8)--A; \ + A = (UINT8)(A - 1); \ SET_NZ(A) /* 65ce02 ****************************************************** @@ -455,7 +455,7 @@ * DEW Decrement memory word ***************************************************************/ #define DEW \ - tmp.w.l = --tmp.w.l; \ + tmp.w.l -= 1; \ SET_NZ_WORD(tmp) /* 65ce02 ****************************************************** @@ -490,7 +490,7 @@ * INA Increment accumulator ***************************************************************/ #define INA \ - A = (UINT8)++A; \ + A = (UINT8)(A + 1); \ SET_NZ(A) /* 65ce02 ****************************************************** @@ -504,7 +504,7 @@ * INW Increment memory word ***************************************************************/ #define INW \ - tmp.w.l = ++tmp.w.l; \ + tmp.w.l += 1; \ SET_NZ_WORD(tmp) /* 65ce02 ****************************************************** diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index ab906c62f19..e82552901f0 100644 --- a/src/emu/cpu/mcs51/mcs51.c +++ b/src/emu/cpu/mcs51/mcs51.c @@ -1977,7 +1977,7 @@ static CPU_EXECUTE( mcs51 ) /* decrement the timed access window */ if (mcs51_state->features & FEATURE_DS5002FP) - mcs51_state->ds5002fp.ta_window = (mcs51_state->ds5002fp.ta_window ? mcs51_state->ds5002fp.ta_window-- : 0x00); + mcs51_state->ds5002fp.ta_window = (mcs51_state->ds5002fp.ta_window ? (mcs51_state->ds5002fp.ta_window - 1) : 0x00); /* If the chip entered in idle mode, end the loop */ if ((mcs51_state->features & FEATURE_CMOS) && GET_IDL) diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c index fe6dace7e27..b809894df60 100644 --- a/src/emu/cpu/spc700/spc700.c +++ b/src/emu/cpu/spc700/spc700.c @@ -848,8 +848,8 @@ INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value) CLK(BCLK); \ DST = EA_DP(cpustate); \ FLAG_NZ = MAKE_UINT_16(read_16_DP(DST) - 1); \ - write_16_DP(DST, FLAG_NZ); \ - FLAG_NZ = NZFLAG_16(FLAG_NZ) + write_16_DP(DST, FLAG_Z); \ + FLAG_NZ = NZFLAG_16(FLAG_Z) /* Disable interrupts */ #define OP_DI(BCLK) \ @@ -918,8 +918,8 @@ INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value) CLK(BCLK); \ DST = EA_DP(cpustate); \ FLAG_NZ = MAKE_UINT_16(read_16_DP(DST) + 1); \ - write_16_DP(DST, FLAG_NZ); \ - FLAG_NZ = NZFLAG_16(FLAG_NZ) + write_16_DP(DST, FLAG_Z); \ + FLAG_NZ = NZFLAG_16(FLAG_Z) /* Jump */ /* If we're in a busy loop, eat all clock cycles */ @@ -981,8 +981,8 @@ INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value) #define OP_MOVWMR(BCLK) \ CLK(BCLK); \ FLAG_NZ = OPER_16_DP(cpustate); \ - SET_REG_YA(cpustate, FLAG_NZ); \ - FLAG_NZ = NZFLAG_16(FLAG_NZ) + SET_REG_YA(cpustate, FLAG_Z); \ + FLAG_NZ = NZFLAG_16(FLAG_Z) /* Move from Stack pointer to X */ #define OP_MOVSX(BCLK) \ diff --git a/src/emu/cpu/z8/z8ops.c b/src/emu/cpu/z8/z8ops.c index 07026fbd2ec..6b656cdb9a8 100644 --- a/src/emu/cpu/z8/z8ops.c +++ b/src/emu/cpu/z8/z8ops.c @@ -556,7 +556,7 @@ static int check_condition_code(z8_state *cpustate, int cc) case CC_T: truth = 1; break; case CC_GE: truth = !(flag(S) ^ flag(V)); break; case CC_GT: truth = !(flag(Z) | (flag(S) ^ flag(V))); break; - case CC_UGT: truth = (!flag(C) & !flag(Z)); break; + case CC_UGT: truth = ((!flag(C)) & (!flag(Z))); break; case CC_NOV: truth = !flag(V); break; case CC_PL: truth = !flag(S); break; case CC_NZ: truth = !flag(Z); break; diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c index b72eb897a9f..935011ffff9 100644 --- a/src/emu/machine/pic8259.c +++ b/src/emu/machine/pic8259.c @@ -307,7 +307,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w ) } break; case 0x80: - pic8259->prio = ++pic8259->prio & 7; + pic8259->prio = (pic8259->prio + 1) & 7; break; case 0xa0: for (n = 0, mask = 1<<pic8259->prio; n < 8; n++, mask = (mask<<1) | (mask>>7)) @@ -315,7 +315,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w ) if( pic8259->isr & mask ) { pic8259->isr &= ~mask; - pic8259->prio = ++pic8259->prio & 7; + pic8259->prio = (pic8259->prio + 1) & 7; break; } } @@ -328,7 +328,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w ) { pic8259->isr &= ~mask; pic8259->irr &= ~mask; - pic8259->prio = ++pic8259->prio & 7; + pic8259->prio = (pic8259->prio + 1) & 7; } break; } diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index c60290bc40d..979c6bf6ff9 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -5101,7 +5101,7 @@ static void genesis_render_videoline_to_videobuffer(int scanline) else if (spritedata==0x3f) { /* This is a Shadow operator set shadow bit */ - video_renderline[x] = video_renderline[x]|=0x2000; + video_renderline[x] = video_renderline[x]|0x2000; } else { diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c index f0883d34e2d..d20c917bf97 100644 --- a/src/mame/drivers/spdodgeb.c +++ b/src/mame/drivers/spdodgeb.c @@ -421,7 +421,7 @@ static MACHINE_RESET( spdodgeb ) { toggle = 0; adpcm_pos[0] = adpcm_pos[1] = 0; - adpcm_end[0] = adpcm_end[0] = 0; + adpcm_end[0] = adpcm_end[1] = 0; adpcm_idle[0] = adpcm_data[1] = 0; adpcm_data[0] = adpcm_data[1] = -1; mcu63701_command = 0; diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index 4bb96e14462..974e6f54cc5 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -1246,9 +1246,9 @@ INLINE void LMS(running_machine *machine, int new_cmd) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); int addr = RDANTIC(space); - antic.doffs = ++antic.doffs & DOFFS; + antic.doffs = (antic.doffs + 1) & DOFFS; addr += 256 * RDANTIC(space); - antic.doffs = ++antic.doffs & DOFFS; + antic.doffs = (antic.doffs + 1) & DOFFS; antic.vpage = addr & VPAGE; antic.voffs = addr & VOFFS; LOG((" LMS $%04x\n", addr)); @@ -1284,7 +1284,7 @@ static void antic_scanline_dma(running_machine *machine, int param) UINT8 new_cmd; new_cmd = RDANTIC(space); - antic.doffs = ++antic.doffs & DOFFS; + antic.doffs = (antic.doffs + 1) & DOFFS; /* steal at one clock cycle from the CPU for fetching the command */ antic.steal_cycles += 1; LOG((" ANTIC CMD $%02x\n", new_cmd)); @@ -1347,7 +1347,7 @@ static void antic_scanline_dma(running_machine *machine, int param) if( new_cmd & ANTIC_LMS ) { int addr = RDANTIC(space); - antic.doffs = ++antic.doffs & DOFFS; + antic.doffs = (antic.doffs + 1) & DOFFS; addr += 256 * RDANTIC(space); antic.dpage = addr & DPAGE; antic.doffs = addr & DOFFS; @@ -1360,7 +1360,7 @@ static void antic_scanline_dma(running_machine *machine, int param) else { int addr = RDANTIC(space); - antic.doffs = ++antic.doffs & DOFFS; + antic.doffs = (antic.doffs + 1) & DOFFS; addr += 256 * RDANTIC(space); antic.dpage = addr & DPAGE; antic.doffs = addr & DOFFS; diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index bba1e0f2b8a..ab7c994ee55 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -124,7 +124,9 @@ WRITE16_HANDLER( seta2_vregs_w ) grdians = 019a */ - if ( seta2_vregs[offset] != COMBINE_DATA(&seta2_vregs[offset]) ) + UINT16 olddata = seta2_vregs[offset]; + COMBINE_DATA(&seta2_vregs[offset]); + if ( seta2_vregs[offset] != olddata ) logerror("CPU #0 PC %06X: Video Reg %02X <- %04X\n",cpu_get_pc(space->cpu),offset*2,data); switch( offset*2 ) diff --git a/src/osd/windows/d3dintf.h b/src/osd/windows/d3dintf.h index 705e6f28077..863013e1c8f 100644 --- a/src/osd/windows/d3dintf.h +++ b/src/osd/windows/d3dintf.h @@ -57,6 +57,7 @@ #if (DIRECT3D_VERSION >= 0x0900) +#ifndef __WINE_D3D9TYPES_H // the following used to be TEXTURESTAGESTATES but are now SAMPLERSTATES enum { @@ -71,6 +72,7 @@ enum D3DTSS_MAXANISOTROPY = 21 }; #endif +#endif //============================================================ diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index 3140f0816e8..f3649fcf0f3 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -193,10 +193,10 @@ struct _device_info // RawInput APIs -typedef WINUSERAPI INT (WINAPI *get_rawinput_device_list_ptr)(OUT PRAWINPUTDEVICELIST pRawInputDeviceList, IN OUT PINT puiNumDevices, IN UINT cbSize); -typedef WINUSERAPI INT (WINAPI *get_rawinput_data_ptr)(IN HRAWINPUT hRawInput, IN UINT uiCommand, OUT LPVOID pData, IN OUT PINT pcbSize, IN UINT cbSizeHeader); -typedef WINUSERAPI INT (WINAPI *get_rawinput_device_info_ptr)(IN HANDLE hDevice, IN UINT uiCommand, OUT LPVOID pData, IN OUT PINT pcbSize); -typedef WINUSERAPI BOOL (WINAPI *register_rawinput_devices_ptr)(IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize); +typedef /*WINUSERAPI*/ INT (WINAPI *get_rawinput_device_list_ptr)(OUT PRAWINPUTDEVICELIST pRawInputDeviceList, IN OUT PINT puiNumDevices, IN UINT cbSize); +typedef /*WINUSERAPI*/ INT (WINAPI *get_rawinput_data_ptr)(IN HRAWINPUT hRawInput, IN UINT uiCommand, OUT LPVOID pData, IN OUT PINT pcbSize, IN UINT cbSizeHeader); +typedef /*WINUSERAPI*/ INT (WINAPI *get_rawinput_device_info_ptr)(IN HANDLE hDevice, IN UINT uiCommand, OUT LPVOID pData, IN OUT PINT pcbSize); +typedef /*WINUSERAPI*/ BOOL (WINAPI *register_rawinput_devices_ptr)(IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize); diff --git a/src/osd/windows/winalloc.c b/src/osd/windows/winalloc.c index f0608db3dd7..152532af89d 100644 --- a/src/osd/windows/winalloc.c +++ b/src/osd/windows/winalloc.c @@ -457,7 +457,7 @@ void check_unfreed_mem(void) if (total == 0) fprintf(stderr, "--- memory leak warning ---\n"); total += entry->size; - fprintf(stderr, "allocation #%06d, %d bytes (%s:%d)\n", entry->id, entry->size, entry->file, entry->line); + fprintf(stderr, "allocation #%06d, %d bytes (%s:%d)\n", entry->id, entry->size, entry->file, (int)entry->line); } memory_lock_release(); diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 41064c858f3..968f25f3bf3 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -141,7 +141,9 @@ static int is_double_click_start(int argc); static DWORD WINAPI watchdog_thread_entry(LPVOID lpParameter); static LONG CALLBACK exception_filter(struct _EXCEPTION_POINTERS *info); static const char *lookup_symbol(UINT32 address); +#ifndef PTR64 static int get_code_base_size(UINT32 *base, UINT32 *size); +#endif static void start_profiler(void); static void stop_profiler(void); @@ -364,7 +366,7 @@ void osd_init(running_machine *machine) assert_always(watchdog_reset_event != NULL, "Failed to create watchdog reset event"); watchdog_exit_event = CreateEvent(NULL, TRUE, FALSE, NULL); assert_always(watchdog_exit_event != NULL, "Failed to create watchdog exit event"); - watchdog_thread = CreateThread(NULL, 0, watchdog_thread_entry, (LPVOID)watchdog, 0, NULL); + watchdog_thread = CreateThread(NULL, 0, watchdog_thread_entry, (LPVOID)(FPTR)watchdog, 0, NULL); assert_always(watchdog_thread != NULL, "Failed to create watchdog thread"); } } @@ -706,6 +708,7 @@ static const char *lookup_symbol(UINT32 address) // get_code_base_size //============================================================ +#ifndef PTR64 static int get_code_base_size(UINT32 *base, UINT32 *size) { FILE * map = fopen(mapfile_name, "r"); @@ -728,6 +731,7 @@ static int get_code_base_size(UINT32 *base, UINT32 *size) fclose(map); return result; } +#endif #if ENABLE_PROFILER |