Slight cleanup of winding allocation.

It seems gcc doesn't care if the & is present when calculating field
offsets, but it not being there bothered me very much and might as well use
our "standard" macro anyway.
This commit is contained in:
Bill Currie 2018-09-09 13:38:32 +09:00
parent db3df6f8a7
commit 06ab36de3d

View file

@ -149,7 +149,7 @@ NewWinding (int points)
if (points > MAX_POINTS_ON_WINDING)
Sys_Error ("NewWinding: %i points", points);
size = (size_t)(uintptr_t) ((winding_t *) 0)->points[points];
size = field_offset (winding_t, points[points]);
winding = calloc (1, size);
return winding;
@ -168,7 +168,7 @@ CopyWinding (const winding_t *w)
size_t size;
winding_t *copy;
size = (size_t) (uintptr_t) ((winding_t *) 0)->points[w->numpoints];
size = field_offset (winding_t, points[w->numpoints]);
copy = malloc (size);
memcpy (copy, w, size);
copy->original = false;