[hackers] [scc] Small cosmetic changes in fold.c || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 1 Sep 2015 22:10:19 +0200 (CEST)

commit bcc4de52e4e216a3b5a9d734fed46a4d06c3252c
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Sep 1 22:09:45 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Sep 1 22:09:45 2015 +0200

    Small cosmetic changes in fold.c

diff --git a/cc1/fold.c b/cc1/fold.c
index 78600ed..43d511e 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
_AT_@ -293,8 +293,6 @@ commutative(int *op, Node **lp, Node **rp)
                 *rp = r;
                 *lp = l;
                 break;
- default:
- return;
         }
 }
 
_AT_@ -329,7 +327,7 @@ ones(int n)
         return v;
 }
 
-static bool
+static Node *
 identity(int op, Node *lp, Node *rp)
 {
         int val;
_AT_@ -352,13 +350,13 @@ identity(int op, Node *lp, Node *rp)
                 if (cmp(lp, ones(lp->type->size * 8)))
                         goto free_right;
         default:
- return 0;
+ return NULL;
         }
         if (!cmp(rp, val))
- return 0;
+ return NULL;
 free_right:
         freetree(rp);
- return 1;
+ return lp;
 }
 
 Node *
_AT_@ -369,8 +367,8 @@ simplify(int op, Type *tp, Node *lp, Node *rp)
         if ((np = fold(op, tp, lp, rp)) != NULL)
                 return np;
         commutative(&op, &lp, &rp);
- if (identity(op, lp, rp))
- return lp;
+ if ((np = identity(op, lp, rp)) != NULL)
+ return np;
         return node(op, tp, lp, rp);
 }
 
Received on Tue Sep 01 2015 - 22:10:19 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2015 - 22:12:11 CEST