diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-30 06:32:01 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-30 06:32:01 +0000 |
commit | b3ad505859ea2f5ec4bf08973384eb45ee0d3b51 (patch) | |
tree | 8c104ec51ea68ba69bd89375653678bd4c7ade99 | |
parent | b4aeb2038ca9bacf1fc58d0b9c007058a5cb5bd8 (diff) |
KNF
-rw-r--r-- | usr.bin/xlint/lint1/scan.l | 92 |
1 files changed, 33 insertions, 59 deletions
diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index 355ca9959f0..dc675199efb 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.14 2005/11/30 06:22:42 cloder Exp $ */ +/* $OpenBSD: scan.l,v 1.15 2005/11/30 06:32:00 cloder 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.14 2005/11/30 06:22:42 cloder Exp $"; +static char rcsid[] = "$OpenBSD: scan.l,v 1.15 2005/11/30 06:32:00 cloder Exp $"; #endif #include <stdlib.h> @@ -157,7 +157,7 @@ EX ([eE][+-]?[0-9]+) %% static void -incline() +incline(void) { curr_pos.p_line++; if (curr_pos.p_file == csrc_pos.p_file) @@ -165,8 +165,7 @@ incline() } static void -badchar(c) - int c; +badchar(int c) { /* unknown character \%o */ error(250, c); @@ -260,7 +259,7 @@ symt_t symtyp; * in a extra table for each name we found. */ void -initscan() +initscan(void) { struct kwtab *kw; sym_t *sym; @@ -304,7 +303,7 @@ initscan() * Get a free sbuf structure, if possible from the free list */ static sbuf_t * -allocsb() +allocsb(void) { sbuf_t *sb; @@ -321,8 +320,7 @@ allocsb() * Put a sbuf structure to the free list */ static void -freesb(sb) - sbuf_t *sb; +freesb(sbuf_t *sb) { sb->sb_nxt = sbfrlst; sbfrlst = sb; @@ -333,7 +331,7 @@ freesb(sb) * Increment line count(s) if necessary. */ static int -inpc() +inpc(void) { int c; @@ -343,8 +341,7 @@ inpc() } static int -hash(s) - const char *s; +hash(const char *s) { u_int v; const u_char *us; @@ -373,7 +370,7 @@ hash(s) * to the symbol table entry. */ static int -name() +name(void) { char *s; sbuf_t *sb; @@ -411,8 +408,7 @@ name() } static sym_t * -search(sb) - sbuf_t *sb; +search(sbuf_t *sb) { sym_t *sym; @@ -427,8 +423,7 @@ search(sb) } static int -keyw(sym) - sym_t *sym; +keyw(sym_t *sym) { int t; @@ -447,8 +442,7 @@ keyw(sym) * The value is returned in yylval. icon() (and yylex()) returns T_CON. */ static int -icon(base) - int base; +icon(int base) { int l_suffix, u_suffix; int len; @@ -583,10 +577,7 @@ icon(base) * to the width of type t. */ int -sign(q, t, len) - quad_t q; - tspec_t t; - int len; +sign(quad_t q, tspec_t t, int len) { if (t == PTR || isutyp(t)) return (0); @@ -594,10 +585,7 @@ sign(q, t, len) } int -msb(q, t, len) - quad_t q; - tspec_t t; - int len; +msb(quad_t q, tspec_t t, int len) { if (len <= 0) len = size(t); @@ -608,10 +596,7 @@ msb(q, t, len) * Extends the sign of q. */ quad_t -xsign(q, t, len) - quad_t q; - tspec_t t; - int len; +xsign(quad_t q, tspec_t t, int len) { if (len <= 0) len = size(t); @@ -632,7 +617,7 @@ xsign(q, t, len) * long double which are greater then DBL_MAX. */ static int -fcon() +fcon(void) { const char *cp; int len; @@ -687,9 +672,7 @@ fcon() } static int -operator(t, o) - int t; - op_t o; +operator(int t, op_t o) { yylval.y_op = o; return (t); @@ -699,7 +682,7 @@ operator(t, o) * Called if lex found a leading \'. */ static int -ccon() +ccon(void) { int n, val, c; char cv; @@ -741,7 +724,7 @@ ccon() * Called if lex found a leading L\' */ static int -wccon() +wccon(void) { static char buf[MB_LEN_MAX + 1]; int i, c; @@ -794,8 +777,7 @@ wccon() * -2 if the EOF is reached, and the charachter otherwise. */ static int -getescc(d) - int d; +getescc(int d) { static int pbc = -1; int n, c, v; @@ -924,7 +906,7 @@ getescc(d) * # lineno "filename" */ static void -directive() +directive(void) { const char *cp, *fn; char c, *eptr; @@ -996,7 +978,7 @@ directive() * parsed and a function which handles this comment is called. */ static void -comment() +comment(void) { int c, lc; static struct { @@ -1101,7 +1083,7 @@ comment() * (if, switch, for, while). */ void -clrwflgs() +clrwflgs(void) { nowarn = 0; quadflg = 1; @@ -1114,7 +1096,7 @@ clrwflgs() * by the parser are responsible for freeing this buffer. */ static int -string() +string(void) { u_char *s; int c; @@ -1145,7 +1127,7 @@ string() } static int -wcstrg() +wcstrg(void) { char *s; int c, i, n, wi; @@ -1215,8 +1197,7 @@ wcstrg() * XXX calls to getsym() should be delayed until decl1*() is called */ sym_t * -getsym(sb) - sbuf_t *sb; +getsym(sbuf_t *sb) { dinfo_t *di; char *s; @@ -1287,8 +1268,7 @@ getsym(sb) * back to the symbol table. */ void -rmsym(sym) - sym_t *sym; +rmsym(sym_t *sym) { if ((*sym->s_rlink = sym->s_link) != NULL) sym->s_link->s_rlink = sym->s_rlink; @@ -1301,8 +1281,7 @@ rmsym(sym) * table. */ void -rmsyms(syms) - sym_t *syms; +rmsyms(sym_t *syms) { sym_t *sym; @@ -1320,9 +1299,7 @@ rmsyms(syms) * Put a symbol into the symbol table */ void -inssym(bl, sym) - int bl; - sym_t *sym; +inssym(int bl, sym_t *sym) { int h; @@ -1342,7 +1319,7 @@ inssym(bl, sym) * level 0. */ void -cleanup() +cleanup(void) { sym_t *sym, *nsym; int i; @@ -1365,8 +1342,7 @@ cleanup() * Create a new symbol with the name of an existing symbol. */ sym_t * -pushdown(sym) - sym_t *sym; +pushdown(sym_t *sym) { int h; sym_t *nsym; @@ -1396,9 +1372,7 @@ pushdown(sym) * The type of information in yylval is described by tok. */ void -freeyyv(sp, tok) - void *sp; - int tok; +freeyyv(void *sp, int tok) { if (tok == T_NAME || tok == T_TYPENAME) { sbuf_t *sb = *(sbuf_t **)sp; |