Browse Source

Several cleanups/fixes from Marshall M. Midden <m4@brecis.com>

Eric Andersen 22 years ago
parent
commit
82ba14bc47

+ 2 - 0
include/regex.h

@@ -532,7 +532,9 @@ extern int re_exec _RE_ARGS ((const char *));
 /* For now unconditionally define __restrict_arr to expand to nothing.
    Ideally we would have a test for the compiler which allows defining
    it to restrict.  */
+#ifndef __restrict_arr
 #define __restrict_arr
+#endif
 
 /* POSIX compatibility.  */
 extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,

+ 1 - 0
libc/sysdeps/linux/common/statfix.c

@@ -28,6 +28,7 @@
 /* Convert from the kernel's version of struct stat to libc's version  */
 void statfix(struct libc_stat *libcstat, struct kernel_stat *kstat)
 {
+	memset(libcstat, 0, sizeof(struct libc_stat));
 	libcstat->st_dev = kstat->st_dev;
 	libcstat->st_ino = kstat->st_ino;
 	libcstat->st_mode = kstat->st_mode;

+ 1 - 0
libc/sysdeps/linux/common/statfix64.c

@@ -31,6 +31,7 @@
 /* Convert from the kernel's version of struct stat to libc's version  */
 void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat)
 {
+	memset(libcstat, 0, sizeof(struct libc_stat64));
 	libcstat->st_dev = kstat->st_dev;
 	libcstat->st_ino = kstat->st_ino;
 	libcstat->st_mode = kstat->st_mode;

+ 1 - 1
libc/sysdeps/linux/mips/bsd-setjmp.S

@@ -34,8 +34,8 @@
 .type setjmp,@function
 
 setjmp:
-	.set	noreorder
 #ifdef __PIC__
+	.set	noreorder
 	.cpload t9
 	.set	reorder
 	la	t9, __sigsetjmp

+ 7 - 2
libm/e_exp.c

@@ -110,8 +110,13 @@ P5   =  4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
 	double x;
 #endif
 {
-	double y,hi,lo,c,t;
-	int32_t k,xsb;
+	double y;
+	double hi = 0;
+	double lo = 0;
+	double c;
+	double t;
+	int32_t k=0;
+	int32_t xsb;
 	u_int32_t hx;
 
 	GET_HIGH_WORD(hx,x);

+ 2 - 2
libm/e_j0.c

@@ -332,7 +332,7 @@ static double pS2[5] = {
 #endif
 {
 #ifdef __STDC__
-	const double *p,*q;
+	const double *p = 0,*q = 0;
 #else
 	double *p,*q;
 #endif
@@ -468,7 +468,7 @@ static double qS2[6] = {
 #endif
 {
 #ifdef __STDC__
-	const double *p,*q;
+	const double *p=0,*q=0;
 #else
 	double *p,*q;
 #endif

+ 2 - 2
libm/e_j1.c

@@ -330,7 +330,7 @@ static double ps2[5] = {
 #endif
 {
 #ifdef __STDC__
-	const double *p,*q;
+	const double *p=0,*q=0;
 #else
 	double *p,*q;
 #endif
@@ -467,7 +467,7 @@ static double qs2[6] = {
 #endif
 {
 #ifdef __STDC__
-	const double *p,*q;
+	const double *p=0,*q=0;
 #else
 	double *p,*q;
 #endif

+ 2 - 2
libm/e_jn.c

@@ -66,7 +66,7 @@ static double zero  =  0.00000000000000000000e+00;
 #endif
 {
 	int32_t i,hx,ix,lx, sgn;
-	double a, b, temp, di;
+	double a, b, temp=0, di;
 	double z, w;
 
     /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
@@ -227,7 +227,7 @@ static double zero  =  0.00000000000000000000e+00;
 {
 	int32_t i,hx,ix,lx;
 	int32_t sign;
-	double a, b, temp;
+	double a, b, temp=0;
 
 	EXTRACT_WORDS(hx,lx,x);
 	ix = 0x7fffffff&hx;

+ 1 - 1
libm/e_lgamma_r.c

@@ -223,7 +223,7 @@ __inline__
 	double x; int *signgamp;
 #endif
 {
-	double t,y,z,nadj,p,p1,p2,p3,q,r,w;
+	double t,y,z,nadj=0,p,p1,p2,p3,q,r,w;
 	int i,hx,lx,ix;
 
 	EXTRACT_WORDS(hx,lx,x);

+ 1 - 1
libm/e_rem_pio2.c

@@ -90,7 +90,7 @@ pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
 	double x,y[];
 #endif
 {
-	double z,w,t,r,fn;
+	double z=0,w,t,r,fn;
 	double tx[3];
 	int32_t e0,i,j,nx,n,ix,hx;
 	u_int32_t low;

+ 1 - 1
libm/math_private.h

@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $Id: math_private.h,v 1.1 2001/11/22 14:01:05 andersen Exp $
+ * $Id: math_private.h,v 1.2 2002/06/26 09:10:51 andersen Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_

+ 1 - 1
libm/s_expm1.c

@@ -138,7 +138,7 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
 	double x;
 #endif
 {
-	double y,hi,lo,c,t,e,hxs,hfx,r1;
+	double y,hi,lo,c=0,t,e,hxs,hfx,r1;
 	int32_t k,xsb;
 	u_int32_t hx;
 

+ 2 - 2
libm/s_log1p.c

@@ -111,8 +111,8 @@ static double zero = 0.0;
 	double x;
 #endif
 {
-	double hfsq,f,c,s,z,R,u;
-	int32_t k,hx,hu,ax;
+	double hfsq,f=0,c=0,s,z,R,u;
+	int32_t k,hx,hu=0,ax;
 
 	GET_HIGH_WORD(hx,x);
 	ax = hx&0x7fffffff;