[hackers] [scc] [cc1] Remove bits from old 8 bit version || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 27 Jan 2017 15:07:11 +0100 (CET)

commit ac253bd1bb4aa75dc5291e9c27dc2db74670b49a
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jan 27 11:13:49 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Jan 27 14:48:36 2017 +0100

    [cc1] Remove bits from old 8 bit version
    
    At the beginning the code was written to be 8 bit friendly
    and it meant that a lot of variables were char instead of int,
    but it doesn't make sense anymore.

diff --git a/cc1/expr.c b/cc1/expr.c
index d888095..5497a26 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -210,7 +210,7 @@ decay(Node *np)
 }
 
 static Node *
-integerop(char op, Node *lp, Node *rp)
+integerop(int op, Node *lp, Node *rp)
 {
         if (!(lp->type->prop & TINTEGER) || !(rp->type->prop & TINTEGER))
                 error("operator requires integer operands");
_AT_@ -219,7 +219,7 @@ integerop(char op, Node *lp, Node *rp)
 }
 
 static Node *
-integeruop(char op, Node *np)
+integeruop(int op, Node *np)
 {
         if (!(np->type->prop & TINTEGER))
                 error("unary operator requires integer operand");
_AT_@ -230,7 +230,7 @@ integeruop(char op, Node *np)
 }
 
 static Node *
-numericaluop(char op, Node *np)
+numericaluop(int op, Node *np)
 {
         if (!(np->type->prop & TARITH))
                 error("unary operator requires numerical operand");
_AT_@ -292,7 +292,7 @@ convert(Node *np, Type *newtp, char iscast)
 }
 
 static Node *
-parithmetic(char op, Node *lp, Node *rp)
+parithmetic(int op, Node *lp, Node *rp)
 {
         Type *tp;
         Node *size, *np;
_AT_@ -333,7 +333,7 @@ incorrect:
 }
 
 static Node *
-arithmetic(char op, Node *lp, Node *rp)
+arithmetic(int op, Node *lp, Node *rp)
 {
         Type *ltp = lp->type, *rtp = rp->type;
 
_AT_@ -355,7 +355,7 @@ arithmetic(char op, Node *lp, Node *rp)
 }
 
 static Node *
-pcompare(char op, Node *lp, Node *rp)
+pcompare(int op, Node *lp, Node *rp)
 {
         Node *np;
         int err = 0;
_AT_@ -379,7 +379,7 @@ pcompare(char op, Node *lp, Node *rp)
 }
 
 static Node *
-compare(char op, Node *lp, Node *rp)
+compare(int op, Node *lp, Node *rp)
 {
         Type *ltp, *rtp;
 
_AT_@ -471,7 +471,7 @@ exp2cond(Node *np, char neg)
 }
 
 static Node *
-logic(char op, Node *lp, Node *rp)
+logic(int op, Node *lp, Node *rp)
 {
         lp = exp2cond(lp, 0);
         rp = exp2cond(rp, 0);
_AT_@ -511,7 +511,7 @@ free_np:
 }
 
 static Node *
-content(char op, Node *np)
+content(int op, Node *np)
 {
         if (BTYPE(np) != PTR) {
                 errorp("invalid argument of memory indirection");
_AT_@ -545,7 +545,7 @@ array(Node *lp, Node *rp)
 }
 
 static Node *
-assignop(char op, Node *lp, Node *rp)
+assignop(int op, Node *lp, Node *rp)
 {
         if ((rp = convert(rp, lp->type, 0)) == NULL) {
                 errorp("incompatible types when assigning");
_AT_@ -556,7 +556,7 @@ assignop(char op, Node *lp, Node *rp)
 }
 
 static Node *
-incdec(Node *np, char op)
+incdec(Node *np, int op)
 {
         Type *tp = np->type;
         Node *inc;
_AT_@ -581,7 +581,7 @@ incdec(Node *np, char op)
 }
 
 static Node *
-address(char op, Node *np)
+address(int op, Node *np)
 {
         Node *new;
 
_AT_@ -613,7 +613,7 @@ dont_check_lvalue:
 }
 
 static Node *
-negation(char op, Node *np)
+negation(int op, Node *np)
 {
         if (!(np->type->prop & TARITH) && np->type->op != PTR) {
                 errorp("invalid argument of unary '!'");
_AT_@ -838,9 +838,9 @@ static Node *cast(int);
 static Node *
 unary(int needdecay)
 {
- Node *(*fun)(char, Node *), *np;
+ Node *(*fun)(int, Node *), *np;
         Symbol *sym;
- char op;
+ int op;
         Type *tp;
         int paren;
 
_AT_@ -943,8 +943,8 @@ cast(int needdecay)
 static Node *
 mul(void)
 {
- Node *np, *(*fun)(char, Node *, Node *);
- char op;
+ Node *np, *(*fun)(int, Node *, Node *);
+ int op;
 
         np = cast(1);
         for (;;) {
_AT_@ -962,7 +962,7 @@ mul(void)
 static Node *
 add(void)
 {
- char op;
+ int op;
         Node *np;
 
         np = mul();
_AT_@ -980,7 +980,7 @@ add(void)
 static Node *
 shift(void)
 {
- char op;
+ int op;
         Node *np;
 
         np = add();
_AT_@ -998,7 +998,7 @@ shift(void)
 static Node *
 relational(void)
 {
- char op;
+ int op;
         Node *np;
 
         np = shift();
_AT_@ -1018,7 +1018,7 @@ relational(void)
 static Node *
 eq(void)
 {
- char op;
+ int op;
         Node *np;
 
         np = relational();
_AT_@ -1110,8 +1110,8 @@ ternary(void)
 Node *
 assign(void)
 {
- Node *np, *(*fun)(char , Node *, Node *);
- char op;
+ Node *np, *(*fun)(int , Node *, Node *);
+ int op;
 
         np = ternary();
         for (;;) {
Received on Fri Jan 27 2017 - 15:07:11 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 27 2017 - 15:12:17 CET