2000-11-23  Ulrich Drepper  <drepper@redhat.com>

	* tst-digits.c (main): Add casts to avoid warnings.
	* collate-test.c (xstrcoll): Make l1 and l2 const.
	* xfrm-test.c (xstrcmp): Make l1 and l2 const.
This commit is contained in:
Ulrich Drepper 2000-11-23 19:41:48 +00:00
parent 33e09162d0
commit d64a397a54
4 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2000-11-23 Ulrich Drepper <drepper@redhat.com>
* tst-digits.c (main): Add casts to avoid warnings.
* collate-test.c (xstrcoll): Make l1 and l2 const.
* xfrm-test.c (xstrcmp): Make l1 and l2 const.
2000-11-20 Ulrich Drepper <drepper@redhat.com> 2000-11-20 Ulrich Drepper <drepper@redhat.com>
* charmaps/BALTIC: Superceded by ISO-8859-13. * charmaps/BALTIC: Superceded by ISO-8859-13.

View File

@ -116,8 +116,8 @@ xstrcoll (ptr1, ptr2)
const void *ptr1; const void *ptr1;
const void *ptr2; const void *ptr2;
{ {
struct lines *l1 = (struct lines *) ptr1; const struct lines *l1 = (const struct lines *) ptr1;
struct lines *l2 = (struct lines *) ptr2; const struct lines *l2 = (const struct lines *) ptr2;
return strcoll (l1->key, l2->key); return strcoll (l1->key, l2->key);
} }

View File

@ -67,6 +67,8 @@ static struct printf_int_test
{ 123456, "%I'10d", ONE TWO THREE "," FOUR FIVE SIX }, { 123456, "%I'10d", ONE TWO THREE "," FOUR FIVE SIX },
{ 1234567, "%I'10d", ONE "," TWO THREE FOUR "," FIVE SIX SEVEN } { 1234567, "%I'10d", ONE "," TWO THREE FOUR "," FIVE SIX SEVEN }
}; };
#define nprintf_int_tests \
(sizeof (printf_int_tests) / sizeof (printf_int_tests[0]))
#define WZERO L"\x2080" #define WZERO L"\x2080"
#define WONE L"\x2081" #define WONE L"\x2081"
@ -106,7 +108,8 @@ static struct wprintf_int_test
{ 123456, L"%I'10d", L" " WONE WTWO WTHREE L"," WFOUR WFIVE WSIX }, { 123456, L"%I'10d", L" " WONE WTWO WTHREE L"," WFOUR WFIVE WSIX },
{ 1234567, L"%I'10d", L" " WONE L"," WTWO WTHREE WFOUR L"," WFIVE WSIX WSEVEN } { 1234567, L"%I'10d", L" " WONE L"," WTWO WTHREE WFOUR L"," WFIVE WSIX WSEVEN }
}; };
#define nwprintf_int_tests \
(sizeof (wprintf_int_tests) / sizeof (wprintf_int_tests[0]))
int int
@ -125,8 +128,7 @@ main (void)
/* First: printf tests. */ /* First: printf tests. */
failures = 0; failures = 0;
for (cnt = 0; cnt < sizeof (printf_int_tests) / sizeof (printf_int_tests[0]); for (cnt = 0; cnt < (int) nprintf_int_tests; ++cnt)
++cnt)
{ {
char buf[100]; char buf[100];
ssize_t n; ssize_t n;
@ -137,7 +139,7 @@ main (void)
printf ("%3d: got \"%s\", expected \"%s\"", printf ("%3d: got \"%s\", expected \"%s\"",
cnt, buf, printf_int_tests[cnt].expected); cnt, buf, printf_int_tests[cnt].expected);
if (n != strlen (printf_int_tests[cnt].expected) if (n != (ssize_t) strlen (printf_int_tests[cnt].expected)
|| strcmp (buf, printf_int_tests[cnt].expected) != 0) || strcmp (buf, printf_int_tests[cnt].expected) != 0)
{ {
puts (" -> FAILED"); puts (" -> FAILED");
@ -152,9 +154,7 @@ main (void)
/* wprintf tests. */ /* wprintf tests. */
failures = 0; failures = 0;
for (cnt = 0; for (cnt = 0; cnt < (int) nwprintf_int_tests; ++cnt)
cnt < sizeof (wprintf_int_tests) / sizeof (wprintf_int_tests[0]);
++cnt)
{ {
wchar_t buf[100]; wchar_t buf[100];
ssize_t n; ssize_t n;
@ -166,7 +166,7 @@ main (void)
printf ("%3d: got \"%ls\", expected \"%ls\"", printf ("%3d: got \"%ls\", expected \"%ls\"",
cnt, buf, wprintf_int_tests[cnt].expected); cnt, buf, wprintf_int_tests[cnt].expected);
if (n != wcslen (wprintf_int_tests[cnt].expected) if (n != (ssize_t) wcslen (wprintf_int_tests[cnt].expected)
|| wcscmp (buf, wprintf_int_tests[cnt].expected) != 0) || wcscmp (buf, wprintf_int_tests[cnt].expected) != 0)
{ {
puts (" -> FAILED"); puts (" -> FAILED");

View File

@ -127,8 +127,8 @@ xstrcmp (ptr1, ptr2)
const void *ptr1; const void *ptr1;
const void *ptr2; const void *ptr2;
{ {
struct lines *l1 = (struct lines *) ptr1; const struct lines *l1 = (const struct lines *) ptr1;
struct lines *l2 = (struct lines *) ptr2; const struct lines *l2 = (const struct lines *) ptr2;
return strcmp (l1->xfrm, l2->xfrm); return strcmp (l1->xfrm, l2->xfrm);
} }