X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fintprops.h;h=1f6a539c1831a882ffdd27b2ed4f9d4736afeecd;hb=a4c436136b4aaa0259add12435af3bbec862e5f7;hp=293204ab43a12cf92f510ed84a336324af83d824;hpb=48552f312571692c5c0141c8d6a94f8efb65728a;p=gnulib.git diff --git a/lib/intprops.h b/lib/intprops.h index 293204ab4..1f6a539c1 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -22,14 +22,13 @@ #include -/* Return a integer value, converted to the same type as the integer - expression E after integer type promotion. V is the unconverted value. - E should not have side effects. */ -#define _GL_INT_CONVERT(e, v) ((e) - (e) + (v)) +/* Return an integer value, converted to the same type as the integer + expression E after integer type promotion. V is the unconverted value. */ +#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see . */ -#define _GL_INT_NEGATE_CONVERT(e, v) ((e) - (e) - (v)) +#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -53,7 +52,7 @@ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* Return 1 if the integer expression E, after integer promotion, has - a signed type. E should not have side effects. */ + a signed type. */ #define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) @@ -314,7 +313,7 @@ Arguments should be free of side effects. */ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ op_result_overflow (a, b, \ - _GL_INT_MINIMUM ((b) - (b) + (a)), \ - _GL_INT_MAXIMUM ((b) - (b) + (a))) + _GL_INT_MINIMUM (0 * (b) + (a)), \ + _GL_INT_MAXIMUM (0 * (b) + (a))) #endif /* _GL_INTPROPS_H */