diff options
author | Jim Meyering <jim@meyering.net> | 2007-02-23 22:16:12 +0100 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-02-23 22:16:12 +0100 |
commit | 813de08e50ee89bccff10d97caa673331de7a244 (patch) | |
tree | 41b114d38b9c6d57413e3a9e4cfa7b2e11778e45 | |
parent | 5a8a00e16ebf5147fe8f5962b2a4f2130ef375d7 (diff) | |
download | coreutils-813de08e50ee89bccff10d97caa673331de7a244.tar.xz |
* randperm.c (randperm_new): Comment: say that this function
returns a pointer to malloc'd storage.
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/randperm.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 09b54b649..2f833f71a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2007-02-23 Jim Meyering <jim@meyering.net> + + * randperm.c (randperm_new): Comment: say that this function + returns a pointer to malloc'd storage. + 2007-02-18 Jim Meyering <jim@meyering.net> * xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h diff --git a/lib/randperm.c b/lib/randperm.c index faf34dde1..c4438ddfb 100644 --- a/lib/randperm.c +++ b/lib/randperm.c @@ -1,6 +1,6 @@ /* Generate random permutations. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,9 +58,9 @@ randperm_bound (size_t h, size_t n) return bound; } -/* From R, allocate and return the first H elements of a random - permutation of N elements. H must not exceed N. Return NULL if H - is zero. */ +/* From R, allocate and return a malloc'd array of the first H elements + of a random permutation of N elements. H must not exceed N. + Return NULL if H is zero. */ size_t * randperm_new (struct randint_source *r, size_t h, size_t n) |