diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index d5254736b24..1d459dd2d87 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -340,7 +340,7 @@ static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *ver HWND hwnd; POINT point; RECT rect; - long x,y; + int x,y; CONV_LPARAMTOPOINT(lParam, &point); ClientToScreen(hDlg, &point); @@ -353,10 +353,8 @@ static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *ver GetClientRect(hwnd, &rect); ScreenToClient(hwnd, &point); - x = (long) point.x * MAXHORI; - x /= rect.right; - y = (long) (rect.bottom - point.y) * MAXVERT; - y /= rect.bottom; + x = (point.x * MAXHORI) / rect.right; + y = ((rect.bottom - point.y) * MAXVERT) / rect.bottom; if (x < 0) x = 0; if (y < 0) y = 0; @@ -398,7 +396,6 @@ static BOOL CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) static int CC_CheckDigitsInEdit( HWND hwnd, int maxval ) { int i, k, m, result, value; - long editpos; char buffer[30]; GetWindowTextA(hwnd, buffer, ARRAY_SIZE(buffer)); @@ -425,7 +422,7 @@ static int CC_CheckDigitsInEdit( HWND hwnd, int maxval ) } if (result) { - editpos = SendMessageA(hwnd, EM_GETSEL, 0, 0); + LRESULT editpos = SendMessageA(hwnd, EM_GETSEL, 0, 0); SetWindowTextA(hwnd, buffer ); SendMessageA(hwnd, EM_SETSEL, 0, editpos); } @@ -465,7 +462,7 @@ static void CC_PaintSelectedColor(const CCPRIV *infoPtr) static void CC_PaintTriangle(CCPRIV *infoPtr) { HDC hDC; - long temp; + int temp; int w = LOWORD(GetDialogBaseUnits()) / 2; POINT points[3]; int height; @@ -485,9 +482,9 @@ static void CC_PaintTriangle(CCPRIV *infoPtr) ScreenToClient(infoPtr->hwndSelf, points); /* |< | */ oben = points[0].y; /* | \ | */ /* | \| */ - temp = (long)height * (long)infoPtr->l; + temp = height * infoPtr->l; points[0].x += 1; - points[0].y = oben + height - temp / (long)MAXVERT; + points[0].y = oben + height - temp / MAXVERT; points[1].y = points[0].y + w; points[2].y = points[0].y - w; points[2].x = points[1].x = points[0].x + w; @@ -536,8 +533,8 @@ static void CC_PaintCross(CCPRIV *infoPtr) SelectClipRgn(hDC, region); DeleteObject(region); - point.x = ((long)rect.right * (long)x) / (long)MAXHORI; - point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT; + point.x = (rect.right * x) / MAXHORI; + point.y = rect.bottom - (rect.bottom * y) / MAXVERT; if ( infoPtr->oldcross.left != infoPtr->oldcross.right ) BitBlt(hDC, infoPtr->oldcross.left, infoPtr->oldcross.top, infoPtr->oldcross.right - infoPtr->oldcross.left,