Module Name: src
Committed By: rillig
Date: Fri Feb 19 21:35:44 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: func.c lint1.h
Log Message:
lint: replace cryptic sym.s_rimpl with expressive name
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/xlint/lint1/lint1.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.68 src/usr.bin/xlint/lint1/func.c:1.69
--- src/usr.bin/xlint/lint1/func.c:1.68 Fri Feb 19 12:28:56 2021
+++ src/usr.bin/xlint/lint1/func.c Fri Feb 19 21:35:44 2021
@@ -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 @@ funcdef(sym_t *fsym)
}
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 @@ funcend(void)
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 @@ funcend(void)
* 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 @@ doreturn(tnode_t *tn)
* 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);
}
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.60 src/usr.bin/xlint/lint1/lint1.h:1.61
--- src/usr.bin/xlint/lint1/lint1.h:1.60 Sat Jan 23 22:20:17 2021
+++ src/usr.bin/xlint/lint1/lint1.h Fri Feb 19 21:35:44 2021
@@ -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 @@ typedef struct sym {
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