Module Name: src
Committed By: rillig
Date: Tue Dec 29 13:33:03 UTC 2020
Modified Files:
src/usr.bin/xlint/common: externs.h tyname.c
src/usr.bin/xlint/lint1: cgram.y decl.c externs1.h func.c init.c
print.c scan.l tree.c
Log Message:
lint: rename functions with very short names
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.113 -r1.114 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/print.c
cvs rdiff -u -r1.97 -r1.98 src/usr.bin/xlint/lint1/scan.l \
src/usr.bin/xlint/lint1/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.7 src/usr.bin/xlint/common/externs.h:1.8
--- src/usr.bin/xlint/common/externs.h:1.7 Mon Feb 10 04:54:01 2020
+++ src/usr.bin/xlint/common/externs.h Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: externs.h,v 1.7 2020/02/10 04:54:01 christos Exp $ */
+/* $NetBSD: externs.h,v 1.8 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -46,7 +46,7 @@ extern void inittyp(void);
*/
extern const char *tyname(char *, size_t, const type_t *);
extern int sametype(const type_t *, const type_t *);
-extern const char *basictyname(tspec_t);
+extern const char *basic_type_name(tspec_t);
/*
* mem.c
Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.15 src/usr.bin/xlint/common/tyname.c:1.16
--- src/usr.bin/xlint/common/tyname.c:1.15 Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/common/tyname.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 rillig Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <limits.h>
@@ -54,7 +54,7 @@ __RCSID("$NetBSD: tyname.c,v 1.15 2020/1
#endif
const char *
-basictyname(tspec_t t)
+basic_type_name(tspec_t t)
{
switch (t) {
case BOOL: return "_Bool";
@@ -88,7 +88,7 @@ basictyname(tspec_t t)
case LCOMPLEX: return "long double _Complex";
case COMPLEX: return "_Complex";
default:
- LERROR("basictyname(%d)", t);
+ LERROR("basic_type_name(%d)", t);
return NULL;
}
}
@@ -170,7 +170,7 @@ tyname(char *buf, size_t bufsiz, const t
if ((t = tp->t_tspec) == INT && tp->t_isenum)
t = ENUM;
- s = basictyname(t);
+ s = basic_type_name(t);
cv[0] = '\0';
if (tp->t_const)
Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.113 src/usr.bin/xlint/lint1/cgram.y:1.114
--- src/usr.bin/xlint/lint1/cgram.y:1.113 Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/cgram.y Tue Dec 29 13:33:03 2020
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <limits.h>
@@ -351,11 +351,11 @@ translation_unit:
ext_decl:
asm_stmnt
| func_def {
- glclup(0);
+ global_clean_up_decl(0);
CLRWFLGS(__FILE__, __LINE__);
}
| data_def {
- glclup(0);
+ global_clean_up_decl(0);
CLRWFLGS(__FILE__, __LINE__);
}
;
@@ -400,10 +400,10 @@ data_def:
}
| declspecs deftyp type_init_decls T_SEMI
| error T_SEMI {
- globclup();
+ global_clean_up();
}
| error T_RBRACE {
- globclup();
+ global_clean_up();
}
;
@@ -573,10 +573,10 @@ type_attribute_spec:
| T_AT_FORMAT T_LPARN type_attribute_format_type T_COMMA
constant T_COMMA constant T_RPARN
| T_AT_USED {
- addused();
+ add_attr_used();
}
| T_AT_UNUSED {
- addused();
+ add_attr_used();
}
| T_AT_WARN_UNUSED_RESULT
| T_AT_WEAK
@@ -624,34 +624,34 @@ deftyp:
declspecs:
clrtyp_typespec {
- addtype($1);
+ add_type($1);
}
| declmods typespec {
- addtype($2);
+ add_type($2);
}
| type_attribute declspecs
| declspecs declmod
| declspecs notype_typespec {
- addtype($2);
+ add_type($2);
}
;
declmods:
clrtyp T_QUAL {
- addqual($2);
+ add_qualifier($2);
}
| clrtyp T_SCLASS {
- addscl($2);
+ add_storage_class($2);
}
| declmods declmod
;
declmod:
T_QUAL {
- addqual($1);
+ add_qualifier($1);
}
| T_SCLASS {
- addscl($1);
+ add_storage_class($1);
}
| type_attribute_list
;
@@ -705,12 +705,12 @@ struct_spec:
| struct struct_tag {
dcs->d_tagtyp = mktag($2, $1, 1, 0);
} struct_declaration {
- $$ = compltag(dcs->d_tagtyp, $4);
+ $$ = complete_tag(dcs->d_tagtyp, $4);
}
| struct {
dcs->d_tagtyp = mktag(NULL, $1, 1, 0);
} struct_declaration {
- $$ = compltag(dcs->d_tagtyp, $3);
+ $$ = complete_tag(dcs->d_tagtyp, $3);
}
| struct error {
symtyp = FVFT;
@@ -820,27 +820,27 @@ member_declaration:
noclass_declspecs:
clrtyp_typespec {
- addtype($1);
+ add_type($1);
}
| type_attribute noclass_declspecs
| noclass_declmods typespec {
- addtype($2);
+ add_type($2);
}
| noclass_declspecs T_QUAL {
- addqual($2);
+ add_qualifier($2);
}
| noclass_declspecs notype_typespec {
- addtype($2);
+ add_type($2);
}
| noclass_declspecs type_attribute
;
noclass_declmods:
clrtyp T_QUAL {
- addqual($2);
+ add_qualifier($2);
}
| noclass_declmods T_QUAL {
- addqual($2);
+ add_qualifier($2);
}
;
@@ -901,12 +901,12 @@ enum_spec:
| enum enum_tag {
dcs->d_tagtyp = mktag($2, ENUM, 1, 0);
} enum_declaration {
- $$ = compltag(dcs->d_tagtyp, $4);
+ $$ = complete_tag(dcs->d_tagtyp, $4);
}
| enum {
dcs->d_tagtyp = mktag(NULL, ENUM, 1, 0);
} enum_declaration {
- $$ = compltag(dcs->d_tagtyp, $3);
+ $$ = complete_tag(dcs->d_tagtyp, $3);
}
| enum error {
symtyp = FVFT;
@@ -1361,7 +1361,7 @@ init_field:
| point identifier {
if (!Sflag)
warning(313);
- memberpush($2);
+ push_member($2);
}
;
@@ -1374,19 +1374,19 @@ init_by_name:
init_field_list T_ASSIGN
| identifier T_COLON {
gnuism(315);
- memberpush($1);
+ push_member($1);
}
;
init_lbrace:
T_LBRACE {
- initlbr();
+ init_lbrace();
}
;
init_rbrace:
T_RBRACE {
- initrbr();
+ init_rbrace();
}
;
@@ -1908,12 +1908,18 @@ term:
| term point_or_arrow T_NAME {
if ($1 != NULL) {
sym_t *msym;
- /* XXX strmemb should be integrated in build() */
+ /*
+ * XXX struct_or_union_member should be integrated
+ * in build()
+ */
if ($2 == ARROW) {
- /* must to this before strmemb is called */
+ /*
+ * must do this before struct_or_union_member
+ * is called
+ */
$1 = cconv($1);
}
- msym = strmemb($1, $2, getsym($3));
+ msym = struct_or_union_member($1, $2, getsym($3));
$$ = build($2, $1, getnnode(msym, 0));
} else {
$$ = NULL;
@@ -1937,17 +1943,18 @@ term:
| T_BUILTIN_OFFSETOF T_LPARN type_name T_COMMA identifier T_RPARN
%prec T_BUILTIN_OFFSETOF {
symtyp = FMOS;
- $$ = bldoffsetof($3, getsym($5));
+ $$ = build_offsetof($3, getsym($5));
}
| T_SIZEOF term %prec T_SIZEOF {
- if (($$ = $2 == NULL ? NULL : bldszof($2->tn_type)) != NULL)
- chkmisc($2, 0, 0, 0, 0, 0, 1);
+ $$ = $2 == NULL ? NULL : build_sizeof($2->tn_type);
+ if ($$ != NULL)
+ check_expr_misc($2, 0, 0, 0, 0, 0, 1);
}
| T_SIZEOF T_LPARN type_name T_RPARN %prec T_SIZEOF {
- $$ = bldszof($3);
+ $$ = build_sizeof($3);
}
| T_ALIGNOF T_LPARN type_name T_RPARN %prec T_ALIGNOF {
- $$ = bldalof($3);
+ $$ = build_alignof($3);
}
| T_LPARN type_name T_RPARN term %prec T_UNOP {
$$ = cast($4, $2);
@@ -1967,7 +1974,7 @@ string:
$$ = $1;
}
| T_STRING string2 {
- $$ = catstrg($1, $2);
+ $$ = cat_strings($1, $2);
}
;
@@ -1980,7 +1987,7 @@ string2:
$$ = $1;
}
| string2 T_STRING {
- $$ = catstrg($1, $2);
+ $$ = cat_strings($1, $2);
}
;
Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.76 src/usr.bin/xlint/lint1/decl.c:1.77
--- src/usr.bin/xlint/lint1/decl.c:1.76 Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/decl.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.76 2020/12/29 11:35:11 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.77 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.76 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.77 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <sys/param.h>
@@ -64,7 +64,7 @@ dinfo_t *dcs;
static type_t *tdeferr(type_t *, tspec_t);
static void settdsym(type_t *, sym_t *);
-static tspec_t mrgtspec(tspec_t, tspec_t);
+static tspec_t merge_type_specifiers(tspec_t, tspec_t);
static void align(int, int);
static sym_t *newtag(sym_t *, scl_t, int, int);
static int eqargs(type_t *, type_t *, int *);
@@ -213,7 +213,7 @@ setcomplete(type_t *tp, int complete)
* storage classes.
*/
void
-addscl(scl_t sc)
+add_storage_class(scl_t sc)
{
if (sc == INLINE) {
@@ -250,7 +250,7 @@ addscl(scl_t sc)
* struct/union/enum tag.
*/
void
-addtype(type_t *tp)
+add_type(type_t *tp)
{
tspec_t t;
#ifdef DEBUG
@@ -264,7 +264,7 @@ addtype(type_t *tp)
* something like "typedef int a; int a b;"
* This should not happen with current grammar.
*/
- LERROR("addtype()");
+ LERROR("add_type()");
}
dcs->d_type = tp;
return;
@@ -305,7 +305,7 @@ addtype(type_t *tp)
else if (dcs->d_cmod == DOUBLE) {
t = DCOMPLEX;
} else
- error(308, basictyname(dcs->d_cmod));
+ error(308, basic_type_name(dcs->d_cmod));
dcs->d_cmod = NOTSPEC;
}
@@ -387,7 +387,7 @@ tdeferr(type_t *td, tspec_t t)
if (!tflag)
/* modifying typedef with ... */
warning(5, ttab[t].tt_name);
- td = duptyp(gettyp(mrgtspec(t2, t)));
+ td = duptyp(gettyp(merge_type_specifiers(t2, t)));
td->t_typedef = 1;
return td;
}
@@ -543,7 +543,7 @@ addpacked(void)
}
void
-addused(void)
+add_attr_used(void)
{
dcs->d_used = 1;
}
@@ -557,7 +557,7 @@ addused(void)
* for all declarators.
*/
void
-addqual(tqual_t q)
+add_qualifier(tqual_t q)
{
if (q == CONST) {
@@ -570,7 +570,7 @@ addqual(tqual_t q)
if (q == THREAD)
return;
if (q != VOLATILE)
- LERROR("addqual()");
+ LERROR("add_qualifier()");
if (dcs->d_volatile) {
/* duplicate "%s" */
warning(10, "volatile");
@@ -684,8 +684,8 @@ popdecl(void)
* But it must be cleared in the outermost dinfo struct, which has
* context EXTERN. This could be done in clrtyp() and would work for
* C, but not for C++ (due to mixed statements and declarations). Thus
- * we clear it in glclup(), which is used to do some cleanup after
- * global declarations/definitions.
+ * we clear it in global_clean_up_decl(), which is used to do some cleanup
+ * after global declarations/definitions.
*/
void
setasm(void)
@@ -800,7 +800,7 @@ deftyp(void)
case LCOMPLEX:
break;
default:
- LERROR("deftyp(%s)", basictyname(t));
+ LERROR("deftyp(%s)", basic_type_name(t));
}
if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
dcs->d_terr = 1;
@@ -808,7 +808,7 @@ deftyp(void)
}
if (l != NOTSPEC)
t = l;
- dcs->d_type = gettyp(mrgtspec(t, s));
+ dcs->d_type = gettyp(merge_type_specifiers(t, s));
}
if (dcs->d_mscl) {
@@ -860,7 +860,7 @@ deftyp(void)
* Merge type specifiers (char, ..., long long, signed, unsigned).
*/
static tspec_t
-mrgtspec(tspec_t t, tspec_t s)
+merge_type_specifiers(tspec_t t, tspec_t s)
{
if (s == SIGNED || s == UNSIGN) {
@@ -1427,7 +1427,7 @@ new_style_function(sym_t *decl, sym_t *a
sc = sym->s_scl;
if (sc == STRTAG || sc == UNIONTAG || sc == ENUMTAG) {
/* dubious tag declaration: %s %s */
- warning(85, scltoa(sc), sym->s_name);
+ warning(85, storage_class_name(sc), sym->s_name);
}
}
@@ -1705,11 +1705,13 @@ newtag(sym_t *tag, scl_t scl, int decl,
if (!tflag) {
if (!sflag)
/* decl. introduces new type ... */
- warning(44, scltoa(scl), tag->s_name);
+ warning(44, storage_class_name(scl),
+ tag->s_name);
tag = pushdown(tag);
} else if (tag->s_scl != scl) {
/* base type is really "%s %s" */
- warning(45, scltoa(tag->s_scl), tag->s_name);
+ warning(45, storage_class_name(tag->s_scl),
+ tag->s_name);
}
dcs->d_nxt->d_nedecl = 1;
} else if (decl) {
@@ -1721,23 +1723,26 @@ newtag(sym_t *tag, scl_t scl, int decl,
dcs->d_nxt->d_nedecl = 1;
} else if (tag->s_scl != scl) {
/* base type is really "%s %s" */
- warning(45, scltoa(tag->s_scl), tag->s_name);
+ warning(45, storage_class_name(tag->s_scl),
+ tag->s_name);
/* declaration introduces new type in ANSI C: %s %s */
- if (!sflag)
- warning(44, scltoa(scl), tag->s_name);
+ if (!sflag) {
+ warning(44, storage_class_name(scl),
+ tag->s_name);
+ }
tag = pushdown(tag);
dcs->d_nxt->d_nedecl = 1;
}
} else {
if (tag->s_scl != scl) {
/* (%s) tag redeclared */
- error(46, scltoa(tag->s_scl));
+ error(46, storage_class_name(tag->s_scl));
print_previous_declaration(-1, tag);
tag = pushdown(tag);
dcs->d_nxt->d_nedecl = 1;
} else if (decl && !incompl(tag->s_type)) {
/* (%s) tag redeclared */
- error(46, scltoa(tag->s_scl));
+ error(46, storage_class_name(tag->s_scl));
print_previous_declaration(-1, tag);
tag = pushdown(tag);
dcs->d_nxt->d_nedecl = 1;
@@ -1749,7 +1754,7 @@ newtag(sym_t *tag, scl_t scl, int decl,
}
const char *
-scltoa(scl_t sc)
+storage_class_name(scl_t sc)
{
const char *s;
@@ -1771,7 +1776,7 @@ scltoa(scl_t sc)
* tp points to the type of the tag, fmem to the list of members/enums.
*/
type_t *
-compltag(type_t *tp, sym_t *fmem)
+complete_tag(type_t *tp, sym_t *fmem)
{
tspec_t t;
str_t *sp;
@@ -2803,7 +2808,7 @@ abstract_name(void)
* Removes anything which has nothing to do on global level.
*/
void
-globclup(void)
+global_clean_up(void)
{
while (dcs->d_nxt != NULL)
@@ -2817,7 +2822,7 @@ globclup(void)
* remove all information about pending lint directives without
* warnings.
*/
- glclup(1);
+ global_clean_up_decl(1);
}
/*
Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.37 src/usr.bin/xlint/lint1/externs1.h:1.38
--- src/usr.bin/xlint/lint1/externs1.h:1.37 Tue Dec 29 10:24:22 2020
+++ src/usr.bin/xlint/lint1/externs1.h Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.37 2020/12/29 10:24:22 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.38 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -141,11 +141,11 @@ extern type_t *duptyp(const type_t *);
extern type_t *tduptyp(const type_t *);
extern int incompl(type_t *);
extern void setcomplete(type_t *, int);
-extern void addscl(scl_t);
-extern void addtype(type_t *);
-extern void addqual(tqual_t);
+extern void add_storage_class(scl_t);
+extern void add_type(type_t *);
+extern void add_qualifier(tqual_t);
extern void addpacked(void);
-extern void addused(void);
+extern void add_attr_used(void);
extern void pushdecl(scl_t);
extern void popdecl(void);
extern void setasm(void);
@@ -165,8 +165,8 @@ extern void check_function_definition(sy
extern sym_t *declarator_name(sym_t *);
extern sym_t *old_style_function_name(sym_t *);
extern type_t *mktag(sym_t *, tspec_t, int, int);
-extern const char *scltoa(scl_t);
-extern type_t *compltag(type_t *, sym_t *);
+extern const char *storage_class_name(scl_t);
+extern type_t *complete_tag(type_t *, sym_t *);
extern sym_t *ename(sym_t *, int, int);
extern void decl1ext(sym_t *, int);
extern void copy_usage_info(sym_t *, sym_t *);
@@ -178,7 +178,7 @@ extern sym_t *decl1arg(sym_t *, int);
extern void cluparg(void);
extern void decl1loc(sym_t *, int);
extern sym_t *abstract_name(void);
-extern void globclup(void);
+extern void global_clean_up(void);
extern sym_t *declare_1_abstract(sym_t *);
extern void check_size(sym_t *);
extern void mark_as_set(sym_t *);
@@ -196,24 +196,24 @@ extern type_t *tincref(type_t *, tspec_t
extern tnode_t *getcnode(type_t *, val_t *);
extern tnode_t *getnnode(sym_t *, int);
extern tnode_t *getsnode(strg_t *);
-extern sym_t *strmemb(tnode_t *, op_t, sym_t *);
+extern sym_t *struct_or_union_member(tnode_t *, op_t, sym_t *);
extern tnode_t *build(op_t, tnode_t *, tnode_t *);
extern tnode_t *cconv(tnode_t *);
extern int typeok(op_t, int, tnode_t *, tnode_t *);
extern tnode_t *promote(op_t, int, tnode_t *);
extern tnode_t *convert(op_t, int, type_t *, tnode_t *);
extern void cvtcon(op_t, int, type_t *, val_t *, val_t *);
-extern tnode_t *bldszof(type_t *);
-extern tnode_t *bldoffsetof(type_t *, sym_t *);
-extern tnode_t *bldalof(type_t *);
+extern tnode_t *build_sizeof(type_t *);
+extern tnode_t *build_offsetof(type_t *, sym_t *);
+extern tnode_t *build_alignof(type_t *);
extern tnode_t *cast(tnode_t *, type_t *);
extern tnode_t *funcarg(tnode_t *, tnode_t *);
extern tnode_t *funccall(tnode_t *, tnode_t *);
extern val_t *constant(tnode_t *, int);
extern void expr(tnode_t *, int, int, int);
-extern void chkmisc(tnode_t *, int, int, int, int, int, int);
+extern void check_expr_misc(tnode_t *, int, int, int, int, int, int);
extern int conaddr(tnode_t *, sym_t **, ptrdiff_t *);
-extern strg_t *catstrg(strg_t *, strg_t *);
+extern strg_t *cat_strings(strg_t *, strg_t *);
extern int64_t tsize(type_t *);
/*
@@ -224,14 +224,14 @@ extern int reached;
extern int rchflg;
extern int ftflg;
extern int nargusg;
-extern pos_t aupos;
+extern pos_t argsused_pos;
extern int nvararg;
extern pos_t vapos;
extern int prflstrg;
-extern pos_t prflpos;
+extern pos_t printflike_pos;
extern int scflstrg;
-extern pos_t scflpos;
-extern int ccflg;
+extern pos_t scanflike_pos;
+extern int constcond_flag;
extern int llibflg;
extern int lwarn;
extern int bitfieldtype_ok;
@@ -240,7 +240,7 @@ extern int quadflg;
extern void pushctrl(int);
extern void popctrl(int);
-extern void chkreach(void);
+extern void check_statement_reachable(void);
extern void funcdef(sym_t *);
extern void funcend(void);
extern void label(int, sym_t *, tnode_t *);
@@ -259,7 +259,7 @@ extern void dogoto(sym_t *);
extern void docont(void);
extern void dobreak(void);
extern void doreturn(tnode_t *);
-extern void glclup(int);
+extern void global_clean_up_decl(int);
extern void argsused(int);
extern void constcond(int);
extern void fallthru(int);
@@ -281,10 +281,10 @@ extern sym_t *initsym;
extern int startinit;
extern void prepinit(void);
-extern void initrbr(void);
-extern void initlbr(void);
+extern void init_rbrace(void);
+extern void init_lbrace(void);
extern void mkinit(tnode_t *);
-extern void memberpush(sbuf_t *);
+extern void push_member(sbuf_t *);
/*
* emit.c
@@ -299,4 +299,4 @@ extern void outusg(sym_t *);
/*
* print.c
*/
-extern char *prtnode(char *, size_t, const tnode_t *);
+extern char *print_tnode(char *, size_t, const tnode_t *);
Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.30 src/usr.bin/xlint/lint1/func.c:1.31
--- src/usr.bin/xlint/lint1/func.c:1.30 Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/func.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.30 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: func.c,v 1.31 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.30 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.31 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <stdlib.h>
@@ -82,10 +82,10 @@ cstk_t *cstk;
* Number of arguments which will be checked for usage in following
* function definition. -1 stands for all arguments.
*
- * The position of the last ARGSUSED comment is stored in aupos.
+ * The position of the last ARGSUSED comment is stored in argsused_pos.
*/
int nargusg = -1;
-pos_t aupos;
+pos_t argsused_pos;
/*
* Number of arguments of the following function definition whose types
@@ -101,13 +101,13 @@ pos_t vapos;
* shall be used to check the types of remaining arguments (for PRINTFLIKE
* and SCANFLIKE).
*
- * prflpos and scflpos are the positions of the last PRINTFLIKE or
- * SCANFLIKE comment.
+ * printflike_pos and scanflike_pos are the positions of the last PRINTFLIKE
+ * or SCANFLIKE comment.
*/
int prflstrg = -1;
int scflstrg = -1;
-pos_t prflpos;
-pos_t scflpos;
+pos_t printflike_pos;
+pos_t scanflike_pos;
/*
* If both plibflg and llibflg are set, prototypes are written as function
@@ -119,7 +119,7 @@ int plibflg;
* Nonzero means that no warnings about constants in conditional
* context are printed.
*/
-int ccflg;
+int constcond_flag;
/*
* llibflg is set if a lint library shall be created. The effect of
@@ -192,7 +192,7 @@ popctrl(int env)
* Prints a warning if a statement cannot be reached.
*/
void
-chkreach(void)
+check_statement_reachable(void)
{
if (!reached && !rchflg) {
/* statement not reached */
@@ -909,7 +909,7 @@ dogoto(sym_t *lab)
mark_as_used(lab, 0, 0);
- chkreach();
+ check_statement_reachable();
reached = rchflg = 0;
}
@@ -935,7 +935,7 @@ dobreak(void)
}
if (bflag)
- chkreach();
+ check_statement_reachable();
reached = rchflg = 0;
}
@@ -958,7 +958,7 @@ docont(void)
ci->c_cont = 1;
}
- chkreach();
+ check_statement_reachable();
reached = rchflg = 0;
}
@@ -1025,7 +1025,7 @@ doreturn(tnode_t *tn)
} else {
- chkreach();
+ check_statement_reachable();
}
@@ -1037,7 +1037,7 @@ doreturn(tnode_t *tn)
* Especially remove information about unused lint comments.
*/
void
-glclup(int silent)
+global_clean_up_decl(int silent)
{
pos_t cpos;
@@ -1045,7 +1045,7 @@ glclup(int silent)
if (nargusg != -1) {
if (!silent) {
- STRUCT_ASSIGN(curr_pos, aupos);
+ STRUCT_ASSIGN(curr_pos, argsused_pos);
/* must precede function definition: %s */
warning(282, "ARGSUSED");
}
@@ -1061,7 +1061,7 @@ glclup(int silent)
}
if (prflstrg != -1) {
if (!silent) {
- STRUCT_ASSIGN(curr_pos, prflpos);
+ STRUCT_ASSIGN(curr_pos, printflike_pos);
/* must precede function definition: %s */
warning(282, "PRINTFLIKE");
}
@@ -1069,7 +1069,7 @@ glclup(int silent)
}
if (scflstrg != -1) {
if (!silent) {
- STRUCT_ASSIGN(curr_pos, scflpos);
+ STRUCT_ASSIGN(curr_pos, scanflike_pos);
/* must precede function definition: %s */
warning(282, "SCANFLIKE");
}
@@ -1104,7 +1104,7 @@ argsused(int n)
warning(281, "ARGSUSED");
}
nargusg = n;
- STRUCT_ASSIGN(aupos, curr_pos);
+ STRUCT_ASSIGN(argsused_pos, curr_pos);
}
/*
@@ -1156,7 +1156,7 @@ printflike(int n)
warning(281, "PRINTFLIKE");
}
prflstrg = n;
- STRUCT_ASSIGN(prflpos, curr_pos);
+ STRUCT_ASSIGN(printflike_pos, curr_pos);
}
/*
@@ -1182,7 +1182,7 @@ scanflike(int n)
warning(281, "SCANFLIKE");
}
scflstrg = n;
- STRUCT_ASSIGN(scflpos, curr_pos);
+ STRUCT_ASSIGN(scanflike_pos, curr_pos);
}
/*
@@ -1194,7 +1194,7 @@ void
constcond(int n)
{
- ccflg = 1;
+ constcond_flag = 1;
}
/*
Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.33 src/usr.bin/xlint/lint1/init.c:1.34
--- src/usr.bin/xlint/lint1/init.c:1.33 Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/init.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.33 2020/12/29 11:35:11 rillig Exp $ */
+/* $NetBSD: init.c,v 1.34 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.33 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.34 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <ctype.h>
@@ -75,7 +75,7 @@ static void pushinit(void);
static void testinit(void);
static void nextinit(int);
static int strginit(tnode_t *);
-static void memberpop(void);
+static void pop_member(void);
#ifndef DEBUG
#define DPRINTF(a)
@@ -84,7 +84,7 @@ static void memberpop(void);
#endif
void
-memberpush(sb)
+push_member(sb)
sbuf_t *sb;
{
namlist_t *nam = xcalloc(1, sizeof (namlist_t));
@@ -102,7 +102,7 @@ memberpush(sb)
}
static void
-memberpop(void)
+pop_member(void)
{
DPRINTF(("%s: %s %p\n", __func__, namedmem->n_name, namedmem));
if (namedmem->n_next == namedmem) {
@@ -191,13 +191,13 @@ popi2(void)
if (strcmp(m->s_name, namedmem->n_name) == 0) {
istk->i_subt = m->s_type;
istk->i_cnt++;
- memberpop();
+ pop_member();
return;
}
}
error(101, namedmem->n_name);
DPRINTF(("%s(): namedmem %s\n", __func__, namedmem->n_name));
- memberpop();
+ pop_member();
istk->i_namedmem = 1;
return;
}
@@ -361,7 +361,7 @@ again:
istk->i_namedmem = 1;
DPRINTF(("%s(): namedmem %s\n", __func__,
namedmem->n_name));
- memberpop();
+ pop_member();
cnt = istk->i_type->t_tspec == STRUCT ? 2 : 1;
}
istk->i_brace = 1;
@@ -470,7 +470,7 @@ nextinit(int brace)
}
void
-initlbr(void)
+init_lbrace(void)
{
DPRINTF(("%s\n", __func__));
@@ -494,7 +494,7 @@ initlbr(void)
}
void
-initrbr(void)
+init_rbrace(void)
{
DPRINTF(("%s\n", __func__));
@@ -517,8 +517,9 @@ mkinit(tnode_t *tn)
char buf[64], sbuf[64];
#endif
- DPRINTF(("%s(%s %s)\n", __func__, tyname(buf, sizeof(buf), tn->tn_type),
- prtnode(sbuf, sizeof(sbuf), tn)));
+ DPRINTF(("%s(%s %s)\n", __func__,
+ tyname(buf, sizeof(buf), tn->tn_type),
+ print_tnode(sbuf, sizeof(sbuf), tn)));
if (initerr || tn == NULL)
return;
Index: src/usr.bin/xlint/lint1/print.c
diff -u src/usr.bin/xlint/lint1/print.c:1.5 src/usr.bin/xlint/lint1/print.c:1.6
--- src/usr.bin/xlint/lint1/print.c:1.5 Mon Dec 28 12:52:45 2020
+++ src/usr.bin/xlint/lint1/print.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.5 2020/12/28 12:52:45 rillig Exp $ */
+/* $NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: print.c,v 1.5 2020/12/28 12:52:45 rillig Exp $");
+__RCSID("$NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <stdio.h>
@@ -108,7 +108,7 @@ static const char *str_op_t[] =
};
char *
-prtnode(char *buf, size_t bufsiz, const tnode_t *tn)
+print_tnode(char *buf, size_t bufsiz, const tnode_t *tn)
{
strg_t *st;
val_t *v;
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.97 src/usr.bin/xlint/lint1/scan.l:1.98
--- src/usr.bin/xlint/lint1/scan.l:1.97 Tue Dec 29 12:29:03 2020
+++ src/usr.bin/xlint/lint1/scan.l Tue Dec 29 13:33:03 2020
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.98 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.98 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <ctype.h>
@@ -203,7 +203,7 @@ static struct kwtab {
u_int kw_c99 : 1; /* c99 keyword */
u_int kw_gcc : 1; /* GCC keyword */
u_int kw_attr : 1; /* GCC attribute, keyword */
- u_int kw_deco : 3; /* name[1] __name[2] __name__[4] */
+ u_int kw_deco : 3; /* 1 = name, 2 = __name, 4 = __name__ */
} kwtab[] = {
#ifdef INT128_SIZE
{ "__int128_t", T_TYPE, 0, INT128, 0, 0,1,0,0,1 },
@@ -327,7 +327,7 @@ symt_t symtyp;
static void
-addkw(struct kwtab *kw, int deco)
+add_keyword(struct kwtab *kw, int deco)
{
sym_t *sym;
size_t h;
@@ -392,9 +392,9 @@ initscan(void)
continue;
if (kw->kw_gcc && !gflag)
continue;
- addkw(kw, 1);
- addkw(kw, 2);
- addkw(kw, 4);
+ add_keyword(kw, 1);
+ add_keyword(kw, 2);
+ add_keyword(kw, 4);
}
/* initialize bit-masks for quads */
@@ -1341,7 +1341,7 @@ clrwflgs(void)
lwarn = LWARN_ALL;
quadflg = 0;
- ccflg = 0;
+ constcond_flag = 0;
}
/*
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.97 src/usr.bin/xlint/lint1/tree.c:1.98
--- src/usr.bin/xlint/lint1/tree.c:1.97 Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/tree.c Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.97 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.98 2020/12/29 13:33:03 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.97 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.98 2020/12/29 13:33:03 rillig Exp $");
#endif
#include <float.h>
@@ -60,8 +60,8 @@ static void chkeop1(op_t, int, tnode_t *
static tnode_t *mktnode(op_t, type_t *, tnode_t *, tnode_t *);
static void balance(op_t, tnode_t **, tnode_t **);
static void incompat(op_t, tspec_t, tspec_t);
-static void illptrc(mod_t *, type_t *, type_t *);
-static void mrgqual(type_t **, type_t *, type_t *);
+static void warn_incompatible_pointers(mod_t *, type_t *, type_t *);
+static void merge_qualifiers(type_t **, type_t *, type_t *);
static int conmemb(type_t *);
static void ptconv(int, tspec_t, tspec_t, type_t *, tnode_t *);
static void iiconv(op_t, int, tspec_t, tspec_t, type_t *, tnode_t *);
@@ -70,7 +70,7 @@ static void ppconv(op_t, tnode_t *, type
static tnode_t *bldstr(op_t, tnode_t *, tnode_t *);
static tnode_t *bldincdec(op_t, tnode_t *);
static tnode_t *bldri(op_t, tnode_t *);
-static tnode_t *bldamper(tnode_t *, int);
+static tnode_t *build_ampersand(tnode_t *, int);
static tnode_t *bldplmi(op_t, tnode_t *, tnode_t *);
static tnode_t *bldshft(op_t, tnode_t *, tnode_t *);
static tnode_t *bldcol(tnode_t *, tnode_t *);
@@ -83,7 +83,7 @@ static tnode_t *chkfarg(type_t *, tnode_
static tnode_t *parg(int, type_t *, tnode_t *);
static void nulleff(tnode_t *);
static void displexpr(tnode_t *, int);
-static void chkaidx(tnode_t *, int);
+static void check_array_index(tnode_t *, int);
static void chkcomp(op_t, tnode_t *, tnode_t *);
static void precconf(tnode_t *);
@@ -303,7 +303,7 @@ getsnode(strg_t *strg)
* member of the struct or union specified by the tn argument.
*/
sym_t *
-strmemb(tnode_t *tn, op_t op, sym_t *msym)
+struct_or_union_member(tnode_t *tn, op_t op, sym_t *msym)
{
str_t *str;
type_t *tp;
@@ -552,7 +552,7 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
ntn = bldincdec(op, ln);
break;
case AMPER:
- ntn = bldamper(ln, 0);
+ ntn = build_ampersand(ln, 0);
break;
case STAR:
ntn = mktnode(STAR, ln->tn_type->t_subt, ln, NULL);
@@ -613,7 +613,7 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
if (mp->m_tctx) {
if (ln->tn_op == CON ||
((mp->m_binary && op != QUEST) && rn->tn_op == CON)) {
- if (hflag && !ccflg)
+ if (hflag && !constcond_flag)
/* constant in conditional context */
warning(161);
}
@@ -669,7 +669,7 @@ cconv(tnode_t *tn)
* of type T)
*/
if (tn->tn_type->t_tspec == FUNC)
- tn = bldamper(tn, 1);
+ tn = build_ampersand(tn, 1);
/* lvalue to rvalue */
if (tn->tn_lvalue) {
@@ -754,8 +754,9 @@ typeok(op_t op, int arg, tnode_t *ln, tn
switch (op) {
case POINT:
/*
- * Most errors required by ANSI C are reported in strmemb().
- * Here we only must check for totaly wrong things.
+ * Most errors required by ANSI C are reported in
+ * struct_or_union_member().
+ * Here we only must check for totally wrong things.
*/
if (lt == FUNC || lt == VOID || ltp->t_isfield ||
((lt != STRUCT && lt != UNION) && !ln->tn_lvalue)) {
@@ -800,7 +801,7 @@ typeok(op_t op, int arg, tnode_t *ln, tn
break;
case AMPER:
if (lt == ARRAY || lt == FUNC) {
- /* ok, a warning comes later (in bldamper()) */
+ /* ok, a warning comes later (in build_ampersand()) */
} else if (!ln->tn_lvalue) {
if (ln->tn_op == CVT && ln->tn_cast &&
ln->tn_left->tn_op == LOAD) {
@@ -1036,7 +1037,7 @@ typeok(op_t op, int arg, tnode_t *ln, tn
if (eqptrtype(lstp, rstp, 1))
break;
if (!eqtype(lstp, rstp, 1, 0, NULL))
- illptrc(mp, ltp, rtp);
+ warn_incompatible_pointers(mp, ltp, rtp);
break;
}
@@ -1166,7 +1167,7 @@ ptrcmpok(op_t op, tnode_t *ln, tnode_t *
}
if (!eqtype(ltp->t_subt, rtp->t_subt, 1, 0, NULL)) {
- illptrc(&modtab[op], ltp, rtp);
+ warn_incompatible_pointers(&modtab[op], ltp, rtp);
return;
}
@@ -1291,7 +1292,7 @@ asgntypok(op_t op, int arg, tnode_t *ln,
switch (op) {
case INIT:
case RETURN:
- illptrc(NULL, ltp, rtp);
+ warn_incompatible_pointers(NULL, ltp, rtp);
break;
case FARG:
/* argument has incompatible pointer type, arg #%d */
@@ -1299,7 +1300,7 @@ asgntypok(op_t op, int arg, tnode_t *ln,
tyname(rbuf, sizeof(rbuf), rtp));
break;
default:
- illptrc(mp, ltp, rtp);
+ warn_incompatible_pointers(mp, ltp, rtp);
break;
}
return 1;
@@ -1815,7 +1816,7 @@ iiconv(op_t op, int arg, tspec_t nt, tsp
warning(324,
tyname(rbuf, sizeof(rbuf), gettyp(ot)),
tyname(lbuf, sizeof(lbuf), tp),
- prtnode(opbuf, sizeof(opbuf), tn));
+ print_tnode(opbuf, sizeof(opbuf), tn));
break;
default:
break;
@@ -2222,10 +2223,10 @@ incompat(op_t op, tspec_t lt, tspec_t rt
return;
case 108:
case 107:
- error(e, mp->m_name, basictyname(lt), basictyname(rt));
+ error(e, mp->m_name, basic_type_name(lt), basic_type_name(rt));
return;
default:
- error(e, basictyname(lt), basictyname(rt));
+ error(e, basic_type_name(lt), basic_type_name(rt));
return;
}
}
@@ -2235,12 +2236,12 @@ incompat(op_t op, tspec_t lt, tspec_t rt
* Print an appropriate warning.
*/
static void
-illptrc(mod_t *mp, type_t *ltp, type_t *rtp)
+warn_incompatible_pointers(mod_t *mp, type_t *ltp, type_t *rtp)
{
tspec_t lt, rt;
if (ltp->t_tspec != PTR || rtp->t_tspec != PTR)
- LERROR("illptrc()");
+ LERROR("warn_incompatible_pointers()");
lt = ltp->t_subt->t_tspec;
rt = rtp->t_subt->t_tspec;
@@ -2269,12 +2270,12 @@ illptrc(mod_t *mp, type_t *ltp, type_t *
* of tp1->t_subt and tp2->t_subt.
*/
static void
-mrgqual(type_t **tpp, type_t *tp1, type_t *tp2)
+merge_qualifiers(type_t **tpp, type_t *tp1, type_t *tp2)
{
if ((*tpp)->t_tspec != PTR ||
tp1->t_tspec != PTR || tp2->t_tspec != PTR) {
- LERROR("mrgqual()");
+ LERROR("merge_qualifiers()");
}
if ((*tpp)->t_subt->t_const ==
@@ -2339,7 +2340,7 @@ bldstr(op_t op, tnode_t *ln, tnode_t *rn
nolval = op == POINT && !ln->tn_lvalue;
if (op == POINT) {
- ln = bldamper(ln, 1);
+ ln = build_ampersand(ln, 1);
} else if (ln->tn_type->t_tspec != PTR) {
if (!tflag || !tspec_is_int(ln->tn_type->t_tspec))
LERROR("bldstr()");
@@ -2425,7 +2426,7 @@ bldri(op_t op, tnode_t *ln)
* Create a tree node for the & operator
*/
static tnode_t *
-bldamper(tnode_t *tn, int noign)
+build_ampersand(tnode_t *tn, int noign)
{
tnode_t *ntn;
tspec_t t;
@@ -2572,12 +2573,12 @@ bldcol(tnode_t *ln, tnode_t *rn)
if (rt != PTR)
LERROR("bldcol()");
rtp = rn->tn_type;
- mrgqual(&rtp, ln->tn_type, rn->tn_type);
+ merge_qualifiers(&rtp, ln->tn_type, rn->tn_type);
} else if (rt == PTR && rn->tn_type->t_subt->t_tspec == VOID) {
if (lt != PTR)
LERROR("bldcol()");
rtp = ln->tn_type;
- mrgqual(&rtp, ln->tn_type, rn->tn_type);
+ merge_qualifiers(&rtp, ln->tn_type, rn->tn_type);
} else {
if (lt != PTR || rt != PTR)
LERROR("bldcol()");
@@ -2588,7 +2589,7 @@ bldcol(tnode_t *ln, tnode_t *rn)
* declaration.
*/
rtp = ln->tn_type;
- mrgqual(&rtp, ln->tn_type, rn->tn_type);
+ merge_qualifiers(&rtp, ln->tn_type, rn->tn_type);
}
ntn = mktnode(COLON, rtp, ln, rn);
@@ -2909,7 +2910,7 @@ foldtst(tnode_t *tn)
switch (tn->tn_op) {
case NOT:
- if (hflag && !ccflg)
+ if (hflag && !constcond_flag)
/* constant argument to NOT */
warning(239);
v->v_quad = !l;
@@ -3033,7 +3034,7 @@ foldflt(tnode_t *tn)
* Create a constant node for sizeof.
*/
tnode_t *
-bldszof(type_t *tp)
+build_sizeof(type_t *tp)
{
tspec_t st;
#if SIZEOF_IS_ULONG
@@ -3048,7 +3049,7 @@ bldszof(type_t *tp)
* Create a constant node for offsetof.
*/
tnode_t *
-bldoffsetof(type_t *tp, sym_t *sym)
+build_offsetof(type_t *tp, sym_t *sym)
{
tspec_t st;
#if SIZEOF_IS_ULONG
@@ -3117,7 +3118,7 @@ tsize(type_t *tp)
} else {
elsz = size(tp->t_tspec);
if (elsz <= 0)
- LERROR("bldszof()");
+ LERROR("build_sizeof()");
}
break;
}
@@ -3129,7 +3130,7 @@ tsize(type_t *tp)
/*
*/
tnode_t *
-bldalof(type_t *tp)
+build_alignof(type_t *tp)
{
tspec_t st;
@@ -3490,15 +3491,15 @@ expr(tnode_t *tn, int vctx, int tctx, in
/* expr() is also called in global initialisations */
if (dcs->d_ctx != EXTERN)
- chkreach();
+ check_statement_reachable();
- chkmisc(tn, vctx, tctx, !tctx, 0, 0, 0);
+ check_expr_misc(tn, vctx, tctx, !tctx, 0, 0, 0);
if (tn->tn_op == ASSIGN) {
if (hflag && tctx)
/* assignment in conditional context */
warning(159);
} else if (tn->tn_op == CON) {
- if (hflag && tctx && !ccflg)
+ if (hflag && tctx && !constcond_flag)
/* constant in conditional context */
warning(161);
}
@@ -3578,13 +3579,15 @@ displexpr(tnode_t *tn, int offs)
if (tn->tn_op == NAME) {
(void)printf("%s: %s ",
- tn->tn_sym->s_name, scltoa(tn->tn_sym->s_scl));
+ tn->tn_sym->s_name,
+ storage_class_name(tn->tn_sym->s_scl));
} else if (tn->tn_op == CON && tspec_is_float(tn->tn_type->t_tspec)) {
(void)printf("%#g ", (double)tn->tn_val->v_ldbl);
} else if (tn->tn_op == CON && tspec_is_int(tn->tn_type->t_tspec)) {
uq = tn->tn_val->v_quad;
- (void)printf("0x %08lx %08lx ", (long)(uq >> 32) & 0xffffffffl,
- (long)uq & 0xffffffffl);
+ (void)printf("0x %08lx %08lx ",
+ (long)(uq >> 32) & 0xffffffffl,
+ (long)uq & 0xffffffffl);
} else if (tn->tn_op == CON) {
if (tn->tn_type->t_tspec != PTR)
LERROR("displexpr()");
@@ -3622,7 +3625,7 @@ displexpr(tnode_t *tn, int offs)
*/
/* ARGSUSED */
void
-chkmisc(tnode_t *tn, int vctx, int tctx, int eqwarn, int fcall, int rvdisc,
+check_expr_misc(tnode_t *tn, int vctx, int tctx, int eqwarn, int fcall, int rvdisc,
int szof)
{
tnode_t *ln, *rn;
@@ -3648,12 +3651,12 @@ chkmisc(tnode_t *tn, int vctx, int tctx,
}
if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS)
/* check the range of array indices */
- chkaidx(ln->tn_left, 1);
+ check_array_index(ln->tn_left, 1);
break;
case LOAD:
if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS)
/* check the range of array indices */
- chkaidx(ln->tn_left, 0);
+ check_array_index(ln->tn_left, 0);
/* FALLTHROUGH */
case PUSH:
case INCBEF:
@@ -3700,11 +3703,11 @@ chkmisc(tnode_t *tn, int vctx, int tctx,
}
if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS)
/* check the range of array indices */
- chkaidx(ln->tn_left, 0);
+ check_array_index(ln->tn_left, 0);
break;
case CALL:
if (ln->tn_op != AMPER || ln->tn_left->tn_op != NAME)
- LERROR("chkmisc(op=%s != %s || %s != %s)",
+ LERROR("check_expr_misc(op=%s != %s || %s != %s)",
getopname(ln->tn_op), getopname(AMPER),
getopname(ln->tn_left->tn_op), getopname(NAME));
if (!szof)
@@ -3771,26 +3774,26 @@ chkmisc(tnode_t *tn, int vctx, int tctx,
if (op == COLON && tn->tn_type->t_tspec == VOID)
cvctx = ctctx = 0;
nrvdisc = op == CVT && tn->tn_type->t_tspec == VOID;
- chkmisc(ln, cvctx, ctctx, mp->m_eqwarn, op == CALL, nrvdisc, szof);
+ check_expr_misc(ln, cvctx, ctctx, mp->m_eqwarn, op == CALL, nrvdisc, szof);
switch (op) {
case PUSH:
if (rn != NULL)
- chkmisc(rn, 0, 0, mp->m_eqwarn, 0, 0, szof);
+ check_expr_misc(rn, 0, 0, mp->m_eqwarn, 0, 0, szof);
break;
case LOGAND:
case LOGOR:
- chkmisc(rn, 0, 1, mp->m_eqwarn, 0, 0, szof);
+ check_expr_misc(rn, 0, 1, mp->m_eqwarn, 0, 0, szof);
break;
case COLON:
- chkmisc(rn, cvctx, ctctx, mp->m_eqwarn, 0, 0, szof);
+ check_expr_misc(rn, cvctx, ctctx, mp->m_eqwarn, 0, 0, szof);
break;
case COMMA:
- chkmisc(rn, vctx, tctx, mp->m_eqwarn, 0, 0, szof);
+ check_expr_misc(rn, vctx, tctx, mp->m_eqwarn, 0, 0, szof);
break;
default:
if (mp->m_binary)
- chkmisc(rn, 1, 0, mp->m_eqwarn, 0, 0, szof);
+ check_expr_misc(rn, 1, 0, mp->m_eqwarn, 0, 0, szof);
break;
}
@@ -3803,7 +3806,7 @@ chkmisc(tnode_t *tn, int vctx, int tctx,
* after the array.
*/
static void
-chkaidx(tnode_t *tn, int amper)
+check_array_index(tnode_t *tn, int amper)
{
int dim;
tnode_t *ln, *rn;
@@ -4007,7 +4010,7 @@ conaddr(tnode_t *tn, sym_t **symp, ptrdi
* Concatenate two string constants.
*/
strg_t *
-catstrg(strg_t *strg1, strg_t *strg2)
+cat_strings(strg_t *strg1, strg_t *strg2)
{
size_t len1, len2, len;