Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/locale de-lint.



details:   https://anonhg.NetBSD.org/src/rev/3efc70a7570d
branches:  trunk
changeset: 503460:3efc70a7570d
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Feb 06 18:48:41 2001 +0000

description:
de-lint.

diffstat:

 lib/libc/locale/iswctype.c  |   8 ++++----
 lib/libc/locale/multibyte.c |  15 ++++++++-------
 lib/libc/locale/rune.c      |  27 ++++++++++++---------------
 lib/libc/locale/runenone.c  |   9 +++++++--
 4 files changed, 31 insertions(+), 28 deletions(-)

diffs (243 lines):

diff -r 47b1ad98cf77 -r 3efc70a7570d lib/libc/locale/iswctype.c
--- a/lib/libc/locale/iswctype.c        Tue Feb 06 18:47:09 2001 +0000
+++ b/lib/libc/locale/iswctype.c        Tue Feb 06 18:48:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iswctype.c,v 1.6 2001/01/20 17:40:10 itojun Exp $      */
+/*     $NetBSD: iswctype.c,v 1.7 2001/02/06 18:48:41 christos Exp $    */
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: iswctype.c,v 1.6 2001/01/20 17:40:10 itojun Exp $");
+__RCSID("$NetBSD: iswctype.c,v 1.7 2001/02/06 18:48:41 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <wchar.h>
@@ -65,8 +65,8 @@
        wint_t c;
        unsigned long f;
 {
-       return ((c < 0 || c >= _CACHED_RUNES) ? ___runetype_mb(c) :
-               _CurrentRuneLocale->__runetype[c]) & f;
+       return (int)(((c < 0 || c >= _CACHED_RUNES) ? ___runetype_mb(c) :
+               _CurrentRuneLocale->__runetype[c]) & f);
 }
 
 static __inline wint_t
diff -r 47b1ad98cf77 -r 3efc70a7570d lib/libc/locale/multibyte.c
--- a/lib/libc/locale/multibyte.c       Tue Feb 06 18:47:09 2001 +0000
+++ b/lib/libc/locale/multibyte.c       Tue Feb 06 18:48:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multibyte.c,v 1.7 2001/01/03 15:23:26 lukem Exp $      */
+/*     $NetBSD: multibyte.c,v 1.8 2001/02/06 18:48:41 christos Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)ansi.c     8.1 (Berkeley) 6/27/93";
 #else
-__RCSID("$NetBSD: multibyte.c,v 1.7 2001/01/03 15:23:26 lukem Exp $");
+__RCSID("$NetBSD: multibyte.c,v 1.8 2001/02/06 18:48:41 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -67,7 +67,7 @@
                if (state && ___rune_initstate(rl))                     \
                        (*___rune_initstate(rl))(rl, state);            \
        }                                                               \
-    } while (0)
+    } while (/*CONSTCOND*/0)
 #define INIT(rl, state, state0, ps) \
     do {                                                               \
        if (___rune_sizestate(rl)) {                                    \
@@ -87,14 +87,14 @@
                        (*___rune_initstate(rl))((rl), (state));        \
                }                                                       \
        }                                                               \
-    } while (0)
+    } while (/*CONSTCOND*/0)
 #define        CLEANUP(rl, state, state0, ps) \
     do {                                                               \
        if ((state) && (ps) && ___rune_packstate(rl))                   \
                (*___rune_packstate(rl))((rl), (ps), (state));          \
        if ((state) && (state0) && (state) != (state0))                 \
                free(state);                                            \
-    } while (0)
+    } while (/*CONSTCOND*/0)
 
 static _RuneLocale *_mbstate_get_locale __P((const mbstate_t *));
 static void _mbstate_set_locale __P((mbstate_t *, const _RuneLocale *));
@@ -108,6 +108,7 @@
 
        _DIAGASSERT(ps != NULL);
 
+       /*LINTED disgusting const castaway can pointer cast */
        rl = *(_RuneLocale **)ps;
        if (!rl)
                rl = _CurrentRuneLocale;
@@ -123,7 +124,7 @@
        _DIAGASSERT(ps != NULL);
        /* XXX: can rl be NULL ? */
 
-       *(const _RuneLocale **)ps = rl;
+       *(const _RuneLocale **)(void *)ps = rl;
 }
 
 static int
@@ -137,7 +138,7 @@
 
        if (!rl)
                rl = _CurrentRuneLocale;
-       if (*(_RuneLocale **)ps != rl) {
+       if (*(_RuneLocale **)(void *)ps != rl) {
                memset(ps, 0, sizeof(*ps));
                _mbstate_set_locale(ps, rl);
                return 0;
diff -r 47b1ad98cf77 -r 3efc70a7570d lib/libc/locale/rune.c
--- a/lib/libc/locale/rune.c    Tue Feb 06 18:47:09 2001 +0000
+++ b/lib/libc/locale/rune.c    Tue Feb 06 18:48:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rune.c,v 1.9 2001/01/21 07:13:23 itojun Exp $  */
+/*     $NetBSD: rune.c,v 1.10 2001/02/06 18:48:41 christos Exp $       */
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)rune.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: rune.c,v 1.9 2001/01/21 07:13:23 itojun Exp $");
+__RCSID("$NetBSD: rune.c,v 1.10 2001/02/06 18:48:41 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -111,9 +111,9 @@
                if (fread(&fre, sizeof(fre), 1, fp) != 1)
                        return -1;
 
-               re->__min = ntohl(fre.__min);
-               re->__max = ntohl(fre.__max);
-               re->__map = ntohl(fre.__map);
+               re->__min = ntohl((u_int32_t)fre.__min);
+               re->__max = ntohl((u_int32_t)fre.__max);
+               re->__map = ntohl((u_int32_t)fre.__map);
                re++;
 
                if ((void *)re > lastp)
@@ -217,7 +217,7 @@
        if (memcmp(frl.__magic, _RUNE_MAGIC_1, sizeof(frl.__magic)))
                return NULL;
 
-       hostdatalen = sizeof(*rl) + ntohl(frl.__variable_len) +
+       hostdatalen = sizeof(*rl) + ntohl((u_int32_t)frl.__variable_len) +
            ntohl(frl.__runetype_ext.__nranges) * sizeof(_RuneEntry) +
            ntohl(frl.__maplower_ext.__nranges) * sizeof(_RuneEntry) +
            ntohl(frl.__mapupper_ext.__nranges) * sizeof(_RuneEntry);
@@ -227,21 +227,21 @@
        memset(hostdata, 0, hostdatalen);
        lastp = hostdata + hostdatalen;
 
-       rl = (_RuneLocale *)hostdata;
+       rl = (_RuneLocale *)(void *)hostdata;
        rl->__rune_variable = rl + 1;
 
        memcpy(rl->__magic, frl.__magic, sizeof(rl->__magic));
        memcpy(rl->__encoding, frl.__encoding, sizeof(rl->__encoding));
 
-       rl->__invalid_rune = ntohl(frl.__invalid_rune);
-       rl->__variable_len = ntohl(frl.__variable_len);
+       rl->__invalid_rune = ntohl((u_int32_t)frl.__invalid_rune);
+       rl->__variable_len = ntohl((u_int32_t)frl.__variable_len);
 
        for (x = 0; x < _CACHED_RUNES; ++x) {
                rl->__runetype[x] = ntohl(frl.__runetype[x]);
 
                /* XXX assumes rune_t = u_int32_t */
-               rl->__maplower[x] = ntohl(frl.__maplower[x]);
-               rl->__mapupper[x] = ntohl(frl.__mapupper[x]);
+               rl->__maplower[x] = ntohl((u_int32_t)frl.__maplower[x]);
+               rl->__mapupper[x] = ntohl((u_int32_t)frl.__mapupper[x]);
        }
 
        if (readrange(rl, &rl->__runetype_ext, &frl.__runetype_ext, lastp, fp))
@@ -317,7 +317,6 @@
        /* host data */
        char *hostdata;
        size_t hostdatalen;
-       void *lastp;
        _RuneLocale *rl;
        struct stat sb;
        int x;
@@ -368,9 +367,7 @@
        if ((hostdata = malloc(hostdatalen)) == NULL)
                goto bad;
        memset(hostdata, 0, hostdatalen);
-       lastp = hostdata + hostdatalen;
-
-       rl = (_RuneLocale *)hostdata;
+       rl = (_RuneLocale *)(void *)hostdata;
        rl->__rune_variable = NULL;
 
        memcpy(rl->__magic, _RUNE_MAGIC_1, sizeof(rl->__magic));
diff -r 47b1ad98cf77 -r 3efc70a7570d lib/libc/locale/runenone.c
--- a/lib/libc/locale/runenone.c        Tue Feb 06 18:47:09 2001 +0000
+++ b/lib/libc/locale/runenone.c        Tue Feb 06 18:48:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: runenone.c,v 1.7 2001/01/26 13:42:11 tsutsui Exp $     */
+/*     $NetBSD: runenone.c,v 1.8 2001/02/06 18:48:41 christos Exp $    */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)none.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: runenone.c,v 1.7 2001/01/26 13:42:11 tsutsui Exp $");
+__RCSID("$NetBSD: runenone.c,v 1.8 2001/02/06 18:48:41 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -92,6 +92,7 @@
 
 /* s is non-null */
 size_t
+/*ARGSUSED*/
 _none_mbrtowc(rl, pwcs, s, n, state)
        _RuneLocale *rl;
        rune_t *pwcs;
@@ -117,6 +118,7 @@
 
 /* s is non-null */
 size_t
+/*ARGSUSED*/
 _none_wcrtomb(rl, s, n, wc, state)
         _RuneLocale *rl;
         char *s;
@@ -143,6 +145,7 @@
 }
 
 void
+/*ARGSUSED*/
 _NONE_initstate(rl, s)
        _RuneLocale *rl;
        void *s;
@@ -157,6 +160,7 @@
 }
 
 void
+/*ARGSUSED*/
 _NONE_packstate(rl, dst, src)
        _RuneLocale *rl;
        mbstate_t *dst;
@@ -171,6 +175,7 @@
 }
 
 void
+/*ARGSUSED*/
 _NONE_unpackstate(rl, dst, src)
        _RuneLocale *rl;
        void* dst;



Home | Main Index | Thread Index | Old Index