Fixed OP_INTEGERP op-code to match version in Tinyscheme 1.40

I don't know how the original block of code got the way it was since it has
been a single line of code in TinyScheme since the second revision. This also
prevents the compile from breaking if the USE_MATH #define was ever set to 0.
This commit is contained in:
Kevin Cozens 2011-01-19 15:30:47 -05:00
parent eb04265ce3
commit 8a8e8c6fad
1 changed files with 3 additions and 9 deletions

View File

@ -3783,14 +3783,7 @@ static pointer opexe_3(scheme *sc, enum scheme_opcodes op) {
case OP_STRINGP: /* string? */
s_retbool(is_string(car(sc->args)));
case OP_INTEGERP: /* integer? */
x = car(sc->args);
if (!is_number(x))
s_retbool(0);
if (is_real(x)) {
double r = rvalue(x);
s_retbool(r == round_per_R5RS(r));
}
s_retbool(is_integer(x));
s_retbool(is_integer(car(sc->args)));
case OP_REALP: /* real? */
s_retbool(is_number(car(sc->args))); /* All numbers are real */
case OP_CHARP: /* char? */
@ -4273,7 +4266,8 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
{ s_return(sc,sc->EOF_OBJ); }
else if (sc->tok == TOK_RPAREN) {
gunichar c = inchar(sc);
if (c != '\n') backchar(sc,c);
if (c != '\n')
backchar(sc,c);
sc->nesting_stack[sc->file_i]--;
s_return(sc,reverse_in_place(sc, sc->NIL, sc->args));
} else if (sc->tok == TOK_DOT) {