summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-04-06 20:20:47 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-04-06 20:20:47 +0000
commit232e078e289220085e912e3d740ae77767611478 (patch)
tree6dc7bc545fe55ce0be8fd1420256058ca7f26c57 /util.c
parent56febc5ef28a2ff414c466231d08046390ce0f59 (diff)
downloadperl-232e078e289220085e912e3d740ae77767611478.tar.gz
perl5.001 patch.1c
Configure Updated to dist PL53. Fix overlapping memcpy test. Add check for ld. Use $cc instead, if on an ELF system. With -d, don't reuse config.sh unless $myuname matches. Warn more explicitly about changing compilers before reloading old config.sh. Detect Linux ELF format in nm scan. Better detection of d_castneg. (ISC 4.1 was passing the test, but couldn't cast in an argument list.) Suggest -fpic for dynamic loading if you're using GNU CC under any name. No longer test for byacc, fmod, or drem, since they are not used. Makefile.SH Use $ld, not ld (only matters for SVR4) Silence some byacc-related harmless error messages. README Suggest using -Dcc=gcc (or whatever). Warn about reusing old config.sh. (The warning was already there in 5.001; I've just expanded it a little.) Warn against using GNU as and GNU ld on SunOS & Solaris. config.H config_h.SH Updated to match Configure. doio.c Add socket includes. ext/Fcntl/Fcntl.xs Fix typo: s/SETFL/F_SETFL/; handy.h Check _G_HAVE_BOOL, not just if it's defined. hints/dynix.sh hints/hpux_9.sh hints/linux.sh hints/netbsd.sh hints/titanos.sh Updated. ELF on linux should probably work. installperl Install pod2html, pod2latex, and pod2man. lib/ExtUtils/MakeMaker.pm Updated to 4.091. (4.09 + a small writedoc() patch.) myconfig Now includes 'ld' command. perl.c Revised an #elif clause since Pyramid's cpp doesn't understand #elif. perl.h Fix U_L, I_V, and I_32 cast macros to ensure that the cast_ulong(), cast_iv(), and cast_i32() functions (if used) are passed a double. In particular, the FIXSTATUS macros were handing int's to U_L(). Remove unnecessary HAS_FMOD testing (See util.c). proto.h Remove my_fmod() prototype. (See util.c) sv.h Fix GV/CV typo. util.c Simplified cast_i32() and cast_iv() to mimic what *actually* happens on a SPARC running SunOS 4.1.3. (Previously, they did some complicated fmod() calculation. I've since discovered that's not what happens on the SPARC.) With this change, fmod() is no longer necessary. Hence my_fmod is removed. This also means the HAS_FMOD and HAS_DREM tests are no longer needed in Configure, so they are gone too. vms/config.vms Remove unnecessary HAS_FMOD and HAS_DREM defines. x2p/Makefile.SH Silence byacc-related things.
Diffstat (limited to 'util.c')
-rw-r--r--util.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/util.c b/util.c
index f2bf077666..4a45c5ef99 100644
--- a/util.c
+++ b/util.c
@@ -1579,12 +1579,12 @@ I32
cast_i32(f)
double f;
{
-# define BIGDOUBLE 2147483648.0 /* Assume 32 bit int's ! */
+# define BIGDOUBLE 2147483647.0 /* Assume 32 bit int's ! */
# define BIGNEGDOUBLE (-2147483648.0)
if (f >= BIGDOUBLE)
- return (I32)fmod(f, BIGDOUBLE);
+ return (I32) BIGDOUBLE;
if (f <= BIGNEGDOUBLE)
- return (I32)fmod(f, BIGNEGDOUBLE);
+ return (I32) BIGNEGDOUBLE;
return (I32) f;
}
# undef BIGDOUBLE
@@ -1595,12 +1595,12 @@ cast_iv(f)
double f;
{
/* XXX This should be fixed. It assumes 32 bit IV's. */
-# define BIGDOUBLE 2147483648.0 /* Assume 32 bit IV's ! */
+# define BIGDOUBLE 2147483647.0 /* Assume 32 bit IV's ! */
# define BIGNEGDOUBLE (-2147483648.0)
if (f >= BIGDOUBLE)
- return (IV)fmod(f, BIGDOUBLE);
+ return (IV) BIGDOUBLE;
if (f <= BIGNEGDOUBLE)
- return (IV)fmod(f, BIGNEGDOUBLE);
+ return (IV) BIGNEGDOUBLE;
return (IV) f;
}
# undef BIGDOUBLE
@@ -1687,28 +1687,3 @@ I32 *retlen;
*retlen = s - start;
return retval;
}
-
-/* Amazingly enough, some systems (e.g. Dynix 3) don't have fmod.
- This is a slow, stupid, but working emulation. (AD)
-*/
-#ifdef USE_MY_FMOD
-double
-my_fmod(x, y)
-double x, y;
-{
- double i = 0.0; /* Can't use int because it can overflow */
- if ((x == 0) || (y == 0))
- return 0;
- /* The sign of fmod is the same as the sign of x. */
- if ( (x < 0 && y > 0) || (x > 0 && y < 0) )
- y = -y;
- if (x > 0) {
- while (x - i*y > y)
- i++;
- } else {
- while (x - i*y < y)
- i++;
- }
- return x - i * y;
-}
-#endif