[hackers] [scc] [cc2] Join odefault and casetbl || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 18 Apr 2016 21:24:04 +0200 (CEST)

commit 8cd212d516410eb5c3403fc3d3c6e60387dd7d38
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Mon Apr 18 01:47:43 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Mon Apr 18 01:56:35 2016 +0200

    [cc2] Join odefault and casetbl
    
    After the last commit there is not any difference between
    these two functions, so they can be joined.

diff --git a/cc2/parser.c b/cc2/parser.c
index ae8f0a4..b429dad 100644
--- a/cc2/parser.c
+++ b/cc2/parser.c
_AT_@ -33,7 +33,7 @@ union tokenop {
 typedef void parsefun(char *, union tokenop);
 static parsefun type, symbol, getname, unary, binary, ternary, call,
                 parameter, constant, composed, binit, einit,
- jump, oreturn, loop, assign, ocase, odefault, casetbl;
+ jump, oreturn, loop, assign, ocase, casetbl;
 
 typedef void evalfun(void);
 static evalfun vardecl, beginfun, endfun, endpars, stmt,
_AT_@ -126,7 +126,7 @@ static struct decoc {
         ['v'] = { NULL, jump, .u.op = OCASE},
         ['s'] = { NULL, jump, .u.op = OSWITCH},
 
- ['f'] = { NULL,odefault, .u.op = ODEFAULT},
+ ['f'] = { NULL, casetbl, .u.op = ODEFAULT},
         ['t'] = { NULL, casetbl, .u.op = OTABLE}
 };
 
_AT_@ -365,18 +365,6 @@ casetbl(char *token, union tokenop u)
 }
 
 static void
-odefault(char *token, union tokenop u)
-{
- Node *np;
-
- np = newnode();
- np->op = u.op;
- eval(strtok(NULL, "\t\n"));
- np->left = pop();
- push(np);
-}
-
-static void
 loop(char *token, union tokenop u)
 {
         Node *np;
Received on Mon Apr 18 2016 - 21:24:04 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 18 2016 - 21:24:35 CEST