Commit 6bd43fbb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/monthcal: Some cleanup to avoid cast in helpers.

parent decc86ad
...@@ -91,7 +91,7 @@ typedef struct ...@@ -91,7 +91,7 @@ typedef struct
int height_increment; int height_increment;
int width_increment; int width_increment;
int firstDayplace; /* place of the first day of the current month */ int firstDayplace; /* place of the first day of the current month */
int delta; /* scroll rate; # of months that the */ INT delta; /* scroll rate; # of months that the */
/* control moves when user clicks a scroll button */ /* control moves when user clicks a scroll button */
int visible; /* # of months visible */ int visible; /* # of months visible */
int firstDay; /* Start month calendar with firstDay's day */ int firstDay; /* Start month calendar with firstDay's day */
...@@ -166,7 +166,7 @@ static inline BOOL MONTHCAL_IsDateEqual(const SYSTEMTIME *first, const SYSTEMTIM ...@@ -166,7 +166,7 @@ static inline BOOL MONTHCAL_IsDateEqual(const SYSTEMTIME *first, const SYSTEMTIM
} }
/* make sure that time is valid */ /* make sure that time is valid */
static int MONTHCAL_ValidateTime(SYSTEMTIME time) static BOOL MONTHCAL_ValidateTime(SYSTEMTIME time)
{ {
if(time.wMonth < 1 || time.wMonth > 12 ) return FALSE; if(time.wMonth < 1 || time.wMonth > 12 ) return FALSE;
if(time.wDayOfWeek > 6) return FALSE; if(time.wDayOfWeek > 6) return FALSE;
...@@ -759,11 +759,11 @@ MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect) ...@@ -759,11 +759,11 @@ MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect)
static LRESULT static LRESULT
MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, WPARAM wParam) MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, INT index)
{ {
TRACE("\n"); TRACE("\n");
switch((int)wParam) { switch(index) {
case MCSC_BACKGROUND: case MCSC_BACKGROUND:
return infoPtr->bk; return infoPtr->bk;
case MCSC_TEXT: case MCSC_TEXT:
...@@ -834,13 +834,13 @@ MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr) ...@@ -834,13 +834,13 @@ MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr)
static LRESULT static LRESULT
MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, WPARAM wParam) MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, INT delta)
{ {
int prev = infoPtr->delta; INT prev = infoPtr->delta;
TRACE("delta %ld\n", wParam); TRACE("delta %d\n", delta);
infoPtr->delta = (int)wParam; infoPtr->delta = delta;
return prev; return prev;
} }
...@@ -1645,21 +1645,21 @@ done: ...@@ -1645,21 +1645,21 @@ done:
static LRESULT static LRESULT
MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, WPARAM wParam) MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, HDC hdc_paint)
{ {
HDC hdc; HDC hdc;
PAINTSTRUCT ps; PAINTSTRUCT ps;
if (wParam) if (hdc_paint)
{ {
GetClientRect(infoPtr->hwndSelf, &ps.rcPaint); GetClientRect(infoPtr->hwndSelf, &ps.rcPaint);
hdc = (HDC)wParam; hdc = hdc_paint;
} }
else else
hdc = BeginPaint(infoPtr->hwndSelf, &ps); hdc = BeginPaint(infoPtr->hwndSelf, &ps);
MONTHCAL_Refresh(infoPtr, hdc, &ps); MONTHCAL_Refresh(infoPtr, hdc, &ps);
if (!wParam) EndPaint(infoPtr->hwndSelf, &ps); if (!hdc_paint) EndPaint(infoPtr->hwndSelf, &ps);
return 0; return 0;
} }
...@@ -2011,7 +2011,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2011,7 +2011,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return MONTHCAL_Paint(infoPtr, wParam); return MONTHCAL_Paint(infoPtr, (HDC)wParam);
case WM_SETFOCUS: case WM_SETFOCUS:
return MONTHCAL_SetFocus(infoPtr); return MONTHCAL_SetFocus(infoPtr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment