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.
This commit is contained in:
parent
91bffee2de
commit
527774e33b
@ -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 @@ setpackedsize(type_t *tp)
|
||||
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 @@ complete_tag_struct_or_union(type_t *tp, sym_t *fmem)
|
||||
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++;
|
||||
|
@ -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 @@ extern void check_expr_misc(const tnode_t *, bool, bool, bool,
|
||||
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
|
||||
|
@ -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 @@ new_tnode(op_t op, type_t *type, tnode_t *ln, tnode_t *rn)
|
||||
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 @@ fold_float(tnode_t *tn)
|
||||
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 @@ build_offsetof(type_t *tp, sym_t *sym)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user