[hackers] [scc] [cc2] Change addnode() to addstmt() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 31 Mar 2016 18:24:48 +0200 (CEST)

commit 9676a1ef385aba1e248f18cd3e6109d392b73815
Author: Roberto E. Vargas Caballero <roberto.vargas_AT_igrid-td.com>
AuthorDate: Thu Mar 31 18:21:05 2016 +0200
Commit: Roberto E. Vargas Caballero <roberto.vargas_AT_igrid-td.com>
CommitDate: Thu Mar 31 18:24:36 2016 +0200

    [cc2] Change addnode() to addstmt()
    
    Addnode() was not a good name because it was suggesting that we were adding
    the current node to some data structure, but in fact we were adding the
    node of the current statement into the function body list.

diff --git a/cc2/parser.c b/cc2/parser.c
index 83e8ecd..193a503 100644
--- a/cc2/parser.c
+++ b/cc2/parser.c
_AT_@ -592,11 +592,10 @@ labeldcl( void)
         nextline();
         stmtp->label = sym;
         sym->u.label = stmtp;
-
 }
 
 static void
-addnode(Node *np)
+addstmt(Node *np)
 {
         if (!curfun->u.label)
                 curfun->u.label = np;
_AT_@ -616,7 +615,7 @@ stmt(void)
                 deltree(np);
                 return;
         }
- addnode(np);
+ addstmt(np);
 }
 
 static void
_AT_@ -634,7 +633,7 @@ endfun(void)
 
         np = newnode();
         np->op = ONOP;
- addnode(np);
+ addstmt(np);
         /* TODO: process the function */
         curfun = NULL;
         funpars = -1;
Received on Thu Mar 31 2016 - 18:24:48 CEST

This archive was generated by hypermail 2.3.0 : Thu Mar 31 2016 - 18:36:23 CEST