浏览代码

no casts in constants used in #if!

ceriel 35 年之前
父节点
当前提交
f9960dbbab
共有 4 个文件被更改,包括 37 次插入37 次删除
  1. 9 9
      lang/cem/cemcom.ansi/BigPars
  2. 8 8
      lang/cem/cemcom.ansi/LintPars
  3. 9 9
      lang/cem/cemcom.ansi/SmallPars
  4. 11 11
      lang/cem/cemcom.ansi/sizes.h

+ 9 - 9
lang/cem/cemcom.ansi/BigPars

@@ -53,15 +53,15 @@
 #define MAXSIZE		8	/* the maximum of the SZ_* constants	*/
 
 /* target machine sizes	*/
-#define	SZ_CHAR		(arith)1
-#define	SZ_SHORT	(arith)2
-#define SZ_WORD		(arith)4
-#define	SZ_INT		(arith)4
-#define	SZ_LONG		(arith)4
-#define	SZ_FLOAT	(arith)4
-#define	SZ_DOUBLE	(arith)8
-#define	SZ_LNGDBL	(arith)8	/* for now */
-#define	SZ_POINTER	(arith)4
+#define	SZ_CHAR		1
+#define	SZ_SHORT	2
+#define SZ_WORD		4
+#define	SZ_INT		4
+#define	SZ_LONG		4
+#define	SZ_FLOAT	4
+#define	SZ_DOUBLE	8
+#define	SZ_LNGDBL	8	/* for now */
+#define	SZ_POINTER	4
 
 /* target machine alignment requirements	*/
 #define	AL_CHAR		1

+ 8 - 8
lang/cem/cemcom.ansi/LintPars

@@ -48,14 +48,14 @@
 #define MAXSIZE		8	/* the maximum of the SZ_* constants	*/
 
 /* target machine sizes	*/
-#define	SZ_CHAR		(arith)1
-#define	SZ_SHORT	(arith)2
-#define SZ_WORD		(arith)4
-#define	SZ_INT		(arith)4
-#define	SZ_LONG		(arith)4
-#define	SZ_FLOAT	(arith)4
-#define	SZ_DOUBLE	(arith)8
-#define	SZ_POINTER	(arith)4
+#define	SZ_CHAR		1
+#define	SZ_SHORT	2
+#define SZ_WORD		4
+#define	SZ_INT		4
+#define	SZ_LONG		4
+#define	SZ_FLOAT	4
+#define	SZ_DOUBLE	8
+#define	SZ_POINTER	4
 
 /* target machine alignment requirements	*/
 #define	AL_CHAR		1

+ 9 - 9
lang/cem/cemcom.ansi/SmallPars

@@ -53,15 +53,15 @@
 #define MAXSIZE		8	/* the maximum of the SZ_* constants	*/
 
 /* target machine sizes	*/
-#define	SZ_CHAR		(arith)1
-#define	SZ_SHORT	(arith)2
-#define SZ_WORD		(arith)4
-#define	SZ_INT		(arith)4
-#define	SZ_LONG		(arith)4
-#define	SZ_FLOAT	(arith)4
-#define	SZ_DOUBLE	(arith)8
-#define	SZ_LNGDBL	(arith)8	/* for now */
-#define	SZ_POINTER	(arith)4
+#define	SZ_CHAR		1
+#define	SZ_SHORT	2
+#define SZ_WORD		4
+#define	SZ_INT		4
+#define	SZ_LONG		4
+#define	SZ_FLOAT	4
+#define	SZ_DOUBLE	8
+#define	SZ_LNGDBL	8	/* for now */
+#define	SZ_POINTER	4
 
 /* target machine alignment requirements	*/
 #define	AL_CHAR		1

+ 11 - 11
lang/cem/cemcom.ansi/sizes.h

@@ -16,20 +16,20 @@ extern arith
 
 extern arith max_int, max_unsigned;	/* cstoper.c	*/
 #else NOCROSS
-#define short_size	(SZ_SHORT)
-#define word_size	(SZ_WORD)
-#define dword_size	(2*SZ_WORD)
-#define int_size	(SZ_INT)
-#define long_size	(SZ_LONG)
-#define float_size	(SZ_FLOAT)
-#define double_size	(SZ_DOUBLE)
-#define	lngdbl_size	(SZ_LNGDBL)
-#define pointer_size	(SZ_POINTER)
+#define short_size	((arith)SZ_SHORT)
+#define word_size	((arith)SZ_WORD)
+#define dword_size	((arith)2*SZ_WORD)
+#define int_size	((arith)SZ_INT)
+#define long_size	((arith)SZ_LONG)
+#define float_size	((arith)SZ_FLOAT)
+#define double_size	((arith)SZ_DOUBLE)
+#define	lngdbl_size	((arith)SZ_LNGDBL)
+#define pointer_size	((arith)SZ_POINTER)
 
-#if int_size == 2
+#if SZ_INT == 2
 #define max_int		((arith)32767)
 #define max_unsigned	((arith)65535)
-#else /* int_size == 4 */
+#else /* SZ_INT == 4 */
 #define max_int		((arith)2147483647)
 #define max_unsigned	((arith)4294967295)
 #endif