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

From: <git_AT_suckless.org>
Date: Fri, 17 Feb 2017 10:52:56 +0100 (CET)

commit 9df10d4d48f1e7da30e53486614ee36a253eb505
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 10:51:30 2017 +0100

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

diff --git a/cc1/decl.c b/cc1/decl.c
index f321d28..32b632d 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 - 10:52:56 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 17 2017 - 11:00:42 CET