Skip to content

Commit

Permalink
Make snek_is_nan a global function
Browse files Browse the repository at this point in the history
Saves a bunch of memory on avr devices

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Sep 27, 2021
1 parent 34342a1 commit 845f4fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions snek-poly.c
Expand Up @@ -159,3 +159,9 @@ snek_poly_get_soffset(snek_poly_t a)
{
return (snek_soffset_t) snek_poly_get_float(a);
}

bool
snek_is_nan(snek_poly_t p)
{
return p.u == SNEK_NAN_U;
}
7 changes: 2 additions & 5 deletions snek.h
Expand Up @@ -337,11 +337,8 @@ extern snek_offset_t snek_stackp;
extern snek_poly_t snek_a;
extern snek_code_t *snek_code;

static inline bool
snek_is_nan(snek_poly_t p)
{
return p.u == SNEK_NAN_U;
}
bool
snek_is_nan(snek_poly_t p);

static inline bool
snek_is_null(snek_poly_t p)
Expand Down

0 comments on commit 845f4fb

Please sign in to comment.