[libclc] r249445 - integer: remove explicit casts from _MIN definitions

Aaron Watry via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 12:12:12 PDT 2015


Author: awatry
Date: Tue Oct  6 14:12:12 2015
New Revision: 249445

URL: http://llvm.org/viewvc/llvm-project?rev=249445&view=rev
Log:
integer: remove explicit casts from _MIN definitions

The spec says (section 6.12.3, CL version 1.2):
  The macro names given in the following list must use the values
  specified. The values shall all be constant expressions suitable
  for use in #if preprocessing directives.

This commit addresses the second part of that statement.

Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewed-by: Tom Stellard <tom at stellard.net>
CC: Moritz Pflanzer <moritz.pflanzer14 at imperial.ac.uk>
CC: Serge Martin <edb+libclc at sigluy.net>

Modified:
    libclc/trunk/generic/include/clc/integer/definitions.h

Modified: libclc/trunk/generic/include/clc/integer/definitions.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/integer/definitions.h?rev=249445&r1=249444&r2=249445&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/integer/definitions.h (original)
+++ libclc/trunk/generic/include/clc/integer/definitions.h Tue Oct  6 14:12:12 2015
@@ -1,14 +1,14 @@
 #define CHAR_BIT 8
 #define INT_MAX 2147483647
-#define INT_MIN ((int)(-2147483647 - 1))
+#define INT_MIN (-2147483647 - 1)
 #define LONG_MAX  0x7fffffffffffffffL
 #define LONG_MIN (-0x7fffffffffffffffL - 1)
 #define CHAR_MAX SCHAR_MAX
 #define CHAR_MIN SCHAR_MIN
 #define SCHAR_MAX 127
-#define SCHAR_MIN ((char)(-127 - 1))
+#define SCHAR_MIN (-127 - 1)
 #define SHRT_MAX 32767
-#define SHRT_MIN ((short)(-32767 - 1))
+#define SHRT_MIN (-32767 - 1)
 #define UCHAR_MAX 255
 #define USHRT_MAX 65535
 #define UINT_MAX 0xffffffff




More information about the cfe-commits mailing list