changeset 1179:f121f2b1711a trunk

[svn] - use g_random_double_ranged()
author nenolod
date Fri, 08 Jun 2007 15:02:31 -0700
parents e9b2d21cf078
children cc6df5de72a6
files ChangeLog src/paranormal/libcalc/function.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 08 14:24:30 2007 -0700
+++ b/ChangeLog	Fri Jun 08 15:02:31 2007 -0700
@@ -1,3 +1,11 @@
+2007-06-08 21:24:30 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [2550]
+  - possible crash fixes wrt global regs
+  
+  trunk/src/paranormal/libcalc/dict.c |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2007-06-08 18:19:25 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [2548]
   - add general_evaluate which can run arbitrary VM code
--- a/src/paranormal/libcalc/function.c	Fri Jun 08 14:24:30 2007 -0700
+++ b/src/paranormal/libcalc/function.c	Fri Jun 08 15:02:31 2007 -0700
@@ -74,7 +74,7 @@
 }
 
 static double f_rand (ex_stack *stack) {
-  return rand() % (int) pop(stack);
+  return g_random_double_range((double) pop(stack), (double) pop(stack));
 }
 
 /* */