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: clean up comments, don't include u...
details: https://anonhg.NetBSD.org/src/rev/fef97e09ecaf
branches: trunk
changeset: 367683:fef97e09ecaf
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Jun 21 22:16:26 2022 +0000
description:
lint: clean up comments, don't include unused header
No functional change.
diffstat:
usr.bin/xlint/lint1/tree.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diffs (71 lines):
diff -r 0b6dc981aedf -r fef97e09ecaf usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Tue Jun 21 22:10:30 2022 +0000
+++ b/usr.bin/xlint/lint1/tree.c Tue Jun 21 22:16:26 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.456 2022/06/21 22:10:30 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.457 2022/06/21 22:16:26 rillig Exp $");
#endif
#include <float.h>
@@ -48,7 +48,6 @@
#include <string.h>
#include "lint1.h"
-#include "cgram.h"
typedef struct integer_constraints {
int64_t smin; /* signed minimum */
@@ -1079,7 +1078,7 @@
static bool
typeok_indir(const type_t *tp, tspec_t t)
{
- /* until now there were no type checks for this operator */
+
if (t != PTR) {
/* cannot dereference non-pointer type '%s' */
error(96, type_name(tp));
@@ -1093,7 +1092,7 @@
const type_t *ltp, tspec_t lt,
const type_t *rtp, tspec_t rt)
{
- /* operands have scalar types (checked above) */
+ /* operands have scalar types (checked in typeok) */
if ((lt == PTR && !is_integer(rt)) || (rt == PTR && !is_integer(lt))) {
warn_incompatible_types(op, ltp, lt, rtp, rt);
return false;
@@ -1106,7 +1105,7 @@
const type_t *ltp, tspec_t lt,
const type_t *rtp, tspec_t rt)
{
- /* operands have scalar types (checked above) */
+ /* operands have scalar types (checked in typeok) */
if (lt == PTR && (!is_integer(rt) && rt != PTR)) {
warn_incompatible_types(op, ltp, lt, rtp, rt);
return false;
@@ -1133,7 +1132,7 @@
olt = before_conversion(ln)->tn_type->t_tspec;
ort = before_conversion(rn)->tn_type->t_tspec;
- /* operands have integer types (checked above) */
+ /* operands have integer types (checked in typeok) */
if (pflag && !is_uinteger(olt)) {
/*
* The left operand is signed. This means that
@@ -1272,7 +1271,7 @@
tspec_t rst = rstp->t_tspec;
if ((lst == VOID && rst == FUNC) || (lst == FUNC && rst == VOID)) {
- /* (void *)0 handled above */
+ /* (void *)0 is handled in typeok_colon */
/* TODO: C99 behaves like C90 here. */
if (!allow_trad && !allow_c99)
/* ANSI C forbids conversion of %s to %s, op %s */
Home |
Main Index |
Thread Index |
Old Index