Author: hbelusca Date: Wed Jun 1 13:20:18 2016 New Revision: 71484
URL: http://svn.reactos.org/svn/reactos?rev=71484&view=rev Log: [WIN32K]: Avoid (LPWSTR) casts on strings that are LPCWSTR, by just using the corresponding const type LPCWSTR in the functions parameters.
Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c trunk/reactos/win32ss/gdi/ntgdi/freetype.c trunk/reactos/win32ss/gdi/ntgdi/text.c trunk/reactos/win32ss/gdi/ntgdi/text.h trunk/reactos/win32ss/user/rtl/text.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.c?re... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] Wed Jun 1 13:20:18 2016 @@ -117,7 +117,7 @@ FASTCALL GreGetCharacterPlacementW( HDC hdc, - LPWSTR pwsz, + LPCWSTR pwsz, INT nCount, INT nMaxExtent, LPGCP_RESULTSW pgcpw,
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype.... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Wed Jun 1 13:20:18 2016 @@ -3316,7 +3316,7 @@ IN INT YStart, IN UINT fuOptions, IN OPTIONAL PRECTL lprc, - IN LPWSTR String, + IN LPCWSTR String, IN INT Count, IN OPTIONAL LPINT Dx, IN DWORD dwCodePage) @@ -3885,7 +3885,7 @@ RECTL SafeRect; BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE]; PVOID Buffer = LocalBuffer; - LPWSTR SafeString = NULL; + LPCWSTR SafeString = NULL; LPINT SafeDx = NULL; ULONG BufSize, StringSize, DxSize = 0;
@@ -3922,7 +3922,7 @@ _SEH2_TRY { /* Put the Dx before the String to assure alignment of 4 */ - SafeString = (LPWSTR)(((ULONG_PTR)Buffer) + DxSize); + SafeString = (LPCWSTR)(((ULONG_PTR)Buffer) + DxSize);
/* Probe and copy the string */ ProbeForRead(UnsafeString, StringSize, 1);
Modified: trunk/reactos/win32ss/gdi/ntgdi/text.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.c?re... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/text.c [iso-8859-1] Wed Jun 1 13:20:18 2016 @@ -23,7 +23,7 @@ LPCWSTR lpString, int cchString) { - return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0); + return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, lpString, cchString, NULL, 0); }
/* @@ -35,7 +35,7 @@ FASTCALL GreGetTextExtentW( HDC hDC, - LPWSTR lpwsz, + LPCWSTR lpwsz, INT cwc, LPSIZE psize, UINT flOpts) @@ -92,7 +92,7 @@ FASTCALL GreGetTextExtentExW( HDC hDC, - LPWSTR String, + LPCWSTR String, ULONG Count, ULONG MaxExtent, PULONG Fit,
Modified: trunk/reactos/win32ss/gdi/ntgdi/text.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.h?re... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/text.h [iso-8859-1] Wed Jun 1 13:20:18 2016 @@ -126,10 +126,10 @@ BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO); DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR); BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL RECTL*, - IN LPWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD); + IN LPCWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD); DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD); -BOOL FASTCALL GreGetTextExtentW(HDC,LPWSTR,INT,LPSIZE,UINT); -BOOL FASTCALL GreGetTextExtentExW(HDC,LPWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG); +BOOL FASTCALL GreGetTextExtentW(HDC,LPCWSTR,INT,LPSIZE,UINT); +BOOL FASTCALL GreGetTextExtentExW(HDC,LPCWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG); BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int); HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * ); BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm);
Modified: trunk/reactos/win32ss/user/rtl/text.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/rtl/text.c?rev... ============================================================================== --- trunk/reactos/win32ss/user/rtl/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/rtl/text.c [iso-8859-1] Wed Jun 1 13:20:18 2016 @@ -120,7 +120,7 @@ if (lpstr[j] == '\t') break; /* get the extent of the normal character part */ #ifdef _WIN32K_ - GreGetTextExtentW( hdc, (LPWSTR)lpstr + i, j - i , &extent, 0 ); + GreGetTextExtentW( hdc, lpstr + i, j - i , &extent, 0 ); #else GetTextExtentPointW( hdc, lpstr + i, j - i , &extent ); #endif @@ -169,7 +169,7 @@ r.bottom = y + extent.cy; #ifdef _WIN32K_ GreExtTextOutW( hdc, x0, y, GreGetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0, - &r, (LPWSTR)lpstr + i, j - i, NULL, 0 ); + &r, lpstr + i, j - i, NULL, 0 ); #else ExtTextOutW( hdc, x0, y, GetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0, &r, lpstr + i, j - i, NULL ); @@ -1029,13 +1029,13 @@ HPEN hpen; HPEN oldPen; #ifdef _WIN32K_ - GreGetTextExtentW (hdc, (LPWSTR)str, offset, &size, 0); + GreGetTextExtentW (hdc, str, offset, &size, 0); #else GetTextExtentPointW (hdc, str, offset, &size); #endif prefix_x = x + size.cx; #ifdef _WIN32K_ - GreGetTextExtentW (hdc, (LPWSTR)str, offset+1, &size, 0); + GreGetTextExtentW (hdc, str, offset+1, &size, 0); #else GetTextExtentPointW (hdc, str, offset+1, &size); #endif @@ -1276,7 +1276,7 @@ len_seg = p - str; if (len_seg != len && #ifdef _WIN32K_ - !GreGetTextExtentW(hdc, (LPWSTR)str, len_seg, &size, 0)) + !GreGetTextExtentW(hdc, str, len_seg, &size, 0)) #else !GetTextExtentPointW(hdc, str, len_seg, &size)) #endif @@ -1295,7 +1295,7 @@ if (!GreExtTextOutW( hdc, xseg, y, ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) | ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0), - rect, (LPWSTR)str, len_seg, NULL, 0 )) + rect, str, len_seg, NULL, 0 )) #else if (!ExtTextOutW( hdc, xseg, y, ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |