Skip to content

Commit 9b84ea1

Browse files
committed
Promote twin_fixed_abs as public API
1 parent d44585d commit 9b84ea1

File tree

4 files changed

+1
-6
lines changed

4 files changed

+1
-6
lines changed

apps/line.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ static twin_dispatch_result_t _apps_line_update_pos(apps_line_t *line,
5050
return TwinDispatchDone;
5151
}
5252

53-
#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))
54-
5553
static int _apps_line_hit(apps_line_t *line, twin_fixed_t x, twin_fixed_t y)
5654
{
5755
int i;

apps/spline.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ static twin_dispatch_result_t _apps_spline_update_pos(apps_spline_t *spline,
132132
return TwinDispatchDone;
133133
}
134134

135-
#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))
136-
137135
static int _apps_spline_hit(apps_spline_t *spline,
138136
twin_fixed_t x,
139137
twin_fixed_t y)

include/twin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ void twin_event_enqueue(const twin_event_t *event);
660660

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

664665
twin_fixed_t twin_fixed_sqrt(twin_fixed_t a);
665666

src/path.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ void twin_path_ellipse(twin_path_t *path,
184184
twin_path_close(path);
185185
}
186186

187-
#define twin_fixed_abs(f) ((f) < 0 ? -(f) : (f))
188-
189187
static twin_fixed_t _twin_matrix_max_radius(twin_matrix_t *m)
190188
{
191189
return (twin_fixed_abs(m->m[0][0]) + twin_fixed_abs(m->m[0][1]) +

0 commit comments

Comments
 (0)