Browse Source

unuse srandom() and random()

rlar 14 years ago
parent
commit
2e4d4a0e02
  1. 7
      ChangeLog
  2. 6
      src/main.c
  3. 6
      src/maths/cmaths/cmath2.c
  4. 2
      src/maths/misc/randnumb.c
  5. 3
      src/tclspice.c

7
ChangeLog

@ -1,3 +1,10 @@
2012-02-09 Robert Larice
* src/main.c ,
* src/tclspice.c ,
* src/maths/cmaths/cmath2.c ,
* src/maths/misc/randnumb.c :
unuse srandom() and random()
2012-02-08 Francesco Lannutti (Robert Larice)
* Makefile.am :
polish make maintainer-clean, make mrproper

6
src/main.c

@ -22,12 +22,6 @@
#include <setjmp.h>
#include <signal.h>
/* MINGW: random, srandom in libiberty.a, but not in libiberty.h */
#if defined(__MINGW32__) && defined(HAVE_RANDOM)
extern long int random (void);
extern void srandom (unsigned int seed);
#endif
/* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
/* from spice3f4 patch to ng-spice. jmr */
#ifdef HAVE_GNUREADLINE

6
src/maths/cmaths/cmath2.c

@ -23,12 +23,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "cmath2.h"
/* MINGW: random, srandom in libiberty.a, but not in libiberty.h
#if defined(__MINGW32__) && defined(HAVE_RANDOM)
extern long int random (void);
extern void srandom (unsigned int seed);
#endif
*/
extern void checkseed(void); /* seed random or set by 'set rndseed=value'*/
extern double drand(void); /* from randnumb.c */
extern double gauss0(void); /* from randnumb.c */

2
src/maths/misc/randnumb.c

@ -86,7 +86,7 @@ void checkseed(void)
/* printf("Enter checkseed()\n"); */
if (cp_getvar("rndseed", CP_NUM, &newseed)) {
if ((newseed > 0) && (oldseed != newseed)) {
srand(newseed); //srandom(newseed);
srand(newseed);
TausSeed();
oldseed = newseed;
printf("Seed value for random number generator is set to %d\n", newseed);

3
src/tclspice.c

@ -2273,7 +2273,8 @@ int Spice_Init(Tcl_Interp *interp) {
/* program name*/
cp_program = ft_sim->simulator;
srandom(getpid());
srand((unsigned int) getpid());
TausSeed();
/*parameter fetcher, used in show*/
if_getparam = spif_getparam;

Loading…
Cancel
Save