Module: wine Branch: master Commit: 4bca12c0db4c8ce56492afd1ed3ee64b77b8508c URL: http://source.winehq.org/git/wine.git/?a=commit;h=4bca12c0db4c8ce56492afd1ed...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Fri Nov 15 18:04:32 2013 +0900
gdiplus: Slightly simplify write_path_types.
---
dlls/gdiplus/region.c | 9 +++++---- 1 files 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,