Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcompat/4.3 De-constify the code, and add const castaw...
details: https://anonhg.NetBSD.org/src/rev/f284f8fe5b75
branches: trunk
changeset: 472677:f284f8fe5b75
user: christos <christos%NetBSD.org@localhost>
date: Tue May 04 17:10:10 1999 +0000
description:
De-constify the code, and add const castaway lint comments.
diffstat:
lib/libcompat/4.3/lsearch.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (40 lines):
diff -r c4027b26fb23 -r f284f8fe5b75 lib/libcompat/4.3/lsearch.c
--- a/lib/libcompat/4.3/lsearch.c Tue May 04 17:08:32 1999 +0000
+++ b/lib/libcompat/4.3/lsearch.c Tue May 04 17:10:10 1999 +0000
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: lsearch.c,v 1.4 1998/02/03 18:58:07 perry Exp $");
+__RCSID("$NetBSD: lsearch.c,v 1.5 1999/05/04 17:10:10 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -76,12 +76,14 @@
cmp_fn_t compar;
int add_flag;
{
- const char *element, *end;
+ char *element, *end;
- end = (const char *)base + *nelp * width;
- for (element = base; element < end; element += width)
+ /* LINTED const castaway */
+ end = (char *)base + *nelp * width;
+ /* LINTED const castaway */
+ for (element = (char *)base; element < end; element += width)
if (!compar(element, key)) /* key found */
- return((void *)element);
+ return element;
if (!add_flag) /* key not found */
return(NULL);
@@ -96,6 +98,6 @@
* manual.
*/
++*nelp;
- memcpy((void *)end, key, width);
- return((void *)end);
+ memcpy(end, key, width);
+ return end;
}
Home |
Main Index |
Thread Index |
Old Index