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: fix names of functions dealing wit...



details:   https://anonhg.NetBSD.org/src/rev/634f8d26e4b3
branches:  trunk
changeset: 981907:634f8d26e4b3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Mar 25 21:51:55 2021 +0000

description:
lint: fix names of functions dealing with designations

These functions modify the whole designation, not only a single
designator.

No functional change.

diffstat:

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

diffs (158 lines):

diff -r f0507b560e9b -r 634f8d26e4b3 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Thu Mar 25 21:45:10 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Thu Mar 25 21:51:55 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.199 2021/03/23 20:57:40 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.200 2021/03/25 21:51:55 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.199 2021/03/23 20:57:40 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.200 2021/03/25 21:51:55 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1379,7 +1379,7 @@
 
 designator:                    /* C99 6.7.8 "Initialization" */
          T_LBRACK range T_RBRACK {
-               designator_push_subscript($2);
+               designation_add_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);
-               designator_push_name($2);
+               designation_add_name($2);
          }
        ;
 
@@ -1402,7 +1402,7 @@
        | identifier T_COLON {
                /* GCC style struct or union member name in initializer */
                gnuism(315);
-               designator_push_name($1);
+               designation_add_name($1);
          }
        ;
 
diff -r f0507b560e9b -r 634f8d26e4b3 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Thu Mar 25 21:45:10 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Thu Mar 25 21:51:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.84 2021/03/23 18:40:50 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.85 2021/03/25 21:51:55 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -301,8 +301,8 @@
 extern void    init_rbrace(void);
 extern void    init_lbrace(void);
 extern void    init_using_expr(tnode_t *);
-extern void    designator_push_name(sbuf_t *);
-extern void    designator_push_subscript(range_t);
+extern void    designation_add_name(sbuf_t *);
+extern void    designation_add_subscript(range_t);
 
 /*
  * emit.c
diff -r f0507b560e9b -r 634f8d26e4b3 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Thu Mar 25 21:45:10 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Thu Mar 25 21:51:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.130 2021/03/25 21:45:10 rillig Exp $        */
+/*     $NetBSD: init.c,v 1.131 2021/03/25 21:51:55 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.130 2021/03/25 21:45:10 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.131 2021/03/25 21:51:55 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -72,8 +72,8 @@
  *
  *     begin_initialization
  *             init_lbrace                     for each '{'
- *             designator_push_name            for each '.member' before '='
- *             designator_push_subscript       for each '[123]' before '='
+ *             designation_add_name            for each '.member' before '='
+ *             designation_add_subscript       for each '[123]' before '='
  *             init_using_expr                 for each expression
  *             init_rbrace                     for each '}'
  *     end_initialization
@@ -479,7 +479,7 @@
 }
 
 void
-designator_push_name(sbuf_t *sb)
+designation_add_name(sbuf_t *sb)
 {
        designation *dd = current_designation_mod();
 
@@ -515,7 +515,7 @@
  * }
  */
 void
-designator_push_subscript(range_t range)
+designation_add_subscript(range_t range)
 {
        debug_enter();
        debug_step("subscript range is %zu ... %zu", range.lo, range.hi);
@@ -525,7 +525,7 @@
 
 /* TODO: add support for array subscripts, not only named members */
 static void
-designator_shift_name(void)
+designation_shift_level(void)
 {
        /* TODO: remove direct access to 'init' */
        lint_assert(init != NULL);
@@ -609,7 +609,7 @@
                        /* XXX: why ++? */
                        istk->i_remaining++;
                        /* XXX: why is i_seen_named_member not set? */
-                       designator_shift_name();
+                       designation_shift_level();
                        return;
                }
        }
@@ -617,7 +617,7 @@
        /* undefined struct/union member: %s */
        error(101, current_designation().head->name);
 
-       designator_shift_name();
+       designation_shift_level();
        istk->i_seen_named_member = true;
 }
 
@@ -835,7 +835,7 @@
                istk->i_seen_named_member = true;
                debug_step("named member '%s'",
                    current_designation().head->name);
-               designator_shift_name();
+               designation_shift_level();
                cnt = istk->i_type->t_tspec == STRUCT ? 2 : 1;
        }
        istk->i_brace = true;
@@ -1202,7 +1202,7 @@
 
 done:
        while (current_designation().head != NULL)
-               designator_shift_name();
+               designation_shift_level();
 
        debug_leave();
 }



Home | Main Index | Thread Index | Old Index