Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gdtoa fix some lint on i386



details:   https://anonhg.NetBSD.org/src/rev/1c81984129aa
branches:  trunk
changeset: 763472:1c81984129aa
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 21 04:52:09 2011 +0000

description:
fix some lint on i386

diffstat:

 lib/libc/gdtoa/gdtoaimp.h |   4 ++--
 lib/libc/gdtoa/hexnan.c   |   6 +++---
 lib/libc/gdtoa/misc.c     |  14 +++++++-------
 3 files changed, 12 insertions(+), 12 deletions(-)

diffs (96 lines):

diff -r 39ca521bfb41 -r 1c81984129aa lib/libc/gdtoa/gdtoaimp.h
--- a/lib/libc/gdtoa/gdtoaimp.h Mon Mar 21 04:42:50 2011 +0000
+++ b/lib/libc/gdtoa/gdtoaimp.h Mon Mar 21 04:52:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdtoaimp.h,v 1.9 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: gdtoaimp.h,v 1.10 2011/03/21 04:52:09 christos Exp $ */
 
 /****************************************************************
 
@@ -581,7 +581,7 @@
  extern CONST double bigtens[], tens[], tinytens[];
  extern unsigned char hexdig[];
 
- extern Bigint *Balloc ANSI((size_t));
+ extern Bigint *Balloc ANSI((int));
  extern void Bfree ANSI((Bigint*));
  extern void ULtof ANSI((ULong*, ULong*, Long, int));
  extern void ULtod ANSI((ULong*, ULong*, Long, int));
diff -r 39ca521bfb41 -r 1c81984129aa lib/libc/gdtoa/hexnan.c
--- a/lib/libc/gdtoa/hexnan.c   Mon Mar 21 04:42:50 2011 +0000
+++ b/lib/libc/gdtoa/hexnan.c   Mon Mar 21 04:52:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hexnan.c,v 1.4 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: hexnan.c,v 1.5 2011/03/21 04:52:09 christos Exp $ */
 
 /****************************************************************
 
@@ -79,7 +79,7 @@
        if (s[1] == '0' && (s[2] == 'x' || s[2] == 'X')
         && *(CONST unsigned char*)(s+3) > ' ')
                s += 2;
-       while((c = *(CONST unsigned char*)++s)) {
+       while((c = *(CONST unsigned char*)++s) != '\0') {
                if (!(h = hexdig[c])) {
                        if (c <= ' ') {
                                if (hd0 < havedig) {
@@ -111,7 +111,7 @@
                                        *sp = s + 1;
                                        break;
                                        }
-                               } while((c = *++s));
+                               } while((c = *++s) != '\0');
 #endif
                        return STRTOG_NaN;
                        }
diff -r 39ca521bfb41 -r 1c81984129aa lib/libc/gdtoa/misc.c
--- a/lib/libc/gdtoa/misc.c     Mon Mar 21 04:42:50 2011 +0000
+++ b/lib/libc/gdtoa/misc.c     Mon Mar 21 04:52:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.6 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: misc.c,v 1.7 2011/03/21 04:52:09 christos Exp $ */
 
 /****************************************************************
 
@@ -45,9 +45,9 @@
  Bigint *
 Balloc
 #ifdef KR_headers
-       (k) size_t k;
+       (k) int k;
 #else
-       (size_t k)
+       (int k)
 #endif
 {
        int x;
@@ -59,17 +59,17 @@
        ACQUIRE_DTOA_LOCK(0);
        /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
        /* but this case seems very unlikely. */
-       if (k <= Kmax && (rv = freelist[k]) !=0) {
+       if ((size_t)k <= Kmax && (rv = freelist[k]) !=0) {
                freelist[k] = rv->next;
                }
        else {
-               x = 1 << (int)k;
+               x = 1 << k;
 #ifdef Omit_Private_Memory
                rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong));
 #else
                len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
                        /sizeof(double);
-               if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
+               if ((size_t)k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
                        rv = (Bigint*)(void *)pmem_next;
                        pmem_next += len;
                        }
@@ -78,7 +78,7 @@
 #endif
                if (rv == NULL)
                        return NULL;
-               rv->k = (int)k;
+               rv->k = k;
                rv->maxwds = x;
                }
        FREE_DTOA_LOCK(0);



Home | Main Index | Thread Index | Old Index