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: replace cryptic sym.s_rimpl with e...
details: https://anonhg.NetBSD.org/src/rev/7c11b5a72eaa
branches: trunk
changeset: 952851:7c11b5a72eaa
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Feb 19 21:35:44 2021 +0000
description:
lint: replace cryptic sym.s_rimpl with expressive name
No functional change.
diffstat:
usr.bin/xlint/lint1/func.c | 13 ++++++-------
usr.bin/xlint/lint1/lint1.h | 4 ++--
2 files changed, 8 insertions(+), 9 deletions(-)
diffs (73 lines):
diff -r f2578c350bda -r 7c11b5a72eaa usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c Fri Feb 19 18:36:50 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c Fri Feb 19 21:35:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.68 2021/02/19 12:28:56 rillig Exp $ */
+/* $NetBSD: func.c,v 1.69 2021/02/19 21:35:44 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.68 2021/02/19 12:28:56 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.69 2021/02/19 21:35:44 rillig Exp $");
#endif
#include <stdlib.h>
@@ -332,8 +332,7 @@
}
if (dcs->d_notyp)
- /* return value is implicitly declared to be int */
- fsym->s_rimpl = true;
+ fsym->s_return_type_implicit_int = true;
reached = true;
}
@@ -350,7 +349,7 @@
if (reached) {
cstmt->c_had_return_noval = true;
if (funcsym->s_type->t_subt->t_tspec != VOID &&
- !funcsym->s_rimpl) {
+ !funcsym->s_return_type_implicit_int) {
/* func. %s falls off bottom without returning value */
warning(217, funcsym->s_name);
}
@@ -362,7 +361,7 @@
* has already printed a warning.
*/
if (cstmt->c_had_return_noval && cstmt->c_had_return_value &&
- funcsym->s_rimpl)
+ funcsym->s_return_type_implicit_int)
/* function %s has return (e); and return; */
warning(216, funcsym->s_name);
@@ -992,7 +991,7 @@
* Assume that the function has a return value only if it
* is explicitly declared.
*/
- if (!funcsym->s_rimpl)
+ if (!funcsym->s_return_type_implicit_int)
/* function %s expects to return value */
warning(214, funcsym->s_name);
}
diff -r f2578c350bda -r 7c11b5a72eaa usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h Fri Feb 19 18:36:50 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h Fri Feb 19 21:35:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.60 2021/01/23 22:20:17 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.61 2021/02/19 21:35:44 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -234,7 +234,7 @@
bool s_reg : 1; /* symbol is register variable */
bool s_defarg : 1; /* undefined symbol in old style function
definition */
- bool s_rimpl : 1; /* return value of function implicit decl. */
+ bool s_return_type_implicit_int : 1;
bool s_osdef : 1; /* symbol stems from old style function def. */
bool s_inline : 1; /* true if this is an inline function */
struct sym *s_ext_sym; /* for local declared external symbols pointer
Home |
Main Index |
Thread Index |
Old Index