/* Sets the seed for the random number generator #GRand to @seed.  */
void g_rand_set_seed(GRand *rand, guint32 seed)
/* Sets the seed for the random number generator #GRand to @seed.  */
void g_rand_set_seed(GRand *rand, guint32 seed)
{
  g_return_if_fail (rand != NULL);
  switch (get_random_version ())
    {
    case 20:
      if (seed == 0)
	seed = 0x6b842128;
      rand->mt[0]= seed;
      for (rand->mti=1; rand->mti<N; rand->mti++)
	rand->mt[rand->mti] = (69069 * rand->mt[rand->mti-1]);
      break;
    case 22:
      rand->mt[0]= seed;
      for (rand->mti=1; rand->mti<N; rand->mti++)
	rand->mt[rand->mti] = 1812433253UL * 
	  (rand->mt[rand->mti-1] ^ (rand->mt[rand->mti-1] >> 30)) + rand->mti; 
      break;
    default:
      g_assert_not_reached ();
    }
}