Module Name: src
Committed By: rillig
Date: Sun Jan 3 20:38:26 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: cgram.y externs1.h tree.c
Log Message:
lint: rename funcarg and funccall to longer names
>From the previous short names, it was no obvious that these functions
create a new tree node.
The function named funccall in lint2 has been left as-is, since it has a
completely different prototype.
To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.121 -r1.122 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/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.128 src/usr.bin/xlint/lint1/cgram.y:1.129
--- src/usr.bin/xlint/lint1/cgram.y:1.128 Sun Jan 3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/cgram.y Sun Jan 3 20:38:26 2021
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.128 2021/01/03 20:31:08 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.129 2021/01/03 20:38:26 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.128 2021/01/03 20:31:08 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.129 2021/01/03 20:38:26 rillig Exp $");
#endif
#include <limits.h>
@@ -1916,10 +1916,10 @@ term:
$$ = build(STAR, build(PLUS, $1, $3), NULL);
}
| term T_LPAREN T_RPAREN {
- $$ = funccall($1, NULL);
+ $$ = new_function_call_node($1, NULL);
}
| term T_LPAREN func_arg_list T_RPAREN {
- $$ = funccall($1, $3);
+ $$ = new_function_call_node($1, $3);
}
| term point_or_arrow T_NAME {
if ($1 != NULL) {
@@ -2010,10 +2010,10 @@ string2:
func_arg_list:
expr %prec T_COMMA {
- $$ = funcarg(NULL, $1);
+ $$ = new_function_argument_node(NULL, $1);
}
| func_arg_list T_COMMA expr {
- $$ = funcarg($1, $3);
+ $$ = new_function_argument_node($1, $3);
}
;
Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.47 src/usr.bin/xlint/lint1/externs1.h:1.48
--- src/usr.bin/xlint/lint1/externs1.h:1.47 Sun Jan 3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/externs1.h Sun Jan 3 20:38:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.47 2021/01/03 20:31:08 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.48 2021/01/03 20:38:26 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -212,8 +212,8 @@ 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 tnode_t *new_function_argument_node(tnode_t *, tnode_t *);
+extern tnode_t *new_function_call_node(tnode_t *, tnode_t *);
extern val_t *constant(tnode_t *, int);
extern void expr(tnode_t *, int, int, int);
extern void check_expr_misc(tnode_t *, int, int, int, int, int, int);
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.121 src/usr.bin/xlint/lint1/tree.c:1.122
--- src/usr.bin/xlint/lint1/tree.c:1.121 Sun Jan 3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 3 20:38:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.121 2021/01/03 20:31:08 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.122 2021/01/03 20:38:26 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.121 2021/01/03 20:31:08 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.122 2021/01/03 20:38:26 rillig Exp $");
#endif
#include <float.h>
@@ -3192,11 +3192,12 @@ cast(tnode_t *tn, type_t *tp)
/*
* Create the node for a function argument.
- * All necessary conversions and type checks are done in funccall(), because
- * in funcarg() we have no information about expected argument types.
+ * All necessary conversions and type checks are done in
+ * new_function_call_node because new_function_argument_node has no
+ * information about expected argument types.
*/
tnode_t *
-funcarg(tnode_t *args, tnode_t *arg)
+new_function_argument_node(tnode_t *args, tnode_t *arg)
{
tnode_t *ntn;
@@ -3218,7 +3219,7 @@ funcarg(tnode_t *args, tnode_t *arg)
* function arguments and insert conversions, if necessary.
*/
tnode_t *
-funccall(tnode_t *func, tnode_t *args)
+new_function_call_node(tnode_t *func, tnode_t *args)
{
tnode_t *ntn;
op_t fcop;