[hackers] [scc] Move limits again to cc1/types.c || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 25 Sep 2015 17:50:44 +0200 (CEST)

commit 275a2ef9b9df16b5b5d7811fe0748bf0a3842743
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Sep 25 17:09:31 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Sep 25 17:09:31 2015 +0200

    Move limits again to cc1/types.c
    
    Nothing in this array depends of the architecture, because it only keeps
    the limits for every signess and size.

diff --git a/cc1/arch/z80/types.c b/cc1/arch/z80/types.c
index 4fc25aa..3d08060 100644
--- a/cc1/arch/z80/types.c
+++ b/cc1/arch/z80/types.c
_AT_@ -37,67 +37,6 @@
 #define L_LDOUBLE 'H'
 
 /*
- * Compiler can generate warnings here if the ranges of TINT,
- * TUINT and TFLOAT are smaller than any of the constants in this
- * array. Ignore them if you know that the target types are correct
- */
-struct limits limits[][4] = {
- {
- { /* 0 = unsigned 1 byte */
- .min.u = 0,
- .max.u = 255
- },
- { /* 1 = unsigned 2 bytes */
- .min.u = 0,
- .max.u = 65535u
- },
- { /* 2 = unsigned 4 bytes */
- .min.u = 0,
- .max.u = 4294967295u
- },
- { /* 3 = unsigned 4 bytes */
- .min.u = 0,
- .max.u = 18446744073709551615u
- }
- },
- {
- { /* 0 = signed 1 byte */
- .min.i = -127,
- .max.i = 127
- },
- { /* 1 = signed 2 byte */
- .min.i = -32767,
- .max.i = 32767
- },
- { /* 2 = signed 4 byte */
- .min.i = -2147483647L,
- .max.i = 2147483647L
- },
- { /* 3 = signed 8 byte */
- .min.i = -9223372036854775807LL,
- .max.i = 9223372036854775807LL,
- }
- },
- {
- {
- /* 0 = float 4 bytes */
- .min.f = -1,
- .max.f = 2
- },
- {
- /* 1 = float 8 bytes */
- .min.f = -1,
- .max.f = 2,
- },
- {
- /* 2 = float 16 bytes */
- .min.f = -1,
- .max.f = 2,
- }
- }
-};
-
-/*
  * Initializaion of type pointers were done with
  * a C99 initilizator '... = &(Type) {...', but
  * c compiler in Plan9 gives error with this
diff --git a/cc1/types.c b/cc1/types.c
index af76ece..47ac04d 100644
--- a/cc1/types.c
+++ b/cc1/types.c
_AT_@ -11,7 +11,66 @@
 
 #define NR_TYPE_HASH 16
 
-extern struct limits limits[][4];
+/*
+ * Compiler can generate warnings here if the ranges of TINT,
+ * TUINT and TFLOAT are smaller than any of the constants in this
+ * array. Ignore them if you know that the target types are correct
+ */
+struct limits limits[][4] = {
+ {
+ { /* 0 = unsigned 1 byte */
+ .min.u = 0,
+ .max.u = 255
+ },
+ { /* 1 = unsigned 2 bytes */
+ .min.u = 0,
+ .max.u = 65535u
+ },
+ { /* 2 = unsigned 4 bytes */
+ .min.u = 0,
+ .max.u = 4294967295u
+ },
+ { /* 3 = unsigned 4 bytes */
+ .min.u = 0,
+ .max.u = 18446744073709551615u
+ }
+ },
+ {
+ { /* 0 = signed 1 byte */
+ .min.i = -127,
+ .max.i = 127
+ },
+ { /* 1 = signed 2 byte */
+ .min.i = -32767,
+ .max.i = 32767
+ },
+ { /* 2 = signed 4 byte */
+ .min.i = -2147483647L,
+ .max.i = 2147483647L
+ },
+ { /* 3 = signed 8 byte */
+ .min.i = -9223372036854775807LL,
+ .max.i = 9223372036854775807LL,
+ }
+ },
+ {
+ {
+ /* 0 = float 4 bytes */
+ .min.f = -1,
+ .max.f = 2
+ },
+ {
+ /* 1 = float 8 bytes */
+ .min.f = -1,
+ .max.f = 2,
+ },
+ {
+ /* 2 = float 16 bytes */
+ .min.f = -1,
+ .max.f = 2,
+ }
+ }
+};
 
 struct limits *
 getlimits(Type *tp)
Received on Fri Sep 25 2015 - 17:50:44 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 25 2015 - 18:00:16 CEST