compilation fixes for mingw64 gcc

This commit is contained in:
Stanislav Shwartsman 2010-11-01 15:02:14 +00:00
parent 8d46433679
commit d9734249b9
2 changed files with 16 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: win32.cc,v 1.140 2010-05-24 22:06:17 vruppert Exp $
// $Id: win32.cc,v 1.141 2010-11-01 15:02:14 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2009 The Bochs Project
@ -768,7 +768,8 @@ void resize_main_window()
mainStyle &= ~(WS_CAPTION | WS_BORDER);
SetWindowLong(stInfo.mainWnd, GWL_STYLE, mainStyle);
// maybe need to adjust stInfo.simWnd here also?
if (saveParent = SetParent(stInfo.mainWnd, desktopWindow)) {
saveParent = SetParent(stInfo.mainWnd, desktopWindow);
if (saveParent) {
BX_DEBUG(("Saved parent window"));
SetWindowPos(stInfo.mainWnd, HWND_TOPMOST, desktop.left, desktop.top,
desktop.right, desktop.bottom, SWP_SHOWWINDOW);
@ -871,7 +872,7 @@ VOID CDECL UIThread(PVOID pvoid)
for (elements = BX_SB_TEXT_ELEMENTS; elements < (BX_MAX_STATUSITEMS+BX_SB_TEXT_ELEMENTS); elements++)
SB_Edges[elements] = SB_Edges[elements-1] + SIZE_OF_SB_ELEMENT;
SB_Edges[elements] = -1;
SendMessage(hwndSB, SB_SETPARTS, BX_MAX_STATUSITEMS+BX_SB_TEXT_ELEMENTS+1, (long)&SB_Edges);
SendMessage(hwndSB, SB_SETPARTS, BX_MAX_STATUSITEMS+BX_SB_TEXT_ELEMENTS+1, (LPARAM)&SB_Edges);
}
SetStatusText(0, szMouseEnable, TRUE);
@ -951,14 +952,14 @@ void SetStatusText(int Num, const char *Text, bx_bool active, bx_bool w)
if ((Num < BX_SB_TEXT_ELEMENTS) || (Num > (BX_MAX_STATUSITEMS+BX_SB_TEXT_ELEMENTS))) {
StatText[0] = ' '; // Add space to text in 1st and last items
lstrcpy(StatText+1, Text);
SendMessage(hwndSB, SB_SETTEXT, Num, (long)StatText);
SendMessage(hwndSB, SB_SETTEXT, Num, (LPARAM)StatText);
} else {
StatText[0] = 9; // Center the rest
lstrcpy(StatText+1, Text);
lstrcpy(SB_Text[Num-BX_SB_TEXT_ELEMENTS], StatText);
SB_Active[Num-BX_SB_TEXT_ELEMENTS] = active;
SB_ActiveW[Num-BX_SB_TEXT_ELEMENTS] = w;
SendMessage(hwndSB, SB_SETTEXT, Num | SBT_OWNERDRAW, (long)SB_Text[Num-BX_SB_TEXT_ELEMENTS]);
SendMessage(hwndSB, SB_SETTEXT, Num | SBT_OWNERDRAW, (LPARAM)SB_Text[Num-BX_SB_TEXT_ELEMENTS]);
}
UpdateWindow(hwndSB);
}
@ -2018,7 +2019,7 @@ unsigned bx_win32_gui_c::create_bitmap(const unsigned char *bmap, unsigned xdim,
bx_bitmaps[bx_bitmap_entries].ydim = ydim;
tbab.hInst = NULL;
tbab.nID = (UINT)bx_bitmaps[bx_bitmap_entries].bmap;
tbab.nID = (UINT_PTR)bx_bitmaps[bx_bitmap_entries].bmap;
SendMessage(hwndTB, TB_ADDBITMAP, 1, (LPARAM)&tbab);
bx_bitmap_entries++;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: win32paramdlg.cc,v 1.16 2010-04-22 17:30:11 sshwarts Exp $
// $Id: win32paramdlg.cc,v 1.17 2010-11-01 15:02:14 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 Volker Ruppert
@ -268,7 +268,7 @@ HWND CreateLabel(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, const cha
r.bottom = r.top + 15;
MapDialogRect(hDlg, &r);
Label = CreateWindow("STATIC", text, WS_CHILD, r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
SendMessage(Label, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Label, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Label, hide ? SW_HIDE : SW_SHOW);
return Label;
}
@ -291,7 +291,7 @@ HWND CreateGroupbox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, SIZE size, BOOL h
}
Groupbox = CreateWindow("BUTTON", title, BS_GROUPBOX | WS_CHILD, r.left, r.top,
r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
SendMessage(Groupbox, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Groupbox, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Groupbox, hide ? SW_HIDE : SW_SHOW);
return Groupbox;
}
@ -321,7 +321,7 @@ HWND CreateTabControl(HWND hDlg, UINT cid, UINT xpos, UINT ypos, SIZE size, BOOL
}
}
TabCtrl_SetCurSel(TabControl, 0);
SendMessage(TabControl, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(TabControl, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(TabControl, hide ? SW_HIDE : SW_SHOW);
return TabControl;
}
@ -340,7 +340,7 @@ HWND CreateBrowseButton(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide)
r.bottom = r.top + 14;
MapDialogRect(hDlg, &r);
Button = CreateWindow("BUTTON", "Browse...", WS_CHILD, r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
SendMessage(Button, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Button, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Button, hide ? SW_HIDE : SW_SHOW);
return Button;
}
@ -362,7 +362,7 @@ HWND CreateCheckbox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_par
hDlg, (HMENU)code, NULL, NULL);
val = bparam->get();
SendMessage(Checkbox, BM_SETCHECK, val ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessage(Checkbox, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Checkbox, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Checkbox, hide ? SW_HIDE : SW_SHOW);
return Checkbox;
}
@ -432,7 +432,7 @@ HWND CreateInput(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_param_
(int)nparam->get_max(), (int)nparam->get_min(), (int)nparam->get());
ShowWindow(Updown, hide ? SW_HIDE : SW_SHOW);
}
SendMessage(Input, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Input, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Input, hide ? SW_HIDE : SW_SHOW);
return Input;
}
@ -459,7 +459,7 @@ HWND CreateCombobox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_par
j++;
} while (choice != NULL);
SendMessage(Combo, CB_SETCURSEL, (WPARAM)(eparam->get()-eparam->get_min()), 0);
SendMessage(Combo, WM_SETFONT, (UINT)DlgFont, TRUE);
SendMessage(Combo, WM_SETFONT, (WPARAM)DlgFont, TRUE);
ShowWindow(Combo, hide ? SW_HIDE : SW_SHOW);
return Combo;
}
@ -822,7 +822,7 @@ static BOOL CALLBACK ParamDlgProc(HWND Window, UINT AMessage, WPARAM wParam, LPA
break;
case WM_CTLCOLOREDIT:
SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
return (long)GetSysColorBrush(COLOR_WINDOW);
return (GetSysColorBrush(COLOR_WINDOW) != NULL);
break;
}
return 0;