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 getbound to alignment_in_bits



details:   https://anonhg.NetBSD.org/src/rev/cf07f4ffb7ef
branches:  trunk
changeset: 959873:cf07f4ffb7ef
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 28 00:23:55 2021 +0000

description:
lint: rename getbound to alignment_in_bits

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c     |  13 +++++--------
 usr.bin/xlint/lint1/externs1.h |   4 ++--
 usr.bin/xlint/lint1/tree.c     |   9 +++++----
 3 files changed, 12 insertions(+), 14 deletions(-)

diffs (101 lines):

diff -r 33590168cd0d -r cf07f4ffb7ef usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Feb 28 00:20:19 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Feb 28 00:23:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.138 2021/02/22 15:09:50 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.139 2021/02/28 00:23:55 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.138 2021/02/22 15:09:50 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.139 2021/02/28 00:23:55 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -925,11 +925,8 @@
        return elem * elsz;
 }
 
-/*
- * Get the alignment of the given Type in bits.
- */
 int
-getbound(const type_t *tp)
+alignment_in_bits(const type_t *tp)
 {
        size_t  a;
        tspec_t t;
@@ -1177,12 +1174,12 @@
                dcs->d_offset = 0;
        }
        if (dsym->s_bitfield) {
-               align(getbound(tp), tp->t_flen);
+               align(alignment_in_bits(tp), tp->t_flen);
                dsym->s_value.v_quad = (dcs->d_offset / size(t)) * size(t);
                tp->t_foffs = dcs->d_offset - (int)dsym->s_value.v_quad;
                dcs->d_offset += tp->t_flen;
        } else {
-               align(getbound(tp), 0);
+               align(alignment_in_bits(tp), 0);
                dsym->s_value.v_quad = dcs->d_offset;
                dcs->d_offset += sz;
        }
diff -r 33590168cd0d -r cf07f4ffb7ef usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Feb 28 00:20:19 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Feb 28 00:23:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.71 2021/02/21 15:02:16 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.72 2021/02/28 00:23:55 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -154,7 +154,7 @@
 extern void    clrtyp(void);
 extern void    deftyp(void);
 extern int     length(const type_t *, const char *);
-extern int     getbound(const type_t *);
+extern int     alignment_in_bits(const type_t *);
 extern sym_t   *lnklst(sym_t *, sym_t *);
 extern void    check_type(sym_t *);
 extern sym_t   *declarator_1_struct_union(sym_t *);
diff -r 33590168cd0d -r cf07f4ffb7ef usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Feb 28 00:20:19 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Feb 28 00:23:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.219 2021/02/27 15:26:30 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.220 2021/02/28 00:23:55 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.219 2021/02/27 15:26:30 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.220 2021/02/28 00:23:55 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2243,7 +2243,8 @@
                return;
        }
 
-       if (getbound(tp->t_subt) > getbound(tn->tn_type->t_subt)) {
+       if (alignment_in_bits(tp->t_subt) >
+           alignment_in_bits(tn->tn_type->t_subt)) {
                if (hflag)
                        /* possible pointer alignment problem */
                        warning(135);
@@ -3420,7 +3421,7 @@
        }
 
        return new_integer_constant_node(SIZEOF_TSPEC,
-           (int64_t)getbound(tp) / CHAR_SIZE);
+           (int64_t)alignment_in_bits(tp) / CHAR_SIZE);
 }
 
 /*



Home | Main Index | Thread Index | Old Index