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 public designator functions



details:   https://anonhg.NetBSD.org/src/rev/95b55e89b765
branches:  trunk
changeset: 1020019:95b55e89b765
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 28 10:09:34 2021 +0000

description:
lint: rename public designator functions

Their previous names were too similar to the actual implementation
functions, which was confusing.

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y    |  10 +++++-----
 usr.bin/xlint/lint1/externs1.h |   6 +++---
 usr.bin/xlint/lint1/init.c     |  14 ++++++--------
 3 files changed, 14 insertions(+), 16 deletions(-)

diffs (116 lines):

diff -r ad9137551bff -r 95b55e89b765 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Mar 28 10:05:19 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Mar 28 10:09:34 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.204 2021/03/26 20:31:07 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.205 2021/03/28 10:09:34 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.204 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.205 2021/03/28 10:09:34 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1379,7 +1379,7 @@
 
 designator:                    /* C99 6.7.8 "Initialization" */
          T_LBRACK range T_RBRACK {
-               designation_add_subscript($2);
+               add_designator_subscript($2);
                if (!Sflag)
                        /* array initializer with des.s is a C9X feature */
                        warning(321);
@@ -1388,7 +1388,7 @@
                if (!Sflag)
                        /* struct or union member name in initializer is ... */
                        warning(313);
-               designation_add_name($2);
+               add_designator_member($2);
          }
        ;
 
@@ -1402,7 +1402,7 @@
        | identifier T_COLON {
                /* GCC style struct or union member name in initializer */
                gnuism(315);
-               designation_add_name($1);
+               add_designator_member($1);
          }
        ;
 
diff -r ad9137551bff -r 95b55e89b765 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Mar 28 10:05:19 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Mar 28 10:09:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.92 2021/03/27 22:04:39 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.93 2021/03/28 10:09:34 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -299,8 +299,8 @@
 extern void    init_rbrace(void);
 extern void    init_lbrace(void);
 extern void    init_using_expr(tnode_t *);
-extern void    designation_add_name(sbuf_t *);
-extern void    designation_add_subscript(range_t);
+extern void    add_designator_member(sbuf_t *);
+extern void    add_designator_subscript(range_t);
 
 /*
  * emit.c
diff -r ad9137551bff -r 95b55e89b765 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sun Mar 28 10:05:19 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sun Mar 28 10:09:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.156 2021/03/28 10:05:19 rillig Exp $        */
+/*     $NetBSD: init.c,v 1.157 2021/03/28 10:09:34 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.156 2021/03/28 10:05:19 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.157 2021/03/28 10:09:34 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -72,8 +72,8 @@
  *
  *     begin_initialization
  *             init_lbrace                     for each '{'
- *             designation_add_name            for each '.member' before '='
- *             designation_add_subscript       for each '[123]' before '='
+ *             add_designator_member           for each '.member' before '='
+ *             add_designator_subscript        for each '[123]' before '='
  *             init_using_expr                 for each expression
  *             init_rbrace                     for each '}'
  *     end_initialization
@@ -655,10 +655,8 @@
        debug_step("end initialization");
 }
 
-
-
 void
-designation_add_name(sbuf_t *sb)
+add_designator_member(sbuf_t *sb)
 {
        designation_add(&current_init()->designation,
            designator_new(sb->sb_name));
@@ -685,7 +683,7 @@
  * }
  */
 void
-designation_add_subscript(range_t range)
+add_designator_subscript(range_t range)
 {
        struct initialization *in = current_init();
        struct brace_level *level;



Home | Main Index | Thread Index | Old Index