[hackers] [scc] Fix definition of sizes for amd64 and i386 || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 25 Jan 2016 12:46:05 +0100 (CET)

commit 95232a91309714fde82840811c7bae6c53dd5778
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Jan 25 11:58:29 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Jan 25 11:58:29 2016 +0100

    Fix definition of sizes for amd64 and i386

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c
index 7a0f601..7eb8dc8 100644
--- a/cc1/arch/amd64-sysv/arch.c
+++ b/cc1/arch/amd64-sysv/arch.c
_AT_@ -80,7 +80,7 @@ static Type types[] = {
                 .size = 2,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 2,
                 .n.rank = RANK_USHORT,
                 .printed = 1
         },
_AT_@ -91,7 +91,7 @@ static Type types[] = {
                 .size = 2,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 2,
                 .sign = 1,
                 .n.rank = RANK_SHORT,
                 .printed = 1
_AT_@ -100,10 +100,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_UINT,
                 .defined = 1,
- .size = 2,
+ .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_UINT,
                 .printed = 1
         },
_AT_@ -111,10 +111,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_INT,
                 .defined = 1,
- .size = 2,
+ .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .sign = 1,
                 .n.rank = RANK_INT,
                 .printed = 1
_AT_@ -123,10 +123,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_LONG,
                 .defined = 1,
- .size = 4,
+ .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .sign = 1,
                 .n.rank = RANK_LONG,
                 .printed = 1
_AT_@ -135,10 +135,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_ULONG,
                 .defined = 1,
- .size = 4,
+ .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .n.rank = RANK_ULONG,
                 .printed = 1
         },
_AT_@ -149,7 +149,7 @@ static Type types[] = {
                 .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .n.rank = RANK_ULLONG,
                 .printed = 1
         },
_AT_@ -160,7 +160,7 @@ static Type types[] = {
                 .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .sign = 1,
                 .n.rank = RANK_LLONG,
                 .printed = 1
_AT_@ -171,7 +171,7 @@ static Type types[] = {
                 .defined = 1,
                 .size = 4,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_FLOAT,
                 .printed = 1
         },
_AT_@ -181,7 +181,7 @@ static Type types[] = {
                 .defined = 1,
                 .size = 8,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .n.rank = RANK_DOUBLE,
                 .printed = 1
         },
_AT_@ -191,7 +191,7 @@ static Type types[] = {
                 .defined = 1,
                 .size = 16,
                 .arith = 1,
- .align = 1,
+ .align = 16,
                 .n.rank = RANK_LDOUBLE,
                 .printed = 1
         },
_AT_@ -199,10 +199,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_UINT,
                 .defined = 1,
- .size = 2,
+ .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 8,
                 .n.rank = RANK_UINT,
                 .printed = 1
         },
diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h
index 82d6e9b..957c5e5 100644
--- a/cc1/arch/amd64-sysv/arch.h
+++ b/cc1/arch/amd64-sysv/arch.h
_AT_@ -26,8 +26,8 @@
 #define L_USHORT L_UINT16
 #define L_INT L_INT32
 #define L_UINT L_UINT32
-#define L_LONG L_INT32
-#define L_ULONG L_UINT32
+#define L_LONG L_INT64
+#define L_ULONG L_UINT64
 #define L_LLONG L_INT64
 #define L_ULLONG L_UINT64
 #define L_ENUM L_INT
diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c
index 7a0f601..237ba41 100644
--- a/cc1/arch/i386-sysv/arch.c
+++ b/cc1/arch/i386-sysv/arch.c
_AT_@ -22,8 +22,8 @@ static Type types[] = {
         { /* 1 = pvoidtype */
                 .op = PTR,
                 .letter = L_POINTER,
- .size = 2,
- .align = 2,
+ .size = 4,
+ .align = 4,
                 .printed = 1,
                 .defined = 1,
         },
_AT_@ -80,7 +80,7 @@ static Type types[] = {
                 .size = 2,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 2,
                 .n.rank = RANK_USHORT,
                 .printed = 1
         },
_AT_@ -91,7 +91,7 @@ static Type types[] = {
                 .size = 2,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 2,
                 .sign = 1,
                 .n.rank = RANK_SHORT,
                 .printed = 1
_AT_@ -100,10 +100,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_UINT,
                 .defined = 1,
- .size = 2,
+ .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_UINT,
                 .printed = 1
         },
_AT_@ -111,10 +111,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_INT,
                 .defined = 1,
- .size = 2,
+ .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .sign = 1,
                 .n.rank = RANK_INT,
                 .printed = 1
_AT_@ -126,7 +126,7 @@ static Type types[] = {
                 .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .sign = 1,
                 .n.rank = RANK_LONG,
                 .printed = 1
_AT_@ -138,7 +138,7 @@ static Type types[] = {
                 .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_ULONG,
                 .printed = 1
         },
_AT_@ -149,7 +149,7 @@ static Type types[] = {
                 .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_ULLONG,
                 .printed = 1
         },
_AT_@ -160,7 +160,7 @@ static Type types[] = {
                 .size = 8,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .sign = 1,
                 .n.rank = RANK_LLONG,
                 .printed = 1
_AT_@ -171,7 +171,7 @@ static Type types[] = {
                 .defined = 1,
                 .size = 4,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_FLOAT,
                 .printed = 1
         },
_AT_@ -181,7 +181,7 @@ static Type types[] = {
                 .defined = 1,
                 .size = 8,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_DOUBLE,
                 .printed = 1
         },
_AT_@ -189,9 +189,9 @@ static Type types[] = {
                 .op = FLOAT,
                 .letter = L_LDOUBLE,
                 .defined = 1,
- .size = 16,
+ .size = 12,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_LDOUBLE,
                 .printed = 1
         },
_AT_@ -199,10 +199,10 @@ static Type types[] = {
                 .op = INT,
                 .letter = L_UINT,
                 .defined = 1,
- .size = 2,
+ .size = 4,
                 .integer = 1,
                 .arith = 1,
- .align = 1,
+ .align = 4,
                 .n.rank = RANK_UINT,
                 .printed = 1
         },
diff --git a/cc2/arch/amd64-sysv/types.c b/cc2/arch/amd64-sysv/types.c
index a258c4f..a6fab5b 100644
--- a/cc2/arch/amd64-sysv/types.c
+++ b/cc2/arch/amd64-sysv/types.c
_AT_@ -42,7 +42,7 @@ Type uint16type = {
 Type uint32type = {
         .flags = INTF,
         .size = 4,
- .align = 2
+ .align = 4
 };
 
 Type uint64type = {
_AT_@ -74,8 +74,8 @@ Type float64type = {
 };
 
 Type float80type = {
- .size = 10,
- .align = 12
+ .size = 16,
+ .align = 16
 };
 
 Type voidtype = {
diff --git a/cc2/arch/i386-sysv/types.c b/cc2/arch/i386-sysv/types.c
index 66ed4a1..c032e2d 100644
--- a/cc2/arch/i386-sysv/types.c
+++ b/cc2/arch/i386-sysv/types.c
_AT_@ -24,7 +24,7 @@ Type int32type = {
 Type int64type = {
         .flags = SIGNF | INTF,
         .size = 8,
- .align = 8
+ .align = 4
 };
 
 Type uint8type = {
_AT_@ -48,7 +48,7 @@ Type uint32type = {
 Type uint64type = {
         .flags = INTF,
         .size = 8,
- .align = 2
+ .align = 4
 };
 
 Type ptrtype = {
_AT_@ -70,11 +70,11 @@ Type float32type = {
 
 Type float64type = {
         .size = 8,
- .align = 8
+ .align = 4
 };
 
 Type float80type = {
- .size = 10,
+ .size = 12,
         .align = 4
 };
 
Received on Mon Jan 25 2016 - 12:46:05 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 25 2016 - 12:48:20 CET