1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

WP cleanup

This commit is contained in:
Ulrich Drepper
2011-12-17 14:27:26 -05:00
parent df33a8fb1c
commit a2d18b64ed
2 changed files with 11 additions and 11 deletions

View File

@@ -142,17 +142,17 @@ static void
do_random_tests (void)
{
size_t i, j, n, align1, align2, len;
UCHAR *p1 = (UCHAR *) (buf1 + page_size) - 512;
UCHAR *p2 = (UCHAR *) (buf2 + page_size) - 512;
UCHAR *res;
for (n = 0; n < ITERATIONS; n++)
{
/* For wcsrchr: align1 and align2 here mean align not in bytes, but in wchar_ts,
in bytes it will equal to align * (sizeof (wchar_t)).
For strrchr we need to check all alignments from 0 to 63 since some assembly implementations
have separate prolog for alignments more 48. */
/* For wcsrchr: align1 and align2 here mean align not in bytes,
but in wchar_ts, in bytes it will equal to align * (sizeof
(wchar_t)). For strrchr we need to check all alignments from
0 to 63 since some assembly implementations have separate
prolog for alignments more 48. */
align1 = random () & (63 / sizeof(CHAR));
if (random () & 1)

View File

@@ -109,7 +109,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
if (!buf[align + i])
buf[align + i] = (random () * random ()) & max_char;
if (!buf[align + i])
buf[align + i] = 1;
buf[align + i] = 1;
if ((i > pos || pos >= len) && buf[align + i] == seek_char)
buf[align + i] = seek_char + 10 + (random () & 15);
}
@@ -160,7 +160,7 @@ do_random_tests (void)
if (pos >= len)
len = pos + (random () & 7);
if (len + align >= 512)
len = 511 - align - (random () & 7);
len = 511 - align - (random () & 7);
seek_char = random () & 255;
if (seek_char && pos == len)
{
@@ -171,7 +171,7 @@ do_random_tests (void)
}
j = len + align + 64;
if (j > 512)
j = 512;
j = 512;
for (i = 0; i < j; i++)
{
@@ -197,7 +197,7 @@ do_random_tests (void)
if (pos <= len)
result = (CHAR *) (p + pos + align);
else if (seek_char == 0)
result = (CHAR *) (p + len + align);
result = (CHAR *) (p + len + align);
else
result = NULL;