comctl32: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Thu Mar 29 16:09:32 CDT 2007


Changelog:
    comctl32: Constify some variables.

diff -urN a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
--- a/dlls/comctl32/monthcal.c	2007-03-16 17:18:51.000000000 +0000
+++ b/dlls/comctl32/monthcal.c	2007-03-29 21:38:56.000000000 +0100
@@ -189,7 +189,7 @@
 /* From a given point, calculate the row (weekpos), column(daypos)
    and day in the calendar. day== 0 mean the last day of tha last month
 */
-static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
+static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y,
 				   int *daypos,int *weekpos)
 {
   int retval, firstDay;
@@ -214,7 +214,7 @@
 /* day is the day of the month, 1 == 1st day of the month */
 /* sets x and y to be the position of the day */
 /* x == day, y == week where(0,0) == firstDay, 1st week */
-static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
+static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, int day, int month,
                                  int *x, int *y)
 {
   int firstDay, prevMonth;
@@ -243,7 +243,7 @@
 
 
 /* x: column(day), y: row(week) */
-static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
+static void MONTHCAL_CalcDayRect(const MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
 {
   r->left = infoPtr->days.left + x * infoPtr->width_increment;
   r->right = r->left + infoPtr->width_increment;
@@ -255,7 +255,7 @@
 /* sets the RECT struct r to the rectangle around the day and month */
 /* day is the day value of the month(1 == 1st), month is the month */
 /* value(january == 1, december == 12) */
-static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr,
+static inline void MONTHCAL_CalcPosFromDay(const MONTHCAL_INFO *infoPtr,
                                             int day, int month, RECT *r)
 {
   int x, y;
@@ -267,7 +267,7 @@
 
 /* day is the day in the month(1 == 1st of the month) */
 /* month is the month value(1 == january, 12 == december) */
-static void MONTHCAL_CircleDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month)
+static void MONTHCAL_CircleDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month)
 {
   HPEN hRedPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
   HPEN hOldPen2 = SelectObject(hdc, hRedPen);
@@ -318,7 +318,7 @@
 }
 
 
-static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month,
+static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month,
                              int x, int y, int bold)
 {
   static const WCHAR fmtW[] = { '%','d',0 };
@@ -387,7 +387,7 @@
 }
 
 
-static void paint_button (MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext, 
+static void paint_button (const MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext, 
                           BOOL pressed, RECT* r)
 {
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
@@ -426,7 +426,7 @@
 }
 
 
-static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
+static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
 {
   static const WCHAR todayW[] = { 'T','o','d','a','y',':',0 };
   static const WCHAR fmt1W[] = { '%','s',' ','%','l','d',0 };
@@ -773,7 +773,7 @@
 
 
 static LRESULT
-MONTHCAL_GetMinReqRect(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
 {
   LPRECT lpRect = (LPRECT) lParam;
 
@@ -796,7 +796,7 @@
 
 
 static LRESULT
-MONTHCAL_GetColor(MONTHCAL_INFO *infoPtr, WPARAM wParam)
+MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, WPARAM wParam)
 {
   TRACE("\n");
 
@@ -859,7 +859,7 @@
 
 
 static LRESULT
-MONTHCAL_GetMonthDelta(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr)
 {
   TRACE("\n");
 
@@ -883,7 +883,7 @@
 
 
 static LRESULT
-MONTHCAL_GetFirstDayOfWeek(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetFirstDayOfWeek(const MONTHCAL_INFO *infoPtr)
 {
   return infoPtr->firstDay;
 }
@@ -919,7 +919,7 @@
 
 
 static LRESULT
-MONTHCAL_GetMonthRange(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr)
 {
   TRACE("\n");
 
@@ -928,7 +928,7 @@
 
 
 static LRESULT
-MONTHCAL_GetMaxTodayWidth(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMaxTodayWidth(const MONTHCAL_INFO *infoPtr)
 {
   return(infoPtr->todayrect.right - infoPtr->todayrect.left);
 }
@@ -1003,7 +1003,7 @@
 
 
 static LRESULT
-MONTHCAL_SetDayState(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 
 {
   int i, iMonths = (int)wParam;
@@ -1018,7 +1018,7 @@
 }
 
 static LRESULT
-MONTHCAL_GetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
 {
   SYSTEMTIME *lpSel = (SYSTEMTIME *) lParam;
 
@@ -1057,7 +1057,7 @@
 
 
 static LRESULT
-MONTHCAL_GetMaxSelCount(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMaxSelCount(const MONTHCAL_INFO *infoPtr)
 {
   return infoPtr->maxSelCount;
 }
@@ -1077,7 +1077,7 @@
 
 
 static LRESULT
-MONTHCAL_GetSelRange(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
 {
   SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam;
 
@@ -1123,7 +1123,7 @@
 
 
 static LRESULT
-MONTHCAL_GetToday(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
 {
   SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam;
 
@@ -1154,7 +1154,7 @@
 
 
 static LRESULT
-MONTHCAL_HitTest(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
 {
   PMCHITTESTINFO lpht = (PMCHITTESTINFO)lParam;
   UINT x,y;
@@ -1693,7 +1693,7 @@
 
 
 static LRESULT
-MONTHCAL_KillFocus(MONTHCAL_INFO *infoPtr)
+MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr)
 {
   TRACE("\n");
 
@@ -1704,7 +1704,7 @@
 
 
 static LRESULT
-MONTHCAL_SetFocus(MONTHCAL_INFO *infoPtr)
+MONTHCAL_SetFocus(const MONTHCAL_INFO *infoPtr)
 {
   TRACE("\n");
 
@@ -1821,7 +1821,7 @@
   return 0;
 }
 
-static LRESULT MONTHCAL_GetFont(MONTHCAL_INFO *infoPtr)
+static LRESULT MONTHCAL_GetFont(const MONTHCAL_INFO *infoPtr)
 {
     return (LRESULT)infoPtr->hFont;
 }
@@ -1847,7 +1847,7 @@
 }
 
 /* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (MONTHCAL_INFO* infoPtr)
+static LRESULT theme_changed (const MONTHCAL_INFO* infoPtr)
 {
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
     CloseThemeData (theme);



More information about the wine-patches mailing list