Fixed a bunch of warnings in MSVC.

This commit is contained in:
James Touton 2015-08-06 01:37:58 -07:00
parent f35cb736c7
commit c92feaf767
7 changed files with 25 additions and 25 deletions

View File

@ -349,7 +349,7 @@ void ADBInterrupt(void)
if (relative_mouse) {
// Mouse movement (relative) and buttons
if (mx != 0 || my != 0 || mb[0] != old_mouse_button[0] || mb[1] != old_mouse_button[1] || mb[2] != old_mouse_button[2]) {
if (mx != 0 || my != 0 || !!mb[0] != old_mouse_button[0] || !!mb[1] != old_mouse_button[1] || !!mb[2] != old_mouse_button[2]) {
// Call mouse ADB handler
if (mouse_reg_3[1] == 4) {
@ -371,9 +371,9 @@ void ADBInterrupt(void)
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
Execute68k(r.a[1], &r);
old_mouse_button[0] = mb[0];
old_mouse_button[1] = mb[1];
old_mouse_button[2] = mb[2];
old_mouse_button[0] = mb[0] != 0;
old_mouse_button[1] = mb[1] != 0;
old_mouse_button[2] = mb[2] != 0;
}
} else {
@ -406,7 +406,7 @@ void ADBInterrupt(void)
}
// Send mouse button events
if (mb[0] != old_mouse_button[0] || mb[1] != old_mouse_button[1] || mb[2] != old_mouse_button[2]) {
if (!!mb[0] != old_mouse_button[0] || !!mb[1] != old_mouse_button[1] || !!mb[2] != old_mouse_button[2]) {
uint32 mouse_base = adb_base + 16;
// Call mouse ADB handler
@ -429,9 +429,9 @@ void ADBInterrupt(void)
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
Execute68k(r.a[1], &r);
old_mouse_button[0] = mb[0];
old_mouse_button[1] = mb[1];
old_mouse_button[2] = mb[2];
old_mouse_button[0] = mb[0] != 0;
old_mouse_button[1] = mb[1] != 0;
old_mouse_button[2] = mb[2] != 0;
}
}

View File

@ -557,7 +557,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
}
case 76: // ModifyPostEvent
info->mount_non_hfs = ReadMacInt16(pb + csParam);
info->mount_non_hfs = ReadMacInt16(pb + csParam) != 0;
return noErr;
case 79: { // Change block size
@ -792,7 +792,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
return paramErr;
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6))) {
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6) != 0)) {
return paramErr;
} else {
return noErr;
@ -944,7 +944,7 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
if (ReadMacInt16(pb + csParam) > 0) {
uint32 adr = ReadMacInt32(pb + csParam + 2);
WriteMacInt16(pb + csParam, 1); // 1 format
WriteMacInt32(adr, SysGetFileSize(info->fh) / 512); // Number of blocks
WriteMacInt32(adr, uint32(SysGetFileSize(info->fh) / 512)); // Number of blocks
WriteMacInt32(adr + 4, 0); // heads/track/sectors
return noErr;
} else {

View File

@ -200,7 +200,7 @@ bool DiskMountVolume(void *fh)
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0);
find_hfs_partition(*info);
if (info->start_byte == 0)
info->num_blocks = SysGetFileSize(info->fh) / 512;
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
WriteMacInt16(info->status + dsDriveSize, info->num_blocks & 0xffff);
WriteMacInt16(info->status + dsDriveS1, info->num_blocks >> 16);
info->to_be_mounted = true;
@ -288,7 +288,7 @@ int16 DiskOpen(uint32 pb, uint32 dce)
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0x80 : 0);
find_hfs_partition(*info);
if (info->start_byte == 0)
info->num_blocks = SysGetFileSize(info->fh) / 512;
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
info->to_be_mounted = true;
}
D(bug(" %d blocks\n", info->num_blocks));

View File

@ -111,7 +111,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
}
case M68K_EMUL_OP_CLKNOMEM: { // Clock/PRAM operations
bool is_read = r->d[1] & 0x80;
bool is_read = (r->d[1] & 0x80) != 0;
if ((r->d[1] & 0x78) == 0x38) {
// XPRAM
uint8 reg = (r->d[1] << 5) & 0xe0 | (r->d[1] >> 10) & 0x1f;

View File

@ -334,7 +334,7 @@ static void pstrcpy(char *dst, const char *src)
// Convert C string to pascal string
static void cstr2pstr(char *dst, const char *src)
{
*dst++ = strlen(src);
*dst++ = char(strlen(src));
char c;
while ((c = *src++) != 0) {
// Note: we are converting host ':' characters to Mac '/' characters here
@ -2158,7 +2158,7 @@ static int16 fs_get_wd_info(uint32 pb, uint32 vcb)
int16 ExtFSHFS(uint32 vcb, uint16 selectCode, uint32 paramBlock, uint32 globalsPtr, int16 fsid)
{
uint16 trapWord = selectCode & 0xf0ff;
bool hfs = selectCode & kHFSMask;
bool hfs = (selectCode & kHFSMask) != 0;
switch (trapWord) {
case kFSMOpen:
return fs_open(paramBlock, hfs ? ReadMacInt32(paramBlock + ioDirID) : 0, vcb, false);

View File

@ -177,7 +177,7 @@ bool InitAll(const char *vmdir)
XPRAM[0x56] = 0x42; // 'B'
XPRAM[0x57] = 0x32; // '2'
const monitor_desc &main_monitor = *VideoMonitors[0];
XPRAM[0x58] = main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth);
XPRAM[0x58] = uint8(main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth));
XPRAM[0x59] = 0;
#if EMULATED_68K

View File

@ -86,7 +86,7 @@ static void Long(uint32 data)
static void Word(uint16 data)
{
srom[p++] = data >> 8;
srom[p++] = data;
srom[p++] = uint8(data);
}
static void String(const char *str)
@ -98,7 +98,7 @@ static void String(const char *str)
static void PString(const char *str)
{
srom[p++] = strlen(str);
srom[p++] = uint8(strlen(str));
while ((srom[p++] = *str++) != 0) ;
p--;
if (p & 1)
@ -211,17 +211,17 @@ static uint32 VMonitor(const monitor_desc &m, uint32 videoType, uint32 videoName
Offs(0x40, gammaDir); // Gamma directory
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in
if (m.has_depth(VDEPTH_1BIT))
Offs(m.depth_to_apple_mode(VDEPTH_1BIT), vidMode1); // Video mode parameters for 1 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_1BIT)), vidMode1); // Video mode parameters for 1 bit
if (m.has_depth(VDEPTH_2BIT))
Offs(m.depth_to_apple_mode(VDEPTH_2BIT), vidMode2); // Video mode parameters for 2 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_2BIT)), vidMode2); // Video mode parameters for 2 bit
if (m.has_depth(VDEPTH_4BIT))
Offs(m.depth_to_apple_mode(VDEPTH_4BIT), vidMode4); // Video mode parameters for 4 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_4BIT)), vidMode4); // Video mode parameters for 4 bit
if (m.has_depth(VDEPTH_8BIT))
Offs(m.depth_to_apple_mode(VDEPTH_8BIT), vidMode8); // Video mode parameters for 8 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_8BIT)), vidMode8); // Video mode parameters for 8 bit
if (m.has_depth(VDEPTH_16BIT))
Offs(m.depth_to_apple_mode(VDEPTH_16BIT), vidMode16); // Video mode parameters for 16 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_16BIT)), vidMode16); // Video mode parameters for 16 bit
if (m.has_depth(VDEPTH_32BIT))
Offs(m.depth_to_apple_mode(VDEPTH_32BIT), vidMode32); // Video mode parameters for 32 bit
Offs(uint8(m.depth_to_apple_mode(VDEPTH_32BIT)), vidMode32); // Video mode parameters for 32 bit
EndOfList();
return ret;
}