comctl32: Constify some variables (9 of 12)
Andrew Talbot
Andrew.Talbot at talbotville.com
Sat Mar 31 11:44:05 CDT 2007
Changelog:
comctl32: Constify some variables.
diff -urN a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
--- a/dlls/comctl32/rebar.c 2007-03-19 17:26:40.000000000 +0000
+++ b/dlls/comctl32/rebar.c 2007-03-31 16:02:58.000000000 +0100
@@ -326,7 +326,7 @@
static VOID
-REBAR_DumpBandInfo(LPREBARBANDINFOW pB)
+REBAR_DumpBandInfo(const REBARBANDINFOW *pB)
{
if( !TRACE_ON(rebar) ) return;
TRACE("band info: ");
@@ -359,7 +359,7 @@
}
static VOID
-REBAR_DumpBand (REBAR_INFO *iP)
+REBAR_DumpBand (const REBAR_INFO *iP)
{
REBAR_BAND *pB;
UINT i;
@@ -423,7 +423,7 @@
}
/* dest can be equal to src */
-static void translate_rect(REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
+static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
{
if (infoPtr->dwStyle & CCS_VERT) {
int tmp;
@@ -439,14 +439,14 @@
}
}
-static int get_rect_cx(REBAR_INFO *infoPtr, RECT *lpRect)
+static int get_rect_cx(const REBAR_INFO *infoPtr, const RECT *lpRect)
{
if (infoPtr->dwStyle & CCS_VERT)
return lpRect->bottom - lpRect->top;
return lpRect->right - lpRect->left;
}
-static int get_rect_cy(REBAR_INFO *infoPtr, RECT *lpRect)
+static int get_rect_cy(const REBAR_INFO *infoPtr, const RECT *lpRect)
{
if (infoPtr->dwStyle & CCS_VERT)
return lpRect->right - lpRect->left;
@@ -485,7 +485,7 @@
}
static HWND
-REBAR_GetNotifyParent (REBAR_INFO *infoPtr)
+REBAR_GetNotifyParent (const REBAR_INFO *infoPtr)
{
HWND parent, owner;
@@ -500,7 +500,7 @@
static INT
-REBAR_Notify (NMHDR *nmhdr, REBAR_INFO *infoPtr, UINT code)
+REBAR_Notify (NMHDR *nmhdr, const REBAR_INFO *infoPtr, UINT code)
{
HWND parent;
@@ -515,7 +515,7 @@
}
static INT
-REBAR_Notify_NMREBAR (REBAR_INFO *infoPtr, UINT uBand, UINT code)
+REBAR_Notify_NMREBAR (const REBAR_INFO *infoPtr, UINT uBand, UINT code)
{
NMREBAR notify_rebar;
REBAR_BAND *lpBand;
@@ -541,7 +541,7 @@
}
static VOID
-REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
+REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
{
HFONT hOldFont = 0;
INT oldBkMode = 0;
@@ -667,7 +667,7 @@
static VOID
-REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc)
+REBAR_Refresh (const REBAR_INFO *infoPtr, HDC hdc)
{
REBAR_BAND *lpBand;
UINT i;
@@ -689,7 +689,7 @@
static void
-REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend)
+REBAR_CalcHorzBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
/* Function: this routine initializes all the rectangles in */
/* each band in a row to fit in the adjusted rcBand rect. */
/* *** Supports only Horizontal bars. *** */
@@ -798,7 +798,7 @@
static VOID
-REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend)
+REBAR_CalcVertBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
/* Function: this routine initializes all the rectangles in */
/* each band in a row to fit in the adjusted rcBand rect. */
/* *** Supports only Vertical bars. *** */
@@ -986,7 +986,7 @@
static VOID
-REBAR_MoveChildWindows (REBAR_INFO *infoPtr, UINT start, UINT endplus)
+REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
{
static const WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
REBAR_BAND *lpBand;
@@ -1096,7 +1096,7 @@
}
-static int next_band(REBAR_INFO *infoPtr, int i)
+static int next_band(const REBAR_INFO *infoPtr, int i)
{
int n;
for (n = i + 1; n < infoPtr->uNumBands; n++)
@@ -1105,7 +1105,7 @@
return n;
}
-static int prev_band(REBAR_INFO *infoPtr, int i)
+static int prev_band(const REBAR_INFO *infoPtr, int i)
{
int n;
for (n = i - 1; n >= 0; n--)
@@ -1114,7 +1114,7 @@
return n;
}
-static int get_row_begin_for_band(REBAR_INFO *infoPtr, INT iBand)
+static int get_row_begin_for_band(const REBAR_INFO *infoPtr, INT iBand)
{
int iLastBand = iBand;
int iRow = infoPtr->bands[iBand].iRow;
@@ -1127,7 +1127,7 @@
return iLastBand;
}
-static int get_row_end_for_band(REBAR_INFO *infoPtr, INT iBand)
+static int get_row_end_for_band(const REBAR_INFO *infoPtr, INT iBand)
{
int iRow = infoPtr->bands[iBand].iRow;
while ((iBand = next_band(infoPtr, iBand)) < infoPtr->uNumBands)
@@ -1136,7 +1136,7 @@
return iBand;
}
-static void REBAR_SetRowRectsX(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
+static void REBAR_SetRowRectsX(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
{
int xPos = 0, i;
for (i = iBeginBand; i < iEndBand; i = next_band(infoPtr, i))
@@ -1160,7 +1160,7 @@
* For some reason "big enough" is defined as bigger than the minimum size of the
* first band in the row
*/
-static REBAR_BAND *REBAR_FindBandToGrow(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
+static REBAR_BAND *REBAR_FindBandToGrow(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
{
INT iLcx = 0, i;
@@ -1179,7 +1179,7 @@
return &infoPtr->bands[i];
}
-static int REBAR_ShrinkBandsRTL(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
+static int REBAR_ShrinkBandsRTL(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
{
REBAR_BAND *lpBand;
INT width, i;
@@ -1201,7 +1201,7 @@
}
-static int REBAR_ShrinkBandsLTR(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
+static int REBAR_ShrinkBandsLTR(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
{
REBAR_BAND *lpBand;
INT width, i;
@@ -1222,7 +1222,7 @@
return cxShrink;
}
-static int REBAR_SetBandsHeight(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
+static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
{
REBAR_BAND *lpBand;
int yMaxHeight = 0;
@@ -1255,7 +1255,7 @@
return yPos + yMaxHeight;
}
-static void REBAR_LayoutRow(REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
+static void REBAR_LayoutRow(const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
{
REBAR_BAND *lpBand;
int i, extra;
@@ -1298,7 +1298,7 @@
}
static VOID
-REBAR_Layout(REBAR_INFO *infoPtr, LPRECT lpRect)
+REBAR_Layout(REBAR_INFO *infoPtr, const RECT *lpRect)
{
REBAR_BAND *lpBand;
RECT rcAdj;
@@ -1387,7 +1387,7 @@
static VOID
-REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
+REBAR_ValidateBand (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
/* Function: This routine evaluates the band specs supplied */
/* by the user and updates the following 5 fields in */
/* the internal band structure: cxHeader, lcx, lcy, hcx, hcy*/
@@ -1508,7 +1508,7 @@
}
static BOOL
-REBAR_CommonSetupBand(HWND hwnd, LPREBARBANDINFOW lprbbi, REBAR_BAND *lpBand)
+REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
/* Function: This routine copies the supplied values from */
/* user input (lprbbi) to the internal band structure. */
/* It returns true if something changed and false if not. */
@@ -1640,7 +1640,7 @@
}
static LRESULT
-REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, RECT *clip)
+REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, const RECT *clip)
/* Function: This erases the background rectangle by drawing */
/* each band with its background color (or the default) and */
/* draws each bands right separator if necessary. The row */
@@ -1762,7 +1762,7 @@
}
static void
-REBAR_InternalHitTest (REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
+REBAR_InternalHitTest (const REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
{
REBAR_BAND *lpBand;
RECT rect;
@@ -1940,7 +1940,7 @@
static LRESULT
-REBAR_GetBandBorders (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBandBorders (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPRECT lpRect = (LPRECT)lParam;
REBAR_BAND *lpBand;
@@ -1979,7 +1979,7 @@
static inline LRESULT
-REBAR_GetBandCount (REBAR_INFO *infoPtr)
+REBAR_GetBandCount (const REBAR_INFO *infoPtr)
{
TRACE("band count %u!\n", infoPtr->uNumBands);
@@ -1988,7 +1988,7 @@
static LRESULT
-REBAR_GetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
+REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
{
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
REBAR_BAND *lpBand;
@@ -2068,7 +2068,7 @@
static LRESULT
-REBAR_GetBarHeight (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBarHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT nHeight;
@@ -2081,7 +2081,7 @@
static LRESULT
-REBAR_GetBarInfo (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBarInfo (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPREBARINFO lpInfo = (LPREBARINFO)lParam;
@@ -2103,7 +2103,7 @@
static inline LRESULT
-REBAR_GetBkColor (REBAR_INFO *infoPtr)
+REBAR_GetBkColor (const REBAR_INFO *infoPtr)
{
COLORREF clr = infoPtr->clrBk;
@@ -2121,7 +2121,7 @@
static LRESULT
-REBAR_GetPalette (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetPalette (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
FIXME("empty stub!\n");
@@ -2130,7 +2130,7 @@
static LRESULT
-REBAR_GetRect (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetRect (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT iBand = (INT)wParam;
LPRECT lprc = (LPRECT)lParam;
@@ -2153,7 +2153,7 @@
static inline LRESULT
-REBAR_GetRowCount (REBAR_INFO *infoPtr)
+REBAR_GetRowCount (const REBAR_INFO *infoPtr)
{
TRACE("%u\n", infoPtr->uNumRows);
@@ -2162,7 +2162,7 @@
static LRESULT
-REBAR_GetRowHeight (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetRowHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT iRow = (INT)wParam;
int j = 0, ret = 0;
@@ -2184,7 +2184,7 @@
static inline LRESULT
-REBAR_GetTextColor (REBAR_INFO *infoPtr)
+REBAR_GetTextColor (const REBAR_INFO *infoPtr)
{
TRACE("text color 0x%06x!\n", infoPtr->clrText);
@@ -2193,14 +2193,14 @@
static inline LRESULT
-REBAR_GetToolTips (REBAR_INFO *infoPtr)
+REBAR_GetToolTips (const REBAR_INFO *infoPtr)
{
return (LRESULT)infoPtr->hwndToolTip;
}
static inline LRESULT
-REBAR_GetUnicodeFormat (REBAR_INFO *infoPtr)
+REBAR_GetUnicodeFormat (const REBAR_INFO *infoPtr)
{
TRACE("%s hwnd=%p\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", infoPtr->hwndSelf);
@@ -2210,7 +2210,7 @@
static inline LRESULT
-REBAR_GetVersion (REBAR_INFO *infoPtr)
+REBAR_GetVersion (const REBAR_INFO *infoPtr)
{
TRACE("version %d\n", infoPtr->iVersion);
return infoPtr->iVersion;
@@ -2218,7 +2218,7 @@
static LRESULT
-REBAR_HitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_HitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
@@ -2232,7 +2232,7 @@
static LRESULT
-REBAR_IdToIndex (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_IdToIndex (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
UINT i;
@@ -2311,7 +2311,7 @@
static LRESULT
-REBAR_MaximizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_MaximizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
REBAR_BAND *lpBand;
UINT uBand = (UINT) wParam;
@@ -2359,7 +2359,7 @@
static LRESULT
-REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_MinimizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
REBAR_BAND *lpBand;
UINT uBand = (UINT) wParam;
@@ -2778,7 +2778,7 @@
static LRESULT
-REBAR_EraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
RECT cliprect;
@@ -2789,13 +2789,13 @@
static LRESULT
-REBAR_GetFont (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetFont (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
return (LRESULT)infoPtr->hFont;
}
static LRESULT
-REBAR_PushChevron(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_PushChevron(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
if (wParam >= 0 && (UINT)wParam < infoPtr->uNumBands)
{
@@ -3000,7 +3000,7 @@
static inline LRESULT
-REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_NCCalcSize (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HTHEME theme;
RECT *rect = (RECT *)lParam;
@@ -3116,7 +3116,7 @@
static LRESULT
-REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_NCHitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
NMMOUSE nmmouse;
POINT clpt;
@@ -3151,7 +3151,7 @@
static LRESULT
-REBAR_NCPaint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_NCPaint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
RECT rcWindow;
HDC hdc;
@@ -3211,7 +3211,7 @@
static LRESULT
-REBAR_Paint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
@@ -3238,7 +3238,7 @@
static LRESULT
-REBAR_SetCursor (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_SetCursor (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
POINT pt;
UINT flags;
@@ -3376,7 +3376,7 @@
}
static LRESULT
-REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_WindowPosChanged (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LRESULT ret;
RECT rc;
More information about the wine-patches
mailing list