diff -urp gnome-games-2.17.5.orig/blackjack/src/game.cpp gnome-games-2.17.5.safari/blackjack/src/game.cpp --- gnome-games-2.17.5.orig/blackjack/src/game.cpp 2007-01-08 01:22:16.000000000 +0200 +++ gnome-games-2.17.5.safari/blackjack/src/game.cpp 2007-03-09 03:42:22.272328847 +0200 @@ -533,12 +533,12 @@ bj_game_new (gchar* file, guint *seedp ) bj_set_game_variation (file); } - if (seedp) + if (seedp) { seed = *seedp; - else + g_random_set_seed (seed); + } else { seed = g_random_int (); - - g_random_set_seed (seed); + } min_w = 600; min_h = 400; diff -urp gnome-games-2.17.5.orig/blackjack/src/player.cpp gnome-games-2.17.5.safari/blackjack/src/player.cpp --- gnome-games-2.17.5.orig/blackjack/src/player.cpp 2007-01-08 01:22:16.000000000 +0200 +++ gnome-games-2.17.5.safari/blackjack/src/player.cpp 2007-03-09 03:45:33.708213336 +0200 @@ -77,7 +77,6 @@ Shoe::Shoe (int lnumDecks) numCards++; } bj_show_shoe_cards (numCards); - g_random_set_seed (seed); shuffle (); } @@ -89,10 +88,9 @@ Shoe::~Shoe () void Shoe::shuffle () { - // perform multiple pass selection shuffle - for (int i=0; i < 5; i++) - for (int card = 52 * numDecks; card > 1; card--) - swap (card - 1, g_random_int_range (0, card)); + for (int card = 52 * numDecks; card > 1; card--) { + swap (card - 1, g_random_int_range (0, card)); + } numCards = 52 * numDecks; // Shoe is now full diff -urp gnome-games-2.17.5.orig/dependencies/ggz-gtk/first.c gnome-games-2.17.5.safari/dependencies/ggz-gtk/first.c --- gnome-games-2.17.5.orig/dependencies/ggz-gtk/first.c 2007-01-08 01:22:10.000000000 +0200 +++ gnome-games-2.17.5.safari/dependencies/ggz-gtk/first.c 2007-03-09 04:38:37.994529312 +0200 @@ -161,11 +161,9 @@ static void first_generate_password(char { int word, d1, d2; - /* rand/srand are more portable than random/srandom */ - srand(time(NULL)); - word = rand() % (sizeof(pw_words) / sizeof(pw_words[0])); - d1 = rand() % 10; - d2 = rand() % 10; + word = g_random_int() % (sizeof(pw_words) / sizeof(pw_words[0])); + d1 = g_random_int() % 10; + d2 = g_random_int() % 10; /* FIXME: shouldn't we translate the pw_words entry here? --JDS */ sprintf(pw, "%s%d%d", pw_words[word], d1, d2); } diff -urp gnome-games-2.17.5.orig/gnect/src/main.c gnome-games-2.17.5.safari/gnect/src/main.c --- gnome-games-2.17.5.orig/gnect/src/main.c 2007-01-08 01:22:36.000000000 +0200 +++ gnome-games-2.17.5.safari/gnect/src/main.c 2007-03-09 03:53:32.452917783 +0200 @@ -422,7 +422,6 @@ window_state_cb (GtkWidget * widget, Gdk static void game_init (void) { - g_random_set_seed ((guint) time (NULL)); vboard = veleng_init (); anim = ANIM_NONE; diff -urp gnome-games-2.17.5.orig/gnect/src/server.c gnome-games-2.17.5.safari/gnect/src/server.c --- gnome-games-2.17.5.orig/gnect/src/server.c 2007-01-08 01:22:36.000000000 +0200 +++ gnome-games-2.17.5.safari/gnect/src/server.c 2007-03-09 03:54:14.703126655 +0200 @@ -508,7 +508,7 @@ static int game_bot_move(int me) int botmove; do{ - botmove = (random() % connectx_game.boardwidth); + botmove = (g_random_int() % connectx_game.boardwidth); }while(game_check_move(me, botmove)!=0); ggzdmod_log(connectx_game.ggz, "boardwidth = %d", connectx_game.boardwidth); @@ -700,8 +700,6 @@ int main(void) ggzdmod_set_handler(ggz, GGZDMOD_EVENT_SPECTATOR_JOIN,&game_handle_ggz_spectator_join); ggzdmod_set_handler(ggz, GGZDMOD_EVENT_SPECTATOR_LEAVE, &game_handle_ggz_spectator_leave); - /* Seed the random number generator */ - srandom((unsigned)time(NULL)); game_init(ggz); /* Connect to GGZ server; main loop */ diff -urp gnome-games-2.17.5.orig/gnibbles/gnibbles.c gnome-games-2.17.5.safari/gnibbles/gnibbles.c --- gnome-games-2.17.5.orig/gnibbles/gnibbles.c 2007-01-08 01:22:30.000000000 +0200 +++ gnome-games-2.17.5.safari/gnibbles/gnibbles.c 2007-03-09 04:03:43.200928364 +0200 @@ -361,15 +361,15 @@ gnibbles_add_bonus (gint regular) if (regular) { good = 0; } else { - good = rand () % 50; + good = g_random_int () % 50; if (good) return; } do { good = 1; - x = rand () % (BOARDWIDTH - 1); - y = rand () % (BOARDHEIGHT - 1); + x = g_random_int () % (BOARDWIDTH - 1); + y = g_random_int () % (BOARDHEIGHT - 1); if (board[x][y] != EMPTYCHAR) good = 0; if (board[x + 1][y] != EMPTYCHAR) @@ -381,13 +381,13 @@ gnibbles_add_bonus (gint regular) } while (!good); if (regular) { - if ((rand () % 7 == 0) && properties->fakes) + if ((g_random_int () % 7 == 0) && properties->fakes) gnibbles_boni_add_bonus (boni, x, y, BONUSREGULAR, 1, 300); good = 0; while (!good) { good = 1; - x = rand () % (BOARDWIDTH - 1); - y = rand () % (BOARDHEIGHT - 1); + x = g_random_int () % (BOARDWIDTH - 1); + y = g_random_int () % (BOARDHEIGHT - 1); if (board[x][y] != EMPTYCHAR) good = 0; if (board[x + 1][y] != EMPTYCHAR) @@ -399,7 +399,7 @@ gnibbles_add_bonus (gint regular) } gnibbles_boni_add_bonus (boni, x, y, BONUSREGULAR, 0, 300); } else if (boni->missed <= MAXMISSED) { - good = rand () % 7; + good = g_random_int () % 7; if (good) good = 0; @@ -409,7 +409,7 @@ gnibbles_add_bonus (gint regular) if (good && !properties->fakes) return; - switch (rand () % 21) { + switch (g_random_int () % 21) { case 0: case 1: case 2: diff -urp gnome-games-2.17.5.orig/gnibbles/warpmanager.c gnome-games-2.17.5.safari/gnibbles/warpmanager.c --- gnome-games-2.17.5.orig/gnibbles/warpmanager.c 2007-01-08 01:22:30.000000000 +0200 +++ gnome-games-2.17.5.safari/gnibbles/warpmanager.c 2007-03-09 04:04:55.961746827 +0200 @@ -123,8 +123,8 @@ gnibbles_warpmanager_worm_change_pos (Gn x = 10 % BOARDWIDTH; y = 10 % BOARDHEIGHT; } else { - x = rand () % BOARDWIDTH; - y = rand () % BOARDHEIGHT; + x = g_random_int () % BOARDWIDTH; + y = g_random_int () % BOARDHEIGHT; } if (board[x][y] == EMPTYCHAR) good = 1; diff -urp gnome-games-2.17.5.orig/gnobots2/game.c gnome-games-2.17.5.safari/gnobots2/game.c --- gnome-games-2.17.5.orig/gnobots2/game.c 2007-01-08 01:22:35.000000000 +0200 +++ gnome-games-2.17.5.safari/gnobots2/game.c 2007-03-09 04:10:36.603853796 +0200 @@ -406,8 +406,8 @@ generate_level (void) for (i = 0; i < num_robots1; ++i) { while (1) { - xp = rand () % GAME_WIDTH; - yp = rand () % GAME_HEIGHT; + xp = g_random_int () % GAME_WIDTH; + yp = g_random_int () % GAME_HEIGHT; if (check_location (xp, yp) == OBJECT_NONE) { arena[xp][yp] = OBJECT_ROBOT1; @@ -419,8 +419,8 @@ generate_level (void) for (i = 0; i < num_robots2; ++i) { while (1) { - xp = rand () % GAME_WIDTH; - yp = rand () % GAME_HEIGHT; + xp = g_random_int () % GAME_WIDTH; + yp = g_random_int () % GAME_HEIGHT; if (check_location (xp, yp) == OBJECT_NONE) { arena[xp][yp] = OBJECT_ROBOT2; @@ -1190,8 +1190,8 @@ random_teleport (void) } - ixp = xp = rand () % GAME_WIDTH; - iyp = yp = rand () % GAME_HEIGHT; + ixp = xp = g_random_int () % GAME_WIDTH; + iyp = yp = g_random_int () % GAME_HEIGHT; while (1) { if (temp_arena[xp][yp] == OBJECT_NONE) { @@ -1272,8 +1272,8 @@ safe_teleport (void) } } - ixp = xp = rand () % GAME_WIDTH; - iyp = yp = rand () % GAME_HEIGHT; + ixp = xp = g_random_int () % GAME_WIDTH; + iyp = yp = g_random_int () % GAME_HEIGHT; while (1) { diff -urp gnome-games-2.17.5.orig/gnotravex/gnotravex.c gnome-games-2.17.5.safari/gnotravex/gnotravex.c --- gnome-games-2.17.5.orig/gnotravex/gnotravex.c 2007-01-08 01:22:17.000000000 +0200 +++ gnome-games-2.17.5.safari/gnotravex/gnotravex.c 2007-03-09 03:31:54.095958963 +0200 @@ -1426,7 +1426,6 @@ create_mover (void) void new_board (gint size) { - static gint myrand = 498; gint x, y, x1, y1, i, j; tile tmp; @@ -1444,10 +1443,6 @@ new_board (gint size) hint_moving = 0; } - g_random_set_seed (time (NULL) + myrand); - - myrand += 17; - for (y = 0; y < size; y++) for (x = 0; x < size; x++) tiles[y][x].status = UNUSED; diff -urp gnome-games-2.17.5.orig/iagno/server.c gnome-games-2.17.5.safari/iagno/server.c --- gnome-games-2.17.5.orig/iagno/server.c 2007-01-08 01:22:35.000000000 +0200 +++ gnome-games-2.17.5.safari/iagno/server.c 2007-03-09 04:30:13.389491045 +0200 @@ -57,8 +57,6 @@ game_init (GGZdMod * ggzdmod) rvr_game.board[CART (5, 5)] = WHITE; rvr_game.board[CART (5, 4)] = BLACK; rvr_game.board[CART (4, 5)] = BLACK; - // Inits random number generator - srand (time (0)); } // Handle server messages @@ -320,8 +318,7 @@ game_bot_move (int player) { int i; - // Returns a random move between 0 and 63 - i = (int) (64.0 * rand () / (RAND_MAX + 1.0)); + i = g_random_int_range (0, 63); if (game_check_move (player, i) >= 0) return i; else diff -urp gnome-games-2.17.5.orig/mahjongg/mahjongg.c gnome-games-2.17.5.safari/mahjongg/mahjongg.c --- gnome-games-2.17.5.orig/mahjongg/mahjongg.c 2007-01-08 01:22:33.000000000 +0200 +++ gnome-games-2.17.5.safari/mahjongg/mahjongg.c 2007-03-09 03:36:23.809525108 +0200 @@ -1182,10 +1182,14 @@ load_map (void) static void do_game (void) { + int i; + guint32 seeds[16]; + games_scores_set_category (highscores, maps[mapset].score_name); if (new_map) load_map (); - generate_game (g_random_int ()); /* puts in the positions of the tiles */ + for (i = 0; i < 16; i++) seeds[i] = g_random_int(); + generate_game (seeds); /* puts in the positions of the tiles */ } /* Record any changes to our window size. */ diff -urp gnome-games-2.17.5.orig/mahjongg/solubility.c gnome-games-2.17.5.safari/mahjongg/solubility.c --- gnome-games-2.17.5.orig/mahjongg/solubility.c 2007-01-08 01:22:33.000000000 +0200 +++ gnome-games-2.17.5.safari/mahjongg/solubility.c 2007-03-09 03:37:57.743542977 +0200 @@ -434,12 +434,12 @@ walk_tree (gint depth) } void -generate_game (guint32 seed) +generate_game (guint32 *seed) { guint i, j; typeinfo tile; - generator = g_rand_new_with_seed (seed); + generator = g_rand_new_with_seed_array (seed, 16); /* Scramble the tiles */ for (i = 0; i < MAX_TILES; i++) { diff -urp gnome-games-2.17.5.orig/mahjongg/solubility.h gnome-games-2.17.5.safari/mahjongg/solubility.h --- gnome-games-2.17.5.orig/mahjongg/solubility.h 2007-01-08 01:22:33.000000000 +0200 +++ gnome-games-2.17.5.safari/mahjongg/solubility.h 2007-03-09 03:37:07.368678511 +0200 @@ -13,7 +13,7 @@ #define SOLUBILITY_H extern int tile_free (int); -extern void generate_game (guint seed); +extern void generate_game (guint32 *seed); extern void generate_dependencies (void); int shuffle (void); diff -urp gnome-games-2.17.5.orig/same-gnome/game.c gnome-games-2.17.5.safari/same-gnome/game.c --- gnome-games-2.17.5.orig/same-gnome/game.c 2007-01-08 01:22:32.000000000 +0200 +++ gnome-games-2.17.5.safari/same-gnome/game.c 2007-03-09 03:51:00.997338490 +0200 @@ -612,8 +612,8 @@ new_game (void) /* Randomise the colours. */ l = board_ncells; - for (i = 0; i < l; i++) { - j = g_random_int_range (0, l); + for (i = l - 1; i > 1; i--) { + j = g_random_int_range (0, i); c = board[j].colour; board[j].colour = board[i].colour; board[i].colour = c; --- gnome-games-2.19.4/gnibbles/main.c.bak 2007-06-18 20:54:17.000000000 +0300 +++ gnome-games-2.19.4/gnibbles/main.c 2007-07-31 17:18:34.429384917 +0300 @@ -438,7 +438,7 @@ new_game (void) if (ggz_network_mode || !properties->random) { current_level = properties->startlevel; } else { - current_level = rand () % MAXLEVEL + 1; + current_level = g_random_int () % MAXLEVEL + 1; } zero_board (); @@ -746,9 +746,9 @@ main_loop (gpointer data) || ggz_network_mode)) current_level++; else if (properties->random && !ggz_network_mode) { - tmp = rand () % MAXLEVEL + 1; + tmp = g_random_int () % MAXLEVEL + 1; while (tmp == current_level) - tmp = rand () % MAXLEVEL + 1; + tmp = g_random_int () % MAXLEVEL + 1; current_level = tmp; } restart_id = g_timeout_add (1000, (GSourceFunc) restart_game, NULL); @@ -1072,7 +1072,6 @@ main (int argc, char **argv) GNOME_PARAM_POPT_TABLE, NULL, GNOME_PARAM_APP_DATADIR, REAL_DATADIR, NULL); gtk_window_set_default_icon_name ("gnome-gnibbles"); - srand (time (NULL)); highscores = games_scores_new (&scoredesc); --- gnome-games-2.19.4/gnobots2/gnobots.c.bak 2007-06-18 20:54:23.000000000 +0300 +++ gnome-games-2.19.4/gnobots2/gnobots.c 2007-07-31 17:20:21.308813010 +0300 @@ -185,7 +185,6 @@ main (int argc, char *argv[]) GnomeClient *client; GnomeProgram *program; GOptionContext *option_context; - struct timeval tv; gint i; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); @@ -194,9 +193,6 @@ main (int argc, char *argv[]) g_thread_init (NULL); - gettimeofday (&tv, NULL); - srand (tv.tv_usec); - setgid_io_init (); option_context = g_option_context_new (NULL); --- gnome-games-2.23.6/gnibbles/worm.c.orig 2008-08-04 21:48:25.000000000 +0300 +++ gnome-games-2.23.6/gnibbles/worm.c 2008-08-09 20:49:58.227311641 +0300 @@ -847,8 +847,8 @@ gnibbles_worm_ai_move (GnibblesWorm * wo worm->direction = dir; } else { // Else move in random direction at random time intervals - if (rand () % 30 == 1) { - dir = worm->direction + (rand() % 2 ? 1 : -1); + if (g_random_int () % 30 == 1) { + dir = worm->direction + (g_random_int() % 2 ? 1 : -1); if (dir != opposite) { if (dir > 4) dir = 1; --- gnome-games-2.23.6/gtali/yahtzee.c.bak 2008-08-04 21:48:14.000000000 +0300 +++ gnome-games-2.23.6/gtali/yahtzee.c 2008-08-09 20:51:10.004310018 +0300 @@ -155,8 +155,6 @@ YahtzeeInit (void) { int i; - srand (time (NULL)); - for (i = 0; i < MAX_NUMBER_OF_PLAYERS; ++i) { players[i].name = _(DefaultPlayerNames[i]); players[i].comp = 1; @@ -212,7 +210,7 @@ NewGame (void) int RollDie (void) { - return ((rand () % 6) + 1); + return (g_random_int_range (1, 7)); } void --- gnome-games-2.23.6/gnibbles/worm.c.bak 2008-08-09 20:55:32.330310724 +0300 +++ gnome-games-2.23.6/gnibbles/worm.c 2008-08-09 20:56:52.901309174 +0300 @@ -892,7 +892,7 @@ gnibbles_worm_ai_move (GnibblesWorm * wo particular, to stop the worms bunching in the bottom- right corner of the board. */ if (thislen <= 0) - thislen -= random() % 100; + thislen -= g_random_int() % 100; if (thislen < bestyet) { bestyet = thislen;