(From Atari Ace. Note that I only took the first patch, which applied

to whole functions. The other one I'm not so sure about. Commented
code is usually hilighted differently, making it very easy to spot.)

Hi mamedev,

This set of patches has one aim only, to identify chunks of code that
have been disabled by the use of C/C++ comments, and to disable them
instead by using the preprocessor.  The C comment approach to
disabling code isn't safe (embedded comments will trip it up), and the
C++ comment approach isn't elegant (you shouldn't need to touch every
line to disable a chunk of code).  Using #if...#endif is preferable
always, excepting perhaps if (0) { ... }.

The patch has three parts.  The first only handles cases where full
functions were disabled.  The second handles cases where parts of
functions were disabled.  The third then tries to restore the
whitespace that the use of comments converted from tabs to spaces via
srcclean.exe.  It also cleans up the whitespace in a handful of the
files in areas outside of the original two patches.

~aa
This commit is contained in:
Aaron Giles 2008-07-31 08:30:22 +00:00
parent e0409bc7b1
commit e8f2759a0c
19 changed files with 54 additions and 43 deletions

View File

@ -379,10 +379,12 @@ static void lr35902_set_irq_line (int irqline, int state)
}
}
/*static void lr35902_clear_pending_interrupts (void)
#ifdef UNUSED_FUNCTION
static void lr35902_clear_pending_interrupts (void)
{
Regs.w.IF = 0;
}*/
}
#endif
static void lr35902_set_info(UINT32 state, cpuinfo *info)
{

View File

@ -22,7 +22,7 @@ struct ym2413_info
void * chip;
};
/*
#ifdef UNUSED_FUNCTION
void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buffer,int length)
{
INT16 *buffer = _buffer[0];
@ -34,7 +34,7 @@ void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buff
}
while (length--) *(buffer++) = out;
}
*/
#endif
static void ym2413_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffers, int length)
{

View File

@ -377,9 +377,11 @@ static void change_register (running_machine *machine, int reg, UINT8 val) {
** Interface functions
*/
/*void TMS9928A_int_callback (void (*callback)(int)) {
#ifdef UNUSED_FUNCTION
void TMS9928A_int_callback (void (*callback)(int)) {
tms.INTCallback = callback;
}*/
}
#endif
void TMS9928A_set_spriteslimit (int limit) {
tms.LimitSprites = limit;

View File

@ -6646,12 +6646,12 @@ static INTERRUPT_GEN( quizchq_irq )
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xee);
}
/*
#ifdef UNUSED_FUNCTION
static INTERRUPT_GEN( rtc_irq )
{
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfc);
}
*/
#endif
static MACHINE_DRIVER_START( quizchq )

View File

@ -2849,7 +2849,7 @@ static DRIVER_INIT( turtles )
}
#ifdef UNUSED_CODE
#ifdef UNUSED_FUNCTION
static DRIVER_INIT( amidar )
{
/* no existing amidar sets run on Amidar hardware as described by Amidar schematics! */

View File

@ -342,12 +342,13 @@ static ADDRESS_MAP_START( galhustl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xe80000, 0xe8ffff) AM_WRITE(SMH_RAM)
ADDRESS_MAP_END
/*
#ifdef UNUSED_FUNCTION
READ16_HANDLER( zipzap_random_read )
{
return mame_rand(machine);
}
*/
#endif
static ADDRESS_MAP_START( zipzap_readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x4fffff) AM_READ(SMH_ROM)
AM_RANGE(0x500000, 0x51ffff) AM_READ(SMH_RAM)

View File

@ -505,12 +505,12 @@ static UINT8 *hng64_com_mmu_mem;
extern UINT32 hng64_hackTilemap3, hng64_hackTm3Count, hng64_rowScrollOffset;
/*
#ifdef UNUSED_FUNCTION
WRITE32_HANDLER( trap_write )
{
logerror("Remapped write... %08x %08x\n",offset,data);
}
*/
#endif
static WRITE32_HANDLER( hng64_videoram_w )
@ -818,13 +818,13 @@ static READ32_HANDLER( dl_r )
return hng64_dl[offset] ;
}
/*
#ifdef UNUSED_FUNCTION
WRITE32_HANDLER( activate_3d_buffer )
{
COMBINE_DATA (&active_3d_buffer[offset]) ;
mame_printf_debug("COMBINED %d\n", active_3d_buffer[offset]) ;
}
*/
#endif
// Transition Control memory.
static WRITE32_HANDLER( tcram_w )
@ -1184,7 +1184,7 @@ static WRITE8_HANDLER( hng64_comm_io_mmu )
KL5C80_virtual_mem_sync();
}
/*
#ifdef UNUSED_FUNCTION
READ8_HANDLER( hng64_comm_shared_r )
{
// I'm thinking 0x54 comes from an interrupt on the MIPS CPU? Or maybe the Toshiba one?
@ -1211,7 +1211,7 @@ WRITE8_HANDLER( hng64_comm_shared_w )
logerror("COM CPU wrote to com_shared_a : %08x\n", hng64_com_shared_a);
}
*/
#endif
static ADDRESS_MAP_START( hng_comm_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000,0xffff) AM_READWRITE( hng64_comm_memory_r, hng64_comm_memory_w )

View File

@ -84,12 +84,12 @@ static WRITE16_HANDLER( quizf1_bankswitch_w )
}
}
/*
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( unknown_w )
{
printf("%04x ",data);
}
*/
#endif
/***************************************************************************/

View File

@ -804,12 +804,12 @@ static const z80pio_interface meritm_io_pio_intf =
0
};
/*
#ifdef UNUSED_FUNCTION
static void meritm_pio1_portb_input_changed_callback(void *param, UINT32 oldval, UINT32 newval)
{
z80pio_p_w(1, 1, (UINT8)newval);
}
*/
#endif
static const struct z80_irq_daisy_chain meritm_daisy_chain[] =
{

View File

@ -440,12 +440,12 @@ ADDRESS_MAP_END
static int sample_buffer = 0;
static int sample_select = 0;
/*
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( spangbl_msm5205_data_w )
{
sample_buffer = data;
}
*/
#endif
static ADDRESS_MAP_START( spangb_sound_memmap, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM

View File

@ -656,7 +656,7 @@ static WRITE32_HANDLER( geo_ctl1_w )
}
/*
#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( geo_sharc_ctl1_w )
{
// did hi bit change?
@ -733,7 +733,7 @@ static WRITE32_HANDLER(geo_sharc_iop_w)
geo_iop_write_num++;
}
}
*/
#endif
static void push_geo_data(UINT32 data)
@ -860,11 +860,13 @@ static READ32_HANDLER(hotd_unk_r)
return 0x000c0000;
}
/*static READ32_HANDLER(sonic_unk_r)
#ifdef UNUSED_FUNCTION
static READ32_HANDLER(sonic_unk_r)
{
return 0x001a0000;
}
*/
#endif
static READ32_HANDLER(daytona_unk_r)
{
return 0x00400000;

View File

@ -634,12 +634,12 @@ anything to compare,infact
nmk16_mainram[_protinput_+1] = (_input_ & 0x0000ffff);\
}
/*
#ifdef UNUSED_FUNCTION
static READ16_HANDLER( mcu_shared_r )
{
return nmk16_mcu_shared_ram[offset];
}
*/
#endif
//td - hmf
//008D9E - 00796e

View File

@ -169,7 +169,7 @@ static VIDEO_UPDATE(pturn)
return 0;
}
/*
#ifdef UNUSED_FUNCTION
READ8_HANDLER (pturn_protection_r)
{
return 0x66;
@ -179,7 +179,7 @@ READ8_HANDLER (pturn_protection2_r)
{
return 0xfe;
}
*/
#endif
static WRITE8_HANDLER( pturn_videoram_w )
{

View File

@ -1918,7 +1918,7 @@ static READ32_HANDLER ( viprp1o_speedup_r )
return spimainram[(0x001d49c-0x800)/4];
}
/*
#ifdef UNUSED_FUNCTION
// causes input problems?
READ32_HANDLER ( ejanhs_speedup_r )
{
@ -1926,7 +1926,7 @@ READ32_HANDLER ( ejanhs_speedup_r )
if (activecpu_get_pc()==0x03032c7) cpu_spinuntil_int(); // idle
return spimainram[(0x002d224-0x800)/4];
}
*/
#endif
static READ32_HANDLER ( rf2_speedup_r )
{

View File

@ -740,13 +740,14 @@ static READ32_HANDLER( groovef_speedup_r )
return stv_workram_h[0x0c64ec/4];
}
/*
#ifdef UNUSED_FUNCTION
static READ32_HANDLER( groovef_second_cpu_off_r )
{
if (activecpu_get_pc()==0x060060c2) cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
return 0;
}
*/
#endif
static void groovef_slave_speedup( UINT32 data )
{

View File

@ -31,12 +31,13 @@ static TILE_GET_INFO( get_tile_info )
0);
}
/*
#ifdef UNUSED_FUNCTION
static READ8_HANDLER( rom_bank_select_r )
{
return suprgolf_rom_bank;
}
*/
#endif
static WRITE8_HANDLER( rom_bank_select_w )
{
UINT8 *region_base = memory_region(machine, "user1");

View File

@ -460,12 +460,12 @@ static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */
/* 68000 A */
/*
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( wgp_interrupt4 )
{
cpunum_set_input_line(machine, 0,4,HOLD_LINE);
}
*/
#endif
static TIMER_CALLBACK( wgp_interrupt6 )
{

View File

@ -804,12 +804,14 @@ WRITE64_HANDLER( dc_rtc_w )
mame_printf_verbose("RTC: [%08x=%x] write %llx to %x, mask %llx\n", 0x710000 + reg*4, dat, data, offset, mem_mask);
}
/*static void dc_rtc_increment(void)
#ifdef UNUSED_FUNCTION
static void dc_rtc_increment(void)
{
dc_rtcregister[RTC2] = (dc_rtcregister[RTC2] + 1) & 0xFFFF;
if (dc_rtcregister[RTC2] == 0)
dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF;
}*/
}
#endif
MACHINE_START( dc )
{

View File

@ -120,7 +120,7 @@ WRITE16_HANDLER( gcpinbal_tilemaps_word_w )
}
/*
#ifdef UNUSED_FUNCTION
READ16_HANDLER( gcpinbal_ctrl_word_r )
{
@ -169,7 +169,7 @@ WRITE16_HANDLER( gcpinbal_ctrl_word_w )
}
}
*/
#endif
/****************************************************************