Skip to content

Commit

Permalink
Promote twin_fixed_abs as public API
Browse files Browse the repository at this point in the history
  • Loading branch information
jserv committed Dec 12, 2024
1 parent d44585d commit 9b84ea1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions apps/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static twin_dispatch_result_t _apps_line_update_pos(apps_line_t *line,
return TwinDispatchDone;
}

#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))

static int _apps_line_hit(apps_line_t *line, twin_fixed_t x, twin_fixed_t y)
{
int i;
Expand Down
2 changes: 0 additions & 2 deletions apps/spline.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ static twin_dispatch_result_t _apps_spline_update_pos(apps_spline_t *spline,
return TwinDispatchDone;
}

#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))

static int _apps_spline_hit(apps_spline_t *spline,
twin_fixed_t x,
twin_fixed_t y)
Expand Down
1 change: 1 addition & 0 deletions include/twin.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ void twin_event_enqueue(const twin_event_t *event);

#define twin_fixed_mul(a, b) ((twin_fixed_t) (((int64_t) (a) * (b)) >> 16))
#define twin_fixed_div(a, b) ((twin_fixed_t) ((((int64_t) (a)) << 16) / (b)))
#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))

twin_fixed_t twin_fixed_sqrt(twin_fixed_t a);

Expand Down
2 changes: 0 additions & 2 deletions src/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ void twin_path_ellipse(twin_path_t *path,
twin_path_close(path);
}

#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))

static twin_fixed_t _twin_matrix_max_radius(twin_matrix_t *m)
{
return (twin_fixed_abs(m->m[0][0]) + twin_fixed_abs(m->m[0][1]) +
Expand Down

0 comments on commit 9b84ea1

Please sign in to comment.