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

From: <git_AT_suckless.org>
Date: Thu, 19 May 2016 08:34:08 +0200 (CEST)

commit 262b22d30948622d5a0ddd068cfd49d3ba11c623
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu May 19 08:28:46 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu May 19 08:28:46 2016 +0200

    [cc1] Remove TSIZE type
    
    This type was used like a host dependant type which represents
    the size quantities, but it generated some problems, mainly
    in the printf strings and in the range comparisions (in the
    first because we didn't know the correct format specifier and
    in the second because we didn't know the maximum/minimun values
    of the type). This modification is a step to make cc1 independent
    of the host architecture.

diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h
index 4417562..11ea606 100644
--- a/cc1/arch/amd64-sysv/arch.h
+++ b/cc1/arch/amd64-sysv/arch.h
_AT_@ -18,6 +18,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
 
 #define L_ENUM L_INT32
diff --git a/cc1/arch/i386-sysv/arch.h b/cc1/arch/i386-sysv/arch.h
index 4417562..11ea606 100644
--- a/cc1/arch/i386-sysv/arch.h
+++ b/cc1/arch/i386-sysv/arch.h
_AT_@ -18,6 +18,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
 
 #define L_ENUM L_INT32
diff --git a/cc1/arch/qbe/arch.h b/cc1/arch/qbe/arch.h
index 4417562..11ea606 100644
--- a/cc1/arch/qbe/arch.h
+++ b/cc1/arch/qbe/arch.h
_AT_@ -18,6 +18,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
 
 #define L_ENUM L_INT32
diff --git a/cc1/arch/z80/arch.h b/cc1/arch/z80/arch.h
index 9e436c4..2c02d45 100644
--- a/cc1/arch/z80/arch.h
+++ b/cc1/arch/z80/arch.h
_AT_@ -18,6 +18,5 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned short
 
 #define L_ENUM L_INT16
diff --git a/cc1/cc1.h b/cc1/cc1.h
index b7cf5c2..a05b631 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
_AT_@ -46,8 +46,8 @@ struct type {
         short id; /* type id, used in dcls */
         char letter; /* letter of the type */
         unsigned char prop; /* type properties */
- TSIZE size; /* sizeof the type */
- TSIZE align; /* align of the type */
+ unsigned long size; /* sizeof the type */
+ unsigned long 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/code.c b/cc1/code.c
index 5859923..adb242e 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -263,12 +263,12 @@ emittype(Type *tp)
                         emittype((*sp)->type);
                 emitletter(tp);
                 tag = tp->tag->name;
- printf("\t\"%s\t#%c%llX\t#%c%llX\n",
+ printf("\t\"%s\t#%c%lX\t#%c%lX\n",
                        (tag) ? tag : "",
                        sizettype->letter,
- (unsigned long long) tp->size,
+ tp->size,
                        sizettype->letter,
- (unsigned long long) tp->align);
+ tp->align);
                 n = tp->n.elem;
                 for (sp = tp->p.fields; n-- > 0; ++sp)
                         emit(ODECL, *sp);
diff --git a/cc1/types.c b/cc1/types.c
index 52e16f2..f01dc5f 100644
--- a/cc1/types.c
+++ b/cc1/types.c
_AT_@ -171,7 +171,7 @@ typesize(Type *tp)
 {
         Symbol **sp;
         Type *aux;
- TSIZE n, size, align, a;
+ unsigned long n, size, align, a;
 
         switch (tp->op) {
         case ARY:
Received on Thu May 19 2016 - 08:34:08 CEST

This archive was generated by hypermail 2.3.0 : Thu May 19 2016 - 08:36:15 CEST