The compiler said about this code:
delaunay.c:484:34: warning: cast between incompatible function types from
‘void (*)(GFace *, fstate *)’ {aka ‘void (*)(struct <anonymous> *, struct
<anonymous> *)’} to ‘gint (*)(void *, void *)’ {aka ‘int (*)(void *,
void *)’} [-Wcast-function-type]
gts_surface_foreach_face (s, (GtsFunc)
addFace, &statf);
^
Similar to the prior commit, this was relying on a coincident return value of 0
from the callback function.
return 0;
}
-static void addFace (GFace* f, fstate* es)
-{
+static gint addFace(void *face, void *state) {
+ GFace *f = face;
+ fstate *es = state;
+
int i, myid = f->idx;
int* ip = es->faces + 3*myid;
int* neigh = es->neigh + 3*myid;
gts_face_foreach_neighbor((GtsFace*)f, 0, addNeighbor, &ni);
for (i = ni.nneigh; i < 3; i++)
neigh[i] = -1;
+
+ return 0;
}
static gint addTri(void *face, void *state) {
statf.faces = faces;
statf.neigh = neigh;
- gts_surface_foreach_face (s, (GtsFunc) addFace, &statf);
+ gts_surface_foreach_face(s, addFace, &statf);
sf->nedges = nsegs;
sf->edges = segs;