[1/2] gdiplus: Slightly simplify write_path_types.
Dmitry Timoshkov
dmitry at baikal.ru
Fri Nov 15 03:04:32 CST 2013
---
dlls/gdiplus/region.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index 5d95fcd..759675a 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -702,14 +702,15 @@ static inline void write_packed_point(DWORD* location, INT* offset,
static inline void write_path_types(DWORD* location, INT* offset,
const GpPath* path)
{
+ INT rounded_size = get_pathtypes_size(path);
+
memcpy(location + *offset, path->pathdata.Types, path->pathdata.Count);
/* The unwritten parts of the DWORD (if any) must be cleared */
- if (path->pathdata.Count % sizeof(DWORD))
+ if (rounded_size - path->pathdata.Count)
ZeroMemory(((BYTE*)location) + (*offset * sizeof(DWORD)) +
- path->pathdata.Count,
- sizeof(DWORD) - path->pathdata.Count % sizeof(DWORD));
- *offset += (get_pathtypes_size(path) / sizeof(DWORD));
+ path->pathdata.Count, rounded_size - path->pathdata.Count);
+ *offset += rounded_size / sizeof(DWORD);
}
static void write_element(const region_element* element, DWORD *buffer,
--
1.8.4.2
More information about the wine-patches
mailing list