comctl32: Constify some variables (6 of 8)
Andrew Talbot
Andrew.Talbot at talbotville.com
Mon Apr 2 11:50:24 CDT 2007
Changelog:
comctl32: Constify some variables.
diff -urN a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c
--- a/dlls/comctl32/trackbar.c 2007-03-19 17:26:40.000000000 +0000
+++ b/dlls/comctl32/trackbar.c 2007-03-31 21:35:45.000000000 +0100
@@ -103,14 +103,14 @@
static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 };
static inline int
-notify_customdraw(TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
+notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
{
pnmcd->dwDrawStage = stage;
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
pnmcd->hdr.idFrom, (LPARAM)pnmcd);
}
-static LRESULT notify_hdr(TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
+static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
{
LRESULT result;
@@ -127,14 +127,14 @@
return result;
}
-static inline int notify(TRACKBAR_INFO *infoPtr, INT code)
+static inline int notify (const TRACKBAR_INFO *infoPtr, INT code)
{
NMHDR nmh;
return notify_hdr(infoPtr, code, &nmh);
}
static BOOL
-notify_with_scroll (TRACKBAR_INFO *infoPtr, UINT code)
+notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
{
BOOL bVert = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT;
@@ -179,8 +179,7 @@
(in range of trackbar) */
static inline LONG
-TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
- int vertical)
+TRACKBAR_ConvertPlaceToPosition (const TRACKBAR_INFO *infoPtr, int place, int vertical)
{
double range, width, pos, offsetthumb;
@@ -207,7 +206,7 @@
/* return: 0> prev, 0 none, >0 next */
static LONG
-TRACKBAR_GetAutoPageDirection (TRACKBAR_INFO *infoPtr, POINT clickPoint)
+TRACKBAR_GetAutoPageDirection (const TRACKBAR_INFO *infoPtr, POINT clickPoint)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
RECT pageRect;
@@ -334,7 +333,7 @@
}
static void
-TRACKBAR_CalcThumb (TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
+TRACKBAR_CalcThumb (const TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
{
int range, width, height, thumbwidth;
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
@@ -381,13 +380,13 @@
}
static inline void
-TRACKBAR_InvalidateAll(TRACKBAR_INFO * infoPtr)
+TRACKBAR_InvalidateAll (const TRACKBAR_INFO *infoPtr)
{
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
}
static void
-TRACKBAR_InvalidateThumb (TRACKBAR_INFO *infoPtr, LONG thumbPos)
+TRACKBAR_InvalidateThumb (const TRACKBAR_INFO *infoPtr, LONG thumbPos)
{
RECT rcThumb;
@@ -397,7 +396,7 @@
}
static inline void
-TRACKBAR_InvalidateThumbMove (TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
+TRACKBAR_InvalidateThumbMove (const TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
{
TRACKBAR_InvalidateThumb (infoPtr, oldPos);
if (newPos != oldPos)
@@ -405,7 +404,7 @@
}
static inline BOOL
-TRACKBAR_HasSelection (TRACKBAR_INFO *infoPtr)
+TRACKBAR_HasSelection (const TRACKBAR_INFO *infoPtr)
{
return infoPtr->lSelMin != infoPtr->lSelMax;
}
@@ -468,7 +467,7 @@
/* Trackbar drawing code. I like my spaghetti done milanese. */
static void
-TRACKBAR_DrawChannel (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
RECT rcChannel = infoPtr->rcChannel;
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
@@ -491,7 +490,7 @@
}
static void
-TRACKBAR_DrawOneTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
+TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
{
int x, y, ox, oy, range, side, indent = 0, len = 3;
int offsetthumb;
@@ -566,7 +565,7 @@
static inline void
-TRACKBAR_DrawTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
+TRACKBAR_DrawTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
{
if ((flags & (TBS_LEFT | TBS_TOP)) || (flags & TBS_BOTH))
TRACKBAR_DrawOneTic (infoPtr, hdc, ticPos, flags | TBS_LEFT);
@@ -576,7 +575,7 @@
}
static void
-TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
unsigned int i;
int ticFlags = dwStyle & 0x0f;
@@ -615,7 +614,7 @@
}
static void
-TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
HBRUSH oldbr;
HPEN oldpen;
@@ -758,7 +757,7 @@
static inline void
-TRACKBAR_ActivateToolTip (TRACKBAR_INFO *infoPtr, BOOL fShow)
+TRACKBAR_ActivateToolTip (const TRACKBAR_INFO *infoPtr, BOOL fShow)
{
TTTOOLINFOW ti;
@@ -773,7 +772,7 @@
static void
-TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr)
+TRACKBAR_UpdateToolTip (const TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
WCHAR buf[80];
@@ -942,7 +941,7 @@
static void
-TRACKBAR_AlignBuddies (TRACKBAR_INFO *infoPtr)
+TRACKBAR_AlignBuddies (const TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
HWND hwndParent = GetParent (infoPtr->hwndSelf);
@@ -1023,7 +1022,7 @@
static inline LRESULT
-TRACKBAR_GetChannelRect (TRACKBAR_INFO *infoPtr, LPRECT lprc)
+TRACKBAR_GetChannelRect (const TRACKBAR_INFO *infoPtr, LPRECT lprc)
{
if (lprc == NULL) return 0;
@@ -1037,7 +1036,7 @@
static inline LONG
-TRACKBAR_GetNumTics (TRACKBAR_INFO *infoPtr)
+TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_NOTICKS)
return 0;
@@ -1049,7 +1048,7 @@
}
-static int comp_tics(const void *ap, const void *bp)
+static int comp_tics (const void *ap, const void *bp)
{
const DWORD a = *(const DWORD *)ap;
const DWORD b = *(const DWORD *)bp;
@@ -1062,7 +1061,7 @@
static inline LONG
-TRACKBAR_GetTic (TRACKBAR_INFO *infoPtr, INT iTic)
+TRACKBAR_GetTic (const TRACKBAR_INFO *infoPtr, INT iTic)
{
if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
return -1;
@@ -1073,7 +1072,7 @@
static inline LONG
-TRACKBAR_GetTicPos (TRACKBAR_INFO *infoPtr, INT iTic)
+TRACKBAR_GetTicPos (const TRACKBAR_INFO *infoPtr, INT iTic)
{
LONG range, width, pos, tic;
int offsetthumb;
@@ -1393,7 +1392,7 @@
static LRESULT
-TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
+TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
TRACKBAR_INFO *infoPtr;
DWORD dwStyle;
@@ -1525,7 +1524,7 @@
static LRESULT
-TRACKBAR_CaptureChanged (TRACKBAR_INFO *infoPtr)
+TRACKBAR_CaptureChanged (const TRACKBAR_INFO *infoPtr)
{
notify_with_scroll (infoPtr, TB_ENDTRACK);
return 0;
@@ -1570,7 +1569,7 @@
static LRESULT
-TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc)
+TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, const TIMERPROC *tmrpc)
{
if (infoPtr->flags & TB_AUTO_PAGE) {
POINT pt;
@@ -1583,7 +1582,7 @@
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (TRACKBAR_INFO* infoPtr)
+static LRESULT theme_changed (const TRACKBAR_INFO* infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme);
@@ -1713,7 +1712,7 @@
static inline BOOL
-TRACKBAR_KeyUp (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
+TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
{
switch (nVirtKey) {
case VK_LEFT:
More information about the wine-patches
mailing list