diff -Naur Numeric-24.2/Packages/RNG/Include/ranf.h Numeric-23.8.2/Packages/RNG/Include/ranf.h --- Numeric-24.2/Packages/RNG/Include/ranf.h 2005-04-03 08:23:05.000000000 -0400 +++ Numeric-23.8.2/Packages/RNG/Include/ranf.h 2006-10-13 05:48:39.000000000 -0400 @@ -21,21 +21,41 @@ typedef double f64; /* Prototypes for routines defined in ranf.c */ -void Seedranf(u32 *s); /* Set seed from 32-bit integer */ -void Mixranf(int *s, u32 s48[2]); /* Set seed, with options; return seed */ -void Getranf(u32 s48[2]); /* Get 48-bit seed in integer array */ -void Setranf(u32 s48[2]); /* Set seed from 48-bit integer */ -void Getmult(u32 m48[2]); /* Get 48-bit multiplier in integer array */ -void Setmult(u32 m48[2]); /* Set multiplier from 48-bit integer */ -f64 Ranf(void); /* The generator itself */ +#ifdef __STDC__ + void Seedranf(u32 *s); /* Set seed from 32-bit integer */ + void Mixranf(int *s, u32 s48[2]); /* Set seed, with options; return seed */ + void Getranf(u32 s48[2]); /* Get 48-bit seed in integer array */ + void Setranf(u32 s48[2]); /* Set seed from 48-bit integer */ + void Getmult(u32 m48[2]); /* Get 48-bit multiplier in integer array */ + void Setmult(u32 m48[2]); /* Set multiplier from 48-bit integer */ + f64 Ranf(); /* The generator itself */ +#else + void Seedranf(); + void Mixranf(); + void Getranf(); + void Setranf(); + void Getmult(); + void Setmult(); + f64 Ranf(); +#endif /* Prototypes for routines defined in pmath_rng.c */ -void PM_16to24(u16 x16[3], double x24[2]); +#ifdef __STDC__ + void PM_16to24(u16 x16[3], double x24[2]); /* Convert 3 16-bit shorts to 2 24-bit doubles */ -void PM_24to16(double x24[2], u16 x16[3]); + void PM_24to16(double x24[2], u16 x16[3]); /* Convert 2 24-bit doubles to 3 16-bit shorts */ -void PM_GSeed(double seedout[2]); /* Get the current seed */ -void PM_SSeed(double seedin[2]); /* Reset the seed (unsafe) */ -void PM_GMult(double multout[2]); /* Get the current multiplier */ -void PM_SMult(double multin[2]); /* Reset the multiplier (unsafe) */ -f64 PM_RANF(void); /* The generator itself */ + void PM_GSeed(double seedout[2]); /* Get the current seed */ + void PM_SSeed(double seedin[2]); /* Reset the seed (unsafe) */ + void PM_GMult(double multout[2]); /* Get the current multiplier */ + void PM_SMult(double multin[2]); /* Reset the multiplier (unsafe) */ + f64 PM_RANF(); /* The generator itself */ +#else + void PM_16to24(); + void PM_24to16(); + void PM_GSeed(); + void PM_SSeed(); + void PM_GMult(); + void PM_SMult(); + f64 PM_RANF(); +#endif diff -Naur Numeric-24.2/Packages/RNG/Src/pmath_rng.c Numeric-23.8.2/Packages/RNG/Src/pmath_rng.c --- Numeric-24.2/Packages/RNG/Src/pmath_rng.c 2005-04-03 08:23:06.000000000 -0400 +++ Numeric-23.8.2/Packages/RNG/Src/pmath_rng.c 2006-10-13 05:48:39.000000000 -0400 @@ -443,7 +443,7 @@ C C**End */ -double PM_RANF (void) +double PM_RANF () { double t1_48, t2_48, t1_24[2], t2_24; double d; diff -Naur Numeric-24.2/Packages/RNG/Src/ranf.c Numeric-23.8.2/Packages/RNG/Src/ranf.c --- Numeric-24.2/Packages/RNG/Src/ranf.c 2005-04-03 08:23:06.000000000 -0400 +++ Numeric-23.8.2/Packages/RNG/Src/ranf.c 2006-10-13 05:48:39.000000000 -0400 @@ -150,7 +150,7 @@ struct timeval tv; struct timezone tz; #if !defined(__sgi) - int gettimeofday(struct timeval *, struct timezone *); + int gettimeofday(); #endif (void)gettimeofday(&tv,&tz); @@ -362,7 +362,7 @@ * PMATH generator has the Cray default starting values built in, * no initialization is needed. */ -f64 Ranf(void) +f64 Ranf() { return(PM_RANF()); } diff -Naur Numeric-24.2/Packages/RNG/Src/RNGmodule.c Numeric-23.8.2/Packages/RNG/Src/RNGmodule.c --- Numeric-24.2/Packages/RNG/Src/RNGmodule.c 2005-04-22 06:54:38.000000000 -0400 +++ Numeric-23.8.2/Packages/RNG/Src/RNGmodule.c 2006-10-13 05:49:36.000000000 -0400 @@ -4,7 +4,7 @@ * distributions in addition to the uniform [0., 1.) distribution. * * Written by Konrad Hinsen (based on the original URNG by Paul Dubois) - * last revision: 1997-11-6 + * last revision: 2006-8-18 * Modified 3/11/98 Source from P. Stoll to make it ANSI * , allow for C++, Windows. P. Dubois fix the &PyType_Type problems. @@ -92,7 +92,7 @@ dist_dealloc(distributionobject *self) { Py_XDECREF(self->parameters); - PyMem_DEL(self); + PyObject_FREE(self); } @@ -614,7 +614,7 @@ ; DL_EXPORT(void) -initRNG(void) +initRNG() { PyObject *m, *d; distributiontype.ob_type = &PyType_Type; @@ -632,7 +632,7 @@ /* Add some symbolic constants to the module */ d = PyModule_GetDict(m); - ErrorObject = PyErr_NewException("RNG.error", NULL, NULL); + ErrorObject = PyString_FromString("RNG.error"); PyDict_SetItemString(d, "error", ErrorObject); default_distribution = create_default_distribution(); PyDict_SetItemString(d, "default_distribution", default_distribution);