if (c_active_windings > c_peak_windings)
c_peak_windings = c_active_windings;
}
- s = sizeof(vec_t)*3*points + sizeof(int);
+ s = sizeof(*w) + (points ? sizeof(w->p[0])*(points-1) : 0);
w = safe_malloc (s);
memset (w, 0, s);
return w;
if (c_active_windings > c_peak_windings)
c_peak_windings = c_active_windings;
}
- s = sizeof(vec_accu_t) * 3 * points + sizeof(int);
+ s = sizeof(*w) + (points ? sizeof(w->p[0])*(points-1) : 0);
w = safe_malloc(s);
memset(w, 0, s);
return w;
typedef struct
{
int numpoints;
- vec3_t p[4]; // variable sized
+ vec3_t p[1]; // variable sized
} winding_t;
#define MAX_POINTS_ON_WINDING 512
typedef struct
{
int numpoints;
- vec3_accu_t p[4]; // variable sized
+ vec3_accu_t p[1]; // variable sized
} winding_accu_t;
winding_accu_t *BaseWindingForPlaneAccu(vec3_t normal, vec_t dist);