[hackers] [scc] [cc2] Use NNODESinstead of NSYMBOLS || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 15 Apr 2016 18:51:19 +0200 (CEST)

commit f60d000d6fbecc3541928fe1112bed3d0dbaeef5
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Fri Apr 15 01:19:48 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Fri Apr 15 01:19:48 2016 +0200

    [cc2] Use NNODESinstead of NSYMBOLS
    
    This is an error due to the first arena implementation was done in symbol.c.

diff --git a/cc2/node.c b/cc2/node.c
index 7988a84..2d1a1ff 100644
--- a/cc2/node.c
+++ b/cc2/node.c
_AT_@ -7,7 +7,7 @@
 #include "arch.h"
 #include "cc2.h"
 
-#define NSYMBOLS 32
+#define NNODES 32
 
 Symbol *curfun;
 
_AT_@ -28,10 +28,10 @@ newnode(void)
 
         if (!freep) {
                 ap = xmalloc(sizeof(*ap));
- ap->mem = xcalloc(NSYMBOLS, sizeof(Node));
+ ap->mem = xcalloc(NNODES, sizeof(Node));
                 ap->next = arena;
                 arena = ap;
- for (np = ap->mem; np < &ap->mem[NSYMBOLS-1]; ++np)
+ for (np = ap->mem; np < &ap->mem[NNODES-1]; ++np)
                         np->left = np+1;
                 np->left = NULL;
                 freep = np;
Received on Fri Apr 15 2016 - 18:51:19 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 15 2016 - 19:00:20 CEST