mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 16:51:08 +00:00
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:
parent
db3df6f8a7
commit
06ab36de3d
1 changed files with 2 additions and 2 deletions
|
@ -149,7 +149,7 @@ NewWinding (int points)
|
||||||
if (points > MAX_POINTS_ON_WINDING)
|
if (points > MAX_POINTS_ON_WINDING)
|
||||||
Sys_Error ("NewWinding: %i points", points);
|
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);
|
winding = calloc (1, size);
|
||||||
|
|
||||||
return winding;
|
return winding;
|
||||||
|
@ -168,7 +168,7 @@ CopyWinding (const winding_t *w)
|
||||||
size_t size;
|
size_t size;
|
||||||
winding_t *copy;
|
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);
|
copy = malloc (size);
|
||||||
memcpy (copy, w, size);
|
memcpy (copy, w, size);
|
||||||
copy->original = false;
|
copy->original = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue