[hackers] [scc] [cc1] ansifun: minor style change || Quentin Rameau

From: <git_AT_suckless.org>
Date: Fri, 17 Feb 2017 23:06:58 +0100 (CET)

commit 19c52444ba18c113bfb9afb5eca8c2ad9f8cdaca
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Fri Jan 27 12:01:22 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Fri Feb 17 22:51:32 2017 +0100

    [cc1] ansifun: minor style change
    
    Make what n is counting more obvious.

diff --git a/cc1/decl.c b/cc1/decl.c
index 488e8bd..aa55dda 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -244,19 +244,19 @@ krfun(Type *tp, Type *types[], Symbol *syms[], int *ntypes, int *nsyms)
 static void
 ansifun(Type *tp, Type *types[], Symbol *syms[], int *ntypes, int *nsyms)
 {
- int n = 0;
+ int npars = 0;
         Symbol *sym;
         int toomany = 0, toovoid = 0;
 
         do {
- if (n == -1 && !toovoid) {
+ if (npars == -1 && !toovoid) {
                         errorp("'void' must be the only parameter");
                         toovoid = 1;
                 }
                 if (accept(ELLIPSIS)) {
- if (n == 0)
- errorp("a named argument is required before '...'");
- ++n;
+ if (npars == 0)
+ errorp("a named argument is requiered before '...'");
+ ++npars;
                         *syms = NULL;
                         *types++ = ellipsistype;
                         break;
_AT_@ -264,22 +264,23 @@ ansifun(Type *tp, Type *types[], Symbol *syms[], int *ntypes, int *nsyms)
                 if ((sym = dodcl(NOREP, parameter, NS_IDEN, tp)) == NULL)
                         continue;
                 if (tp->n.elem == -1) {
- n = -1;
+ npars = -1;
                         continue;
                 }
- if (n < NR_FUNPARAM) {
+ if (npars < NR_FUNPARAM) {
                         *syms++ = sym;
                         *types++ = sym->type;
- ++n;
+ ++npars;
                         continue;
                 }
- if (!toomany)
+ if (!toomany) {
                         errorp("too many parameters in function definition");
- toomany = 1;
+ toomany = 1;
+ }
         } while (accept(','));
 
- *nsyms = n;
- *ntypes = n;
+ *nsyms = npars;
+ *ntypes = npars;
 }
 
 static void
Received on Fri Feb 17 2017 - 23:06:58 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 17 2017 - 23:12:34 CET