unuse srandom() and random()

This commit is contained in:
rlar 2012-02-09 20:39:24 +00:00
parent 32751766d1
commit 2e4d4a0e02
5 changed files with 10 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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);

View File

@ -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;