Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib revert previous, my include files were out o...



details:   https://anonhg.NetBSD.org/src/rev/e32186dbe56a
branches:  trunk
changeset: 583039:e32186dbe56a
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 16 17:32:09 2005 +0000

description:
revert previous, my include files were out of day.

diffstat:

 lib/libc/stdlib/lsearch.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (64 lines):

diff -r 7db24b9de627 -r e32186dbe56a lib/libc/stdlib/lsearch.c
--- a/lib/libc/stdlib/lsearch.c Sat Jul 16 17:20:12 2005 +0000
+++ b/lib/libc/stdlib/lsearch.c Sat Jul 16 17:32:09 2005 +0000
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)lsearch.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: lsearch.c,v 1.3 2005/07/16 17:15:46 christos Exp $");
+__RCSID("$NetBSD: lsearch.c,v 1.4 2005/07/16 17:32:09 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -47,13 +47,13 @@
 #include <search.h>
 
 typedef int (*cmp_fn_t) __P((const void *, const void *));
-static void *linear_base __P((const void *, const void *, size_t *, size_t,
+static void *linear_base __P((const void *, void *, size_t *, size_t,
                             cmp_fn_t, int));
 
 void *
 lsearch(key, base, nelp, width, compar)
        const void *key;
-       const void *base;
+       void *base;
        size_t *nelp, width;
        cmp_fn_t compar;
 {
@@ -82,21 +82,21 @@
 static void *
 linear_base(key, base, nelp, width, compar, add_flag)
        const void *key;
-       const void *base;
+       void *base;
        size_t *nelp, width;
        cmp_fn_t compar;
        int add_flag;
 {
-       const char *element, *end;
+       char *element, *end;
 
        _DIAGASSERT(key != NULL);
        _DIAGASSERT(base != NULL);
        _DIAGASSERT(compar != NULL);
 
-       end = (const char *)base + *nelp * width;
-       for (element = (const char *)base; element < end; element += width)
+       end = (char *)base + *nelp * width;
+       for (element = (char *)base; element < end; element += width)
                if (!compar(element, key))              /* key found */
-                       return __UNCONST(element);
+                       return element;
 
        if (!add_flag)                                  /* key not found */
                return(NULL);
@@ -111,6 +111,6 @@
         * manual.
         */
        ++*nelp;
-       memcpy(__UNCONST(end), key, width);
-       return __UNCONST(end);
+       memcpy(end, key, width);
+       return end;
 }



Home | Main Index | Thread Index | Old Index