diff --git a/src/build/makedep.c b/src/build/makedep.c index 743198cb84d..df94e540515 100644 --- a/src/build/makedep.c +++ b/src/build/makedep.c @@ -346,7 +346,7 @@ static int recurse_dir(int srcrootlen, const astring *srcdir) if (core_filename_ends_with(astring_c(curlist->name), ".c")) { tagmap *depend_map = tagmap_alloc(); - tagmap_entry *entry; + tagmap_entry *map_entry; file_entry *file; astring *target; int taghash; @@ -363,8 +363,8 @@ static int recurse_dir(int srcrootlen, const astring *srcdir) /* iterate over the hashed dependencies and output them as well */ for (taghash = 0; taghash < TAGMAP_HASH_SIZE; taghash++) - for (entry = depend_map->table[taghash]; entry != NULL; entry = entry->next) - printf("\t%s \\\n", astring_c((astring *)entry->object)); + for (map_entry = depend_map->table[taghash]; map_entry != NULL; map_entry = map_entry->next) + printf("\t%s \\\n", astring_c((astring *)map_entry->object)); astring_free(target); tagmap_free(depend_map); @@ -517,9 +517,9 @@ static astring *find_include_file(int srcrootlen, const astring *srcfile, const /* handle .. by removing a chunk from the incpath */ if (astring_cmpc(pathpart, "..") == 0) { - int sepindex = astring_rchr(srcincpath, 0, PATH_SEPARATOR[0]); - if (sepindex != -1) - astring_substr(srcincpath, 0, sepindex); + int sepindex_part = astring_rchr(srcincpath, 0, PATH_SEPARATOR[0]); + if (sepindex_part != -1) + astring_substr(srcincpath, 0, sepindex_part); } /* otherwise, append a path separator and the pathpart */ diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 311d2bdde1d..170d1c04a38 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -1061,12 +1061,12 @@ void cli_frontend::listsoftware(const char *gamename) if ( part->featurelist ) { - feature_list *list = part->featurelist; + feature_list *flist = part->featurelist; - while( list ) + while( flist ) { - fprintf( out, "\t\t\t\t\n", list->name, list->value ); - list = list->next; + fprintf( out, "\t\t\t\t\n", flist->name, flist->value ); + flist = flist->next; } } diff --git a/src/emu/cpu/i386/i386op16.c b/src/emu/cpu/i386/i386op16.c index 531a08b53e4..8b265e09761 100644 --- a/src/emu/cpu/i386/i386op16.c +++ b/src/emu/cpu/i386/i386op16.c @@ -3115,7 +3115,7 @@ static void I386OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 STORE_RM16(modrm, cpustate->cr[0]); CYCLES(cpustate,CYCLES_SMSW_REG); } else { - UINT32 ea = GetEA(cpustate,modrm); + ea = GetEA(cpustate,modrm); WRITE16(cpustate,ea, cpustate->cr[0]); CYCLES(cpustate,CYCLES_SMSW_MEM); } diff --git a/src/emu/cpu/i386/i486ops.c b/src/emu/cpu/i386/i486ops.c index 1c5ff7388da..daca98767b9 100644 --- a/src/emu/cpu/i386/i486ops.c +++ b/src/emu/cpu/i386/i486ops.c @@ -269,7 +269,7 @@ static void I486OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 STORE_RM16(modrm, cpustate->cr[0]); CYCLES(cpustate,CYCLES_SMSW_REG); } else { - UINT32 ea = GetEA(cpustate,modrm); + ea = GetEA(cpustate,modrm); WRITE16(cpustate,ea, cpustate->cr[0]); CYCLES(cpustate,CYCLES_SMSW_MEM); } diff --git a/src/emu/cpu/i86/instr286.c b/src/emu/cpu/i86/instr286.c index bc02d2d9446..e188cfd8371 100644 --- a/src/emu/cpu/i86/instr286.c +++ b/src/emu/cpu/i86/instr286.c @@ -666,7 +666,6 @@ static void PREFIX286(_0fpre)(i8086_state *cpustate) cpustate->regs.w[DX] = ReadWord(0x830); cpustate->regs.w[CX] = ReadWord(0x832); cpustate->regs.w[AX] = ReadWord(0x834); - UINT16 desc[3]; // loadall uses base-rights-limit order #define LOADDESC(addr, sreg) { desc[1] = ReadWord(addr); desc[2] = ReadWord(addr+2); desc[0] = ReadWord(addr+4); \ cpustate->base[sreg] = BASE(desc); cpustate->rights[sreg] = RIGHTS(desc); \ diff --git a/src/emu/cpu/i860/i860dis.c b/src/emu/cpu/i860/i860dis.c index b454ee58ffc..8fb32b7beb4 100644 --- a/src/emu/cpu/i860/i860dis.c +++ b/src/emu/cpu/i860/i860dis.c @@ -118,7 +118,6 @@ static void flop_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) { const char *const suffix[4] = { "ss", "sd", "ds", "dd" }; const char *prefix_d, *prefix_p; - int s = (insn & 0x180) >> 7; prefix_p = (insn & 0x400) ? "p" : ""; prefix_d = (insn & 0x200) ? "d." : ""; @@ -159,8 +158,11 @@ static void flop_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) suffix[s], get_fsrc1 (insn), get_fsrc2 (insn), get_fdest (insn)); } else + { + int s = (insn & 0x180) >> 7; sprintf(buf, "%s%s%s%s\t%%f%d,%%f%d,%%f%d", prefix_d, prefix_p, mnemonic, suffix[s], get_fsrc1 (insn), get_fsrc2 (insn), get_fdest (insn)); + } } diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c index af3c3e6bd69..039bba02b56 100644 --- a/src/emu/cpu/nec/v25.c +++ b/src/emu/cpu/nec/v25.c @@ -436,7 +436,7 @@ static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback) nec_state->config = config; - for (int i = 0; i < 4; i++) + for (i = 0; i < 4; i++) nec_state->timers[i] = device->machine().scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state); device->save_item(NAME(nec_state->ram.w)); diff --git a/src/emu/cpu/psx/psx.c b/src/emu/cpu/psx/psx.c index 523382a5723..e743ca4ec1e 100644 --- a/src/emu/cpu/psx/psx.c +++ b/src/emu/cpu/psx/psx.c @@ -788,17 +788,17 @@ void psxcpu_device::log_bioscall() ( address == 0xb0 && operation == 0x35 ) ) { int fd = log_bioscall_parameter( 0 ); - int buf = log_bioscall_parameter( 1 ); + int buffer = log_bioscall_parameter( 1 ); int nbytes = log_bioscall_parameter( 2 ); if( fd == 1 ) { while( nbytes > 0 ) { - UINT8 c = readbyte( buf ); + UINT8 c = readbyte( buffer ); putchar( c ); nbytes--; - buf++; + buffer++; } } } diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c index b572c91a303..f4aacbcd132 100644 --- a/src/emu/cpu/scmp/scmp.c +++ b/src/emu/cpu/scmp/scmp.c @@ -375,10 +375,10 @@ static void execute_one(scmp_state *cpustate, int opcode) case 0x3c: case 0x3d :case 0x3e: case 0x3f: // XPPC { - UINT16 tmp = ADD12(cpustate->PC.w.l,-1); // Since PC is incremented we need to fix it + UINT16 tmp16 = ADD12(cpustate->PC.w.l,-1); // Since PC is incremented we need to fix it cpustate->icount -= 7; cpustate->PC.w.l = GET_PTR_REG(cpustate,ptr)->w.l; - GET_PTR_REG(cpustate,ptr)->w.l = tmp; + GET_PTR_REG(cpustate,ptr)->w.l = tmp16; // After exchange CPU increment PC cpustate->PC.w.l = ADD12(cpustate->PC.w.l,1); } diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c index 7315c1d69c2..5c6ea18a2c7 100644 --- a/src/emu/cpu/superfx/superfx.c +++ b/src/emu/cpu/superfx/superfx.c @@ -223,10 +223,10 @@ INLINE void superfx_pixelcache_flush(superfx_state *cpustate, INT32 line) { UINT32 byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; UINT8 data = 0x00; - UINT32 x = 0; - for(x = 0; x < 8; x++) + UINT32 x32 = 0; + for(x32 = 0; x32 < 8; x32++) { - data |= ((cpustate->pixelcache[line].data[x] >> n) & 1) << x; + data |= ((cpustate->pixelcache[line].data[x32] >> n) & 1) << x32; } if(cpustate->pixelcache[line].bitpend != 0xff) { diff --git a/src/emu/cpu/tms57002/tmsmake.c b/src/emu/cpu/tms57002/tmsmake.c index 9e4bdbd2820..22cb92f16f3 100644 --- a/src/emu/cpu/tms57002/tmsmake.c +++ b/src/emu/cpu/tms57002/tmsmake.c @@ -172,7 +172,7 @@ static void load(const char *fname) } } else { char *name=0, *cat=0, *id=0, *cyc=0, *rep=0, *type=0; - char *p = buf; + p = buf; int pid, limit; instr *bi; unsigned int flags; diff --git a/src/emu/dimemory.c b/src/emu/dimemory.c index 8e1f43a0b08..c647596ff8b 100644 --- a/src/emu/dimemory.c +++ b/src/emu/dimemory.c @@ -313,8 +313,8 @@ bool device_memory_interface::interface_validity_check(emu_options &options, con for (const rom_source *source = rom_first_source(device().mconfig()); source != NULL && !found; source = rom_next_source(*source)) for (const rom_entry *romp = rom_first_region(*source); !ROMENTRY_ISEND(romp) && !found; romp++) { - const char *regiontag = ROMREGION_GETTAG(romp); - if (regiontag != NULL) + const char *regiontag_c = ROMREGION_GETTAG(romp); + if (regiontag_c != NULL) { astring fulltag; astring regiontag; diff --git a/src/emu/ioport.c b/src/emu/ioport.c index a4561c791b1..55f897b07c9 100644 --- a/src/emu/ioport.c +++ b/src/emu/ioport.c @@ -3205,7 +3205,7 @@ static void load_config_callback(running_machine &machine, int config_type, xml_ /* what we will diff against */ if (config_type == CONFIG_TYPE_CONTROLLER) for (input_type_entry *entry = portdata->typelist.first(); entry != NULL; entry = entry->next()) - for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++) + for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++) entry->defseq[seqtype] = entry->seq[seqtype]; } @@ -3455,7 +3455,7 @@ static void save_default_inputs(running_machine &machine, xml_data_node *parentn xml_set_attribute(portnode, "type", input_field_type_to_token(machine, entry->type, entry->player)); /* add only the sequences that have changed from the defaults */ - for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++) + for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++) if (entry->seq[seqtype] != entry->defseq[seqtype]) save_sequence(machine, portnode, seqtype, entry->type, entry->seq[seqtype]); } diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c index 3f5cdfd126f..5e847b8832d 100644 --- a/src/emu/machine/ldcore.c +++ b/src/emu/machine/ldcore.c @@ -1036,7 +1036,7 @@ static STREAM_UPDATE( custom_stream_callback ) /* clear out the rest of the buffer */ if (samples > 0) { - int sampout = (ldcore->audiobufout == 0) ? ldcore->audiobufsize - 1 : ldcore->audiobufout - 1; + sampout = (ldcore->audiobufout == 0) ? ldcore->audiobufsize - 1 : ldcore->audiobufout - 1; stream_sample_t fill0 = buffer0[sampout] & leftand; stream_sample_t fill1 = buffer1[sampout] & rightand; diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c index c5325f3c1e8..c96b155d8a5 100644 --- a/src/emu/rendfont.c +++ b/src/emu/rendfont.c @@ -696,10 +696,10 @@ bool render_font::save_cached(const char *filename, UINT32 hash) try { // allocate an array to hold the character data - UINT8 *chartable = auto_alloc_array_clear(m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE); + chartable = auto_alloc_array_clear(m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE); // allocate a temp buffer to compress into - UINT8 *tempbuffer = auto_alloc_array(m_manager.machine(), UINT8, 65536); + tempbuffer = auto_alloc_array(m_manager.machine(), UINT8, 65536); // write the header UINT8 *dest = tempbuffer; diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 373c26332c6..cbf13f7ab1a 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -1798,11 +1798,11 @@ static DEVICE_VALIDITY_CHECK( software_list ) if (data->_name && data->_hashdata) { - const char *s; + const char *str; /* make sure it's all lowercase */ - for (s = data->_name; *s; s++) - if (tolower((UINT8)*s) != *s) + for (str = data->_name; *str; str++) + if (tolower((UINT8)*str) != *str) { mame_printf_error("%s: %s has upper case ROM name %s\n", swlist->list_name[i], swinfo->shortname, data->_name); error = TRUE; diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c index df26313c100..9978020edb1 100644 --- a/src/emu/sound/spu.c +++ b/src/emu/sound/spu.c @@ -776,7 +776,7 @@ bool spu_device::sample_cache::try_update(spu_device *spu) #endif signed short *dp=data+(((invalid_start-start)>>4)*28); - adpcm_packet *ap=(adpcm_packet *)(spu->spu_ram+invalid_start); + ap=(adpcm_packet *)(spu->spu_ram+invalid_start); for (a=invalid_start; aloopstart) { adpcm_decoder tmp=decoder; - signed short *dp=lc->data, - *dpend=dp+lc->len; + dp=lc->data; + signed short *dpend=dp+lc->len; unsigned int adr=lc->loopstart; for (unsigned int i=0; ((ispu_ram+adr),dp); @@ -806,7 +806,7 @@ bool spu_device::sample_cache::try_update(spu_device *spu) invalid_start=0xffffffff; valid=true; - for (unsigned int a=start; acache[a>>4]=this; } diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c index 25b04c0a2bd..889c2aafd0c 100644 --- a/src/emu/tilemap.c +++ b/src/emu/tilemap.c @@ -1236,7 +1236,7 @@ static void mappings_update(tilemap_t *tmap) { UINT32 logical_col = logindex % tmap->cols; UINT32 logical_row = logindex / tmap->cols; - tilemap_memory_index memindex = (*tmap->mapper)(logical_col, logical_row, tmap->cols, tmap->rows); + memindex = (*tmap->mapper)(logical_col, logical_row, tmap->cols, tmap->rows); UINT32 flipped_logindex; /* apply tilemap flip to get the final location to store */ diff --git a/src/emu/ui.c b/src/emu/ui.c index d80712cd42e..56817e9190e 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -1020,7 +1020,7 @@ astring &game_info_astring(running_machine &machine, astring &string) /* count how many identical CPUs we have */ int count = 1; device_execute_interface *scan = NULL; - for (bool gotone = exec->next(scan); gotone; gotone = scan->next(scan)) + for (bool gotanother = exec->next(scan); gotanother; gotanother = scan->next(scan)) { if (exec->device().type() != scan->device().type() || exec->device().clock() != scan->device().clock()) break; diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index e3538f54903..1f0f3eccc67 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -857,7 +857,7 @@ static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly for (linenum = 0; linenum < visible_lines; linenum++) { float line_y = visible_top + (float)linenum * line_height; - int itemnum = top_line + linenum; + itemnum = top_line + linenum; const ui_menu_item *item = &menu->item[itemnum]; const char *itemtext = item->text; rgb_t fgcolor = UI_TEXT_COLOR; @@ -992,7 +992,7 @@ static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly { const ui_menu_item *item = &menu->item[menu->selected]; int subitem_invert = item->flags & MENU_FLAG_INVERT; - int linenum = menu->selected - top_line; + linenum = menu->selected - top_line; float line_y = visible_top + (float)linenum * line_height; float target_width, target_height; float target_x, target_y; @@ -3883,7 +3883,7 @@ static void menu_select_game_custom_render(running_machine &machine, ui_menu *me else { const char *s = COPYRIGHT; - int line = 0; + line = 0; int col = 0; /* first line is version string */ diff --git a/src/mame/machine/cd32.c b/src/mame/machine/cd32.c index b6a9b4d9cc4..960fb6c3fc6 100644 --- a/src/mame/machine/cd32.c +++ b/src/mame/machine/cd32.c @@ -89,7 +89,6 @@ static DEVICE_STOP( akiko ) akiko_state *state = get_safe_token(device); if (!state->m_cdrom_is_device) { - akiko_state *state = get_safe_token(device); if( state->m_cdrom ) { cdrom_close(state->m_cdrom); diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index f9d1ef8c447..514e3a0cddc 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -1682,7 +1682,6 @@ static int pif_channel_handle_command(running_machine &machine, int channel, int case 0x03: { UINT32 address; - int i; /*mame_printf_debug("Write to mempack, rlength = %d, slength = %d\n", rlength, slength); for (i=0; i < slength; i++) { diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c index 1247cc51880..7bfc7fb5da5 100644 --- a/src/osd/windows/d3dhlsl.c +++ b/src/osd/windows/d3dhlsl.c @@ -1567,7 +1567,7 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum) { (*d3dintf->effect.begin_pass)(curr_effect, pass); // add the primitives - HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); + result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); (*d3dintf->effect.end_pass)(curr_effect); } @@ -1590,7 +1590,7 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum) { (*d3dintf->effect.begin_pass)(curr_effect, pass); // add the primitives - HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); + result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); (*d3dintf->effect.end_pass)(curr_effect); } @@ -1614,7 +1614,7 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum) { (*d3dintf->effect.begin_pass)(curr_effect, pass); // add the primitives - HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); + result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); (*d3dintf->effect.end_pass)(curr_effect); } diff --git a/src/osd/windows/winclip.c b/src/osd/windows/winclip.c index ed58df73ec9..521dff412f1 100644 --- a/src/osd/windows/winclip.c +++ b/src/osd/windows/winclip.c @@ -112,8 +112,7 @@ char *osd_get_clipboard_text(void) char *result = NULL; // try to access unicode text - if (result == NULL) - result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide); + result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide); // try to access ANSI text if (result == NULL)