Fixes for #101264 and #99372:
[platform/upstream/glib.git] / glib / grand.c
index 1ec78d5..ef28b82 100644 (file)
@@ -22,7 +22,7 @@
  * code from this file in your own programs or libraries.
  * Further information on the Mersenne Twister can be found at
  * http://www.math.keio.ac.jp/~matumoto/emt.html
- * This code was adapted to glib by Sebastian Wilhelmi <wilhelmi@ira.uka.de>.
+ * This code was adapted to glib by Sebastian Wilhelmi.
  */
 
 /*
 
 #include <math.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "glib.h"
-
+#include "gthreadinit.h"
 
 G_LOCK_DEFINE_STATIC (global_random);
 static GRand* global_random = NULL;
@@ -92,7 +93,7 @@ get_random_version (void)
  * initialize some static data in a threadsafe way.
  */
 void 
-g_rand_init (void)
+_g_rand_thread_init (void)
 {
   (void)get_random_version ();
 }
@@ -339,6 +340,7 @@ g_rand_int_range (GRand* rand, gint32 begin, gint32 end)
        }
       break;
     default:
+      random = 0;              /* Quiet GCC */
       g_assert_not_reached ();
     }