Rename rand64() to _rand64()

This commit is contained in:
Justine Tunney 2022-10-10 04:12:06 -07:00
parent c424352a0a
commit 7ae556463a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
52 changed files with 141 additions and 139 deletions

View file

@ -42,7 +42,7 @@ TEST(MemMove, overlapping) {
for (i = 0; i < N; i += S) {
for (j = 0; j < N; j += S) {
for (n = MIN(N - i, N - j) + 1; n--;) {
b0 = rngset(malloc(N), N, rand64, -1);
b0 = rngset(malloc(N), N, _rand64, -1);
b1 = memcpy(malloc(N), b0, N);
b2 = memcpy(malloc(N), b0, N);
ASSERT_EQ(b1 + j, memmove(b1 + j, b1 + i, n));
@ -66,7 +66,7 @@ TEST(MemCpy, overlapping) {
for (j = 0; j < N; j += S) {
for (n = MIN(N - i, N - j) + 1; n--;) {
if (j <= i) {
b0 = rngset(malloc(N), N, rand64, -1);
b0 = rngset(malloc(N), N, _rand64, -1);
b1 = memcpy(malloc(N), b0, N);
b2 = memcpy(malloc(N), b0, N);
ASSERT_EQ(b1 + j, memcpy(b1 + j, b1 + i, n));
@ -90,7 +90,7 @@ TEST(MemMove, overlappingDirect) {
for (i = 0; i < N; i += S) {
for (j = 0; j < N; j += S) {
for (n = MIN(N - i, N - j) + 1; n--;) {
b0 = rngset(malloc(N), N, rand64, -1);
b0 = rngset(malloc(N), N, _rand64, -1);
b1 = memcpy(malloc(N), b0, N);
b2 = memcpy(malloc(N), b0, N);
ASSERT_EQ(b1 + j, (memmove)(b1 + j, b1 + i, n));

View file

@ -16,10 +16,10 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/mem/gc.internal.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/stdio/rand.h"
#include "libc/mem/gc.internal.h"
#include "libc/str/str.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
@ -56,7 +56,7 @@ BENCH(strtolower, bench) {
EZBENCH2(
"strtolower",
{
rngset(data, size, rand64, -1);
rngset(data, size, _rand64, -1);
data[size - 1] = 0;
},
strtolower(data));