[hackers] [scc] [cc2] Update the number of cases per switch || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 26 May 2016 15:07:16 +0200 (CEST)

commit c1e0104d5d49ab4d4f6545f90fb4c14cb76cd7b8
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu May 26 15:06:17 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu May 26 15:06:17 2016 +0200

    [cc2] Update the number of cases per switch
    
    This is a very important field because it will determinate
    which of the possible implementation will be used for the
    switch.

diff --git a/cc2/parser.c b/cc2/parser.c
index f03b9dd..292d1ce 100644
--- a/cc2/parser.c
+++ b/cc2/parser.c
_AT_@ -337,15 +337,18 @@ static void
 waft(Node *np)
 {
         Node *p;
+ struct swtch *cur;
 
         if (swp == swtbl)
                 error(EWTACKU);
- p = swp[-1].last;
 
+ cur = swp - 1;
+ p = cur->last;
         np->next = p->next;
         np->prev = p;
         p->next = np;
- swp[-1].last = np;
+ cur->last = np;
+ cur->nr++;
 }
 
 static void
Received on Thu May 26 2016 - 15:07:16 CEST

This archive was generated by hypermail 2.3.0 : Thu May 26 2016 - 15:12:13 CEST