projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed some memory leaks.
[pspp-builds.git]
/
src
/
algorithm.c
diff --git
a/src/algorithm.c
b/src/algorithm.c
index 230b1437f214ca6090979679bed2be9747051625..e6b9132b0649dfc17c845eb267ff0ea3a06a1973 100644
(file)
--- a/
src/algorithm.c
+++ b/
src/algorithm.c
@@
-91,11
+91,12
@@
#include <config.h>
#include "algorithm.h"
#include <config.h>
#include "algorithm.h"
+#include <gsl/gsl_rng.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
-#include "
random
.h"
+#include "
settings
.h"
/* Some of the assertions in this file are very expensive. We
don't use them by default. */
/* Some of the assertions in this file are very expensive. We
don't use them by default. */
@@
-310,7
+311,8
@@
is_partitioned (const void *array, size_t count, size_t size,
unsigned
algo_default_random (unsigned max, void *aux UNUSED)
{
unsigned
algo_default_random (unsigned max, void *aux UNUSED)
{
- return rng_get_unsigned (pspp_rng ()) % max;
+ unsigned long r_min = gsl_rng_min (get_rng ());
+ return (gsl_rng_get (get_rng ()) - r_min) % max;
}
/* Randomly reorders ARRAY, which contains COUNT elements of SIZE
}
/* Randomly reorders ARRAY, which contains COUNT elements of SIZE