gdiplus: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-10 08:43:13 +01:00 committed by Alexandre Julliard
parent 46667959e7
commit 846fcc5bf6
10 changed files with 50 additions and 51 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = gdiplus.dll
IMPORTLIB = gdiplus
IMPORTS = uuid shlwapi ole32 oleaut32 user32 gdi32

View File

@ -271,7 +271,7 @@ GpStatus get_hatch_data(GpHatchStyle hatchstyle, const unsigned char **result)
*/
GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
{
TRACE("(%d, %d, %d, %p)\n", hatchstyle, forecol, backcol, brush);
TRACE("(%d, %ld, %ld, %p)\n", hatchstyle, forecol, backcol, brush);
if(!brush) return InvalidParameter;
@ -372,7 +372,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
GpStatus stat;
GpRectF rect;
TRACE("(%s, %s, %x, %x, %d, %p)\n", debugstr_pointf(startpoint),
TRACE("(%s, %s, %lx, %lx, %d, %p)\n", debugstr_pointf(startpoint),
debugstr_pointf(endpoint), startcolor, endcolor, wrap, line);
if(!line || !startpoint || !endpoint || wrap == WrapModeClamp)
@ -415,7 +415,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint,
GpPointF stF;
GpPointF endF;
TRACE("(%p, %p, %x, %x, %d, %p)\n", startpoint, endpoint,
TRACE("(%p, %p, %lx, %lx, %d, %p)\n", startpoint, endpoint,
startcolor, endcolor, wrap, line);
if(!startpoint || !endpoint)
@ -435,7 +435,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
{
float angle;
TRACE("(%s, %x, %x, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, mode,
TRACE("(%s, %lx, %lx, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, mode,
wrap, line);
if(!line || !rect)
@ -468,7 +468,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
{
GpRectF rectF;
TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
TRACE("(%p, %lx, %lx, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
wrap, line);
set_rect(&rectF, rect->X, rect->Y, rect->Width, rect->Height);
@ -487,7 +487,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect
REAL sin_angle, cos_angle, sin_cos_angle;
GpPointF start, end;
TRACE("(%s, %x, %x, %.2f, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, angle, isAngleScalable,
TRACE("(%s, %lx, %lx, %.2f, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, angle, isAngleScalable,
wrap, line);
if (!rect || !line || wrap == WrapModeClamp)
@ -586,7 +586,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect
ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap,
GpLineGradient **line)
{
TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
TRACE("(%p, %lx, %lx, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
wrap, line);
return GdipCreateLineBrushFromRectI(rect, startcolor, endcolor, LinearGradientModeForwardDiagonal,
@ -752,7 +752,7 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
*/
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
{
TRACE("(%x, %p)\n", color, sf);
TRACE("(%lx, %p)\n", color, sf);
if(!sf) return InvalidParameter;
@ -1652,7 +1652,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount(GpPathGradient *brush,
GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad,
ARGB argb)
{
TRACE("(%p, %x)\n", grad, argb);
TRACE("(%p, %lx)\n", grad, argb);
if(!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter;
@ -1920,7 +1920,7 @@ GpStatus WINGDIPAPI GdipTranslatePathGradientTransform(GpPathGradient *grad,
GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
{
TRACE("(%p, %x)\n", sf, argb);
TRACE("(%p, %lx)\n", sf, argb);
if(!sf)
return InvalidParameter;
@ -1965,7 +1965,7 @@ GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode
GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
ARGB color2)
{
TRACE("(%p, %x, %x)\n", brush, color1, color2);
TRACE("(%p, %lx, %lx)\n", brush, color1, color2);
if(!brush || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter;

View File

@ -354,7 +354,7 @@ GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
if (!(font && size)) return InvalidParameter;
*size = get_font_size(font);
TRACE("%s,%d => %f\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *size);
TRACE("%s,%ld => %f\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *size);
return Ok;
}
@ -398,7 +398,7 @@ GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style)
return InvalidParameter;
*style = get_font_style(font);
TRACE("%s,%d => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *style);
TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *style);
return Ok;
}
@ -421,7 +421,7 @@ GpStatus WINGDIPAPI GdipGetFontUnit(GpFont *font, Unit *unit)
if (!(font && unit)) return InvalidParameter;
*unit = font->unit;
TRACE("%s,%d => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *unit);
TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *unit);
return Ok;
}
@ -509,7 +509,7 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW
lf->lfPitchAndFamily = 0;
lstrcpyW(lf->lfFaceName, font->family->FamilyName);
TRACE("=> %s,%d\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
TRACE("=> %s,%ld\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
return Ok;
}
@ -561,7 +561,7 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font,
if (!graphics)
{
*height = font_height;
TRACE("%s,%d => %f\n",
TRACE("%s,%ld => %f\n",
debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
return Ok;
}
@ -571,7 +571,7 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font,
*height = pixels_to_units(font_height, graphics->unit, dpi, graphics->printer_display);
TRACE("%s,%d(unit %d) => %f\n",
TRACE("%s,%ld(unit %d) => %f\n",
debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, graphics->unit, *height);
return Ok;
}
@ -612,7 +612,7 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi,
*height = (REAL)line_spacing * font_size / (REAL)em_height;
TRACE("%s,%d => %f\n",
TRACE("%s,%ld => %f\n",
debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
return Ok;
@ -1489,7 +1489,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
return OutOfMemory;
font = AddFontMemResourceEx((void*)memory, length, NULL, &count);
TRACE("%s: %p/%u\n", debugstr_w(name), font, count);
TRACE("%s: %p/%lu\n", debugstr_w(name), font, count);
if (!font || !count)
ret = InvalidParameter;
else

View File

@ -49,7 +49,7 @@ static Status WINAPI NotificationHook(ULONG_PTR *token)
static void WINAPI NotificationUnhook(ULONG_PTR token)
{
TRACE("%ld\n", token);
TRACE("%Id\n", token);
}
/*****************************************************
@ -57,7 +57,7 @@ static void WINAPI NotificationUnhook(ULONG_PTR token)
*/
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
TRACE("(%p, %ld, %p)\n", hinst, reason, reserved);
switch(reason)
{
@ -115,7 +115,7 @@ GpStatus WINAPI GdiplusNotificationHook(ULONG_PTR *token)
void WINAPI GdiplusNotificationUnhook(ULONG_PTR token)
{
FIXME("%ld\n", token);
FIXME("%Id\n", token);
NotificationUnhook(token);
}

View File

@ -297,7 +297,7 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
TRACE("dashes are: ");
for(i = 0; i < numdashes; i++){
dash_array[i] = gdip_round(width * pen->dashes[i]);
TRACE("%d, ", dash_array[i]);
TRACE("%ld, ", dash_array[i]);
}
TRACE("\n and the pen style is %x\n", pen->style);
@ -3132,7 +3132,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
BOOL do_resampling = FALSE;
BOOL use_software = FALSE;
TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n",
TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08lx\n",
graphics->xres, graphics->yres,
graphics->image && graphics->image->type == ImageTypeBitmap ? ((GpBitmap *)graphics->image)->format : 0,
graphics->scale, image->xres, image->yres, bitmap->format,
@ -5049,7 +5049,7 @@ GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
GpRectF wnd_rect;
CompositingMode prev_comp_mode;
TRACE("(%p, %x)\n", graphics, color);
TRACE("(%p, %lx)\n", graphics, color);
if(!graphics)
return InvalidParameter;

View File

@ -1455,7 +1455,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* info,
height = abs(info->bmiHeader.biHeight);
stride = ((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) >> 3) & ~3;
TRACE("height %u, stride %u, image size %u\n", height, stride, height * stride);
TRACE("height %lu, stride %lu, image size %lu\n", height, stride, height * stride);
memcpy(bmbits, bits, height * stride);
@ -1519,7 +1519,7 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
LPBYTE bits;
BOOL unlock;
TRACE("(%p,%p,%x)\n", bitmap, hbmReturn, background);
TRACE("(%p,%p,%lx)\n", bitmap, hbmReturn, background);
if (!bitmap || !hbmReturn) return InvalidParameter;
if (!image_lock(&bitmap->image, &unlock)) return ObjectBusy;
@ -2540,7 +2540,7 @@ GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT
IWICMetadataReader *reader;
PROPVARIANT id, value;
TRACE("(%p,%#x,%p)\n", image, propid, size);
TRACE("(%p,%#lx,%p)\n", image, propid, size);
if (!size || !image) return InvalidParameter;
@ -2688,7 +2688,7 @@ GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size
IWICMetadataReader *reader;
PROPVARIANT id, value;
TRACE("(%p,%#x,%u,%p)\n", image, propid, size, buffer);
TRACE("(%p,%#lx,%u,%p)\n", image, propid, size, buffer);
if (!image || !buffer) return InvalidParameter;
@ -4319,7 +4319,7 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res
}
}
TRACE("no match for %i byte signature %x %x %x %x %x %x %x %x\n", bytesread,
TRACE("no match for %lu byte signature %x %x %x %x %x %x %x %x\n", bytesread,
signature[0],signature[1],signature[2],signature[3],
signature[4],signature[5],signature[6],signature[7]);
@ -4444,7 +4444,7 @@ GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId)
{
static int calls;
TRACE("(%p,%u)\n", image, propId);
TRACE("(%p,%lu)\n", image, propId);
if(!image)
return InvalidParameter;
@ -4461,7 +4461,7 @@ GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem*
if (!image || !item) return InvalidParameter;
TRACE("(%p,%p:%#x,%u,%u,%p)\n", image, item, item->id, item->type, item->length, item->value);
TRACE("(%p,%p:%#lx,%u,%lu,%p)\n", image, item, item->id, item->type, item->length, item->value);
if(!(calls++))
FIXME("not implemented\n");
@ -5252,7 +5252,7 @@ static PixelFormat get_16bpp_format(HBITMAP hbm)
}
else
{
FIXME("unrecognized bitfields %x,%x,%x\n", bmh.bV4RedMask,
FIXME("unrecognized bitfields %lx,%lx,%lx\n", bmh.bV4RedMask,
bmh.bV4GreenMask, bmh.bV4BlueMask);
result = PixelFormatUndefined;
}

View File

@ -129,7 +129,7 @@ GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette(GpImageAttributes *ima
GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
{
TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr, type, enableFlag, colorLow, colorHigh);
TRACE("(%p,%u,%i,%08lx,%08lx)\n", imageattr, type, enableFlag, colorLow, colorHigh);
if(!imageattr || type >= ColorAdjustTypeCount)
return InvalidParameter;
@ -176,7 +176,7 @@ GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageat
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
WrapMode wrap, ARGB argb, BOOL clamp)
{
TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp);
TRACE("(%p,%u,%08lx,%i)\n", imageAttr, wrap, argb, clamp);
if(!imageAttr || wrap > WrapModeClamp)
return InvalidParameter;

View File

@ -1777,7 +1777,7 @@ static GpStatus metafile_deserialize_image(const BYTE *record_data, UINT data_si
break;
}
default:
WARN("Invalid bitmap type %d.\n", bitmapdata->Type);
WARN("Invalid bitmap type %ld.\n", bitmapdata->Type);
return InvalidParameter;
}
break;
@ -1810,7 +1810,7 @@ static GpStatus metafile_deserialize_image(const BYTE *record_data, UINT data_si
break;
}
default:
FIXME("metafile type %d not supported.\n", metafiledata->Type);
FIXME("metafile type %ld not supported.\n", metafiledata->Type);
return NotImplemented;
}
break;
@ -1980,7 +1980,7 @@ static GpStatus metafile_read_region_node(struct memory_buffer *mbuf, GpRegion *
*count += 1;
return Ok;
default:
FIXME("element type %#x is not supported\n", *type);
FIXME("element type %#lx is not supported\n", *type);
break;
}
@ -2151,7 +2151,7 @@ static GpStatus metafile_deserialize_brush(const BYTE *record_data, UINT data_si
break;
}
default:
FIXME("brush type %u is not supported.\n", data->Type);
FIXME("brush type %lu is not supported.\n", data->Type);
return NotImplemented;
}

View File

@ -139,7 +139,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
GpBrush *brush;
GpStatus status;
TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);
TRACE("(%lx, %.2f, %d, %p)\n", color, width, unit, pen);
GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
status = GdipCreatePen2(brush, width, unit, pen);
@ -512,7 +512,7 @@ GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
{
TRACE("(%p, %x)\n", pen, argb);
TRACE("(%p, %lx)\n", pen, argb);
if(!pen)
return InvalidParameter;

View File

@ -772,7 +772,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
type = buffer_read(mbuf, sizeof(*type));
if (!type) return Ok;
TRACE("type %#x\n", *type);
TRACE("type %#lx\n", *type);
node->type = *type;
@ -844,7 +844,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
}
if (!VALID_MAGIC(path_header->magic))
{
ERR("invalid path header magic %#x\n", path_header->magic);
ERR("invalid path header magic %#lx\n", path_header->magic);
return InvalidParameter;
}
@ -866,7 +866,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
path->pathdata.Count = path_header->count;
if (path_header->flags & ~FLAGS_INTPATH)
FIXME("unhandled path flags %#x\n", path_header->flags);
FIXME("unhandled path flags %#lx\n", path_header->flags);
if (path_header->flags & FLAGS_INTPATH)
{
@ -876,7 +876,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
pt = buffer_read(mbuf, sizeof(*pt) * path_header->count);
if (!pt)
{
ERR("failed to read packed %u path points\n", path_header->count);
ERR("failed to read packed %lu path points\n", path_header->count);
return InvalidParameter;
}
@ -893,7 +893,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
ptf = buffer_read(mbuf, sizeof(*ptf) * path_header->count);
if (!ptf)
{
ERR("failed to read %u path points\n", path_header->count);
ERR("failed to read %lu path points\n", path_header->count);
return InvalidParameter;
}
memcpy(path->pathdata.Points, ptf, sizeof(*ptf) * path_header->count);
@ -902,7 +902,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
types = buffer_read(mbuf, path_header->count);
if (!types)
{
ERR("failed to read %u path types\n", path_header->count);
ERR("failed to read %lu path types\n", path_header->count);
return InvalidParameter;
}
memcpy(path->pathdata.Types, types, path_header->count);
@ -910,7 +910,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
{
if (!buffer_read(mbuf, 4 - (path_header->count & 3)))
{
ERR("failed to read rounding %u bytes\n", 4 - (path_header->count & 3));
ERR("failed to read rounding %lu bytes\n", 4 - (path_header->count & 3));
return InvalidParameter;
}
}
@ -925,7 +925,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
return Ok;
default:
FIXME("element type %#x is not supported\n", *type);
FIXME("element type %#lx is not supported\n", *type);
break;
}
@ -1174,7 +1174,7 @@ static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *grap
return Ok;
}
default:
FIXME("GdipGetRegionHRgn unimplemented for region type=%x\n", element->type);
FIXME("GdipGetRegionHRgn unimplemented for region type=%lx\n", element->type);
*hrgn = NULL;
return NotImplemented;
}