[postgis-tickets] r14678 - Switch from using random to rand(). random() not supported on windows (at least mingw64)

Regina Obe lr at pcorp.us
Wed Feb 24 06:00:02 PST 2016


Author: robe
Date: 2016-02-24 06:00:02 -0800 (Wed, 24 Feb 2016)
New Revision: 14678

Modified:
   trunk/liblwgeom/cunit/cu_algorithm.c
Log:
Switch from using random to rand(). random() not supported on windows (at least mingw64)

Modified: trunk/liblwgeom/cunit/cu_algorithm.c
===================================================================
--- trunk/liblwgeom/cunit/cu_algorithm.c	2016-02-24 13:00:16 UTC (rev 14677)
+++ trunk/liblwgeom/cunit/cu_algorithm.c	2016-02-24 14:00:02 UTC (rev 14678)
@@ -1038,8 +1038,8 @@
 	for (j = 0; j < num_clusters; j++) {
 		for (i = 0; i < cluster_size; i++)
 		{
-			double u1 = 1.0 * random() / RAND_MAX;
-			double u2 = 1.0 * random() / RAND_MAX;
+			double u1 = 1.0 * rand() / RAND_MAX;
+			double u2 = 1.0 * rand() / RAND_MAX;
 			double z1 = spread * j + sqrt(-2*log2(u1))*cos(2*M_PI*u2);
 			double z2 = spread * j + sqrt(-2*log2(u1))*sin(2*M_PI*u2);
 



More information about the postgis-tickets mailing list