Skip to content

Commit

Permalink
Allow portions of snek-input.c to be used in isolation
Browse files Browse the repository at this point in the history
Just avoid compiler warnings about the unused functions

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Feb 5, 2021
1 parent 9d86ef2 commit 8dc1561
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions snek-input.c
Expand Up @@ -15,6 +15,7 @@
#include "snek.h"
#include <math.h>

#ifdef SNEK_BUILTIN_input
bool snek_in_input;

snek_poly_t
Expand Down Expand Up @@ -43,7 +44,9 @@ snek_builtin_input(uint8_t nposition, uint8_t nnamed, snek_poly_t *args)
snek_in_input = false;
return s;
}
#endif

#if defined(SNEK_BUILTIN_float)
snek_poly_t
snek_builtin_float(snek_poly_t a)
{
Expand All @@ -60,9 +63,12 @@ snek_builtin_float(snek_poly_t a)
}
return snek_float_to_poly(f);
}
#endif

#ifdef SNEK_BUILTIN_int
snek_poly_t
snek_builtin_int(snek_poly_t a)
{
return snek_float_to_poly(truncf(snek_poly_get_float(snek_builtin_float(a))));
}
#endif

0 comments on commit 8dc1561

Please sign in to comment.