View | Details | Raw Unified | Return to bug 248236
Collapse All | Expand All

(-)graphics/gegl/files/patch-operations_common_perlin_perlin.c (+28 lines)
Line 0 Link Here
1
--- operations/common/perlin/perlin.c.orig	2020-06-07 19:11:34 UTC
2
+++ operations/common/perlin/perlin.c
3
@@ -7,7 +7,7 @@
4
 #include "perlin.h"
5
 
6
 /* random is not portable to all platforms */
7
-#define random g_random_int
8
+#define random() g_rand_int (gr)
9
 
10
 static int p[B + B + 2];
11
 static double g3[B + B + 2][3];
12
@@ -151,7 +151,7 @@ perlin_init (void)
13
     return;
14
   /* this is racy - but we call it once when creating our perlin noise op */
15
 
16
-  g_random_set_seed (1234567890);
17
+  GRand *gr = g_rand_new_with_seed (1234567890);
18
 
19
   for (i = 0; i < B; i++)
20
     {
21
@@ -184,6 +184,7 @@ perlin_init (void)
22
         g3[B + i][j] = g3[i][j];
23
     }
24
   initialized = 1;
25
+  g_rand_free (gr);
26
 }
27
 
28
 /* --- My harmonic summing functions - PDB --------------------------*/

Return to bug 248236