Commit 5e8253aa authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

gdiplus: Assign to structs instead of using memcpy.

parent da0a48d2
...@@ -95,7 +95,7 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, ...@@ -95,7 +95,7 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
if(!font || !graphics || !lfw) if(!font || !graphics || !lfw)
return InvalidParameter; return InvalidParameter;
memcpy(lfw, &font->lfw, sizeof(LOGFONTW)); *lfw = font->lfw;
return Ok; return Ok;
} }
...@@ -1426,7 +1426,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string ...@@ -1426,7 +1426,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
* width, angle). */ * width, angle). */
SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw));
GetTextMetricsW(graphics->hdc, &textmet); GetTextMetricsW(graphics->hdc, &textmet);
memcpy(&lfw, &font->lfw, sizeof(LOGFONTW)); lfw = font->lfw;
lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height); lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height);
lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width); lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width);
...@@ -1811,7 +1811,7 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix ...@@ -1811,7 +1811,7 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix
if(!graphics || !matrix) if(!graphics || !matrix)
return InvalidParameter; return InvalidParameter;
memcpy(matrix, graphics->worldtrans, sizeof(GpMatrix)); *matrix = *graphics->worldtrans;
return Ok; return Ok;
} }
......
...@@ -281,7 +281,7 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone) ...@@ -281,7 +281,7 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone)
*clone = GdipAlloc(sizeof(GpPath)); *clone = GdipAlloc(sizeof(GpPath));
if(!*clone) return OutOfMemory; if(!*clone) return OutOfMemory;
memcpy(*clone, path, sizeof(GpPath)); **clone = *path;
(*clone)->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF)); (*clone)->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF));
(*clone)->pathdata.Types = GdipAlloc(path->datalen); (*clone)->pathdata.Types = GdipAlloc(path->datalen);
......
...@@ -441,7 +441,7 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, ...@@ -441,7 +441,7 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
if(!image || !srcRect || !srcUnit) if(!image || !srcRect || !srcUnit)
return InvalidParameter; return InvalidParameter;
if(image->type == ImageTypeMetafile){ if(image->type == ImageTypeMetafile){
memcpy(srcRect, &((GpMetafile*)image)->bounds, sizeof(GpRectF)); *srcRect = ((GpMetafile*)image)->bounds;
*srcUnit = ((GpMetafile*)image)->unit; *srcUnit = ((GpMetafile*)image)->unit;
} }
else if(image->type == ImageTypeBitmap){ else if(image->type == ImageTypeBitmap){
......
...@@ -97,7 +97,7 @@ GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone) ...@@ -97,7 +97,7 @@ GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
*clone = GdipAlloc(sizeof(GpMatrix)); *clone = GdipAlloc(sizeof(GpMatrix));
if(!*clone) return OutOfMemory; if(!*clone) return OutOfMemory;
memcpy(*clone, matrix, sizeof(GpMatrix)); **clone = *matrix;
return Ok; return Ok;
} }
......
...@@ -75,7 +75,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) ...@@ -75,7 +75,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
*clonepen = GdipAlloc(sizeof(GpPen)); *clonepen = GdipAlloc(sizeof(GpPen));
if(!*clonepen) return OutOfMemory; if(!*clonepen) return OutOfMemory;
memcpy(*clonepen, pen, sizeof(GpPen)); **clonepen = *pen;
GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart); GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend); GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment