Author: cwittich
Date: Thu Jan 24 21:29:50 2008
New Revision: 31976
URL:
http://svn.reactos.org/svn/reactos?rev=31976&view=rev
Log:
fix building with gcc 4.3.0
Modified:
trunk/reactos/base/applications/regedit/childwnd.c
trunk/reactos/base/applications/regedit/hexedit.c
Modified: trunk/reactos/base/applications/regedit/childwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/childwnd.c (original)
+++ trunk/reactos/base/applications/regedit/childwnd.c Thu Jan 24 21:29:50 2008
@@ -21,6 +21,7 @@
#include <regedit.h>
ChildWnd* g_pChildWnd;
+static int last_split;
HBITMAP SizingPattern = 0;
HBRUSH SizingBrush = 0;
static TCHAR Suggestions[256];
@@ -95,6 +96,24 @@
}
/*******************************************************************************
+ * finish_splitbar [internal]
+ *
+ * make the splitbar invisible and resize the windows
+ * (helper for ChildWndProc)
+ */
+static void finish_splitbar(HWND hWnd, int x)
+{
+ RECT rt;
+
+ draw_splitbar(hWnd, last_split);
+ last_split = -1;
+ GetClientRect(hWnd, &rt);
+ g_pChildWnd->nSplitPos = x;
+ ResizeWnd(g_pChildWnd, rt.right, rt.bottom);
+ ReleaseCapture();
+}
+
+/*******************************************************************************
*
* FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
*
@@ -305,7 +324,6 @@
*/
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- static int last_split;
BOOL Result;
ChildWnd* pChildWnd = g_pChildWnd;
@@ -376,10 +394,9 @@
break;
case WM_LBUTTONDOWN: {
RECT rt;
- POINTS pt;
- pt = MAKEPOINTS(lParam);
+ int x = (short)LOWORD(lParam);
GetClientRect(hWnd, &rt);
- if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
+ if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 &&
x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
last_split = pChildWnd->nSplitPos;
draw_splitbar(hWnd, last_split);
SetCapture(hWnd);
@@ -388,17 +405,9 @@
}
case WM_LBUTTONUP:
+ case WM_RBUTTONDOWN:
if (GetCapture() == hWnd) {
- RECT rt;
- POINTS pt;
- pt = MAKEPOINTS(lParam);
- GetClientRect(hWnd, &rt);
- pt.x = (SHORT) min(max(pt.x, SPLIT_MIN), rt.right - SPLIT_MIN);
- draw_splitbar(hWnd, last_split);
- last_split = -1;
- pChildWnd->nSplitPos = pt.x;
- ResizeWnd(pChildWnd, rt.right, rt.bottom);
- ReleaseCapture();
+ finish_splitbar(hWnd, LOWORD(lParam));
}
break;
@@ -425,7 +434,7 @@
HDC hdc;
RECT rt;
HGDIOBJ OldObj;
- POINTS pt;
+ int x = LOWORD(lParam);
if(!SizingPattern)
{
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
@@ -436,19 +445,18 @@
SizingBrush = CreatePatternBrush(SizingPattern);
}
- pt = MAKEPOINTS(lParam);
GetClientRect(hWnd, &rt);
- pt.x = (SHORT) min(max(pt.x, SPLIT_MIN), rt.right - SPLIT_MIN);
- if(last_split != pt.x)
+ x = (SHORT) min(max(x, SPLIT_MIN), rt.right - SPLIT_MIN);
+ if(last_split != x)
{
rt.left = last_split-SPLIT_WIDTH/2;
rt.right = last_split+SPLIT_WIDTH/2+1;
hdc = GetDC(hWnd);
OldObj = SelectObject(hdc, SizingBrush);
PatBlt(hdc, rt.left, rt.top, rt.right - rt.left, rt.bottom - rt.top,
PATINVERT);
- last_split = pt.x;
- rt.left = pt.x-SPLIT_WIDTH/2;
- rt.right = pt.x+SPLIT_WIDTH/2+1;
+ last_split = x;
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
PatBlt(hdc, rt.left, rt.top, rt.right - rt.left, rt.bottom - rt.top,
PATINVERT);
SelectObject(hdc, OldObj);
ReleaseDC(hWnd, hdc);
@@ -575,7 +583,8 @@
{
int i, cnt;
BOOL IsDefault;
- pt = MAKEPOINTS(lParam);
+ pt.x = LOWORD(lParam);
+ pt.y = HIWORD(lParam);
cnt = ListView_GetSelectedCount(pChildWnd->hListWnd);
i = ListView_GetNextItem(pChildWnd->hListWnd, -1, LVNI_FOCUSED |
LVNI_SELECTED);
FixPointIfContext(&pt, pChildWnd->hListWnd);
@@ -612,7 +621,8 @@
int iLastPos;
WORD wID;
- pt = MAKEPOINTS(lParam);
+ pt.x = LOWORD(lParam);
+ pt.y = HIWORD(lParam);
hti.pt.x = pt.x;
hti.pt.y = pt.y;
ScreenToClient(pChildWnd->hTreeWnd, &hti.pt);
Modified: trunk/reactos/base/applications/regedit/hexedit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/hexedit.c (original)
+++ trunk/reactos/base/applications/regedit/hexedit.c Thu Jan 24 21:29:50 2008
@@ -869,6 +869,7 @@
HexEditWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PHEXEDIT_DATA hed;
+ POINTS p;
hed = (PHEXEDIT_DATA)(LONG_PTR)GetWindowLongPtr(hWnd, (DWORD_PTR)0);
switch(uMsg)
@@ -889,7 +890,11 @@
return HEXEDIT_WM_SIZE(hed, (DWORD)wParam, LOWORD(lParam), HIWORD(lParam));
case WM_LBUTTONDOWN:
- return HEXEDIT_WM_LBUTTONDOWN(hed, (INT)wParam, MAKEPOINTS(lParam));
+ {
+ p.x = LOWORD(lParam);
+ p.y = HIWORD(lParam);
+ return HEXEDIT_WM_LBUTTONDOWN(hed, (INT)wParam, p);
+ }
case WM_MOUSEWHEEL:
{
@@ -900,7 +905,9 @@
delta -= (SHORT)HIWORD(wParam);
if(abs(delta) >= WHEEL_DELTA && nScrollLines != 0)
{
- return HEXEDIT_WM_MOUSEWHEEL(hed, nScrollLines * (delta / WHEEL_DELTA),
LOWORD(wParam), &MAKEPOINTS(lParam));
+ p.x = LOWORD(lParam);
+ p.y = HIWORD(lParam);
+ return HEXEDIT_WM_MOUSEWHEEL(hed, nScrollLines * (delta / WHEEL_DELTA),
LOWORD(wParam), &p);
}
break;
}