[hackers] [scc] Add TSIZE type || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 26 Jan 2016 10:57:41 +0100 (CET)

commit 64ee117fc51af33bf4557d6405eefc506e269185
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Jan 25 14:22:16 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Jan 25 14:22:16 2016 +0100

    Add TSIZE type
    
    This type is the target specific type for sizes.

diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h
index 957c5e5..7ff94d2 100644
--- a/cc1/arch/amd64-sysv/arch.h
+++ b/cc1/arch/amd64-sysv/arch.h
_AT_@ -18,6 +18,7 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
+#define TSIZE unsigned long
 
 #define L_SCHAR L_INT8
 #define L_UCHAR L_UINT8
diff --git a/cc1/arch/i386-sysv/arch.h b/cc1/arch/i386-sysv/arch.h
index 82d6e9b..c3a49a7 100644
--- a/cc1/arch/i386-sysv/arch.h
+++ b/cc1/arch/i386-sysv/arch.h
_AT_@ -18,6 +18,7 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
+#define TSIZE unsigned long
 
 #define L_SCHAR L_INT8
 #define L_UCHAR L_UINT8
diff --git a/cc1/arch/z80/arch.h b/cc1/arch/z80/arch.h
index a90b864..74d7239 100644
--- a/cc1/arch/z80/arch.h
+++ b/cc1/arch/z80/arch.h
_AT_@ -18,6 +18,7 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
+#define TSIZE unsigned short
 
 #define L_SCHAR L_INT8
 #define L_UCHAR L_UINT8
diff --git a/cc1/cc1.h b/cc1/cc1.h
index a5dd178..1eda834 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
_AT_@ -42,8 +42,8 @@ struct type {
         bool arith : 1; /* this type is INT, ENUM, FLOAT */
         bool aggreg : 1; /* this type is struct or union */
         bool k_r : 1; /* This is a k&r function */
- size_t size; /* sizeof the type */
- size_t align; /* align of the type */
+ TSIZE size; /* sizeof the type */
+ TSIZE align; /* align of the type */
         Type *type; /* base type */
         Symbol *tag; /* symbol of the strug tag */
         Type *next; /* next element in the hash */
diff --git a/cc1/types.c b/cc1/types.c
index 5becacd..2d57c84 100644
--- a/cc1/types.c
+++ b/cc1/types.c
_AT_@ -166,11 +166,11 @@ invalid_type:
         error("invalid type specification");
 }
 
-static TINT
+static TSIZE
 typesize(Type *tp)
 {
         Symbol **sp;
- TINT n, size, align;
+ TSIZE n, size, align;
 
         switch (tp->op) {
         case ARY:
diff --git a/cc2/arch/amd64-sysv/arch.h b/cc2/arch/amd64-sysv/arch.h
index fa129dd..439e3b7 100644
--- a/cc2/arch/amd64-sysv/arch.h
+++ b/cc2/arch/amd64-sysv/arch.h
_AT_@ -2,4 +2,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
+#define TSIZE unsigned long
 
diff --git a/cc2/arch/i386-sysv/arch.h b/cc2/arch/i386-sysv/arch.h
index fa129dd..439e3b7 100644
--- a/cc2/arch/i386-sysv/arch.h
+++ b/cc2/arch/i386-sysv/arch.h
_AT_@ -2,4 +2,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
+#define TSIZE unsigned long
 
diff --git a/cc2/arch/z80/arch.h b/cc2/arch/z80/arch.h
index fa129dd..7cde253 100644
--- a/cc2/arch/z80/arch.h
+++ b/cc2/arch/z80/arch.h
_AT_@ -2,4 +2,4 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-
+#define TSIZE unsigned short
\ No newline at end of file
diff --git a/cc2/cc2.h b/cc2/cc2.h
index 6f02d59..9ce3bd6 100644
--- a/cc2/cc2.h
+++ b/cc2/cc2.h
_AT_@ -107,9 +107,9 @@ typedef struct type Type;
 typedef struct symbol Symbol;
 
 struct type {
- unsigned short size;
- unsigned short align;
- unsigned short flags;
+ TSIZE size;
+ TSIZE align;
+ char flags;
 };
 
 struct symbol {
Received on Tue Jan 26 2016 - 10:57:41 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 26 2016 - 11:00:24 CET