From cfb3a821b441dda570be25615e6501326846910b Mon Sep 17 00:00:00 2001 From: Joseph Poirier Date: Wed, 10 Jun 2015 13:52:30 -0500 Subject: [PATCH] removed BROKEN_FLOAT_CASTS --- expression.c | 15 --------------- platform.h | 43 +++++++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/expression.c b/expression.c index 1b31711..2b23c9f 100644 --- a/expression.c +++ b/expression.c @@ -207,7 +207,6 @@ unsigned long ExpressionCoerceUnsignedInteger(struct Value *Val) double ExpressionCoerceFP(struct Value *Val) { -#ifndef BROKEN_FLOAT_CASTS int IntVal; unsigned UnsignedVal; @@ -223,20 +222,6 @@ double ExpressionCoerceFP(struct Value *Val) case TypeFP: return Val->Val->FP; default: return 0.0; } -#else - switch (Val->Typ->Base) { - case TypeInt: return (double)Val->Val->Integer; - case TypeChar: return (double)Val->Val->Character; - case TypeShort: return (double)Val->Val->ShortInteger; - case TypeLong: return (double)Val->Val->LongInteger; - case TypeUnsignedInt: return (double)Val->Val->UnsignedInteger; - case TypeUnsignedShort: return (double)Val->Val->UnsignedShortInteger; - case TypeUnsignedLong: return (double)Val->Val->UnsignedLongInteger; - case TypeUnsignedChar: return (double)Val->Val->UnsignedCharacter; - case TypeFP: return (double)Val->Val->FP; - default: return 0.0; - } -#endif } /* assign an integer value */ diff --git a/platform.h b/platform.h index c34947a..6c73f8d 100644 --- a/platform.h +++ b/platform.h @@ -2,14 +2,6 @@ #ifndef PLATFORM_H #define PLATFORM_H -/* configurable options */ -/* select your host type (or do it in the Makefile): - #define UNIX_HOST - #define WIN32 (predefined on MSVC) - #define DEBUGGER - #define USE_READLINE (defined by default for UNIX_HOST) - */ - #include #include #include @@ -19,6 +11,26 @@ #include #include #include +#include + +/* configurable options */ +/* select your host type (or do it in the Makefile): + #define UNIX_HOST + #define DEBUGGER + #define USE_READLINE (defined by default for UNIX_HOST) + */ + +/* undocumented, but probably useful */ +#undef DEBUG_HEAP +#undef DEBUG_EXPRESSIONS +#undef FANCY_ERROR_MESSAGES +#undef DEBUG_ARRAY_INITIALIZER +#undef FEATURE_AUTO_DECLARE_VARIABLES +#undef DEBUG_LEXER +#undef VAR_SCOPE_DEBUG + +/* set based on the platform */ +#undef BIG_ENDIAN #define LARGE_INT_POWER_OF_TEN (1000000000) /* the largest power of ten which fits in an int on this architecture */ @@ -45,28 +57,15 @@ #define INTERACTIVE_PROMPT_STATEMENT "picoc> " #define INTERACTIVE_PROMPT_LINE " > " -/* undocumented, but probably useful */ -#undef DEBUG_HEAP -#undef DEBUG_EXPRESSIONS -#undef FANCY_ERROR_MESSAGES -#undef BROKEN_FLOAT_CASTS -#undef DEBUG_ARRAY_INITIALIZER -#undef FEATURE_AUTO_DECLARE_VARIABLES -#undef DEBUG_LEXER -#undef VAR_SCOPE_DEBUG -/* set based on the platform */ -#undef BIG_ENDIAN /* host platform includes */ #ifdef UNIX_HOST # include # include -# include # define USE_READLINE +#elif defined(WIN32) /*(predefined on MSVC)*/ -#elif defined(WIN32) -# include #else # error ***** A platform must be explicitly defined! ***** #endif