Fixed some gcc 4.8.1 warnings

This commit is contained in:
Volker Ruppert 2013-10-27 15:13:19 +00:00
parent 66b311a8a6
commit 7f19435887
10 changed files with 19 additions and 20 deletions

View File

@ -162,8 +162,8 @@ static char rfbPalette[256];
static unsigned rfbWindowX, rfbWindowY;
static unsigned rfbDimensionX, rfbDimensionY;
static long rfbHeaderbarY;
static long rfbTileX = 0;
static long rfbTileY = 0;
static unsigned rfbTileX = 0;
static unsigned rfbTileY = 0;
static unsigned long rfbCursorX = 0;
static unsigned long rfbCursorY = 0;
static unsigned long rfbOriginLeft = 0;
@ -1290,10 +1290,10 @@ void UpdateScreen(unsigned char *newBits, int x, int y, int width, int height,
int i, x0, y0;
x0 = x;
y0 = y;
if ((x + width - 1) >= rfbWindowX) {
if ((unsigned)(x + width - 1) >= rfbWindowX) {
width = rfbWindowX - x + 1;
}
if ((y + height - 1) >= rfbWindowY) {
if ((unsigned)(y + height - 1) >= rfbWindowY) {
height = rfbWindowY - y + 1;
}
for (i = 0; i < height; i++) {

View File

@ -1048,7 +1048,7 @@ void bx_sdl_gui_c::handle_events(void)
new_mousebuttons &= 0x07;
// send motion information
if (sdl_mouse_mode_absxy) {
if ((new_mousey >= headerbar_height) && (new_mousey < (res_y + headerbar_height))) {
if ((new_mousey >= headerbar_height) && (new_mousey < (int)(res_y + headerbar_height))) {
dx = new_mousex * 0x7fff / res_x;
dy = (new_mousey - headerbar_height) * 0x7fff / res_y;
DEV_mouse_motion(dx, dy, wheel_status, new_mousebuttons, 1);

View File

@ -979,10 +979,10 @@ void UpdateScreen(rfbPixel *newBits, int x, int y, int width, int height)
int i, x0, y0;
x0 = x;
y0 = y;
if ((x + width - 1) >= rfbWindowX) {
if ((unsigned)(x + width - 1) >= rfbWindowX) {
width = rfbWindowX - x + 1;
}
if ((y + height - 1) >= rfbWindowY) {
if ((unsigned)(y + height - 1) >= rfbWindowY) {
height = rfbWindowY - y + 1;
}
for (i = 0; i < height; i++) {

View File

@ -999,7 +999,7 @@ static INT_PTR CALLBACK ParamDlgProc(HWND Window, UINT AMessage, WPARAM wParam,
EndDialog(Window, 1);
break;
default:
if ((code >= ID_BROWSE) && (code < (int)(ID_BROWSE + nextDlgID))) {
if ((code >= ID_BROWSE) && (code < (ID_BROWSE + nextDlgID))) {
i = (UINT)(code - ID_BROWSE);
sparam = (bx_param_string_c *)findParamFromDlgID(i);
if (sparam != NULL) {
@ -1010,7 +1010,7 @@ static INT_PTR CALLBACK ParamDlgProc(HWND Window, UINT AMessage, WPARAM wParam,
SetFocus(GetDlgItem(Window, ID_PARAM + i));
}
}
} else if ((code >= ID_PARAM) && (code < (int)(ID_PARAM + nextDlgID))) {
} else if ((code >= ID_PARAM) && (code < (ID_PARAM + nextDlgID))) {
i = (UINT)(code - ID_PARAM);
param = findParamFromDlgID(i);
if (param != NULL) {

View File

@ -399,7 +399,7 @@ void bx_vgacore_c::determine_screen_dimensions(unsigned *piHeight, unsigned *piW
{
int ai[0x20];
int i,h,v;
for (i = 0 ; i < 0x20 ; i++)
for (i = 0 ; i < 0x19 ; i++)
ai[i] = BX_VGA_THIS s.CRTC.reg[i];
h = (ai[1] + 1) * 8;

View File

@ -48,7 +48,6 @@ extern "C" {
static BOOL isWindowsXP;
static BOOL isOldWindows;
static UINT cdromCount = 0;
#define BX_CD_FRAMESIZE 2048
#define CD_FRAMESIZE 2048
@ -230,7 +229,7 @@ bx_bool cdrom_interface::read_toc(Bit8u* buf, int* length, bx_bool msf, int star
// We have to allocate a chunk of memory to make sure it is aligned on a sector base.
UCHAR *data = (UCHAR *) VirtualAlloc(NULL, 2048*2, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
unsigned long iBytesReturned;
DWORD iBytesReturned;
DeviceIoControl(hFile, IOCTL_CDROM_READ_TOC_EX, &input, sizeof(input), data, 804, &iBytesReturned, NULL);
// now copy it to the users buffer and free our buffer
*length = data[1] + (data[0] << 8) + 2;
@ -298,7 +297,7 @@ bx_bool BX_CPP_AttrRegparmN(3) cdrom_interface::read_block(Bit8u* buf, Bit32u lb
if ((pos.LowPart == 0xffffffff) && (GetLastError() != NO_ERROR)) {
BX_PANIC(("cdrom: read_block: SetFilePointer returned error."));
} else {
ReadFile(hFile, (void *) buf1, BX_CD_FRAMESIZE, (unsigned long *) &n, NULL);
ReadFile(hFile, (void *) buf1, BX_CD_FRAMESIZE, (LPDWORD) &n, NULL);
}
}
} while ((n != BX_CD_FRAMESIZE) && (--try_count > 0));

View File

@ -767,8 +767,8 @@ void bx_es1370_c::sendwavepacket(unsigned channel, Bit32u buflen, Bit8u *buffer)
}
bits = (format >> 1) ? 16 : 8;
Bit8u temparray[12] =
{ samplerate & 0xff, samplerate >> 8, 0, 0,
bits, (format & 1) + 1, 0, 0, 0, 0, 0, 0 };
{ (Bit8u)(samplerate & 0xff), (Bit8u)(samplerate >> 8), 0, 0,
bits, (Bit8u)((format & 1) + 1), 0, 0, 0, 0, 0, 0 };
if (bits == 16)
temparray[6] = 4;

View File

@ -970,7 +970,7 @@ void bx_sb16_c::dsp_datawrite(Bit32u value)
// only handled for VOC output so far
if (BX_SB16_THIS wavemode == 2)
{
Bit8u temparray[3] = { length & 0xff, length >> 8, DSP.dma.timeconstant >> 8 };
Bit8u temparray[3] = { (Bit8u)(length & 0xff), (Bit8u)(length >> 8), (Bit8u)(DSP.dma.timeconstant >> 8) };
DEV_soundmod_VOC_write_block(WAVEDATA, 3, 3, temparray, 0, NULL);
}
break;
@ -1425,8 +1425,8 @@ void bx_sb16_c::dsp_sendwavepacket()
break;
case 2:
Bit8u temparray[12] =
{ DSP.dma.samplerate & 0xff, DSP.dma.samplerate >> 8, 0, 0,
DSP.dma.bits, DSP.dma.stereo + 1, 0, 0, 0, 0, 0, 0 };
{ (Bit8u)(DSP.dma.samplerate & 0xff), (Bit8u)(DSP.dma.samplerate >> 8), 0, 0,
(Bit8u)DSP.dma.bits, (Bit8u)(DSP.dma.stereo + 1), 0, 0, 0, 0, 0, 0 };
switch ((DSP.dma.format >> 1) & 7)
{
case 2:

View File

@ -329,7 +329,7 @@ void bx_usb_xhci_c::reset_hc()
BX_XHCI_THIS hub.op_regs.HcStatus.hch = 1;
// Page Size
BX_XHCI_THIS hub.op_regs.HcPageSize.pagesize = PAGE_SIZE;
BX_XHCI_THIS hub.op_regs.HcPageSize.pagesize = XHCI_PAGE_SIZE;
// Device Notification Control Register
BX_XHCI_THIS hub.op_regs.HcNotification.RsvdP = 0;

View File

@ -76,7 +76,7 @@
#define EXT_CAPS_OFFSET 0x500
#define EXT_CAPS_SIZE 48
#define PAGE_SIZE 1 // Page size operational register value
#define XHCI_PAGE_SIZE 1 // Page size operational register value
#define PORT_SET_OFFSET (0x400 + OPS_REGS_OFFSET)
#define RUNTIME_OFFSET 0x600