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 tsize to type_size_in_bits



details:   https://anonhg.NetBSD.org/src/rev/420c24ff63bf
branches:  trunk
changeset: 960432:420c24ff63bf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Mar 19 08:19:24 2021 +0000

description:
lint: rename tsize to type_size_in_bits

The shorter name size_in_bits was already taken by the function-like
macro with argument type tspec_t.

No functional change.

diffstat:

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

diffs (107 lines):

diff -r 33642c46525f -r 420c24ff63bf usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Fri Mar 19 08:01:58 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Fri Mar 19 08:19:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.147 2021/03/17 02:18:03 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.148 2021/03/19 08:19:24 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.147 2021/03/17 02:18:03 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.148 2021/03/19 08:19:24 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -524,7 +524,7 @@
                                if (mem == NULL)
                                        break;
                        }
-                       size_t x = (size_t)tsize(mem->s_type);
+                       size_t x = (size_t)type_size_in_bits(mem->s_type);
                        if (tp->t_tspec == STRUCT)
                                sp->sou_size_in_bit += x;
                        else if (x > sp->sou_size_in_bit)
@@ -1820,7 +1820,7 @@
                                if (mem == NULL)
                                        break;
                        }
-                       sp->sou_size_in_bit += tsize(mem->s_type);
+                       sp->sou_size_in_bit += type_size_in_bits(mem->s_type);
                }
                if (mem->s_name != unnamed)
                        n++;
diff -r 33642c46525f -r 420c24ff63bf usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Fri Mar 19 08:01:58 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Fri Mar 19 08:19:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.77 2021/03/19 00:55:02 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.78 2021/03/19 08:19:24 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -223,7 +223,7 @@
                    bool, bool, bool);
 extern bool    constant_addr(const tnode_t *, sym_t **, ptrdiff_t *);
 extern strg_t  *cat_strings(strg_t *, strg_t *);
-extern  int64_t tsize(type_t *);
+extern  int64_t type_size_in_bits(type_t *);
 #ifdef DEBUG
 extern void    debug_node(const tnode_t *, int);
 #else
diff -r 33642c46525f -r 420c24ff63bf usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Fri Mar 19 08:01:58 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Fri Mar 19 08:19:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.235 2021/03/18 22:05:33 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.236 2021/03/19 08:19:24 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.235 2021/03/18 22:05:33 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.236 2021/03/19 08:19:24 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1819,7 +1819,7 @@
                if (rn->tn_op != CON)
                        break;
                rnum = rn->tn_val->v_quad;
-               l = tsize(ln->tn_type) / CHAR_SIZE;
+               l = type_size_in_bits(ln->tn_type) / CHAR_SIZE;
                t = ln->tn_type->t_tspec;
                switch (l) {
                case 8:
@@ -3318,7 +3318,7 @@
 tnode_t *
 build_sizeof(type_t *tp)
 {
-       int64_t size_in_bytes = tsize(tp) / CHAR_SIZE;
+       int64_t size_in_bytes = type_size_in_bits(tp) / CHAR_SIZE;
        tnode_t *tn = new_integer_constant_node(SIZEOF_TSPEC, size_in_bytes);
        tn->tn_system_dependent = true;
        return tn;
@@ -3336,14 +3336,14 @@
                error(111, "offsetof");
 
        // XXX: wrong size, no checking for sym fixme
-       int64_t offset_in_bytes = tsize(tp) / CHAR_SIZE;
+       int64_t offset_in_bytes = type_size_in_bits(tp) / CHAR_SIZE;
        tnode_t *tn = new_integer_constant_node(SIZEOF_TSPEC, offset_in_bytes);
        tn->tn_system_dependent = true;
        return tn;
 }
 
 int64_t
-tsize(type_t *tp)
+type_size_in_bits(type_t *tp)
 {
        int     elem, elsz;
        bool    flex;



Home | Main Index | Thread Index | Old Index