Commit 3e00fefd by Richard Kenner

Cast enum arithmetic and logical operands to int.

From-SVN: r5595
parent f0afa4a2
...@@ -30,19 +30,19 @@ enum typecode ...@@ -30,19 +30,19 @@ enum typecode
}; };
/* Determine if a given type is integer. */ /* Determine if a given type is integer. */
#define TYPECODE_INTEGER_P(TYPECODE) ((TYPECODE) < SFcode) #define TYPECODE_INTEGER_P(TYPECODE) ((int) (TYPECODE) < (int) SFcode)
/* Determine if a given type is unsigned. */ /* Determine if a given type is unsigned. */
#define TYPECODE_UNSIGNED_P(TYPECODE) \ #define TYPECODE_UNSIGNED_P(TYPECODE) \
(TYPECODE_INTEGER_P(TYPECODE) && (TYPECODE) & 1) (TYPECODE_INTEGER_P(TYPECODE) && (int) (TYPECODE) & 1)
/* Determine if a given type is signed. */ /* Determine if a given type is signed. */
#define TYPECODE_SIGNED_P(TYPECODE) \ #define TYPECODE_SIGNED_P(TYPECODE) \
(TYPECODE_INTEGER_P(TYPECODE) && !((TYPECODE) & 1)) (TYPECODE_INTEGER_P(TYPECODE) && !((int) (TYPECODE) & 1))
/* Determine if a given type is floating. */ /* Determine if a given type is floating. */
#define TYPECODE_FLOAT_P(TYPECODE) \ #define TYPECODE_FLOAT_P(TYPECODE) \
((TYPECODE) < Pcode && !TYPECODE_INTEGER_P(TYPECODE)) ((int) (TYPECODE) < (int) Pcode && !TYPECODE_INTEGER_P(TYPECODE))
/* Determine if the given type is arithmetic. */ /* Determine if the given type is arithmetic. */
#define TYPECODE_ARITH_P(TYPECODE) \ #define TYPECODE_ARITH_P(TYPECODE) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment