Skip to content

Commit

Permalink
fix mt19937ar.c to compile with C89
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Oct 13, 2020
1 parent 362fb57 commit d29f211
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/support/mt19937ar.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ static unsigned long mt_save[N]; /* save state from before latest genrand */
/* initializes mt[N] with a seed */
void meep_mt_init_genrand(unsigned long s)
{
for (int i=0; i<N; ++i) mt_save[i] = mt[i];
int i;
for (i=0; i<N; ++i) mt_save[i] = mt[i];
mt[0]= s & 0xffffffffUL;
for (mti=1; mti<N; mti++) {
mt[mti] =
Expand All @@ -77,7 +78,8 @@ void meep_mt_init_genrand(unsigned long s)

/* restores state to what it was before most recent call to genrand */
void meep_mt_restore_genrand() {
for (int i=0; i<N; ++i) mt[i] = mt_save[i];
int i;
for (i=0; i<N; ++i) mt[i] = mt_save[i];
}

/* initialize by an array with array-length */
Expand Down

0 comments on commit d29f211

Please sign in to comment.