Module Name: src
Committed By: christos
Date: Mon Mar 21 12:53:51 UTC 2011
Modified Files:
src/lib/libc/gdtoa: g__fmt.c strtod.c strtodg.c
Log Message:
more de-linting.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/lib/libc/gdtoa/g__fmt.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/gdtoa/strtod.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/gdtoa/strtodg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gdtoa/g__fmt.c
diff -u src/lib/libc/gdtoa/g__fmt.c:1.1.1.2 src/lib/libc/gdtoa/g__fmt.c:1.2
--- src/lib/libc/gdtoa/g__fmt.c:1.1.1.2 Sat Mar 19 12:26:37 2011
+++ src/lib/libc/gdtoa/g__fmt.c Mon Mar 21 08:53:50 2011
@@ -56,7 +56,7 @@
if (!(s0 = decimalpoint_cache)) {
s0 = localeconv()->decimal_point;
dlen = strlen(s0);
- if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) {
+ if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
strcpy(decimalpoint_cache, s0);
s0 = decimalpoint_cache;
}
Index: src/lib/libc/gdtoa/strtod.c
diff -u src/lib/libc/gdtoa/strtod.c:1.6 src/lib/libc/gdtoa/strtod.c:1.7
--- src/lib/libc/gdtoa/strtod.c:1.6 Sun Mar 20 19:15:35 2011
+++ src/lib/libc/gdtoa/strtod.c Mon Mar 21 08:53:50 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: strtod.c,v 1.6 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: strtod.c,v 1.7 2011/03/21 12:53:50 christos Exp $ */
/****************************************************************
@@ -122,7 +122,7 @@
static int dplen;
if (!(s0 = decimalpoint_cache)) {
s0 = localeconv()->decimal_point;
- if ((decimalpoint_cache = MALLOC(strlen(s0) + 1))) {
+ if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
strcpy(decimalpoint_cache, s0);
s0 = decimalpoint_cache;
}
Index: src/lib/libc/gdtoa/strtodg.c
diff -u src/lib/libc/gdtoa/strtodg.c:1.7 src/lib/libc/gdtoa/strtodg.c:1.8
--- src/lib/libc/gdtoa/strtodg.c:1.7 Sun Mar 20 19:15:35 2011
+++ src/lib/libc/gdtoa/strtodg.c Mon Mar 21 08:53:50 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: strtodg.c,v 1.7 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: strtodg.c,v 1.8 2011/03/21 12:53:50 christos Exp $ */
/****************************************************************
@@ -349,7 +349,7 @@
static int dplen;
if (!(s0 = decimalpoint_cache)) {
s0 = localeconv()->decimal_point;
- if ((decimalpoint_cache = MALLOC(strlen(s0) + 1))) {
+ if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
strcpy(decimalpoint_cache, s0);
s0 = decimalpoint_cache;
}
@@ -640,7 +640,7 @@
e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;
word0(&rv) &= ~Exp_mask;
word0(&rv) |= Bias << Exp_shift1;
- for(j = 0; e1 > 0; j++, e1 >>= 1)
+ for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
if (e1 & 1)
dval(&rv) *= bigtens[j];
}
@@ -651,7 +651,6 @@
dval(&rv) /= tens[i];
if (e1 &= ~15) {
e1 = (unsigned int)e1 >> 4;
- e1 >>= 4;
while(e1 >= (1 << (n_bigtens-1))) {
e2 += ((word0(&rv) & Exp_mask)
>> Exp_shift1) - Bias;
@@ -663,7 +662,7 @@
e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;
word0(&rv) &= ~Exp_mask;
word0(&rv) |= Bias << Exp_shift1;
- for(j = 0; e1 > 0; j++, e1 >>= 1)
+ for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
if (e1 & 1)
dval(&rv) *= tinytens[j];
}
@@ -1073,10 +1072,10 @@
irv = STRTOG_Normal | STRTOG_Inexlo;
*expt = fpi->emax;
b = bits;
- be = b + ((fpi->nbits + 31) >> 5);
+ be = b + ((unsigned int)(fpi->nbits + 31) >> 5);
while(b < be)
- *b++ = -1;
- if ((j = fpi->nbits & 0x1f))
+ *b++ = (unsigned int)-1;
+ if ((j = fpi->nbits & 0x1f) != 0)
*--be >>= (32 - j);
goto ret;
huge: