X-Authentication-Warning: kendall.sfbr.org: jeffw set sender to jeffw AT darwin DOT sfbr DOT org using -f Date: Tue, 26 Jun 2001 13:51:49 -0500 From: JT Williams To: djgpp-workers AT delorie DOT com Subject: Re: signed/unsigned in libm Message-ID: <20010626135149.A6641@kendall.sfbr.org> Mail-Followup-To: djgpp-workers AT delorie DOT com References: <20010620135643 DOT B3036 AT kendall DOT sfbr DOT org> <200106201947 DOT VAA23224 AT father DOT ludd DOT luth DOT se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106201947.VAA23224@father.ludd.luth.se>; from ams@ludd.luth.se on Wed, Jun 20, 2001 at 09:47:57PM +0200 Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk -: > -: I don't plan to do anything about these as I don't understand the code -: > -: in question. Martin, Here are the casts I came up with. Several of them were difficult to decide. Unfortunately I am not able to test these changes on my setup (I don't have the resources to compile libc/libm). I'm sorry I couldn't be of more help. jeff Index: e_pow.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/e_pow.c,v retrieving revision 1.1 diff -u -3 -r1.1 e_pow.c --- e_pow.c 1998/10/06 10:04:10 1.1 +++ e_pow.c 2001/06/26 18:40:11 @@ -135,10 +135,10 @@ k = (iy>>20)-0x3ff; /* exponent */ if(k>20) { j = ly>>(52-k); - if((j<<(52-k))==ly) yisint = 2-(j&1); + if((__uint32_t)(j<<(52-k))==ly) yisint = 2-(j&1); } else if(ly==0) { j = iy>>(20-k); - if((j<<(20-k))==iy) yisint = 2-(j&1); + if((__uint32_t)(j<<(20-k))==iy) yisint = 2-(j&1); } } } Index: e_sqrt.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/e_sqrt.c,v retrieving revision 1.1 diff -u -3 -r1.1 e_sqrt.c --- e_sqrt.c 1998/10/06 10:04:10 1.1 +++ e_sqrt.c 2001/06/26 18:40:11 @@ -160,7 +160,7 @@ t = s0; if((t0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x); + if((__uint32_t)ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(x); @@ -156,7 +156,7 @@ if ((s*c)0x80000000U) z = (invsqrtpi*ss)/__ieee754_sqrtf(x); + if((__uint32_t)ix>0x80000000U) z = (invsqrtpi*ss)/__ieee754_sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x); Index: ef_j1.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/ef_j1.c,v retrieving revision 1.1 diff -u -3 -r1.1 ef_j1.c --- ef_j1.c 1998/02/07 14:13:26 1.1 +++ ef_j1.c 2001/06/26 18:40:12 @@ -75,7 +75,7 @@ * j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x) * y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x) */ - if(ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(y); + if((__uint32_t)ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(y); else { u = ponef(y); v = qonef(y); z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(y); Index: ef_jn.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/ef_jn.c,v retrieving revision 1.1 diff -u -3 -r1.1 ef_jn.c --- ef_jn.c 1998/02/07 14:13:24 1.1 +++ ef_jn.c 2001/06/26 18:40:12 @@ -197,7 +197,7 @@ b = __ieee754_y1f(x); /* quit if b is -inf */ GET_FLOAT_WORD(ib,b); - for(i=1;i0x43160000) /* z <= -150 */ return s*tiny*tiny; /* underflow */ - else if (j==0xc3160000U){ /* z == -150 */ + else if ((__uint32_t)j==0xc3160000U){ /* z == -150 */ if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */ } /* Index: ef_rem_pio2.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/ef_rem_pio2.c,v retrieving revision 1.1 diff -u -3 -r1.1 ef_rem_pio2.c --- ef_rem_pio2.c 1998/10/06 10:04:12 1.1 +++ ef_rem_pio2.c 2001/06/26 18:40:12 @@ -143,7 +143,7 @@ fn = (float)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 40 bit */ - if(n<32&&(ix&0xffffff00U)!=npio2_hw[n-1]) { + if((__int32_t)(n<32&&(ix&0xffffff00U))!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { __uint32_t high; Index: s_ceil.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libm/math/s_ceil.c,v retrieving revision 1.1 diff -u -3 -r1.1 s_ceil.c --- s_ceil.c 1998/02/07 13:47:36 1.1 +++ s_ceil.c 2001/06/26 18:40:12 @@ -66,7 +66,7 @@ if(j_0==20) i0+=1; else { j = i1 + (1<<(52-j_0)); - if(j