gdi32: Fix compiler warnings with flag -Wcast-qual.
This commit is contained in:
parent
0519c4b68a
commit
8fd8d9e96a
|
@ -1077,7 +1077,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually
|
||||
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
|
||||
|
||||
POINTS *pts = (POINTS *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
|
||||
const POINTS *pts = (const POINTS *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
|
||||
POINT *pt = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) );
|
||||
DWORD i;
|
||||
for(i = 0; i < pPolyPoly->cpts; i++)
|
||||
|
@ -1085,7 +1085,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
pt[i].x = pts[i].x;
|
||||
pt[i].y = pts[i].y;
|
||||
}
|
||||
PolyPolygon(hdc, pt, (INT*)pPolyPoly->aPolyCounts, pPolyPoly->nPolys);
|
||||
PolyPolygon(hdc, pt, (const INT*)pPolyPoly->aPolyCounts, pPolyPoly->nPolys);
|
||||
HeapFree( GetProcessHeap(), 0, pt );
|
||||
break;
|
||||
}
|
||||
|
@ -1095,7 +1095,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually
|
||||
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
|
||||
|
||||
POINTS *pts = (POINTS *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
|
||||
const POINTS *pts = (const POINTS *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
|
||||
POINT *pt = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) );
|
||||
DWORD i;
|
||||
for(i = 0; i < pPolyPoly->cpts; i++)
|
||||
|
@ -1218,7 +1218,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
HRGN hRgn = 0;
|
||||
|
||||
if (mr->nSize >= sizeof(*lpRgn) + sizeof(RGNDATAHEADER))
|
||||
hRgn = ExtCreateRegion( &info->init_transform, 0, (RGNDATA *)lpRgn->RgnData );
|
||||
hRgn = ExtCreateRegion( &info->init_transform, 0, (const RGNDATA *)lpRgn->RgnData );
|
||||
|
||||
ExtSelectClipRgn(hdc, hRgn, (INT)(lpRgn->iMode));
|
||||
/* ExtSelectClipRgn created a copy of the region */
|
||||
|
@ -1281,7 +1281,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
const EMRPOLYPOLYLINE *pPolyPolyline = (const EMRPOLYPOLYLINE *)mr;
|
||||
/* NB Points at pPolyPolyline->aPolyCounts + pPolyPolyline->nPolys */
|
||||
|
||||
PolyPolyline(hdc, (LPPOINT)(pPolyPolyline->aPolyCounts +
|
||||
PolyPolyline(hdc, (const POINT*)(pPolyPolyline->aPolyCounts +
|
||||
pPolyPolyline->nPolys),
|
||||
pPolyPolyline->aPolyCounts,
|
||||
pPolyPolyline->nPolys );
|
||||
|
@ -1295,9 +1295,9 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
|
||||
/* NB Points at pPolyPolygon->aPolyCounts + pPolyPolygon->nPolys */
|
||||
|
||||
PolyPolygon(hdc, (LPPOINT)(pPolyPolygon->aPolyCounts +
|
||||
PolyPolygon(hdc, (const POINT*)(pPolyPolygon->aPolyCounts +
|
||||
pPolyPolygon->nPolys),
|
||||
(INT*)pPolyPolygon->aPolyCounts, pPolyPolygon->nPolys );
|
||||
(const INT*)pPolyPolygon->aPolyCounts, pPolyPolygon->nPolys );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2113,7 +2113,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
case EMR_FILLRGN:
|
||||
{
|
||||
const EMRFILLRGN *pFillRgn = (const EMRFILLRGN *)mr;
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pFillRgn->cbRgnData, (RGNDATA *)pFillRgn->RgnData);
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pFillRgn->cbRgnData, (const RGNDATA *)pFillRgn->RgnData);
|
||||
FillRgn(hdc,
|
||||
hRgn,
|
||||
(handletable->objectHandle)[pFillRgn->ihBrush]);
|
||||
|
@ -2124,7 +2124,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
case EMR_FRAMERGN:
|
||||
{
|
||||
const EMRFRAMERGN *pFrameRgn = (const EMRFRAMERGN *)mr;
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pFrameRgn->cbRgnData, (RGNDATA *)pFrameRgn->RgnData);
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pFrameRgn->cbRgnData, (const RGNDATA *)pFrameRgn->RgnData);
|
||||
FrameRgn(hdc,
|
||||
hRgn,
|
||||
(handletable->objectHandle)[pFrameRgn->ihBrush],
|
||||
|
@ -2137,7 +2137,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
case EMR_INVERTRGN:
|
||||
{
|
||||
const EMRINVERTRGN *pInvertRgn = (const EMRINVERTRGN *)mr;
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pInvertRgn->cbRgnData, (RGNDATA *)pInvertRgn->RgnData);
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pInvertRgn->cbRgnData, (const RGNDATA *)pInvertRgn->RgnData);
|
||||
InvertRgn(hdc, hRgn);
|
||||
DeleteObject(hRgn);
|
||||
break;
|
||||
|
@ -2146,7 +2146,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
|
|||
case EMR_PAINTRGN:
|
||||
{
|
||||
const EMRPAINTRGN *pPaintRgn = (const EMRPAINTRGN *)mr;
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pPaintRgn->cbRgnData, (RGNDATA *)pPaintRgn->RgnData);
|
||||
HRGN hRgn = ExtCreateRegion(NULL, pPaintRgn->cbRgnData, (const RGNDATA *)pPaintRgn->RgnData);
|
||||
PaintRgn(hdc, hRgn);
|
||||
DeleteObject(hRgn);
|
||||
break;
|
||||
|
|
|
@ -4248,7 +4248,7 @@ static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph)
|
|||
const GSUB_CoverageFormat2* cf2;
|
||||
int i;
|
||||
int count;
|
||||
cf2 = (GSUB_CoverageFormat2*)cf1;
|
||||
cf2 = (const GSUB_CoverageFormat2*)cf1;
|
||||
|
||||
count = GET_BE_WORD(cf2->RangeCount);
|
||||
TRACE("Coverage Format 2, %i ranges\n",count);
|
||||
|
@ -4276,7 +4276,7 @@ static const GSUB_Script* GSUB_get_script_table( const GSUB_Header* header, cons
|
|||
const GSUB_ScriptList *script;
|
||||
const GSUB_Script *deflt = NULL;
|
||||
int i;
|
||||
script = (GSUB_ScriptList*)((LPBYTE)header + GET_BE_WORD(header->ScriptList));
|
||||
script = (const GSUB_ScriptList*)((const BYTE*)header + GET_BE_WORD(header->ScriptList));
|
||||
|
||||
TRACE("%i scripts in this font\n",GET_BE_WORD(script->ScriptCount));
|
||||
for (i = 0; i < GET_BE_WORD(script->ScriptCount); i++)
|
||||
|
@ -4285,7 +4285,7 @@ static const GSUB_Script* GSUB_get_script_table( const GSUB_Header* header, cons
|
|||
int offset;
|
||||
|
||||
offset = GET_BE_WORD(script->ScriptRecord[i].Script);
|
||||
scr = (GSUB_Script*)((LPBYTE)script + offset);
|
||||
scr = (const GSUB_Script*)((const BYTE*)script + offset);
|
||||
|
||||
if (strncmp(script->ScriptRecord[i].ScriptTag, tag,4)==0)
|
||||
return scr;
|
||||
|
@ -4306,7 +4306,7 @@ static const GSUB_LangSys* GSUB_get_lang_table( const GSUB_Script* script, const
|
|||
for (i = 0; i < GET_BE_WORD(script->LangSysCount) ; i++)
|
||||
{
|
||||
offset = GET_BE_WORD(script->LangSysRecord[i].LangSys);
|
||||
Lang = (GSUB_LangSys*)((LPBYTE)script + offset);
|
||||
Lang = (const GSUB_LangSys*)((const BYTE*)script + offset);
|
||||
|
||||
if ( strncmp(script->LangSysRecord[i].LangSysTag,tag,4)==0)
|
||||
return Lang;
|
||||
|
@ -4314,7 +4314,7 @@ static const GSUB_LangSys* GSUB_get_lang_table( const GSUB_Script* script, const
|
|||
offset = GET_BE_WORD(script->DefaultLangSys);
|
||||
if (offset)
|
||||
{
|
||||
Lang = (GSUB_LangSys*)((LPBYTE)script + offset);
|
||||
Lang = (const GSUB_LangSys*)((const BYTE*)script + offset);
|
||||
return Lang;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -4324,7 +4324,7 @@ static const GSUB_Feature * GSUB_get_feature(const GSUB_Header *header, const GS
|
|||
{
|
||||
int i;
|
||||
const GSUB_FeatureList *feature;
|
||||
feature = (GSUB_FeatureList*)((LPBYTE)header + GET_BE_WORD(header->FeatureList));
|
||||
feature = (const GSUB_FeatureList*)((const BYTE*)header + GET_BE_WORD(header->FeatureList));
|
||||
|
||||
TRACE("%i features\n",GET_BE_WORD(lang->FeatureCount));
|
||||
for (i = 0; i < GET_BE_WORD(lang->FeatureCount); i++)
|
||||
|
@ -4333,7 +4333,7 @@ static const GSUB_Feature * GSUB_get_feature(const GSUB_Header *header, const GS
|
|||
if (strncmp(feature->FeatureRecord[index].FeatureTag,tag,4)==0)
|
||||
{
|
||||
const GSUB_Feature *feat;
|
||||
feat = (GSUB_Feature*)((LPBYTE)feature + GET_BE_WORD(feature->FeatureRecord[index].Feature));
|
||||
feat = (const GSUB_Feature*)((const BYTE*)feature + GET_BE_WORD(feature->FeatureRecord[index].Feature));
|
||||
return feat;
|
||||
}
|
||||
}
|
||||
|
@ -4345,14 +4345,14 @@ static FT_UInt GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature
|
|||
int i;
|
||||
int offset;
|
||||
const GSUB_LookupList *lookup;
|
||||
lookup = (GSUB_LookupList*)((LPBYTE)header + GET_BE_WORD(header->LookupList));
|
||||
lookup = (const GSUB_LookupList*)((const BYTE*)header + GET_BE_WORD(header->LookupList));
|
||||
|
||||
TRACE("%i lookups\n", GET_BE_WORD(feature->LookupCount));
|
||||
for (i = 0; i < GET_BE_WORD(feature->LookupCount); i++)
|
||||
{
|
||||
const GSUB_LookupTable *look;
|
||||
offset = GET_BE_WORD(lookup->Lookup[GET_BE_WORD(feature->LookupListIndex[i])]);
|
||||
look = (GSUB_LookupTable*)((LPBYTE)lookup + offset);
|
||||
look = (const GSUB_LookupTable*)((const BYTE*)lookup + offset);
|
||||
TRACE("type %i, flag %x, subtables %i\n",GET_BE_WORD(look->LookupType),GET_BE_WORD(look->LookupFlag),GET_BE_WORD(look->SubTableCount));
|
||||
if (GET_BE_WORD(look->LookupType) != 1)
|
||||
FIXME("We only handle SubType 1\n");
|
||||
|
@ -4364,12 +4364,12 @@ static FT_UInt GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature
|
|||
{
|
||||
const GSUB_SingleSubstFormat1 *ssf1;
|
||||
offset = GET_BE_WORD(look->SubTable[j]);
|
||||
ssf1 = (GSUB_SingleSubstFormat1*)((LPBYTE)look+offset);
|
||||
ssf1 = (const GSUB_SingleSubstFormat1*)((const BYTE*)look+offset);
|
||||
if (GET_BE_WORD(ssf1->SubstFormat) == 1)
|
||||
{
|
||||
int offset = GET_BE_WORD(ssf1->Coverage);
|
||||
TRACE(" subtype 1, delta %i\n", GET_BE_WORD(ssf1->DeltaGlyphID));
|
||||
if (GSUB_is_glyph_covered((LPBYTE)ssf1+offset, glyph) != -1)
|
||||
if (GSUB_is_glyph_covered((const BYTE*)ssf1+offset, glyph) != -1)
|
||||
{
|
||||
TRACE(" Glyph 0x%x ->",glyph);
|
||||
glyph += GET_BE_WORD(ssf1->DeltaGlyphID);
|
||||
|
@ -4382,10 +4382,10 @@ static FT_UInt GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature
|
|||
INT index;
|
||||
INT offset;
|
||||
|
||||
ssf2 = (GSUB_SingleSubstFormat2 *)ssf1;
|
||||
ssf2 = (const GSUB_SingleSubstFormat2 *)ssf1;
|
||||
offset = GET_BE_WORD(ssf1->Coverage);
|
||||
TRACE(" subtype 2, glyph count %i\n", GET_BE_WORD(ssf2->GlyphCount));
|
||||
index = GSUB_is_glyph_covered((LPBYTE)ssf2+offset, glyph);
|
||||
index = GSUB_is_glyph_covered((const BYTE*)ssf2+offset, glyph);
|
||||
TRACE(" Coverage index %i\n",index);
|
||||
if (index != -1)
|
||||
{
|
||||
|
|
|
@ -1031,12 +1031,12 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA*
|
|||
|
||||
if (lpXform)
|
||||
{
|
||||
RECT *pCurRect, *pEndRect;
|
||||
const RECT *pCurRect, *pEndRect;
|
||||
|
||||
hrgn = CreateRectRgn( 0, 0, 0, 0 );
|
||||
|
||||
pEndRect = (RECT *)rgndata->Buffer + rgndata->rdh.nCount;
|
||||
for (pCurRect = (RECT *)rgndata->Buffer; pCurRect < pEndRect; pCurRect++)
|
||||
pEndRect = (const RECT *)rgndata->Buffer + rgndata->rdh.nCount;
|
||||
for (pCurRect = (const RECT *)rgndata->Buffer; pCurRect < pEndRect; pCurRect++)
|
||||
{
|
||||
static const INT count = 4;
|
||||
HRGN poly_hrgn;
|
||||
|
@ -1063,10 +1063,10 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA*
|
|||
|
||||
if (init_region( &obj->rgn, rgndata->rdh.nCount ))
|
||||
{
|
||||
RECT *pCurRect, *pEndRect;
|
||||
const RECT *pCurRect, *pEndRect;
|
||||
|
||||
pEndRect = (RECT *)rgndata->Buffer + rgndata->rdh.nCount;
|
||||
for(pCurRect = (RECT *)rgndata->Buffer; pCurRect < pEndRect; pCurRect++)
|
||||
pEndRect = (const RECT *)rgndata->Buffer + rgndata->rdh.nCount;
|
||||
for(pCurRect = (const RECT *)rgndata->Buffer; pCurRect < pEndRect; pCurRect++)
|
||||
{
|
||||
if (pCurRect->left < pCurRect->right && pCurRect->top < pCurRect->bottom)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue