Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: rename funcarg and funccall to lon...



details:   https://anonhg.NetBSD.org/src/rev/65e97553bf97
branches:  trunk
changeset: 949175:65e97553bf97
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 03 20:38:26 2021 +0000

description:
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.

diffstat:

 usr.bin/xlint/lint1/cgram.y    |  12 ++++++------
 usr.bin/xlint/lint1/externs1.h |   6 +++---
 usr.bin/xlint/lint1/tree.c     |  13 +++++++------
 3 files changed, 16 insertions(+), 15 deletions(-)

diffs (108 lines):

diff -r 5e1f23b8d8ea -r 65e97553bf97 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Jan 03 20:31:08 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Jan 03 20:38:26 2021 +0000
@@ -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 @@
                $$ = 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 @@
 
 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);
          }
        ;
 
diff -r 5e1f23b8d8ea -r 65e97553bf97 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Jan 03 20:31:08 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Jan 03 20:38:26 2021 +0000
@@ -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_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);
diff -r 5e1f23b8d8ea -r 65e97553bf97 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 03 20:31:08 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 03 20:38:26 2021 +0000
@@ -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 @@
 
 /*
  * 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 @@
  * 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;



Home | Main Index | Thread Index | Old Index