reverting, sorry for this vconv needs to be updated (nw)

This commit is contained in:
Miodrag Milanovic 2014-03-31 10:23:22 +00:00
parent 2d7b9fac51
commit de513a0f98
55 changed files with 108 additions and 128 deletions

View File

@ -618,7 +618,7 @@ static const decode_tbl_t fp_decode_tbl[128] =
/* Replaces tabs with spaces. */ /* Replaces tabs with spaces. */
static void i860_dasm_tab_replacer(char* buf, int tab_size) static void i860_dasm_tab_replacer(char* buf, int tab_size)
{ {
size_t i = 0; int i = 0;
int tab_count = 0; int tab_count = 0;
char tab_buf[1024]; char tab_buf[1024];
memset(tab_buf, 0, 1024); memset(tab_buf, 0, 1024);

View File

@ -2083,7 +2083,7 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con
static void execute_cheatnext(running_machine &machine, int ref, int params, const char *param[]) static void execute_cheatnext(running_machine &machine, int ref, int params, const char *param[])
{ {
address_space *space; address_space *space;
int cheatindex; UINT64 cheatindex;
UINT32 active_cheat = 0; UINT32 active_cheat = 0;
UINT8 condition; UINT8 condition;
UINT64 comp_value = 0; UINT64 comp_value = 0;
@ -2149,7 +2149,7 @@ static void execute_cheatnext(running_machine &machine, int ref, int params, con
cheat.undo++; cheat.undo++;
/* execute the search */ /* execute the search */
for (cheatindex = 0; cheatindex < cheat.cheatmap.count(); cheatindex += 1) for (cheatindex = 0; cheatindex < (UINT64)cheat.cheatmap.count(); cheatindex += 1)
if (cheat.cheatmap[cheatindex].state == 1) if (cheat.cheatmap[cheatindex].state == 1)
{ {
UINT64 cheat_value = cheat_read_extended(&cheat, *space, cheat.cheatmap[cheatindex].offset); UINT64 cheat_value = cheat_read_extended(&cheat, *space, cheat.cheatmap[cheatindex].offset);
@ -2263,7 +2263,7 @@ static void execute_cheatlist(running_machine &machine, int ref, int params, con
address_space *space; address_space *space;
device_t *cpu; device_t *cpu;
UINT32 active_cheat = 0; UINT32 active_cheat = 0;
int cheatindex; UINT64 cheatindex;
UINT64 sizemask; UINT64 sizemask;
FILE *f = NULL; FILE *f = NULL;
@ -2294,7 +2294,7 @@ static void execute_cheatlist(running_machine &machine, int ref, int params, con
} }
/* write the cheat list */ /* write the cheat list */
for (cheatindex = 0; cheatindex < cheat.cheatmap.count(); cheatindex += 1) for (cheatindex = 0; cheatindex < (UINT64)cheat.cheatmap.count(); cheatindex += 1)
{ {
if (cheat.cheatmap[cheatindex].state == 1) if (cheat.cheatmap[cheatindex].state == 1)
{ {
@ -2325,12 +2325,12 @@ static void execute_cheatlist(running_machine &machine, int ref, int params, con
static void execute_cheatundo(running_machine &machine, int ref, int params, const char *param[]) static void execute_cheatundo(running_machine &machine, int ref, int params, const char *param[])
{ {
int cheatindex; UINT64 cheatindex;
UINT32 undo_count = 0; UINT32 undo_count = 0;
if (cheat.undo > 0) if (cheat.undo > 0)
{ {
for (cheatindex = 0; cheatindex < cheat.cheatmap.count(); cheatindex += 1) for (cheatindex = 0; cheatindex < (UINT64)cheat.cheatmap.count(); cheatindex += 1)
{ {
if (cheat.cheatmap[cheatindex].undo == cheat.undo) if (cheat.cheatmap[cheatindex].undo == cheat.undo)
{ {
@ -2359,9 +2359,9 @@ static void execute_find(running_machine &machine, int ref, int params, const ch
UINT64 data_to_find[256]; UINT64 data_to_find[256];
UINT8 data_size[256]; UINT8 data_size[256];
int cur_data_size; int cur_data_size;
size_t data_count = 0; int data_count = 0;
int found = 0; int found = 0;
size_t j; int j;
/* validate parameters */ /* validate parameters */
if (!debug_command_parameter_number(machine, param[0], &offset)) if (!debug_command_parameter_number(machine, param[0], &offset))

View File

@ -1472,9 +1472,8 @@ const char *debug_get_help(const char *tag)
{ {
static char ambig_message[1024]; static char ambig_message[1024];
const help_item *found = NULL; const help_item *found = NULL;
size_t i; int i, msglen, foundcount = 0;
int msglen, foundcount = 0; int taglen = (int)strlen(tag);
size_t taglen = strlen(tag);
char tagcopy[256]; char tagcopy[256];
/* make a lowercase copy of the tag */ /* make a lowercase copy of the tag */

View File

@ -445,7 +445,7 @@ static void dview_set_title(DView *dv, astring title)
static void dview_draw_title(DView *dv) static void dview_draw_title(DView *dv)
{ {
size_t i; int i;
rgb_t col = rgb_t(0xff,0x00,0x00,0xff); rgb_t col = rgb_t(0xff,0x00,0x00,0xff);
rectangle r; rectangle r;

View File

@ -324,7 +324,7 @@ astring &device_state_entry::format(astring &dest, const char *string, bool maxo
const_cast<device_state_entry *>(this)->m_flags |= DSF_CUSTOM_STRING; const_cast<device_state_entry *>(this)->m_flags |= DSF_CUSTOM_STRING;
return dest; return dest;
} }
if (strlen(string) <= (size_t)width) if (strlen(string) <= width)
{ {
dest.cat(string); dest.cat(string);
width -= strlen(string); width -= strlen(string);

View File

@ -35,7 +35,7 @@ microtouch_device::microtouch_device(const machine_config &mconfig, const char *
int microtouch_device::check_command( const char* commandtocheck, int command_len, UINT8* command_data ) int microtouch_device::check_command( const char* commandtocheck, int command_len, UINT8* command_data )
{ {
if ( ((size_t)command_len == (strlen(commandtocheck) + 2)) && if ( (command_len == (strlen(commandtocheck) + 2)) &&
(command_data[0] == 0x01) && (command_data[0] == 0x01) &&
(strncmp(commandtocheck, (const char*)command_data + 1, strlen(commandtocheck)) == 0) && (strncmp(commandtocheck, (const char*)command_data + 1, strlen(commandtocheck)) == 0) &&
(command_data[command_len-1] == 0x0d) ) (command_data[command_len-1] == 0x0d) )

View File

@ -105,7 +105,7 @@ void nvram_device::nvram_default()
case DEFAULT_RANDOM: case DEFAULT_RANDOM:
{ {
UINT8 *nvram = reinterpret_cast<UINT8 *>(m_base); UINT8 *nvram = reinterpret_cast<UINT8 *>(m_base);
for (size_t index = 0; index < m_length; index++) for (int index = 0; index < m_length; index++)
nvram[index] = machine().rand(); nvram[index] = machine().rand();
break; break;
} }

View File

@ -1033,7 +1033,7 @@ UINT8 pc_keyboard_device::unicode_char_to_at_keycode(unicode_char ch)
int pc_keyboard_device::queue_chars(const unicode_char *text, size_t text_len) int pc_keyboard_device::queue_chars(const unicode_char *text, size_t text_len)
{ {
size_t i; int i;
UINT8 b; UINT8 b;
for (i = 0; (i < text_len) && ((queue_size()) + 4 < sizeof(m_queue)); i++) for (i = 0; (i < text_len) && ((queue_size()) + 4 < sizeof(m_queue)); i++)

View File

@ -207,7 +207,7 @@ void *pblockpool::alloc(const std::size_t n)
else else
{ {
int memsize = ((n + m_align - 1) / m_align) * m_align; int memsize = ((n + m_align - 1) / m_align) * m_align;
int min_alloc = MAX((size_t)m_blocksize, (memsize+sizeof(memblock)-MINDATASIZE)); int min_alloc = MAX(m_blocksize, memsize+sizeof(memblock)-MINDATASIZE);
char *ret = NULL; char *ret = NULL;
//std::printf("m_first %p\n", m_first); //std::printf("m_first %p\n", m_first);
for (memblock *p = m_first; p != NULL && ret == NULL; p = p->next) for (memblock *p = m_first; p != NULL && ret == NULL; p = p->next)

View File

@ -153,7 +153,7 @@ bool ui_input_push_event(running_machine &machine, ui_event evt)
} }
/* is the queue filled up? */ /* is the queue filled up? */
if ((uidata->events_end + 1) % ARRAY_LENGTH(uidata->events) == (size_t)uidata->events_start) if ((uidata->events_end + 1) % ARRAY_LENGTH(uidata->events) == uidata->events_start)
return false; return false;
uidata->events[uidata->events_end++] = evt; uidata->events[uidata->events_end++] = evt;

View File

@ -600,8 +600,7 @@ void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect) void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
size_t pos; int pos, line, column, c, addr, curr_addr;
int line, column, c, addr, curr_addr;
UINT32 *bitmapline; UINT32 *bitmapline;
UINT16 mask_comp; UINT16 mask_comp;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
@ -659,8 +658,7 @@ void svga_device::svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect)
int xi; int xi;
int yi; int yi;
int xm; int xm;
size_t pos; int pos, line, column, c, addr, curr_addr;
int line, column, c, addr, curr_addr;
UINT32 *bitmapline; UINT32 *bitmapline;
// UINT16 mask_comp; // UINT16 mask_comp;
@ -704,8 +702,7 @@ void svga_device::svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect)
int xi; int xi;
int yi; int yi;
int xm; int xm;
size_t pos; int pos, line, column, c, addr, curr_addr;
int line, column, c, addr, curr_addr;
UINT32 *bitmapline; UINT32 *bitmapline;
// UINT16 mask_comp; // UINT16 mask_comp;
@ -749,8 +746,7 @@ void svga_device::svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect)
int xi; int xi;
int yi; int yi;
int xm; int xm;
size_t pos; int pos, line, column, c, addr, curr_addr;
int line, column, c, addr, curr_addr;
UINT32 *bitmapline; UINT32 *bitmapline;
// UINT16 mask_comp; // UINT16 mask_comp;
@ -791,8 +787,7 @@ void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect)
int xi; int xi;
int yi; int yi;
int xm; int xm;
size_t pos; int pos, line, column, c, addr, curr_addr;
int line, column, c, addr, curr_addr;
UINT32 *bitmapline; UINT32 *bitmapline;
// UINT16 mask_comp; // UINT16 mask_comp;

View File

@ -802,7 +802,7 @@ void vic3_device::draw_sprite_multi( int nr, int yoff, int ybegin, int yend, int
#ifndef memset16 #ifndef memset16
static void *memset16(void *dest, int value, size_t size) static void *memset16(void *dest, int value, size_t size)
{ {
size_t i; register int i;
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
((short *) dest)[i] = value; ((short *) dest)[i] = value;

View File

@ -664,8 +664,7 @@ static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int
{ {
floperr_t err; floperr_t err;
size_t pos = 0; size_t pos = 0;
int sector_count, sector, i; int sector_count, sector, i, j;
size_t j;
struct apple35_tag *tag; struct apple35_tag *tag;
UINT8 sum, format_byte, val, side; UINT8 sum, format_byte, val, side;
UINT32 found_sectors = 0; UINT32 found_sectors = 0;

View File

@ -377,7 +377,7 @@ static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sam
size_t sample_index = sample % SAMPLES_PER_BLOCK; size_t sample_index = sample % SAMPLES_PER_BLOCK;
/* is this block beyond the edge of our waveform? */ /* is this block beyond the edge of our waveform? */
if (sample_blocknum >= (size_t)cassette->blocks.count()) if (sample_blocknum >= cassette->blocks.count())
cassette->blocks.resize_keep_and_clear_new(sample_blocknum + 1); cassette->blocks.resize_keep_and_clear_new(sample_blocknum + 1);
if (cassette->blocks[sample_blocknum] == NULL) if (cassette->blocks[sample_blocknum] == NULL)
@ -386,7 +386,7 @@ static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sam
sample_block &block = *cassette->blocks[sample_blocknum]; sample_block &block = *cassette->blocks[sample_blocknum];
/* is this sample access off the current block? */ /* is this sample access off the current block? */
if (sample_index >= (size_t)block.count()) if (sample_index >= block.count())
block.resize_keep_and_clear_new(SAMPLES_PER_BLOCK); block.resize_keep_and_clear_new(SAMPLES_PER_BLOCK);
*ptr = &block[sample_index]; *ptr = &block[sample_index];

View File

@ -114,7 +114,7 @@ static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, co
} }
/* vote on the best format */ /* vote on the best format */
for (i = 0; (i < (size_t)max_options) && floppy_options[i].construct; i++) for (i = 0; (i < max_options) && floppy_options[i].construct; i++)
{ {
if (!extension || !floppy_options[i].extensions || image_find_extension(floppy_options[i].extensions, extension)) if (!extension || !floppy_options[i].extensions || image_find_extension(floppy_options[i].extensions, extension))
{ {

View File

@ -202,7 +202,7 @@ static casserr_t to7_k7_load( cassette_image *cass )
cassette_image_read( cass, block, 0, 64 ); cassette_image_read( cass, block, 0, 64 );
for ( i = 3; ; i++ ) for ( i = 3; ; i++ )
{ {
if ( ( (size_t)i >= size ) || ( i >= 64 ) ) if ( ( i >= size ) || ( i >= 64 ) )
{ {
/* ? */ /* ? */
PRINT (( "to7_k7_load: WARNING: this does not look like a MO or TO cassette.\n" )); PRINT (( "to7_k7_load: WARNING: this does not look like a MO or TO cassette.\n" ));
@ -534,7 +534,7 @@ static casserr_t mo5_k5_load( cassette_image *cass )
cassette_image_read( cass, block, 0, 64 ); cassette_image_read( cass, block, 0, 64 );
for ( i = 3; ; i++ ) for ( i = 3; ; i++ )
{ {
if ( ( (size_t)i >= size ) || ( i >= 64 ) ) if ( ( i >= size ) || ( i >= 64 ) )
{ {
/* ? */ /* ? */
PRINT (( "to5_k5_load: WARNING: this does not look like a MO or TO cassette.\n" )); PRINT (( "to5_k5_load: WARNING: this does not look like a MO or TO cassette.\n" ));

View File

@ -105,7 +105,7 @@ static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head,
{ {
UINT64 offset; UINT64 offset;
floperr_t err; floperr_t err;
size_t i; int i;
UINT8 *buf; UINT8 *buf;
err = get_offset(floppy, head, track, sector, sector_is_index, &offset); err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
if (err) if (err)
@ -127,7 +127,7 @@ static floperr_t internal_sap_write_sector(floppy_image_legacy *floppy, int head
floperr_t err; floperr_t err;
UINT8 buf[256+6]; UINT8 buf[256+6];
UINT16 crc; UINT16 crc;
size_t i; int i;
err = get_offset(floppy, head, track, sector, sector_is_index, &offset); err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
if (err) if (err)
return err; return err;

View File

@ -1505,7 +1505,7 @@ static floperr_t ti99_sdf_read_track(floppy_image_legacy *floppy, int head, int
*/ */
static floperr_t ti99_sdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen) static floperr_t ti99_sdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
{ {
size_t current_pos = 0; int current_pos = 0;
UINT8 *track_image; UINT8 *track_image;
int leadin, gap1, gap2; int leadin, gap1, gap2;
int is_fm, found; int is_fm, found;
@ -2128,8 +2128,7 @@ static floperr_t ti99_tdf_read_track_internal(floppy_image_legacy *floppy, int h
UINT64 track_offset; UINT64 track_offset;
int first_idam = 0; int first_idam = 0;
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy); struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
size_t i; int i, byte, crc;
int byte, crc;
UINT8 *track_data = (UINT8*)buffer; UINT8 *track_data = (UINT8*)buffer;

View File

@ -995,7 +995,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{ {
FILE *infile; FILE *infile;
size_t i, trknum; int i, trknum;
static char token[512]; static char token[512];
char tocftemp[512]; char tocftemp[512];

View File

@ -249,7 +249,7 @@ outofmemory:
optreserr_t option_resolution_add_param(option_resolution *resolution, const char *param, const char *value) optreserr_t option_resolution_add_param(option_resolution *resolution, const char *param, const char *value)
{ {
size_t i; int i;
int must_resolve; int must_resolve;
optreserr_t err; optreserr_t err;
const char *option_specification; const char *option_specification;
@ -344,7 +344,7 @@ void option_resolution_close(option_resolution *resolution)
optreserr_t option_resolution_finish(option_resolution *resolution) optreserr_t option_resolution_finish(option_resolution *resolution)
{ {
size_t i; int i;
optreserr_t err; optreserr_t err;
struct option_resolution_entry *entry; struct option_resolution_entry *entry;
const char *option_specification; const char *option_specification;
@ -445,7 +445,7 @@ const option_guide *option_resolution_find_option(option_resolution *resolution,
const option_guide *option_resolution_index_option(option_resolution *resolution, int indx) const option_guide *option_resolution_index_option(option_resolution *resolution, int indx)
{ {
if ((indx < 0) || ((size_t)indx >= resolution->option_count)) if ((indx < 0) || (indx >= resolution->option_count))
return NULL; return NULL;
return resolution->entries[indx].guide_entry; return resolution->entries[indx].guide_entry;
} }

View File

@ -220,7 +220,7 @@ int _7z_search_crc_match(_7z_file *new_7z, UINT32 search_crc, const char* search
/* Check for a name match */ /* Check for a name match */
SzArEx_GetFileNameUtf16(&new_7z->db, i, temp); SzArEx_GetFileNameUtf16(&new_7z->db, i, temp);
if (len == (size_t)search_filename_length+1) if (len == search_filename_length+1)
{ {
int j; int j;
for (j=0;j<search_filename_length;j++) for (j=0;j<search_filename_length;j++)

View File

@ -30,7 +30,7 @@ int uchar_isvalid(unicode_char uchar)
int uchar_from_utf8(unicode_char *uchar, const char *utf8char, size_t count) int uchar_from_utf8(unicode_char *uchar, const char *utf8char, size_t count)
{ {
unicode_char c, minchar; unicode_char c, minchar;
size_t auxlen, i; int auxlen, i;
char auxchar; char auxchar;
/* validate parameters */ /* validate parameters */

View File

@ -697,7 +697,7 @@ void zippath_closedir(zippath_directory *directory)
static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header) static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header)
{ {
const char *result = NULL; const char *result = NULL;
size_t len = directory->zipprefix.len(); int len = directory->zipprefix.len();
if ((len <= strlen(header->filename)) if ((len <= strlen(header->filename))
&& !strncmp(directory->zipprefix, header->filename, len)) && !strncmp(directory->zipprefix, header->filename, len))

View File

@ -2097,7 +2097,7 @@ void astra_addresslines( UINT16* src, size_t srcsize, int small )
if (small) blocksize= 0x100000/2; if (small) blocksize= 0x100000/2;
else blocksize= 0x100000; else blocksize= 0x100000;
for (size_t block = 0; block < srcsize; block += blocksize) for (int block = 0; block < srcsize; block += blocksize)
{ {
for (int x = 0; x<blocksize/2;x+=2) for (int x = 0; x<blocksize/2;x+=2)
{ {

View File

@ -512,7 +512,7 @@ DRIVER_INIT_MEMBER(blmbycar_state,blmbycar)
{ {
UINT16 *RAM = (UINT16 *) memregion("maincpu")->base(); UINT16 *RAM = (UINT16 *) memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes() / 2; size_t size = memregion("maincpu")->bytes() / 2;
size_t i; int i;
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
{ {

View File

@ -3483,7 +3483,7 @@ void coolridr_state::machine_start()
UINT16* compressed = (UINT16*)memregion( "compressedgfx" )->base(); UINT16* compressed = (UINT16*)memregion( "compressedgfx" )->base();
int count = 0; int count = 0;
for (size_t i=0;i<size/2/10;i++) for (int i=0;i<size/2/10;i++)
{ {
m_rearranged_16bit_gfx[count+0] = ((compressed[i+((0x0400000/2)*0)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*0)]&0xff00) >> 8); m_rearranged_16bit_gfx[count+0] = ((compressed[i+((0x0400000/2)*0)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*0)]&0xff00) >> 8);
m_rearranged_16bit_gfx[count+1] = ((compressed[i+((0x0400000/2)*1)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*1)]&0xff00) >> 8); m_rearranged_16bit_gfx[count+1] = ((compressed[i+((0x0400000/2)*1)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*1)]&0xff00) >> 8);

View File

@ -1465,11 +1465,11 @@ READ8_MEMBER(ddenlovr_state::rongrong_gfxrom_r)
{ {
UINT8 *rom = memregion("blitter")->base(); UINT8 *rom = memregion("blitter")->base();
size_t size = memregion("blitter")->bytes(); size_t size = memregion("blitter")->bytes();
size_t address = m_ddenlovr_blit_address; int address = m_ddenlovr_blit_address;
if (address >= size) if (address >= size)
{ {
logerror("CPU#0 PC %06X: Error, Blitter address %lX out of range\n", space.device().safe_pc(), address); logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", space.device().safe_pc(), address);
address %= size; address %= size;
} }
@ -2655,11 +2655,11 @@ READ8_MEMBER(ddenlovr_state::hanakanz_gfxrom_r)
{ {
UINT8 *rom = memregion("blitter")->base(); UINT8 *rom = memregion("blitter")->base();
size_t size = memregion("blitter")->bytes(); size_t size = memregion("blitter")->bytes();
size_t address = (m_ddenlovr_blit_address & 0xffffff) * 2; int address = (m_ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size) if (address >= size)
{ {
logerror("CPU#0 PC %06X: Error, Blitter address %lX out of range\n", space.device().safe_pc(), address); logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", space.device().safe_pc(), address);
address %= size; address %= size;
} }
@ -2879,11 +2879,11 @@ void ddenlovr_state::mjchuuka_get_romdata()
{ {
UINT8 *rom = memregion("blitter")->base(); UINT8 *rom = memregion("blitter")->base();
size_t size = memregion("blitter")->bytes(); size_t size = memregion("blitter")->bytes();
size_t address = (m_ddenlovr_blit_address & 0xffffff) * 2; int address = (m_ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size) if (address >= size)
{ {
logerror("%s: Error, Blitter address %lX out of range\n", machine().describe_context(), address); logerror("%s: Error, Blitter address %06X out of range\n", machine().describe_context(), address);
address %= size; address %= size;
} }

View File

@ -5898,7 +5898,7 @@ ROM_END
// Decrypted by yong // Decrypted by yong
DRIVER_INIT_MEMBER(dynax_state,mjelct3) DRIVER_INIT_MEMBER(dynax_state,mjelct3)
{ {
size_t i; int i;
UINT8 *rom = memregion("maincpu")->base(); UINT8 *rom = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes(); size_t size = memregion("maincpu")->bytes();
dynamic_buffer rom1(size); dynamic_buffer rom1(size);
@ -5910,7 +5910,7 @@ DRIVER_INIT_MEMBER(dynax_state,mjelct3)
DRIVER_INIT_MEMBER(dynax_state,mjelct3a) DRIVER_INIT_MEMBER(dynax_state,mjelct3a)
{ {
size_t i, j; int i, j;
UINT8 *rom = memregion("maincpu")->base(); UINT8 *rom = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes(); size_t size = memregion("maincpu")->bytes();
dynamic_buffer rom1(size); dynamic_buffer rom1(size);

View File

@ -360,7 +360,7 @@ void fantland_state::borntofi_adpcm_int( msm5205_device *device, int voice )
{ {
UINT8 *rom; UINT8 *rom;
size_t len; size_t len;
size_t start, stop; int start, stop;
if (!m_adpcm_playing[voice]) if (!m_adpcm_playing[voice])
return; return;
@ -374,7 +374,7 @@ void fantland_state::borntofi_adpcm_int( msm5205_device *device, int voice )
if (start >= len) if (start >= len)
{ {
borntofi_adpcm_stop(device, voice); borntofi_adpcm_stop(device, voice);
logerror("adpcm address out of range: %lx\n", start); logerror("adpcm address out of range: %06x\n", start);
return; return;
} }

View File

@ -1508,7 +1508,7 @@ DRIVER_INIT_MEMBER(gaiden_state,raiga)
void gaiden_state::descramble_drgnbowl_gfx() void gaiden_state::descramble_drgnbowl_gfx()
{ {
size_t i; int i;
UINT8 *ROM = memregion("maincpu")->base(); UINT8 *ROM = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes(); size_t size = memregion("maincpu")->bytes();

View File

@ -1736,7 +1736,7 @@ static void hng64_reorder(running_machine &machine, UINT8* gfxregion, size_t gfx
{ {
// by default 2 4bpp tiles are stored in each 8bpp tile, this makes decoding in MAME harder than it needs to be // by default 2 4bpp tiles are stored in each 8bpp tile, this makes decoding in MAME harder than it needs to be
// reorder them // reorder them
size_t i; int i;
UINT8 tilesize = 4*8; // 4 bytes per line, 8 lines UINT8 tilesize = 4*8; // 4 bytes per line, 8 lines
dynamic_buffer buffer(gfxregionsize); dynamic_buffer buffer(gfxregionsize);

View File

@ -845,7 +845,7 @@ ROM_END
DRIVER_INIT_MEMBER(igs009_state,jingbell) DRIVER_INIT_MEMBER(igs009_state,jingbell)
{ {
size_t i; int i;
UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); UINT8 *rom = (UINT8 *)memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes(); size_t size = memregion("maincpu")->bytes();

View File

@ -852,7 +852,7 @@ void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
{ {
// if nvram is the main RAM, don't overwrite exception vectors // if nvram is the main RAM, don't overwrite exception vectors
int start = (base == m_main_ram) ? 0x80 : 0x00; int start = (base == m_main_ram) ? 0x80 : 0x00;
for (size_t i = start; i < length; i++) for (int i = start; i < length; i++)
((UINT8 *)base)[i] = machine().rand(); ((UINT8 *)base)[i] = machine().rand();
// due to accessing uninitialized RAM, we need this hack // due to accessing uninitialized RAM, we need this hack

View File

@ -1320,7 +1320,7 @@ DRIVER_INIT_MEMBER(darkhors_state,darkhors)
{ {
size_t len = memregion("eeprom")->bytes(); size_t len = memregion("eeprom")->bytes();
dynamic_buffer temp(len); dynamic_buffer temp(len);
size_t i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
temp[i] = eeprom[BITSWAP8(i,7,5,4,3,2,1,0,6)]; temp[i] = eeprom[BITSWAP8(i,7,5,4,3,2,1,0,6)];

View File

@ -5109,7 +5109,7 @@ MACHINE_CONFIG_END
static void decryptcode( running_machine &machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12, static void decryptcode( running_machine &machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12,
int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 ) int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 )
{ {
size_t i; int i;
UINT8 *RAM = machine.root_device().memregion( "maincpu" )->base(); UINT8 *RAM = machine.root_device().memregion( "maincpu" )->base();
size_t size = machine.root_device().memregion( "maincpu" )->bytes(); size_t size = machine.root_device().memregion( "maincpu" )->bytes();
dynamic_buffer buffer( size ); dynamic_buffer buffer( size );

View File

@ -3989,7 +3989,7 @@ void pgm_state::expand_colourdata()
{ {
UINT8 *src = memregion( "sprcol" )->base(); UINT8 *src = memregion( "sprcol" )->base();
size_t srcsize = memregion( "sprcol" )->bytes(); size_t srcsize = memregion( "sprcol" )->bytes();
size_t cnt; int cnt;
size_t needed = srcsize / 2 * 3; size_t needed = srcsize / 2 * 3;
/* work out how much ram we need to allocate to expand the sprites into /* work out how much ram we need to allocate to expand the sprites into

View File

@ -331,7 +331,7 @@ void pirates_state::pirates_decrypt_68k()
memcpy (buf, rom, rom_size); memcpy (buf, rom, rom_size);
for (size_t i=0; i<rom_size/2; i++) for (int i=0; i<rom_size/2; i++)
{ {
int adrl, adrr; int adrl, adrr;
UINT8 vl, vr; UINT8 vl, vr;

View File

@ -377,7 +377,7 @@ DRIVER_INIT_MEMBER(md_boot_state,puckpkmn)
{ {
UINT8 *rom = memregion("maincpu")->base(); UINT8 *rom = memregion("maincpu")->base();
size_t len = memregion("maincpu")->bytes(); size_t len = memregion("maincpu")->bytes();
size_t i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
rom[i] = BITSWAP8(rom[i],1,4,2,0,7,5,3,6); rom[i] = BITSWAP8(rom[i],1,4,2,0,7,5,3,6);

View File

@ -624,7 +624,7 @@ void tecmosys_state::tecmosys_descramble()
{ {
UINT8 *gfxsrc = memregion( "gfx1" )->base(); UINT8 *gfxsrc = memregion( "gfx1" )->base();
size_t srcsize = memregion( "gfx1" )->bytes(); size_t srcsize = memregion( "gfx1" )->bytes();
size_t i; int i;
for (i=0; i < srcsize; i+=4) for (i=0; i < srcsize; i+=4)
{ {

View File

@ -1302,7 +1302,7 @@ void wecleman_state::wecleman_unpack_sprites()
void wecleman_state::bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0) void wecleman_state::bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0)
{ {
dynamic_buffer buffer(len); dynamic_buffer buffer(len);
size_t i; int i;
memcpy(buffer,src,len); memcpy(buffer,src,len);
for (i = 0;i < len;i++) for (i = 0;i < len;i++)

View File

@ -685,7 +685,7 @@ void neogeo_state::svcpcb_gfx_decrypt()
/* and a further swap on the s1 data */ /* and a further swap on the s1 data */
void neogeo_state::svcpcb_s1data_decrypt() void neogeo_state::svcpcb_s1data_decrypt()
{ {
size_t i; int i;
UINT8 *s1 = memregion( "fixed" )->base(); UINT8 *s1 = memregion( "fixed" )->base();
size_t s1_size = memregion( "fixed" )->bytes(); size_t s1_size = memregion( "fixed" )->bytes();

View File

@ -673,7 +673,7 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
UINT8 *opcodes = m_harem_decrypted_opcodes = auto_alloc_array(machine(), UINT8, size * 3); UINT8 *opcodes = m_harem_decrypted_opcodes = auto_alloc_array(machine(), UINT8, size * 3);
// decryption 03 // decryption 03
for (size_t i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
UINT8 x = ROM[i]; UINT8 x = ROM[i];
opcodes[size * 0 + i] = BITSWAP8(x, 7,0,5,2,3,4,1,6); opcodes[size * 0 + i] = BITSWAP8(x, 7,0,5,2,3,4,1,6);
@ -681,7 +681,7 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
} }
// decryption 09 // decryption 09
for (size_t i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
UINT8 x = ROM[i]; UINT8 x = ROM[i];
opcodes[size * 1 + i] = BITSWAP8(x, 7,0,5,6,3,2,1,4); opcodes[size * 1 + i] = BITSWAP8(x, 7,0,5,6,3,2,1,4);
@ -689,7 +689,7 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
} }
// decryption 0a // decryption 0a
for (size_t i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
UINT8 x = ROM[i]; UINT8 x = ROM[i];
opcodes[size * 2 + i] = BITSWAP8(x, 7,2,5,6,3,0,1,4); opcodes[size * 2 + i] = BITSWAP8(x, 7,2,5,6,3,0,1,4);

View File

@ -451,7 +451,7 @@ int dynax_state::blitter_drawgfx( int layer, int mask, const char *gfx, int src,
for ( ;; ) for ( ;; )
{ {
if ((size_t)src >= ROM_size) if (src >= ROM_size)
{ {
popmessage("GFXROM %s OVER %08x",gfx,src); popmessage("GFXROM %s OVER %08x",gfx,src);
LOG(("\nGFXROM %s OVER %08x",gfx,src)); LOG(("\nGFXROM %s OVER %08x",gfx,src));
@ -479,7 +479,7 @@ int dynax_state::blitter_drawgfx( int layer, int mask, const char *gfx, int src,
popmessage("Blitter unknown command %06X: %02X\n", src - 1, cmd); popmessage("Blitter unknown command %06X: %02X\n", src - 1, cmd);
case 0xd: // Skip X pixels case 0xd: // Skip X pixels
if ((size_t)src >= ROM_size) if (src >= ROM_size)
{ {
popmessage("GFXROM %s OVER %08x",gfx,src); popmessage("GFXROM %s OVER %08x",gfx,src);
LOG(("\nGFXROM %s OVER %08x",gfx,src)); LOG(("\nGFXROM %s OVER %08x",gfx,src));
@ -490,7 +490,7 @@ int dynax_state::blitter_drawgfx( int layer, int mask, const char *gfx, int src,
/* fall through into next case */ /* fall through into next case */
case 0xc: // Draw N pixels case 0xc: // Draw N pixels
if ((size_t)src >= ROM_size) if (src >= ROM_size)
{ {
popmessage("GFXROM %s OVER %08x",gfx,src); popmessage("GFXROM %s OVER %08x",gfx,src);
LOG(("\nGFXROM %s OVER %08x",gfx,src)); LOG(("\nGFXROM %s OVER %08x",gfx,src));

View File

@ -210,8 +210,7 @@ static const UINT16 supported_screen_heights[4] = { 262, 312, 328, 342 };
int a2600_state::detect_modeDC() int a2600_state::detect_modeDC()
{ {
size_t i; int i,numfound = 0;
int numfound = 0;
// signature is also in 'video reflex'.. maybe figure out that controller port someday... // signature is also in 'video reflex'.. maybe figure out that controller port someday...
static const unsigned char signature[3] = { 0x8d, 0xf0, 0xff }; static const unsigned char signature[3] = { 0x8d, 0xf0, 0xff };
if (m_cart_size == 0x10000) if (m_cart_size == 0x10000)
@ -231,8 +230,7 @@ int a2600_state::detect_modeDC()
int a2600_state::detect_modef6() int a2600_state::detect_modef6()
{ {
size_t i; int i, numfound = 0;
int numfound = 0;
static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff }; static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff };
if (m_cart_size == 0x4000) if (m_cart_size == 0x4000)
{ {
@ -255,8 +253,7 @@ int a2600_state::detect_mode3E()
// 'not boulderdash', but is the only example i have (cow) // 'not boulderdash', but is the only example i have (cow)
// Would have used STA $3e, but 'Alien' and 'Star Raiders' do that for unknown reasons // Would have used STA $3e, but 'Alien' and 'Star Raiders' do that for unknown reasons
size_t i; int i,numfound = 0;
int numfound = 0;
static const unsigned char signature[3] = { 0x84, 0x3e, 0x9d }; static const unsigned char signature[3] = { 0x84, 0x3e, 0x9d };
if (m_cart_size == 0x0800 || m_cart_size == 0x1000) if (m_cart_size == 0x0800 || m_cart_size == 0x1000)
{ {
@ -275,8 +272,7 @@ int a2600_state::detect_mode3E()
int a2600_state::detect_modeSS() int a2600_state::detect_modeSS()
{ {
size_t i; int i,numfound = 0;
int numfound = 0;
static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 }; static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 };
if (m_cart_size == 0x0800 || m_cart_size == 0x1000) if (m_cart_size == 0x0800 || m_cart_size == 0x1000)
{ {
@ -295,8 +291,7 @@ int a2600_state::detect_modeSS()
int a2600_state::detect_modeFE() int a2600_state::detect_modeFE()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][5] = { static const unsigned char signatures[][5] = {
{ 0x20, 0x00, 0xd0, 0xc6, 0xc5 }, { 0x20, 0x00, 0xd0, 0xc6, 0xc5 },
{ 0x20, 0xc3, 0xf8, 0xa5, 0x82 }, { 0x20, 0xc3, 0xf8, 0xa5, 0x82 },
@ -323,8 +318,7 @@ int a2600_state::detect_modeFE()
int a2600_state::detect_modeE0() int a2600_state::detect_modeE0()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][3] = { static const unsigned char signatures[][3] = {
{ 0x8d, 0xe0, 0x1f }, { 0x8d, 0xe0, 0x1f },
{ 0x8d, 0xe0, 0x5f }, { 0x8d, 0xe0, 0x5f },
@ -353,8 +347,7 @@ int a2600_state::detect_modeE0()
int a2600_state::detect_modeCV() int a2600_state::detect_modeCV()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][3] = { static const unsigned char signatures[][3] = {
{ 0x9d, 0xff, 0xf3 }, { 0x9d, 0xff, 0xf3 },
{ 0x99, 0x00, 0xf4 } { 0x99, 0x00, 0xf4 }
@ -379,8 +372,7 @@ int a2600_state::detect_modeCV()
int a2600_state::detect_modeFV() int a2600_state::detect_modeFV()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][3] = { static const unsigned char signatures[][3] = {
{ 0x2c, 0xd0, 0xff } { 0x2c, 0xd0, 0xff }
}; };
@ -405,8 +397,7 @@ int a2600_state::detect_modeFV()
int a2600_state::detect_modeJVP() int a2600_state::detect_modeJVP()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][4] = { static const unsigned char signatures[][4] = {
{ 0x2c, 0xc0, 0xef, 0x60 }, { 0x2c, 0xc0, 0xef, 0x60 },
{ 0x8d, 0xa0, 0x0f, 0xf0 } { 0x8d, 0xa0, 0x0f, 0xf0 }
@ -431,8 +422,7 @@ int a2600_state::detect_modeJVP()
int a2600_state::detect_modeE7() int a2600_state::detect_modeE7()
{ {
size_t i,j; int i,j,numfound = 0;
int numfound = 0;
static const unsigned char signatures[][3] = { static const unsigned char signatures[][3] = {
{ 0xad, 0xe5, 0xff }, { 0xad, 0xe5, 0xff },
{ 0x8d, 0xe7, 0xff } { 0x8d, 0xe7, 0xff }
@ -457,8 +447,7 @@ int a2600_state::detect_modeE7()
int a2600_state::detect_modeUA() int a2600_state::detect_modeUA()
{ {
size_t i; int i,numfound = 0;
int numfound = 0;
static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 }; static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 };
if (m_cart_size == 0x2000) if (m_cart_size == 0x2000)
{ {
@ -477,8 +466,7 @@ int a2600_state::detect_modeUA()
int a2600_state::detect_8K_mode3F() int a2600_state::detect_8K_mode3F()
{ {
size_t i; int i,numfound = 0;
int numfound = 0;
static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f }; static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f };
static const unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f }; static const unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f };
// have to look for two signatures because 'not boulderdash' gives false positive otherwise // have to look for two signatures because 'not boulderdash' gives false positive otherwise
@ -503,8 +491,7 @@ int a2600_state::detect_8K_mode3F()
int a2600_state::detect_32K_mode3F() int a2600_state::detect_32K_mode3F()
{ {
size_t i; int i,numfound = 0;
int numfound = 0;
static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f }; static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f };
if (m_cart_size >= 0x8000) if (m_cart_size >= 0x8000)
{ {
@ -523,7 +510,7 @@ int a2600_state::detect_32K_mode3F()
int a2600_state::detect_super_chip() int a2600_state::detect_super_chip()
{ {
size_t i,j; int i,j;
UINT8 *cart = CART; UINT8 *cart = CART;
static const unsigned char signatures[][5] = { static const unsigned char signatures[][5] = {
{ 0xa2, 0x7f, 0x9d, 0x00, 0xf0 }, // dig dug { 0xa2, 0x7f, 0x9d, 0x00, 0xf0 }, // dig dug

View File

@ -946,7 +946,7 @@ UINT32 pockstat_state::screen_update_pockstat(screen_device &screen, bitmap_rgb3
DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash ) DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash )
{ {
int length; int i, length;
UINT8 *cart = memregion("flash")->base(); UINT8 *cart = memregion("flash")->base();
static const char *gme_id = "123-456-STD"; static const char *gme_id = "123-456-STD";
@ -957,7 +957,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash )
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
for(size_t i = 0; i < strlen(gme_id); i++) for(i = 0; i < strlen(gme_id); i++)
{ {
if(cart[i] != gme_id[i]) if(cart[i] != gme_id[i])
{ {

View File

@ -405,7 +405,7 @@ void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, const char
{ {
va_list arg_list; va_list arg_list;
char buf[32768]; char buf[32768];
size_t index = 0; INT32 index = 0;
const rectangle &visarea = m_screen->visible_area(); const rectangle &visarea = m_screen->visible_area();
va_start( arg_list, msg ); va_start( arg_list, msg );
@ -502,8 +502,9 @@ UINT32 ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitma
void ssem_state::strlower(char *buf) void ssem_state::strlower(char *buf)
{ {
if(buf) if(buf)
{ {
for(size_t i = 0; i < strlen(buf); i++) int i = 0;
for(i = 0; i < strlen(buf); i++)
{ {
if(buf[i] >= 'A' && buf[i] <= 'Z') if(buf[i] >= 'A' && buf[i] <= 'Z')
{ {

View File

@ -271,7 +271,7 @@ QUICKLOAD_LOAD_MEMBER( svmu_state, svmu )
vmufat_write_word(flash, 253, 0x02, 0x0000); // location of first file block vmufat_write_word(flash, 253, 0x02, 0x0000); // location of first file block
const char *vms_filename = image.basename_noext(); const char *vms_filename = image.basename_noext();
for (size_t i=0; i<12; i++) for (int i=0; i<12; i++)
{ {
if (i < strlen(vms_filename)) if (i < strlen(vms_filename))
vmufat_write_byte(flash, 253, i + 4, vms_filename[i]); // 12 bytes filename vmufat_write_byte(flash, 253, i + 4, vms_filename[i]); // 12 bytes filename

View File

@ -766,7 +766,7 @@ static imgtoolerr_t bml3_diskimage_writefile(imgtool_partition *partition, const
read_sz -= i; read_sz -= i;
sz -= i; sz -= i;
} }
if (i < (size_t)(info->granule_sectors * info->sector_size) && sz > 0) { if (i < info->granule_sectors * info->sector_size && sz > 0) {
// write EOF and trailing NULs in the final sector // write EOF and trailing NULs in the final sector
ferr = write_granule(img, g, i, (info->granule_sectors * info->sector_size - i - 1) % info->sector_size + 1, eof_buf); ferr = write_granule(img, g, i, (info->granule_sectors * info->sector_size - i - 1) % info->sector_size + 1, eof_buf);
if (ferr) if (ferr)

View File

@ -894,7 +894,7 @@ static imgtoolerr_t fat_readwrite_file(imgtool_partition *partition, fat_file *f
return fat_corrupt_file_error(file); return fat_corrupt_file_error(file);
offset = file->index % FAT_SECLEN; offset = file->index % FAT_SECLEN;
len = MIN(buffer_len, (size_t(FAT_SECLEN - offset))); len = MIN(buffer_len, FAT_SECLEN - offset);
/* read or write the data from the disk */ /* read or write the data from the disk */
if (read_or_write) if (read_or_write)
@ -1196,7 +1196,7 @@ static UINT8 fat_calc_filename_checksum(const UINT8 *short_filename)
static void fat_calc_dirent_lfnchecksum(UINT8 *entry, size_t entry_len) static void fat_calc_dirent_lfnchecksum(UINT8 *entry, size_t entry_len)
{ {
UINT8 checksum; UINT8 checksum;
size_t i; int i;
checksum = fat_calc_filename_checksum(entry + entry_len - FAT_DIRENT_SIZE); checksum = fat_calc_filename_checksum(entry + entry_len - FAT_DIRENT_SIZE);

View File

@ -337,7 +337,7 @@ enum
*/ */
static void mac_to_c_strncpy(char *dst, int n, UINT8 *src) static void mac_to_c_strncpy(char *dst, int n, UINT8 *src)
{ {
int len = src[0]; size_t len = src[0];
int i, j; int i, j;
i = j = 0; i = j = 0;
@ -554,11 +554,12 @@ static int mac_stricmp(const UINT8 *s1, const UINT8 *s2)
}; };
size_t common_len; size_t common_len;
int i;
int c1, c2; int c1, c2;
common_len = (s1[0] <= s2[0]) ? s1[0] : s2[0]; common_len = (s1[0] <= s2[0]) ? s1[0] : s2[0];
for (size_t i=0; i<common_len; i++) for (i=0; i<common_len; i++)
{ {
c1 = mac_char_sort_table[s1[i+1]]; c1 = mac_char_sort_table[s1[i+1]];
c2 = mac_char_sort_table[s2[i+1]]; c2 = mac_char_sort_table[s2[i+1]];
@ -1921,7 +1922,7 @@ static imgtoolerr_t mfs_dir_insert(struct mac_l2_imgref *l2_img, mfs_dirref *dir
dirref->index++; dirref->index++;
} }
if (new_dir_entry_len <= (size_t)(/*512*/510 - dirref->cur_offset)) if (new_dir_entry_len <= (/*512*/510 - dirref->cur_offset))
{ {
/*memcpy(cur_dir_entry, new_dir_entry, new_dir_entry_len);*/ /*memcpy(cur_dir_entry, new_dir_entry, new_dir_entry_len);*/
cur_dir_entry->flags = 0x80; cur_dir_entry->flags = 0x80;
@ -3176,7 +3177,7 @@ static imgtoolerr_t hfs_get_cat_record_data(struct mac_l2_imgref *l2_img, void *
lrec_key = (hfs_catKey*)rec_raw; lrec_key = (hfs_catKey*)rec_raw;
/* check that key is long enough to hold it all */ /* check that key is long enough to hold it all */
if ((size_t)(lrec_key->keyLen+1) < (offsetof(hfs_catKey, cName) + lrec_key->cName[0] + 1)) if ((lrec_key->keyLen+1) < (offsetof(hfs_catKey, cName) + lrec_key->cName[0] + 1))
return IMGTOOLERR_CORRUPTIMAGE; return IMGTOOLERR_CORRUPTIMAGE;
/* get pointer to record data */ /* get pointer to record data */

View File

@ -197,13 +197,13 @@ UINT8 get_free_file_id(psion_pack *pack)
void put_name_record(imgtool_stream *stream, const char* filename, UINT8 record_type, UINT8 record_id) void put_name_record(imgtool_stream *stream, const char* filename, UINT8 record_type, UINT8 record_id)
{ {
char data[0x10]; char data[0x10];
size_t i = 0; int i = 0;
data[i++] = 0x09; data[i++] = 0x09;
data[i++] = record_type; data[i++] = record_type;
// filename is 8 char long space filled // filename is 8 char long space filled
for (size_t j=0; j<8; j++) for (int j=0; j<8; j++)
if (j < strlen(filename)) if (j < strlen(filename))
data[i++] = filename[j]; data[i++] = filename[j];
else else
@ -314,7 +314,7 @@ UINT16 put_opl(imgtool_stream *instream, imgtool_stream *outstream)
while ((line = stream_getline(instream, 256))) while ((line = stream_getline(instream, 256)))
{ {
// replace tab with space // replace tab with space
for (size_t i=0; i<strlen(line); i++) for (int i=0; i<strlen(line); i++)
if (line[i] == '\t') line[i] = ' '; if (line[i] == '\t') line[i] = ' ';
stream_write(outstream, line, strlen(line)); stream_write(outstream, line, strlen(line));

View File

@ -232,8 +232,7 @@ static imgtoolerr_t vzdos_clear_dirent(imgtool_image *img, int index)
/* search the index for a directory entry */ /* search the index for a directory entry */
static imgtoolerr_t vzdos_searchentry(imgtool_image *image, const char *fname, int *entry) { static imgtoolerr_t vzdos_searchentry(imgtool_image *image, const char *fname, int *entry) {
int i, ret; int i, len, ret;
size_t len;
vzdos_dirent ent; vzdos_dirent ent;
char filename[9]; char filename[9];

View File

@ -170,7 +170,7 @@ static int drawgdi_window_draw(win_window_info *window, HDC dc, int update)
pitch = (width + 3) & ~3; pitch = (width + 3) & ~3;
// make sure our temporary bitmap is big enough // make sure our temporary bitmap is big enough
if ((size_t)(pitch * height * 4) > gdi->bmsize) if (pitch * height * 4 > gdi->bmsize)
{ {
gdi->bmsize = pitch * height * 4 * 2; gdi->bmsize = pitch * height * 4 * 2;
global_free_array(gdi->bmdata); global_free_array(gdi->bmdata);

View File

@ -383,7 +383,7 @@ int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count)
{ {
WCHAR wch; WCHAR wch;
count = MIN(count, (size_t)(IsDBCSLeadByte(*osdchar) ? 2 : 1)); count = MIN(count, IsDBCSLeadByte(*osdchar) ? 2 : 1);
if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0) if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0)
*uchar = wch; *uchar = wch;
else else

View File

@ -598,7 +598,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring &
{ {
const token_entry *curtoken; const token_entry *curtoken;
char *temp = srcptr; char *temp = srcptr;
size_t toklength; int toklength;
// find the end of the token // find the end of the token
while (*temp != 0 && is_token[(UINT8)*temp]) while (*temp != 0 && is_token[(UINT8)*temp])