[hackers] [scc] [cc1] Simplify popctx() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 22 Dec 2016 16:08:43 +0100 (CET)

commit 55c925535846f926611e070fe5bd417dc9ac326c
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Dec 22 16:03:38 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Dec 22 16:03:38 2016 +0100

    [cc1] Simplify popctx()
    
    This new version removed some indentation and does a better use
    of the whitespaces.

diff --git a/cc1/symbol.c b/cc1/symbol.c
index 400c4c5..bd171b3 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -106,23 +106,25 @@ popctx(void)
 {
         Symbol *next, *sym;
 
- if (--curctx == GLOBALCTX) {
- for (sym = labels; sym; sym = next) {
- next = sym->next;
- killsym(sym);
- }
- labels = NULL;
- if (curfun) {
- free(curfun->u.pars);
- curfun->u.pars = NULL;
- }
- }
-
         for (sym = head; sym && sym->ctx > curctx; sym = next) {
                 next = sym->next;
                 killsym(sym);
         }
         head = sym;
+
+ if (--curctx != GLOBALCTX)
+ return;
+
+ for (sym = labels; sym; sym = next) {
+ next = sym->next;
+ killsym(sym);
+ }
+ labels = NULL;
+
+ if (curfun) {
+ free(curfun->u.pars);
+ curfun->u.pars = NULL;
+ }
 }
 
 unsigned
Received on Thu Dec 22 2016 - 16:08:43 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 22 2016 - 16:12:28 CET