comctl32: Constify some variables (8 of 8)

Andrew Talbot Andrew.Talbot at talbotville.com
Mon Apr 2 11:51:03 CDT 2007


Changelog:
    comctl32: Constify some variables.

diff -urN a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c
--- a/dlls/comctl32/updown.c	2007-03-08 17:37:16.000000000 +0000
+++ b/dlls/comctl32/updown.c	2007-03-31 23:05:01.000000000 +0100
@@ -108,7 +108,7 @@
  *           UPDOWN_IsBuddyEdit
  * 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;
 }
@@ -117,7 +117,7 @@
  *           UPDOWN_IsBuddyListbox
  * 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;
 }
@@ -126,7 +126,7 @@
  *           UPDOWN_InBounds
  * 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)
         return (infoPtr->MinVal <= val) && (val <= infoPtr->MaxVal);
@@ -162,7 +162,7 @@
  * 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.
  */
-static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr)
+static BOOL UPDOWN_HasBuddyBorder(const UPDOWN_INFO *infoPtr)
 {
     return  ( ((infoPtr->dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) &&
 	      UPDOWN_IsBuddyEdit(infoPtr) );
@@ -176,7 +176,7 @@
  *            FLAG_DECR to get the "decrement" rect (down or left)
  *            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);
     const int border = theme ? DEFAULT_BUDDYBORDER_THEMED : DEFAULT_BUDDYBORDER;
@@ -228,7 +228,7 @@
  * If it returns the up rect, it returns FLAG_INCR.
  * 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);
     if(PtInRect(rect, pt)) return FLAG_INCR;
@@ -306,7 +306,7 @@
  *   TRUE  - if it set the caption of the  buddy successfully
  *   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 txt[20];
@@ -352,7 +352,7 @@
  *
  * 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;
     HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy);
@@ -370,7 +370,7 @@
  *
  * 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;
     RECT rect;
@@ -437,7 +437,7 @@
  * Asynchronous drawing (must ONLY be used in WM_PAINT).
  * Calls UPDOWN_Draw.
  */
-static LRESULT UPDOWN_Paint (UPDOWN_INFO *infoPtr, HDC hdc)
+static LRESULT UPDOWN_Paint (const UPDOWN_INFO *infoPtr, HDC hdc)
 {
     PAINTSTRUCT ps;
     if (hdc) return UPDOWN_Draw (infoPtr, hdc);
@@ -650,7 +650,7 @@
  * Returns TRUE if it is enabled as well as its buddy (if any)
  *         FALSE otherwise
  */
-static BOOL UPDOWN_IsEnabled (UPDOWN_INFO *infoPtr)
+static BOOL UPDOWN_IsEnabled (const UPDOWN_INFO *infoPtr)
 {
     if (!IsWindowEnabled(infoPtr->Self))
         return FALSE;



More information about the wine-patches mailing list