diff options
author | Manish Singh <yosh@src.gnome.org> | 1998-06-28 06:24:49 +0000 |
---|---|---|
committer | Manish Singh <yosh@src.gnome.org> | 1998-06-28 06:24:49 +0000 |
commit | 4b7bbd4434cabf22cebd7437eef849e5ba94409f (patch) | |
tree | 4d07a0a6a82859d6cad1e12747c0c10dd3bcbaf5 /gtk | |
parent | 28c70890773facf7502dd0de4e7a9a2b70d9819f (diff) | |
download | gtk+-4b7bbd4434cabf22cebd7437eef849e5ba94409f.tar.gz |
use rand() instead of random() for portability
-Yosh
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/testgtk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/testgtk.c b/gtk/testgtk.c index 6545a11533..d614dc28b6 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <string.h> #include <math.h> +#include <time.h> #include "gtk.h" #include "../gdk/gdk.h" #include "../gdk/gdkx.h" @@ -3907,7 +3908,7 @@ void build_recursive (GtkCTree *ctree, gint cur_depth, gint depth, for (i = num_pages + num_books; i > num_books; i--) { pages++; - sprintf (buf1, "Page %02d", (gint) random() % 100); + sprintf (buf1, "Page %02d", (gint) rand() % 100); sprintf (buf2, "Item %d-%d", cur_depth, i); sibling = gtk_ctree_insert (ctree, parent, sibling, text, 5, pixmap3, mask3, NULL, NULL, TRUE, FALSE); @@ -3922,7 +3923,7 @@ void build_recursive (GtkCTree *ctree, gint cur_depth, gint depth, for (i = num_books; i > 0; i--) { books++; - sprintf (buf1, "Book %02d", (gint) random() % 100); + sprintf (buf1, "Book %02d", (gint) rand() % 100); sprintf (buf2, "Item %d-%d", cur_depth, i); sibling = gtk_ctree_insert (ctree, parent, sibling, text, 5, pixmap1, mask1, pixmap2, mask2, FALSE, FALSE); @@ -7026,6 +7027,8 @@ create_main_window (void) int main (int argc, char *argv[]) { + srand (time (NULL)); + gtk_set_locale (); gtk_init (&argc, &argv); |