lint: rename basic_type_name to tspec_name
The term "basic type" is precisely defined in C99 6.2.5p14, and tspec_t is close to that, but nowhere identical.
This commit is contained in:
parent
15ccb490cc
commit
259b122f43
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: externs.h,v 1.8 2020/12/29 13:33:03 rillig Exp $ */
|
||||
/* $NetBSD: externs.h,v 1.9 2021/01/01 01:42:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
@ -46,7 +46,7 @@ extern void inittyp(void);
|
||||
*/
|
||||
extern const char *tyname(char *, size_t, const type_t *);
|
||||
extern int sametype(const type_t *, const type_t *);
|
||||
extern const char *basic_type_name(tspec_t);
|
||||
extern const char *tspec_name(tspec_t);
|
||||
|
||||
/*
|
||||
* mem.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tyname.c,v 1.17 2020/12/31 18:51:28 rillig Exp $ */
|
||||
/* $NetBSD: tyname.c,v 1.18 2021/01/01 01:42:55 rillig Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID) && !defined(lint)
|
||||
__RCSID("$NetBSD: tyname.c,v 1.17 2020/12/31 18:51:28 rillig Exp $");
|
||||
__RCSID("$NetBSD: tyname.c,v 1.18 2021/01/01 01:42:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
@ -54,7 +54,7 @@ __RCSID("$NetBSD: tyname.c,v 1.17 2020/12/31 18:51:28 rillig Exp $");
|
||||
#endif
|
||||
|
||||
const char *
|
||||
basic_type_name(tspec_t t)
|
||||
tspec_name(tspec_t t)
|
||||
{
|
||||
switch (t) {
|
||||
case BOOL: return "_Bool";
|
||||
@ -90,7 +90,7 @@ basic_type_name(tspec_t t)
|
||||
case SIGNED: return "signed";
|
||||
case UNSIGN: return "unsigned";
|
||||
default:
|
||||
LERROR("basic_type_name(%d)", t);
|
||||
LERROR("tspec_name(%d)", t);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -172,7 +172,7 @@ tyname(char *buf, size_t bufsiz, const type_t *tp)
|
||||
if ((t = tp->t_tspec) == INT && tp->t_isenum)
|
||||
t = ENUM;
|
||||
|
||||
s = basic_type_name(t);
|
||||
s = tspec_name(t);
|
||||
|
||||
cv[0] = '\0';
|
||||
if (tp->t_const)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: decl.c,v 1.90 2021/01/01 01:29:30 rillig Exp $ */
|
||||
/* $NetBSD: decl.c,v 1.91 2021/01/01 01:42: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.90 2021/01/01 01:29:30 rillig Exp $");
|
||||
__RCSID("$NetBSD: decl.c,v 1.91 2021/01/01 01:42:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -305,7 +305,7 @@ add_type(type_t *tp)
|
||||
else if (dcs->d_cmod == DOUBLE) {
|
||||
t = DCOMPLEX;
|
||||
} else
|
||||
error(308, basic_type_name(dcs->d_cmod));
|
||||
error(308, tspec_name(dcs->d_cmod));
|
||||
dcs->d_cmod = NOTSPEC;
|
||||
}
|
||||
|
||||
@ -800,7 +800,7 @@ deftyp(void)
|
||||
case LCOMPLEX:
|
||||
break;
|
||||
default:
|
||||
LERROR("deftyp(%s)", basic_type_name(t));
|
||||
LERROR("deftyp(%s)", tspec_name(t));
|
||||
}
|
||||
if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
|
||||
dcs->d_terr = 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tree.c,v 1.110 2021/01/01 01:38:14 rillig Exp $ */
|
||||
/* $NetBSD: tree.c,v 1.111 2021/01/01 01:42: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.110 2021/01/01 01:38:14 rillig Exp $");
|
||||
__RCSID("$NetBSD: tree.c,v 1.111 2021/01/01 01:42:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
@ -2200,17 +2200,17 @@ warn_incompatible_types(op_t op, tspec_t lt, tspec_t rt)
|
||||
if ((lt == STRUCT || lt == UNION) &&
|
||||
(rt == STRUCT || rt == UNION)) {
|
||||
/* assignment of different structures (%s != %s) */
|
||||
error(240, basic_type_name(lt), basic_type_name(rt));
|
||||
error(240, tspec_name(lt), tspec_name(rt));
|
||||
} else {
|
||||
/* assignment type mismatch (%s != %s) */
|
||||
error(171, basic_type_name(lt), basic_type_name(rt));
|
||||
error(171, tspec_name(lt), tspec_name(rt));
|
||||
}
|
||||
} else if (mp->m_binary) {
|
||||
/* operands of '%s' have incompatible types (%s != %s) */
|
||||
error(107, mp->m_name, basic_type_name(lt), basic_type_name(rt));
|
||||
error(107, mp->m_name, tspec_name(lt), tspec_name(rt));
|
||||
} else {
|
||||
/* operand of '%s' has incompatible type (%s != %s) */
|
||||
error(108, mp->m_name, basic_type_name(lt), basic_type_name(rt));
|
||||
error(108, mp->m_name, tspec_name(lt), tspec_name(rt));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user