Skip to content
  • Matthew Fernandez's avatar
    gts_surface_foreach_edge: fix mismatch of calling convention in callback · 13a51421
    Matthew Fernandez authored
    The compiler said about this code:
    
      delaunay.c: In function ‘edgeStats’:
      delaunay.c:245:34: warning: cast between incompatible function types from
        ‘void (*)(GtsSegment *, estats *)’ {aka ‘void (*)(struct _GtsSegment *,
        struct <anonymous> *)’} to ‘gint (*)(void *, void *)’ {aka
        ‘int (*)(void *, void *)’} [-Wcast-function-type]
           gts_surface_foreach_edge (s, (GtsFunc) cnt_edge, sp);
                                        ^
    
    This is not quite as bad as the previous instance of this fixed. However, it
    seems to have been relying on a coincident return value. E.g. on x86-64 this
    code relies on 0 ending up in `RAX` at the end of the callback to indicate
    iteration should continue, despite `cnt_edge` having no declared return value.
    13a51421
To find the state of this project's repository at the time of any of these versions, check out the tags.