[WIN32K]: Avoid (LPWSTR) casts on strings that are LPCWSTR, by just using the corresponding const type LPCWSTR in the functions parameters.

svn path=/trunk/; revision=71484
This commit is contained in:
Hermès Bélusca-Maïto 2016-06-01 13:20:18 +00:00
parent b98bfa81af
commit 2c7124382b
5 changed files with 16 additions and 16 deletions

View file

@ -117,7 +117,7 @@ DWORD
FASTCALL FASTCALL
GreGetCharacterPlacementW( GreGetCharacterPlacementW(
HDC hdc, HDC hdc,
LPWSTR pwsz, LPCWSTR pwsz,
INT nCount, INT nCount,
INT nMaxExtent, INT nMaxExtent,
LPGCP_RESULTSW pgcpw, LPGCP_RESULTSW pgcpw,

View file

@ -3316,7 +3316,7 @@ GreExtTextOutW(
IN INT YStart, IN INT YStart,
IN UINT fuOptions, IN UINT fuOptions,
IN OPTIONAL PRECTL lprc, IN OPTIONAL PRECTL lprc,
IN LPWSTR String, IN LPCWSTR String,
IN INT Count, IN INT Count,
IN OPTIONAL LPINT Dx, IN OPTIONAL LPINT Dx,
IN DWORD dwCodePage) IN DWORD dwCodePage)
@ -3885,7 +3885,7 @@ NtGdiExtTextOutW(
RECTL SafeRect; RECTL SafeRect;
BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE]; BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE];
PVOID Buffer = LocalBuffer; PVOID Buffer = LocalBuffer;
LPWSTR SafeString = NULL; LPCWSTR SafeString = NULL;
LPINT SafeDx = NULL; LPINT SafeDx = NULL;
ULONG BufSize, StringSize, DxSize = 0; ULONG BufSize, StringSize, DxSize = 0;
@ -3922,7 +3922,7 @@ NtGdiExtTextOutW(
_SEH2_TRY _SEH2_TRY
{ {
/* Put the Dx before the String to assure alignment of 4 */ /* 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 */ /* Probe and copy the string */
ProbeForRead(UnsafeString, StringSize, 1); ProbeForRead(UnsafeString, StringSize, 1);

View file

@ -23,7 +23,7 @@ GreTextOutW(
LPCWSTR lpString, LPCWSTR lpString,
int cchString) 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 @@ BOOL
FASTCALL FASTCALL
GreGetTextExtentW( GreGetTextExtentW(
HDC hDC, HDC hDC,
LPWSTR lpwsz, LPCWSTR lpwsz,
INT cwc, INT cwc,
LPSIZE psize, LPSIZE psize,
UINT flOpts) UINT flOpts)
@ -92,7 +92,7 @@ BOOL
FASTCALL FASTCALL
GreGetTextExtentExW( GreGetTextExtentExW(
HDC hDC, HDC hDC,
LPWSTR String, LPCWSTR String,
ULONG Count, ULONG Count,
ULONG MaxExtent, ULONG MaxExtent,
PULONG Fit, PULONG Fit,

View file

@ -126,10 +126,10 @@ BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO); BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR); DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL RECTL*, 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); DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD);
BOOL FASTCALL GreGetTextExtentW(HDC,LPWSTR,INT,LPSIZE,UINT); BOOL FASTCALL GreGetTextExtentW(HDC,LPCWSTR,INT,LPSIZE,UINT);
BOOL FASTCALL GreGetTextExtentExW(HDC,LPWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG); BOOL FASTCALL GreGetTextExtentExW(HDC,LPCWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG);
BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int); BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int);
HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * ); HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * );
BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm); BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm);

View file

@ -120,7 +120,7 @@ LONG TEXT_TabbedTextOut( HDC hdc,
if (lpstr[j] == '\t') break; if (lpstr[j] == '\t') break;
/* get the extent of the normal character part */ /* get the extent of the normal character part */
#ifdef _WIN32K_ #ifdef _WIN32K_
GreGetTextExtentW( hdc, (LPWSTR)lpstr + i, j - i , &extent, 0 ); GreGetTextExtentW( hdc, lpstr + i, j - i , &extent, 0 );
#else #else
GetTextExtentPointW( hdc, lpstr + i, j - i , &extent ); GetTextExtentPointW( hdc, lpstr + i, j - i , &extent );
#endif #endif
@ -169,7 +169,7 @@ LONG TEXT_TabbedTextOut( HDC hdc,
r.bottom = y + extent.cy; r.bottom = y + extent.cy;
#ifdef _WIN32K_ #ifdef _WIN32K_
GreExtTextOutW( hdc, x0, y, GreGetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0, 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 #else
ExtTextOutW( hdc, x0, y, GetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0, ExtTextOutW( hdc, x0, y, GetBkMode(hdc) == OPAQUE ? ETO_OPAQUE : 0,
&r, lpstr + i, j - i, NULL ); &r, lpstr + i, j - i, NULL );
@ -1029,13 +1029,13 @@ static void TEXT_DrawUnderscore (HDC hdc, int x, int y, const WCHAR *str, int of
HPEN hpen; HPEN hpen;
HPEN oldPen; HPEN oldPen;
#ifdef _WIN32K_ #ifdef _WIN32K_
GreGetTextExtentW (hdc, (LPWSTR)str, offset, &size, 0); GreGetTextExtentW (hdc, str, offset, &size, 0);
#else #else
GetTextExtentPointW (hdc, str, offset, &size); GetTextExtentPointW (hdc, str, offset, &size);
#endif #endif
prefix_x = x + size.cx; prefix_x = x + size.cx;
#ifdef _WIN32K_ #ifdef _WIN32K_
GreGetTextExtentW (hdc, (LPWSTR)str, offset+1, &size, 0); GreGetTextExtentW (hdc, str, offset+1, &size, 0);
#else #else
GetTextExtentPointW (hdc, str, offset+1, &size); GetTextExtentPointW (hdc, str, offset+1, &size);
#endif #endif
@ -1276,7 +1276,7 @@ INT WINAPI DrawTextExWorker( HDC hdc,
len_seg = p - str; len_seg = p - str;
if (len_seg != len && if (len_seg != len &&
#ifdef _WIN32K_ #ifdef _WIN32K_
!GreGetTextExtentW(hdc, (LPWSTR)str, len_seg, &size, 0)) !GreGetTextExtentW(hdc, str, len_seg, &size, 0))
#else #else
!GetTextExtentPointW(hdc, str, len_seg, &size)) !GetTextExtentPointW(hdc, str, len_seg, &size))
#endif #endif
@ -1295,7 +1295,7 @@ INT WINAPI DrawTextExWorker( HDC hdc,
if (!GreExtTextOutW( hdc, xseg, y, if (!GreExtTextOutW( hdc, xseg, y,
((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) | ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |
((flags & DT_RTLREADING) ? ETO_RTLREADING : 0), ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0),
rect, (LPWSTR)str, len_seg, NULL, 0 )) rect, str, len_seg, NULL, 0 ))
#else #else
if (!ExtTextOutW( hdc, xseg, y, if (!ExtTextOutW( hdc, xseg, y,
((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) | ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |