Minor type safety cleanup.
parent
133165ef9b
commit
be54fe31e7
|
@ -166,9 +166,9 @@ bool sch_hull_sat(const sch_hull* hull_A, const sch_hull* hull_B, sch_manifold*
|
||||||
|
|
||||||
int sch_hull_is_vertex_concave(const sch_hull* hull, const simd4f p);
|
int sch_hull_is_vertex_concave(const sch_hull* hull, const simd4f p);
|
||||||
|
|
||||||
int sch_hull_is_closed (const sch_hull* hull);
|
SchHullResult sch_hull_is_closed (const sch_hull* hull);
|
||||||
|
|
||||||
int sch_hull_connect_face_edges(const sch_hull* hull, int face_index);
|
SchHullResult sch_hull_connect_face_edges(const sch_hull* hull, int face_index);
|
||||||
|
|
||||||
void sch_create_face(int num_vert, simd4f* vertices, sch_face* out_face);
|
void sch_create_face(int num_vert, simd4f* vertices, sch_face* out_face);
|
||||||
|
|
||||||
|
@ -232,8 +232,8 @@ void sch_create_face(int num_vert, simd4f* vertices, sch_face* out_face) {
|
||||||
assert(out_face->edge == NULL);
|
assert(out_face->edge == NULL);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
sch_edge* f_edges = malloc(sizeof(sch_edge) * num_vert);
|
sch_edge* f_edges = (sch_edge*) malloc(sizeof(sch_edge) * num_vert);
|
||||||
sch_vert* f_verts = malloc(sizeof(sch_vert) * num_vert);
|
sch_vert* f_verts = (sch_vert*) malloc(sizeof(sch_vert) * num_vert);
|
||||||
|
|
||||||
while (i < num_vert) {
|
while (i < num_vert) {
|
||||||
sch_vert* vert = &f_verts[i];
|
sch_vert* vert = &f_verts[i];
|
||||||
|
@ -384,7 +384,7 @@ SchHullResult sch_builder_create_hull(sch_hull_builder* builder, sch_hull* out_h
|
||||||
prev_edge = edge;
|
prev_edge = edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
int edge_add_result = sch_hull_connect_face_edges (out_hull, face_index);
|
SchHullResult edge_add_result = sch_hull_connect_face_edges (out_hull, face_index);
|
||||||
if (edge_add_result != SchHullResultOK) {
|
if (edge_add_result != SchHullResultOK) {
|
||||||
sch_hull_free_memory(out_hull);
|
sch_hull_free_memory(out_hull);
|
||||||
return edge_add_result;
|
return edge_add_result;
|
||||||
|
@ -555,7 +555,7 @@ float sch_query_edge_directions (const sch_hull* hull_A, const sch_hull* hull_B,
|
||||||
}
|
}
|
||||||
|
|
||||||
void sch_clip_faces (const sch_face* ref_face, const sch_face* inc_face, sch_manifold* manifold) {
|
void sch_clip_faces (const sch_face* ref_face, const sch_face* inc_face, sch_manifold* manifold) {
|
||||||
simd4f* input_vertices = malloc(sizeof(simd4f) * manifold->num_vertices);
|
simd4f* input_vertices = (simd4f*) malloc(sizeof(simd4f) * manifold->num_vertices);
|
||||||
assert (input_vertices != NULL);
|
assert (input_vertices != NULL);
|
||||||
|
|
||||||
sch_edge* inc_start_edge = inc_face->edge;
|
sch_edge* inc_start_edge = inc_face->edge;
|
||||||
|
@ -722,7 +722,7 @@ int sch_hull_is_vertex_concave(const sch_hull* hull, const simd4f v) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sch_hull_connect_face_edges(const sch_hull* hull, int new_face_index) {
|
SchHullResult sch_hull_connect_face_edges(const sch_hull* hull, int new_face_index) {
|
||||||
sch_face* new_face = &hull->faces[new_face_index];
|
sch_face* new_face = &hull->faces[new_face_index];
|
||||||
|
|
||||||
sch_edge* new_face_edge0 = new_face->edge;
|
sch_edge* new_face_edge0 = new_face->edge;
|
||||||
|
@ -771,7 +771,7 @@ int sch_hull_connect_face_edges(const sch_hull* hull, int new_face_index) {
|
||||||
return SchHullResultOK;
|
return SchHullResultOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sch_hull_is_closed (const sch_hull* hull) {
|
SchHullResult sch_hull_is_closed (const sch_hull* hull) {
|
||||||
for (int ei = 0; ei < hull->num_edges; ei++) {
|
for (int ei = 0; ei < hull->num_edges; ei++) {
|
||||||
if (hull->edges[ei].twin == NULL) {
|
if (hull->edges[ei].twin == NULL) {
|
||||||
return SchHullResultOpenHull;
|
return SchHullResultOpenHull;
|
||||||
|
|
Loading…
Reference in New Issue