Commit b84348c4 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

comctl32: Constify some variables.

parent 3c9f867f
...@@ -108,7 +108,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action); ...@@ -108,7 +108,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action);
* UPDOWN_IsBuddyEdit * UPDOWN_IsBuddyEdit
* Tests if our buddy is an edit control. * Tests if our buddy is an edit control.
*/ */
static inline BOOL UPDOWN_IsBuddyEdit(UPDOWN_INFO *infoPtr) static inline BOOL UPDOWN_IsBuddyEdit(const UPDOWN_INFO *infoPtr)
{ {
return infoPtr->BuddyType == BUDDY_TYPE_EDIT; return infoPtr->BuddyType == BUDDY_TYPE_EDIT;
} }
...@@ -117,7 +117,7 @@ static inline BOOL UPDOWN_IsBuddyEdit(UPDOWN_INFO *infoPtr) ...@@ -117,7 +117,7 @@ static inline BOOL UPDOWN_IsBuddyEdit(UPDOWN_INFO *infoPtr)
* UPDOWN_IsBuddyListbox * UPDOWN_IsBuddyListbox
* Tests if our buddy is a listbox control. * Tests if our buddy is a listbox control.
*/ */
static inline BOOL UPDOWN_IsBuddyListbox(UPDOWN_INFO *infoPtr) static inline BOOL UPDOWN_IsBuddyListbox(const UPDOWN_INFO *infoPtr)
{ {
return infoPtr->BuddyType == BUDDY_TYPE_LISTBOX; return infoPtr->BuddyType == BUDDY_TYPE_LISTBOX;
} }
...@@ -126,7 +126,7 @@ static inline BOOL UPDOWN_IsBuddyListbox(UPDOWN_INFO *infoPtr) ...@@ -126,7 +126,7 @@ static inline BOOL UPDOWN_IsBuddyListbox(UPDOWN_INFO *infoPtr)
* UPDOWN_InBounds * UPDOWN_InBounds
* Tests if a given value 'val' is between the Min&Max limits * Tests if a given value 'val' is between the Min&Max limits
*/ */
static BOOL UPDOWN_InBounds(UPDOWN_INFO *infoPtr, int val) static BOOL UPDOWN_InBounds(const UPDOWN_INFO *infoPtr, int val)
{ {
if(infoPtr->MaxVal > infoPtr->MinVal) if(infoPtr->MaxVal > infoPtr->MinVal)
return (infoPtr->MinVal <= val) && (val <= infoPtr->MaxVal); return (infoPtr->MinVal <= val) && (val <= infoPtr->MaxVal);
...@@ -162,7 +162,7 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta) ...@@ -162,7 +162,7 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta)
* When we have a buddy set and that we are aligned on our buddy, we * When we have a buddy set and that we are aligned on our buddy, we
* want to draw a sunken edge to make like we are part of that control. * want to draw a sunken edge to make like we are part of that control.
*/ */
static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr) static BOOL UPDOWN_HasBuddyBorder(const UPDOWN_INFO *infoPtr)
{ {
return ( ((infoPtr->dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) && return ( ((infoPtr->dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) &&
UPDOWN_IsBuddyEdit(infoPtr) ); UPDOWN_IsBuddyEdit(infoPtr) );
...@@ -176,7 +176,7 @@ static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr) ...@@ -176,7 +176,7 @@ static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr)
* FLAG_DECR to get the "decrement" rect (down or left) * FLAG_DECR to get the "decrement" rect (down or left)
* If both flags are pressent, the envelope is returned. * If both flags are pressent, the envelope is returned.
*/ */
static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow) static void UPDOWN_GetArrowRect (const UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
{ {
HTHEME theme = GetWindowTheme (infoPtr->Self); HTHEME theme = GetWindowTheme (infoPtr->Self);
const int border = theme ? DEFAULT_BUDDYBORDER_THEMED : DEFAULT_BUDDYBORDER; const int border = theme ? DEFAULT_BUDDYBORDER_THEMED : DEFAULT_BUDDYBORDER;
...@@ -228,7 +228,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow) ...@@ -228,7 +228,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
* If it returns the up rect, it returns FLAG_INCR. * If it returns the up rect, it returns FLAG_INCR.
* If it returns the down rect, it returns FLAG_DECR. * If it returns the down rect, it returns FLAG_DECR.
*/ */
static INT UPDOWN_GetArrowFromPoint (UPDOWN_INFO* infoPtr, RECT *rect, POINT pt) static INT UPDOWN_GetArrowFromPoint (const UPDOWN_INFO *infoPtr, RECT *rect, POINT pt)
{ {
UPDOWN_GetArrowRect (infoPtr, rect, FLAG_INCR); UPDOWN_GetArrowRect (infoPtr, rect, FLAG_INCR);
if(PtInRect(rect, pt)) return FLAG_INCR; if(PtInRect(rect, pt)) return FLAG_INCR;
...@@ -306,7 +306,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr) ...@@ -306,7 +306,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
* TRUE - if it set the caption of the buddy successfully * TRUE - if it set the caption of the buddy successfully
* FALSE - if an error occurred * FALSE - if an error occurred
*/ */
static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr) static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
{ {
WCHAR fmt[3] = { '%', 'd', '\0' }; WCHAR fmt[3] = { '%', 'd', '\0' };
WCHAR txt[20]; WCHAR txt[20];
...@@ -352,7 +352,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr) ...@@ -352,7 +352,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr)
* *
* Draw buddy background for visual integration. * Draw buddy background for visual integration.
*/ */
static BOOL UPDOWN_DrawBuddyBackground (UPDOWN_INFO *infoPtr, HDC hdc) static BOOL UPDOWN_DrawBuddyBackground (const UPDOWN_INFO *infoPtr, HDC hdc)
{ {
RECT br; RECT br;
HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy); HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy);
...@@ -370,7 +370,7 @@ static BOOL UPDOWN_DrawBuddyBackground (UPDOWN_INFO *infoPtr, HDC hdc) ...@@ -370,7 +370,7 @@ static BOOL UPDOWN_DrawBuddyBackground (UPDOWN_INFO *infoPtr, HDC hdc)
* *
* Draw the arrows. The background need not be erased. * Draw the arrows. The background need not be erased.
*/ */
static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc) static LRESULT UPDOWN_Draw (const UPDOWN_INFO *infoPtr, HDC hdc)
{ {
BOOL uPressed, uHot, dPressed, dHot; BOOL uPressed, uHot, dPressed, dHot;
RECT rect; RECT rect;
...@@ -437,7 +437,7 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc) ...@@ -437,7 +437,7 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc)
* Asynchronous drawing (must ONLY be used in WM_PAINT). * Asynchronous drawing (must ONLY be used in WM_PAINT).
* Calls UPDOWN_Draw. * Calls UPDOWN_Draw.
*/ */
static LRESULT UPDOWN_Paint (UPDOWN_INFO *infoPtr, HDC hdc) static LRESULT UPDOWN_Paint (const UPDOWN_INFO *infoPtr, HDC hdc)
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
if (hdc) return UPDOWN_Draw (infoPtr, hdc); if (hdc) return UPDOWN_Draw (infoPtr, hdc);
...@@ -650,7 +650,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action) ...@@ -650,7 +650,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
* Returns TRUE if it is enabled as well as its buddy (if any) * Returns TRUE if it is enabled as well as its buddy (if any)
* FALSE otherwise * FALSE otherwise
*/ */
static BOOL UPDOWN_IsEnabled (UPDOWN_INFO *infoPtr) static BOOL UPDOWN_IsEnabled (const UPDOWN_INFO *infoPtr)
{ {
if (!IsWindowEnabled(infoPtr->Self)) if (!IsWindowEnabled(infoPtr->Self))
return FALSE; return FALSE;
......
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