diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 2df5b6e1b39..1dcb8e49a20 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -117,7 +117,7 @@ UINT8 devcb_stub(device_t *device, offs_t offset) // static template for a read16 stub function that calls through a given READ16_MEMBER template -UINT16 devcb_stub16(device_t *device, offs_t offset, UINT16 mask=0xffff) +UINT16 devcb_stub16(device_t *device, offs_t offset, UINT16 mask) { _Class *target = downcast<_Class *>(device); return (target->*_Function)(*device->machine().memory().first_space(), offset, mask); @@ -141,7 +141,7 @@ void devcb_stub(device_t *device, offs_t offset, UINT8 data) // static template for a write16 stub function that calls through a given WRITE16_MEMBER template -void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask=0xffff) +void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask) { _Class *target = downcast<_Class *>(device); (target->*_Function)(*device->machine().memory().first_space(), offset, data, mask); diff --git a/src/lib/formats/adam_cas.c b/src/lib/formats/adam_cas.c index 521d2c9c1e1..1e8e328b517 100644 --- a/src/lib/formats/adam_cas.c +++ b/src/lib/formats/adam_cas.c @@ -58,7 +58,7 @@ static casserr_t coladam_ddp_identify ( cassette_image *cass, struct CassetteOpt // Store byte of data casserr_t coladam_put_byte(cassette_image *cass, int channel, double *time_index, int byte, int *prev_sign) { - casserr_t err; + casserr_t err = CASSETTE_ERROR_SUCCESS; for (int i = 0; i < 8; i++) { if(byte & 0x80) @@ -127,7 +127,7 @@ static casserr_t coladam_ddp_load( cassette_image *cass ) double time = 0.; int i, block, prev_sign=-1; UINT8 buffer[0x400]; - casserr_t err; + casserr_t err = CASSETTE_ERROR_SUCCESS; // It would appear that data packs that originally had the type GW data layout and headers work fine when converted to type // HE. Thus we set all tapes to type HE. @@ -194,10 +194,7 @@ static casserr_t coladam_ddp_load( cassette_image *cass ) } } - if (err) - return err; - - return CASSETTE_ERROR_SUCCESS; + return err; } diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index bb551aeb5dd..c416d2c4ca0 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -1162,7 +1162,7 @@ UINT32 floppy_image_format_t::bitn_r(const UINT32 *buffer, int offset, int count { UINT32 r = 0; for(int i=0; imachine().driver_data(); - int clock = (data & 0x40); + bool clock = (data & 0x40) != 0; int datline = (data & 0x80); //Unlike MPU4, this uses positive transitions on both lines, so this may be a similar, but not identical component diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c index ce1f5ae7760..3043d767885 100644 --- a/src/mame/drivers/igs017.c +++ b/src/mame/drivers/igs017.c @@ -1854,8 +1854,8 @@ READ16_MEMBER(igs017_state::lhzb2a_magic_r) { case 0x03: { - UINT8 a = BITSWAP8(m_prot[0], 9,9,1,9,2,5,4,7); // 9 means 0 value - UINT8 b = BITSWAP8(m_prot[1], 5,2,9,7,9,9,9,9); + UINT8 a = BITSWAP8((UINT16)m_prot[0], 9,9,1,9,2,5,4,7); // 9 means 0 value + UINT8 b = BITSWAP8((UINT16)m_prot[1], 5,2,9,7,9,9,9,9); return a | b; } diff --git a/src/mame/video/galaxia.c b/src/mame/video/galaxia.c index 09a58dd95da..7afe14c01af 100644 --- a/src/mame/video/galaxia.c +++ b/src/mame/video/galaxia.c @@ -210,7 +210,7 @@ SCREEN_UPDATE_IND16( astrowar ) { // NOTE: similar to zac2650.c, the sprite chip runs at a different frequency than the background generator // the exact timing ratio is unknown, so we'll have to do with guesswork - float s_ratio = 256.0 / 196.0; + float s_ratio = 256.0f / 196.0f; float sx = x * s_ratio; if ((int)(sx + 0.5) > cliprect.max_x) diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c index c68ad1915a7..e1a11e21737 100644 --- a/src/mame/video/gticlub.c +++ b/src/mame/video/gticlub.c @@ -1,3 +1,4 @@ +#include #include "emu.h" #include "cpu/sharc/sharc.h" #include "machine/konppc.h" @@ -564,7 +565,7 @@ static void draw_scanline_2d(void *dest, INT32 scanline, const poly_extent *exte if (color & 0xff000000) { fb[x] = color; - zb[x] = 0x7fffffff; // FIXME + zb[x] = FLT_MAX; // FIXME } } } @@ -609,7 +610,7 @@ static void draw_scanline_2d_tex(void *dest, INT32 scanline, const poly_extent * if (color & 0xff000000) { fb[x] = color; - zb[x] = 0x7fffffff; // FIXME + zb[x] = FLT_MAX; // FIXME } u += du; diff --git a/src/mame/video/rdptpipe.c b/src/mame/video/rdptpipe.c index 64067e6b599..df412614ff5 100644 --- a/src/mame/video/rdptpipe.c +++ b/src/mame/video/rdptpipe.c @@ -1372,7 +1372,7 @@ UINT32 N64TexturePipeT::Fetch(INT32 s, INT32 t, INT32 tilenum, const rdp_poly_st tbase += tile[tilenum].tmem; UINT32 tpal = tile[tilenum].palette; - UINT32 index = (tformat << 4) | (tsize << 2) | (object.OtherModes.en_tlut << 1) | object.OtherModes.tlut_type; + UINT32 index = (tformat << 4) | (tsize << 2) | ((UINT32) object.OtherModes.en_tlut << 1) | (UINT32) object.OtherModes.tlut_type; return ((this)->*(TexelFetch[index]))(s, t, tbase, tpal, userdata); }