@@ -21,17 +21,17 @@ typedef struct _twin_hull {
2121} twin_hull_t ;
2222
2323static void _twin_slope_init (twin_slope_t * slope ,
24- twin_spoint_t * a ,
25- twin_spoint_t * b )
24+ const twin_spoint_t * a ,
25+ const twin_spoint_t * b )
2626{
2727 slope -> dx = b -> x - a -> x ;
2828 slope -> dy = b -> y - a -> y ;
2929}
3030
31- static twin_hull_t * _twin_hull_create (twin_path_t * path , int * nhull )
31+ static twin_hull_t * _twin_hull_create (const twin_path_t * path , int * nhull )
3232{
3333 int n = path -> npoints ;
34- twin_spoint_t * p = path -> points ;
34+ const twin_spoint_t * p = path -> points ;
3535 twin_hull_t * hull ;
3636
3737 int e = 0 ;
@@ -77,12 +77,10 @@ static twin_hull_t *_twin_hull_create(twin_path_t *path, int *nhull)
7777 == 0 => a equal to be
7878 > 0 => a more positive than b
7979*/
80- static int _twin_slope_compare (twin_slope_t * a , twin_slope_t * b )
80+ static int _twin_slope_compare (const twin_slope_t * a , const twin_slope_t * b )
8181{
82- twin_dfixed_t diff ;
83-
84- diff = ((twin_dfixed_t ) a -> dy * (twin_dfixed_t ) b -> dx -
85- (twin_dfixed_t ) b -> dy * (twin_dfixed_t ) a -> dx );
82+ twin_dfixed_t diff = ((twin_dfixed_t ) a -> dy * (twin_dfixed_t ) b -> dx -
83+ (twin_dfixed_t ) b -> dy * (twin_dfixed_t ) a -> dx );
8684
8785 if (diff > 0 )
8886 return 1 ;
@@ -125,7 +123,7 @@ static int _twin_hull_vertex_compare(const void *av, const void *bv)
125123 return ret ;
126124}
127125
128- static int _twin_hull_prev_valid (twin_hull_t * hull ,
126+ static int _twin_hull_prev_valid (const twin_hull_t * hull ,
129127 int maybe_unused num_hull ,
130128 int index )
131129{
@@ -137,7 +135,9 @@ static int _twin_hull_prev_valid(twin_hull_t *hull,
137135 return index ;
138136}
139137
140- static int _twin_hull_next_valid (twin_hull_t * hull , int num_hull , int index )
138+ static int _twin_hull_next_valid (const twin_hull_t * hull ,
139+ int num_hull ,
140+ int index )
141141{
142142 do {
143143 index = (index + 1 ) % num_hull ;
@@ -180,7 +180,7 @@ static void _twin_hull_eliminate_concave(twin_hull_t *hull, int num_hull)
180180/*
181181 * Convert the hull structure back to a simple path
182182 */
183- static twin_path_t * _twin_hull_to_path (twin_hull_t * hull , int num_hull )
183+ static twin_path_t * _twin_hull_to_path (const twin_hull_t * hull , int num_hull )
184184{
185185 twin_path_t * path = twin_path_create ();
186186
0 commit comments