[hackers] [scc] [cc2] Remove TSIZE type || Quentin Rameau

From: <git_AT_suckless.org>
Date: Thu, 19 May 2016 20:21:18 +0200 (CEST)

commit 9fb2e758d7d98e82afc5029a29adb8fdc23f7bb0
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu May 19 13:50:01 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Thu May 19 20:20:41 2016 +0200

    [cc2] Remove TSIZE type
    
    As done for cc1

diff --git a/cc2/arch/amd64-sysv/arch.h b/cc2/arch/amd64-sysv/arch.h
index 9cf5fb6..f5c4b7c 100644
--- a/cc2/arch/amd64-sysv/arch.h
+++ b/cc2/arch/amd64-sysv/arch.h
_AT_@ -2,4 +2,3 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
diff --git a/cc2/arch/amd64-sysv/code.c b/cc2/arch/amd64-sysv/code.c
index f597cc4..d223ecb 100644
--- a/cc2/arch/amd64-sysv/code.c
+++ b/cc2/arch/amd64-sysv/code.c
_AT_@ -120,11 +120,11 @@ size2asm(Type *tp)
                         s = "\t.quad\t";
                         break;
                 default:
- s = "\t.space\t%llu,";
+ s = "\t.space\t%lu,";
                         break;
                 }
         }
- printf(s, (unsigned long long) tp->size);
+ printf(s, tp->size);
 }
 
 
_AT_@ -158,15 +158,12 @@ label(Symbol *sym)
                 return;
         case SGLOB:
                 printf("\t.global\t%s\n", name);
- if (seg == BSSSEG) {
- printf("\t.comm\t%s,%llu\n",
- name,
- (unsigned long long) tp->size);
- }
+ if (seg == BSSSEG)
+ printf("\t.comm\t%s,%lu\n", name, tp->size);
                 break;
         }
         if (sym->type.align != 1)
- printf("\t.align\t%lld\n", (long long) sym->type.align );
+ printf("\t.align\t%lu\n", sym->type.align );
         printf("%s:\n", name);
 }
 
diff --git a/cc2/arch/i386-sysv/arch.h b/cc2/arch/i386-sysv/arch.h
index 9cf5fb6..f5c4b7c 100644
--- a/cc2/arch/i386-sysv/arch.h
+++ b/cc2/arch/i386-sysv/arch.h
_AT_@ -2,4 +2,3 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
diff --git a/cc2/arch/i386-sysv/code.c b/cc2/arch/i386-sysv/code.c
index 152e7ee..2a7cefa 100644
--- a/cc2/arch/i386-sysv/code.c
+++ b/cc2/arch/i386-sysv/code.c
_AT_@ -120,11 +120,11 @@ size2asm(Type *tp)
                         s = "\t.quad\t";
                         break;
                 default:
- s = "\t.space\t%llu,";
+ s = "\t.space\t%lu,";
                         break;
                 }
         }
- printf(s, (unsigned long long) tp->size);
+ printf(s, tp->size);
 }
 
 void
_AT_@ -157,15 +157,12 @@ label(Symbol *sym)
                 return;
         case SGLOB:
                 printf("\t.global\t%s\n", name);
- if (seg == BSSSEG) {
- printf("\t.comm\t%s,%llu\n",
- name,
- (unsigned long long) tp->size);
- }
+ if (seg == BSSSEG)
+ printf("\t.comm\t%s,%lu\n", name, tp->size);
                 break;
         }
         if (sym->type.align != 1)
- printf("\t.align\t%lld\n", (long long) sym->type.align );
+ printf("\t.align\t%lud\n", sym->type.align );
         printf("%s:\n", name);
 }
 
diff --git a/cc2/arch/qbe/arch.h b/cc2/arch/qbe/arch.h
index d83ecbd..3403fff 100644
--- a/cc2/arch/qbe/arch.h
+++ b/cc2/arch/qbe/arch.h
_AT_@ -2,7 +2,6 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned long
 
 enum asmop {
         ASNOP = 0,
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index a06fbd6..fcfa568 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -261,7 +261,7 @@ defglobal(Symbol *sym)
         printf("data %s = {\n", symname(sym));
         if (sym->type.flags & INITF)
                 return;
- printf("\tz\t%llu\n}\n", (unsigned long long) sym->type.size);
+ printf("\tz\t%lu\n}\n", sym->type.size);
 }
 
 void
_AT_@ -289,9 +289,8 @@ alloc(Symbol *sym)
 {
         Type *tp = &sym->type;
 
- printf("\t%s %s=\talloc%lld\t%lld\n",
- symname(sym), size2asm(tp),
- (long long) tp->size, (long long) tp->align);
+ printf("\t%s %s=\talloc%lu\t%lu\n",
+ symname(sym), size2asm(tp), tp->size, tp->align);
 }
 
 void
diff --git a/cc2/arch/z80/arch.h b/cc2/arch/z80/arch.h
index 0a3895e..f5c4b7c 100644
--- a/cc2/arch/z80/arch.h
+++ b/cc2/arch/z80/arch.h
_AT_@ -2,4 +2,3 @@
 #define TINT long long
 #define TUINT unsigned long long
 #define TFLOAT double
-#define TSIZE unsigned short
diff --git a/cc2/arch/z80/code.c b/cc2/arch/z80/code.c
index 71fcab5..0c4e860 100644
--- a/cc2/arch/z80/code.c
+++ b/cc2/arch/z80/code.c
_AT_@ -14,7 +14,7 @@ enum segment {
 };
 
 static int curseg = NOSEG;
-static TSIZE offpar, offvar;
+static unsigned long offpar, offvar;
 
 static void
 segment(int seg)
_AT_@ -147,11 +147,11 @@ size2asm(Type *tp)
                         s = "\tDD\t";
                         break;
                 default:
- s = "\tDS\t%llu,";
+ s = "\tDS\t%lu,";
                         break;
                 }
         }
- printf(s, (unsigned long long) tp->size);
+ printf(s, tp->size);
 }
 
 void
_AT_@ -163,7 +163,7 @@ newfun()
 void
 defpar(Symbol *sym)
 {
- TSIZE align, size;
+ unsigned long align, size;
 
         if (sym->kind != SREG && sym->kind != SAUTO)
                 return;
_AT_@ -179,7 +179,7 @@ defpar(Symbol *sym)
 void
 defvar(Symbol *sym)
 {
- TSIZE align, size;
+ unsigned long align, size;
 
         if (sym->kind != SREG && sym->kind != SAUTO)
                 return;
diff --git a/cc2/cc2.h b/cc2/cc2.h
index 5bc2f41..931586f 100644
--- a/cc2/cc2.h
+++ b/cc2/cc2.h
_AT_@ -126,8 +126,8 @@ typedef struct addr Addr;
 typedef struct inst Inst;
 
 struct type {
- TSIZE size;
- TSIZE align;
+ unsigned long size;
+ unsigned long align;
         char flags;
 };
 
_AT_@ -139,7 +139,7 @@ struct symbol {
         char *name;
         char kind;
         union {
- TSIZE off;
+ unsigned long off;
                 Node *stmt;
                 Inst *inst;
         } u;
Received on Thu May 19 2016 - 20:21:18 CEST

This archive was generated by hypermail 2.3.0 : Thu May 19 2016 - 20:24:19 CEST