diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-20 17:42:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-20 17:42:51 +0000 |
commit | 9194aaad298f29e6bd39b2e61b61cd38a9b80a16 (patch) | |
tree | a72732e10b2ea798dbe4848ab0394eea23a92be1 /usr.bin/xlint/lint1 | |
parent | 2d3ff7614dff2c02b923d828ca4d6f0e6141bd1a (diff) |
spacing
Diffstat (limited to 'usr.bin/xlint/lint1')
-rw-r--r-- | usr.bin/xlint/lint1/decl.c | 31 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/err.c | 10 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/init.c | 6 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/lint1.h | 4 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/main1.c | 6 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/mem1.c | 6 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/scan.l | 6 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/tree.c | 22 |
8 files changed, 39 insertions, 52 deletions
diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c index 3965f62a3f1..aa2ffffe631 100644 --- a/usr.bin/xlint/lint1/decl.c +++ b/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: decl.c,v 1.12 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: decl.c,v 1.13 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: decl.c,v 1.11 1995/10/02 17:34:16 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: decl.c,v 1.12 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: decl.c,v 1.13 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <sys/param.h> @@ -174,7 +174,7 @@ initdecl(void) for (i = 0; i < NTSPEC; i++) ttab[i].tt_psz = ttab[i].tt_sz; } - + /* shared type structures */ typetab = xcalloc(NTSPEC, sizeof (type_t)); for (i = 0; i < NTSPEC; i++) @@ -404,7 +404,7 @@ addtype(type_t *tp) } else { /* * remember specifiers "void", "char", "int", "float" or - * "double" int dcs->d_atyp + * "double" int dcs->d_atyp */ if (dcs->d_atyp != NOTSPEC) /* more than one, print error in deftyp() */ @@ -1128,7 +1128,7 @@ align(int al, int len) */ if (al > dcs->d_stralign) dcs->d_stralign = al; - + no = (dcs->d_offset + (al - 1)) & ~(al - 1); if (len == 0 || dcs->d_offset + len > no) dcs->d_offset = no; @@ -1352,7 +1352,7 @@ osfunc(sym_t *decl, sym_t *args) decl->s_type == dcs->d_nxt->d_type) { /* * We assume that this becomes a function definition. If - * we are wrong, its corrected in chkfdef(). + * we are wrong, its corrected in chkfdef(). */ if (args != NULL) { decl->s_osdef = 1; @@ -1790,7 +1790,6 @@ decl1ext(sym_t *dsym, int initflg) } if ((rdsym = dcs->d_rdcsym) != NULL) { - /* * If the old symbol stems from a old style function definition * we have remembered the params in rdsmy->s_args and compare @@ -1803,7 +1802,6 @@ decl1ext(sym_t *dsym, int initflg) } if (!redec && !isredec(dsym, (warn = 0, &warn))) { - if (warn) { /* redeclaration of %s */ (*(sflag ? error : warning))(27, dsym->s_name); @@ -1849,7 +1847,7 @@ decl1ext(sym_t *dsym, int initflg) compltyp(dsym, rdsym); } - + rmsym(rdsym); } @@ -1964,7 +1962,6 @@ eqtype(type_t *tp1, type_t *tp2, int ignqual, int promot, int *warn) tspec_t t; while (tp1 != NULL && tp2 != NULL) { - t = tp1->t_tspec; if (promot) { if (t == FLOAT) { @@ -2036,7 +2033,6 @@ eqargs(type_t *tp1, type_t *tp2, int *warn) a2 = tp2->t_args; while (a1 != NULL && a2 != NULL) { - if (eqtype(a1->s_type, a2->s_type, 1, 0, warn) == 0) return (0); @@ -2357,7 +2353,7 @@ cluparg(void) /* from now the prototype is valid */ funcsym->s_osdef = 0; funcsym->s_args = NULL; - + } } @@ -2458,9 +2454,7 @@ decl1loc(sym_t *dsym, int initflg) } if (dcs->d_rdcsym != NULL) { - if (dcs->d_rdcsym->s_blklev == 0) { - switch (dsym->s_scl) { case AUTO: /* automatic hides external declaration: %s */ @@ -2485,9 +2479,7 @@ decl1loc(sym_t *dsym, int initflg) default: lerror("decl1loc() 1"); } - } else if (dcs->d_rdcsym->s_blklev == blklev) { - /* no hflag, because its illegal! */ if (dcs->d_rdcsym->s_arg) { /* @@ -2503,21 +2495,16 @@ decl1loc(sym_t *dsym, int initflg) } } else if (dcs->d_rdcsym->s_blklev < blklev) { - if (hflag) /* declaration hides earlier one: %s */ warning(95, dsym->s_name); - } if (dcs->d_rdcsym->s_blklev == blklev) { - /* redeclaration of %s */ error(27, dsym->s_name); rmsym(dcs->d_rdcsym); - } - } if (initflg && !(initerr = chkinit(dsym))) { @@ -2961,7 +2948,7 @@ chkglvar(sym_t *sym) { if (sym->s_scl == TYPEDEF || sym->s_scl == ENUMCON) return; - + if (sym->s_scl != EXTERN && sym->s_scl != STATIC) lerror("chkglvar() 1"); diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index 666a3f83bdb..3b1d7d9a5b9 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.6 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: err.c,v 1.7 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: err.c,v 1.8 1995/10/02 17:37:00 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: err.c,v 1.6 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: err.c,v 1.7 2005/11/20 17:42:49 deraadt Exp $"; #endif /* number of errors found */ @@ -209,9 +209,9 @@ const char *msgs[] = { "argument has incompatible pointer type, arg #%d", /* 153 */ "illegal combination of pointer and integer, arg #%d", /* 154 */ "argument is incompatible with prototype, arg #%d", /* 155 */ - "enum type mismatch, arg #%d", /* 156 */ + "enum type mismatch, arg #%d", /* 156 */ "ANSI C treats constant as unsigned", /* 157 */ - "%s may be used before set", /* 158 */ + "%s may be used before set", /* 158 */ "assignment in conditional context", /* 159 */ "operator '==' found where '=' was expected", /* 160 */ "constant in conditional context", /* 161 */ @@ -244,7 +244,7 @@ const char *msgs[] = { "no automatic aggregate initialization in traditional C", /* 188 */ "assignment of struct/union illegal in traditional C", /* 189 */ "empty array declaration: %s", /* 190 */ - "%s set but not used in function %s", /* 191 */ + "%s set but not used in function %s", /* 191 */ "%s unused in function %s", /* 192 */ "statement not reached", /* 193 */ "label %s redefined", /* 194 */ diff --git a/usr.bin/xlint/lint1/init.c b/usr.bin/xlint/lint1/init.c index 1ec11a5e48b..2c2a5a2de50 100644 --- a/usr.bin/xlint/lint1/init.c +++ b/usr.bin/xlint/lint1/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.5 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: init.c,v 1.6 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: init.c,v 1.4 1995/10/02 17:21:37 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: init.c,v 1.5 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.6 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <stdlib.h> @@ -410,7 +410,7 @@ mkinit(tnode_t *tn) tmem = tsave(); expr(tn, 1, 0); trestor(tmem); - + if (isityp(lt) && ln->tn_type->t_isfield && !isityp(rt)) { /* * Bit-fields can be initialized in trad. C only by integer diff --git a/usr.bin/xlint/lint1/lint1.h b/usr.bin/xlint/lint1/lint1.h index 2777d386f7a..cc90d5e6c00 100644 --- a/usr.bin/xlint/lint1/lint1.h +++ b/usr.bin/xlint/lint1/lint1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lint1.h,v 1.2 1996/06/26 05:44:15 deraadt Exp $ */ +/* $OpenBSD: lint1.h,v 1.3 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: lint1.h,v 1.6 1995/10/02 17:31:41 jpo Exp $ */ /* @@ -226,7 +226,7 @@ typedef struct sym { struct sym **s_rlink; /* pointer to s_link of prev. symbol */ struct sym *s_nxt; /* next struct/union member, enumerator, argument */ - struct sym *s_dlnxt; /* next symbol declared on same level */ + struct sym *s_dlnxt; /* next symbol declared on same level */ } sym_t; #define s_styp u._s_st diff --git a/usr.bin/xlint/lint1/main1.c b/usr.bin/xlint/lint1/main1.c index 458e2d22947..3d0a73ef57b 100644 --- a/usr.bin/xlint/lint1/main1.c +++ b/usr.bin/xlint/lint1/main1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main1.c,v 1.4 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: main1.c,v 1.5 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: main1.c,v 1.3 1995/10/02 17:29:56 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: main1.c,v 1.4 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: main1.c,v 1.5 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <stdio.h> @@ -172,7 +172,7 @@ usage(void) (void)fprintf(stderr, "usage: lint1 [-abcdeghprstuvyzF] src dest\n"); exit(1); } - + void norecover(void) { diff --git a/usr.bin/xlint/lint1/mem1.c b/usr.bin/xlint/lint1/mem1.c index 71942f707b7..d84888bde1e 100644 --- a/usr.bin/xlint/lint1/mem1.c +++ b/usr.bin/xlint/lint1/mem1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem1.c,v 1.6 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: mem1.c,v 1.7 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: mem1.c,v 1.2 1995/07/03 21:24:25 cgd Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mem1.c,v 1.6 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: mem1.c,v 1.7 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <sys/types.h> @@ -246,7 +246,7 @@ initmem(void) mblks = xcalloc(nmblks = ML_INC, sizeof (mbl_t *)); } - + /* * Allocate memory associated with level l. */ diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index af0fab7e43e..b50a9ee502d 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.6 2004/05/10 15:26:22 deraadt Exp $ */ +/* $OpenBSD: scan.l,v 1.7 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: scan.l,v 1.8 1995/10/23 13:38:51 jpo Exp $ */ /* @@ -34,7 +34,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: scan.l,v 1.6 2004/05/10 15:26:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: scan.l,v 1.7 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <stdlib.h> @@ -94,7 +94,7 @@ EX ([eE][+-]?[0-9]+) %% -{L}({L}|{D})* return (name()); +{L}({L}|{D})* return (name()); 0{OD}*[lLuU]* return (icon(8)); {NZD}{D}*[lLuU]* return (icon(10)); 0[xX]{HD}+[lLuU]* return (icon(16)); diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 0ff5c7d992e..3a9657a251b 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.8 2005/11/19 03:35:27 cloder Exp $ */ +/* $OpenBSD: tree.c,v 1.9 2005/11/20 17:42:49 deraadt Exp $ */ /* $NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: tree.c,v 1.8 2005/11/19 03:35:27 cloder Exp $"; +static char rcsid[] = "$OpenBSD: tree.c,v 1.9 2005/11/20 17:42:49 deraadt Exp $"; #endif #include <stdlib.h> @@ -793,7 +793,7 @@ typeok(op_t op, int arg, tnode_t *ln, tnode_t *rn) for (tn=rn; tn->tn_op==CVT && !tn->tn_cast; tn=tn->tn_left) ; ort = tn->tn_type->t_tspec; } - + switch (op) { case POINT: /* @@ -1732,7 +1732,7 @@ iiconv(op_t op, int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn) } else { warning(132, tyname(tn->tn_type)); } - } + } } } @@ -1796,7 +1796,7 @@ ppconv(op_t op, tnode_t *tn, type_t *tp) warning(229); return; } - + if (getbound(tp->t_subt) > getbound(tn->tn_type->t_subt)) { if (hflag) /* possible pointer alignment problem */ @@ -1924,7 +1924,7 @@ cvtcon(op_t op, int arg, type_t *tp, val_t *nv, val_t *v) sz = tp->t_isfield ? tp->t_flen : size(nt); nv->v_quad = xsign(nv->v_quad, nt, sz); } - + if (rchk && op != CVT) { osz = size(ot); nsz = tp->t_isfield ? tp->t_flen : size(nt); @@ -2280,7 +2280,7 @@ bldamper(tnode_t *tn, int noign) { tnode_t *ntn; tspec_t t; - + if (!noign && ((t = tn->tn_type->t_tspec) == ARRAY || t == FUNC)) { /* & before array or function: ignored */ if (tflag) @@ -2294,7 +2294,7 @@ bldamper(tnode_t *tn, int noign) tn->tn_left->tn_type->t_subt == tn->tn_type) { return (tn->tn_left); } - + ntn = mktnode(AMPER, tincref(tn->tn_type, PTR), tn, NULL); return (ntn); @@ -3112,7 +3112,7 @@ chkfarg(type_t *ftp, tnode_t *args) error(150, narg, narg > 1 ? "s" : "", npar); asym = NULL; } - + for (n = 1; n <= narg; n++) { /* @@ -3159,7 +3159,7 @@ chkfarg(type_t *ftp, tnode_t *args) * prototype parameter. If it is a valid combination, but both types * are not the same, insert a conversion to convert the argument into * the type of the parameter. - * + * * n: position of arg * tp: expected type (from prototype) * tn: argument @@ -3539,7 +3539,7 @@ chkaidx(tnode_t *tn, int amper) return; if (ln->tn_left->tn_type->t_tspec != ARRAY) return; - + /* * For incomplete array types, we can print a warning only if * the index is negative. |