comctl32: Constify some variables (2 of 2)

Andrew Talbot Andrew.Talbot at talbotville.com
Thu Mar 22 18:02:31 CDT 2007


Note: This patch gives extra constification to the input paramaters of
GetEffectiveClientRect() and DrawStatusText(); I believe this accords with
the PSDK.

-- Andy.
---
Changelog:
    comctl32: Constify some variables.

diff -urN a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
--- a/dlls/comctl32/commctrl.c	2007-03-19 17:26:39.000000000 +0000
+++ b/dlls/comctl32/commctrl.c	2007-03-22 22:56:43.000000000 +0000
@@ -378,10 +378,10 @@
  */
 
 VOID WINAPI
-GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, LPINT lpInfo)
+GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, const INT *lpInfo)
 {
     RECT rcCtrl;
-    INT  *lpRun;
+    const INT *lpRun;
     HWND hwndCtrl;
 
     TRACE("(%p %p %p)\n",
@@ -426,7 +426,7 @@
  *     (will be written ...)
  */
 
-void WINAPI DrawStatusTextW (HDC hdc, LPRECT lprc, LPCWSTR text, UINT style)
+void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
 {
     RECT r = *lprc;
     UINT border = BDR_SUNKENOUTER;
@@ -475,7 +475,7 @@
  *     No return value.
  */
 
-void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
+void WINAPI DrawStatusTextA (HDC hdc, LPCRECT lprc, LPCSTR text, UINT style)
 {
     INT len;
     LPWSTR textW = NULL;
@@ -743,7 +743,8 @@
 {
     HGLOBAL hglb;
     HRSRC hRsrc;
-    LPBITMAPINFOHEADER lpBitmap, lpBitmapInfo;
+    const BITMAPINFOHEADER *lpBitmap;
+    LPBITMAPINFOHEADER lpBitmapInfo;
     UINT nSize, nColorTableSize, iColor;
     RGBQUAD *pColorTable;
     INT i, iMaps, nWidth, nHeight;
@@ -819,7 +820,7 @@
     if (hbm) {
 	HDC hdcDst = CreateCompatibleDC (hdcScreen);
 	HBITMAP hbmOld = SelectObject (hdcDst, hbm);
-	LPBYTE lpBits = (LPBYTE)(lpBitmap + 1);
+	const BYTE *lpBits = (const BYTE *)(lpBitmap + 1);
 	lpBits += nColorTableSize * sizeof(RGBQUAD);
 	StretchDIBits (hdcDst, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
 		         lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS,
@@ -1087,8 +1088,8 @@
 BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
                               UINT_PTR uID, DWORD_PTR *pdwRef)
 {
-   LPSUBCLASS_INFO stack;
-   LPSUBCLASSPROCS proc;
+   const SUBCLASS_INFO *stack;
+   const SUBCLASSPROCS *proc;
 
    TRACE ("(%p, %p, %x, %p)\n", hWnd, pfnSubclass, uID, pdwRef);
 
@@ -1254,7 +1255,7 @@
       else
          ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam);
    } else {
-      LPSUBCLASSPROCS proc = stack->stackpos;
+      const SUBCLASSPROCS *proc = stack->stackpos;
       stack->stackpos = stack->stackpos->next; 
       /* call the Subclass procedure from the stack */
       ret = proc->subproc (hWnd, uMsg, wParam, lParam,
diff -urN a/include/commctrl.h b/include/commctrl.h
--- a/include/commctrl.h	2007-02-20 21:13:26.000000000 +0000
+++ b/include/commctrl.h	2007-03-22 21:16:40.000000000 +0000
@@ -28,7 +28,7 @@
 #endif
 
 BOOL WINAPI ShowHideMenuCtl (HWND, UINT_PTR, LPINT);
-VOID WINAPI GetEffectiveClientRect (HWND, LPRECT, LPINT);
+VOID WINAPI GetEffectiveClientRect (HWND, LPRECT, const INT*);
 VOID WINAPI InitCommonControls (VOID);
 
 typedef struct tagINITCOMMONCONTROLSEX {
@@ -340,8 +340,8 @@
 HWND WINAPI CreateStatusWindowA (LONG, LPCSTR, HWND, UINT);
 HWND WINAPI CreateStatusWindowW (LONG, LPCWSTR, HWND, UINT);
 #define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
-VOID WINAPI DrawStatusTextA (HDC, LPRECT, LPCSTR, UINT);
-VOID WINAPI DrawStatusTextW (HDC, LPRECT, LPCWSTR, UINT);
+VOID WINAPI DrawStatusTextA (HDC, LPCRECT, LPCSTR, UINT);
+VOID WINAPI DrawStatusTextW (HDC, LPCRECT, LPCWSTR, UINT);
 #define DrawStatusText WINELIB_NAME_AW(DrawStatusText)
 VOID WINAPI MenuHelp (UINT, WPARAM, LPARAM, HMENU,
                       HINSTANCE, HWND, UINT*);



More information about the wine-patches mailing list