comctl32: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-03-26 18:57:43 +01:00 committed by Alexandre Julliard
parent a110e6e433
commit 79205875f7
3 changed files with 28 additions and 28 deletions

View File

@ -129,8 +129,8 @@ extern int MONTHCAL_MonthLength(int month, int year);
#define DTHT_MCPOPUP 0x300 /* & DTHT_DATEFIELD 0 when DATETIME_KeyDown */
#define DTHT_GOTFOCUS 0x400 /* tests for date-fields */
static BOOL DATETIME_SendSimpleNotify (DATETIME_INFO *infoPtr, UINT code);
static BOOL DATETIME_SendDateTimeChangeNotify (DATETIME_INFO *infoPtr);
static BOOL DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code);
static BOOL DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr);
extern void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to);
static const WCHAR allowedformatchars[] = {'d', 'h', 'H', 'm', 'M', 's', 't', 'y', 'X', '\'', 0};
static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1,-1};
@ -152,7 +152,7 @@ DATETIME_GetSystemTime (DATETIME_INFO *infoPtr, SYSTEMTIME *lprgSysTimeArray)
static BOOL
DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysTimeArray)
DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *lprgSysTimeArray)
{
if (!lprgSysTimeArray) return 0;
@ -304,7 +304,7 @@ DATETIME_SetFormatA (DATETIME_INFO *infoPtr, LPCSTR lpszFormat)
static void
DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize)
DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize)
{
static const WCHAR fmt_dW[] = { '%', 'd', 0 };
static const WCHAR fmt__2dW[] = { '%', '.', '2', 'd', 0 };
@ -525,7 +525,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
static void
DATETIME_ReturnFieldWidth (DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *fieldWidthPtr)
DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *fieldWidthPtr)
{
/* fields are a fixed width, determined by the largest possible string */
/* presumably, these widths should be language dependent */
@ -677,7 +677,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
static INT
DATETIME_HitTest (DATETIME_INFO *infoPtr, POINT pt)
DATETIME_HitTest (const DATETIME_INFO *infoPtr, POINT pt)
{
int i;
@ -735,7 +735,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
if(IsWindowVisible(infoPtr->hMonthCal)) {
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
} else {
SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
TRACE("update calendar %04d/%02d/%02d\n",
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay);
SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
@ -816,7 +816,7 @@ DATETIME_Enable (DATETIME_INFO *infoPtr, BOOL bEnable)
static LRESULT
DATETIME_EraseBackground (DATETIME_INFO *infoPtr, HDC hdc)
DATETIME_EraseBackground (const DATETIME_INFO *infoPtr, HDC hdc)
{
HBRUSH hBrush, hSolidBrush = NULL;
RECT rc;
@ -1044,7 +1044,7 @@ DATETIME_KillFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
static LRESULT
DATETIME_NCCreate (HWND hwnd, LPCREATESTRUCTW lpcs)
DATETIME_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{
DWORD dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
/* force control to have client edge */
@ -1072,7 +1072,7 @@ DATETIME_SetFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
static BOOL
DATETIME_SendDateTimeChangeNotify (DATETIME_INFO *infoPtr)
DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr)
{
NMDATETIMECHANGE dtdtc;
@ -1089,7 +1089,7 @@ DATETIME_SendDateTimeChangeNotify (DATETIME_INFO *infoPtr)
static BOOL
DATETIME_SendSimpleNotify (DATETIME_INFO *infoPtr, UINT code)
DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code)
{
NMHDR nmhdr;
@ -1142,7 +1142,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height)
static LRESULT
DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{
static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 };
@ -1187,7 +1187,7 @@ DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint)
static LRESULT
DATETIME_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 };
DATETIME_INFO *infoPtr = (DATETIME_INFO *)Alloc (sizeof(DATETIME_INFO));

View File

@ -108,12 +108,12 @@ typedef struct
static BOOL HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask);
static void HEADER_FreeCallbackItems(HEADER_ITEM *lpItem);
static LRESULT HEADER_SendNotify(HWND hwnd, UINT code, NMHDR *hdr);
static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect);
static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect);
static const WCHAR themeClass[] = {'H','e','a','d','e','r',0};
static WCHAR emptyString[] = {0};
static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *phdi, BOOL fUnicode)
static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDITEMW *phdi, BOOL fUnicode)
{
if (mask & HDI_UNSUPPORTED_FIELDS)
FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS));
@ -182,7 +182,7 @@ HEADER_OrderToIndex(HWND hwnd, WPARAM wParam)
}
static void
HEADER_ChangeItemOrder(HEADER_INFO *infoPtr, INT iItem, INT iNewOrder)
HEADER_ChangeItemOrder(const HEADER_INFO *infoPtr, INT iItem, INT iNewOrder)
{
HEADER_ITEM *lpItem = &infoPtr->items[iItem];
INT i, nMin, nMax;
@ -257,7 +257,7 @@ HEADER_Size (HWND hwnd, WPARAM wParam)
return 0;
}
static void HEADER_GetHotDividerRect(HWND hwnd, HEADER_INFO *infoPtr, RECT *r)
static void HEADER_GetHotDividerRect(HWND hwnd, const HEADER_INFO *infoPtr, RECT *r)
{
INT iDivider = infoPtr->iHotDivider;
if (infoPtr->uNumItem > 0)
@ -588,7 +588,7 @@ HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
static void
HEADER_InternalHitTest (HWND hwnd, LPPOINT lpPt, UINT *pFlags, INT *pItem)
HEADER_InternalHitTest (HWND hwnd, const POINT *lpPt, UINT *pFlags, INT *pItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
RECT rect, rcTest;
@ -794,7 +794,7 @@ HEADER_SendSimpleNotify (HWND hwnd, UINT code)
}
static LRESULT
HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect)
HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect)
{
NMCUSTOMDRAW nm;
nm.dwDrawStage = dwDrawStage;
@ -1262,7 +1262,7 @@ HEADER_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_InsertItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem;
@ -1532,7 +1532,7 @@ HEADER_GetFont (HWND hwnd)
static BOOL
HEADER_IsDragDistance(HEADER_INFO *infoPtr, POINT *pt)
HEADER_IsDragDistance(const HEADER_INFO *infoPtr, const POINT *pt)
{
/* Windows allows for a mouse movement before starting the drag. We use the
* SM_CXDOUBLECLICK/SM_CYDOUBLECLICK as that distance.

View File

@ -63,7 +63,7 @@ static LRESULT HOTKEY_SetFont (HOTKEY_INFO *infoPtr, HFONT hFont, BOOL redraw);
#define IsOnlySet(flags) (infoPtr->CurrMod == (flags))
static BOOL
HOTKEY_IsCombInv(HOTKEY_INFO *infoPtr)
HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
{
TRACE("(infoPtr=%p)\n", infoPtr);
if((infoPtr->InvComb & HKCOMB_NONE) && !infoPtr->CurrMod)
@ -197,7 +197,7 @@ HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc)
}
static LRESULT
HOTKEY_GetHotKey(HOTKEY_INFO *infoPtr)
HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr)
{
TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
@ -226,7 +226,7 @@ HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
static LRESULT
HOTKEY_Create (HOTKEY_INFO *infoPtr, LPCREATESTRUCTW lpcs)
HOTKEY_Create (HOTKEY_INFO *infoPtr, const CREATESTRUCTW *lpcs)
{
infoPtr->hwndNotify = lpcs->hwndParent;
@ -248,7 +248,7 @@ HOTKEY_Destroy (HOTKEY_INFO *infoPtr)
static LRESULT
HOTKEY_EraseBackground (HOTKEY_INFO *infoPtr, HDC hdc)
HOTKEY_EraseBackground (const HOTKEY_INFO *infoPtr, HDC hdc)
{
HBRUSH hBrush, hSolidBrush = NULL;
RECT rc;
@ -275,7 +275,7 @@ HOTKEY_EraseBackground (HOTKEY_INFO *infoPtr, HDC hdc)
static inline LRESULT
HOTKEY_GetFont (HOTKEY_INFO *infoPtr)
HOTKEY_GetFont (const HOTKEY_INFO *infoPtr)
{
return (LRESULT)infoPtr->hFont;
}
@ -393,7 +393,7 @@ HOTKEY_KillFocus (HOTKEY_INFO *infoPtr, HWND receiveFocus)
static LRESULT
HOTKEY_LButtonDown (HOTKEY_INFO *infoPtr)
HOTKEY_LButtonDown (const HOTKEY_INFO *infoPtr)
{
if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED))
SetFocus (infoPtr->hwndSelf);
@ -403,7 +403,7 @@ HOTKEY_LButtonDown (HOTKEY_INFO *infoPtr)
static inline LRESULT
HOTKEY_NCCreate (HWND hwnd, LPCREATESTRUCTW lpcs)
HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{
HOTKEY_INFO *infoPtr;
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);