[hackers] [scc] Remove eval() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 4 Sep 2015 20:22:39 +0200 (CEST)

commit c65ba1f014232a19cd2b4d27f1a06dc18b9c4c2d
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Sep 4 19:57:05 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Sep 4 20:16:34 2015 +0200

    Remove eval()
    
    This function was added to transform comparision or logic
    expressions in arithmetic expressions using ternary
    operations. This transformation is needed in a z80,
    but not in a amd64, and it makes difficult to apply
    algebraic transformations.

diff --git a/cc1/expr.c b/cc1/expr.c
index a15468a..8ce08b3 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -284,12 +284,13 @@ pcompare(char op, Node *lp, Node *rp)
 static Node *
 compare(char op, Node *lp, Node *rp)
 {
- lp = promote(decay(lp));
- rp = promote(decay(rp));
+ lp = decay(lp);
+ rp = decay(rp);
+
         switch (BTYPE(lp)) {
         case INT:
         case FLOAT:
- switch (BTYPE(lp)) {
+ switch (BTYPE(rp)) {
                 case INT:
                 case FLOAT:
                         typeconv(&lp, &rp);
Received on Fri Sep 04 2015 - 20:22:39 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 04 2015 - 20:24:29 CEST