* string/tester.c: Mark test functions as static to avoid warnings.
This commit is contained in:
Ulrich Drepper 2000-11-26 04:52:36 +00:00
parent 03fb20b51b
commit c3560dfdaf
2 changed files with 42 additions and 39 deletions

View File

@ -1,5 +1,7 @@
2000-11-25 Ulrich Drepper <drepper@redhat.com> 2000-11-25 Ulrich Drepper <drepper@redhat.com>
* string/tester.c: Mark test functions as static to avoid warnings.
* iconv/gconv_conf.c (read_conf_file): Make mod_counter static to * iconv/gconv_conf.c (read_conf_file): Make mod_counter static to
preserve value over different gconv-modules files. preserve value over different gconv-modules files.

View File

@ -45,7 +45,7 @@ const char *it = "<UNSET>"; /* Routine name for message routines. */
size_t errors = 0; size_t errors = 0;
/* Complain if condition is not true. */ /* Complain if condition is not true. */
void static void
check (int thing, int number) check (int thing, int number)
{ {
if (!thing) if (!thing)
@ -56,7 +56,7 @@ check (int thing, int number)
} }
/* Complain if first two args don't strcmp as equal. */ /* Complain if first two args don't strcmp as equal. */
void static void
equal (const char *a, const char *b, int number) equal (const char *a, const char *b, int number)
{ {
check(a != NULL && b != NULL && STREQ (a, b), number); check(a != NULL && b != NULL && STREQ (a, b), number);
@ -66,7 +66,7 @@ char one[50];
char two[50]; char two[50];
char *cp; char *cp;
void static void
test_strcmp (void) test_strcmp (void)
{ {
it = "strcmp"; it = "strcmp";
@ -120,7 +120,7 @@ test_strcmp (void)
do { \ do { \
int __n; \ int __n; \
char *cp; \ char *cp; \
for (__n = 0; __n < sizeof (one); ++__n) \ for (__n = 0; __n < (int) sizeof (one); ++__n) \
one[__n] = 'Z'; \ one[__n] = 'Z'; \
fn (one, str); \ fn (one, str); \
for (cp = one, __n = 0; __n < n; ++__n, ++cp) \ for (cp = one, __n = 0; __n < n; ++__n, ++cp) \
@ -128,7 +128,7 @@ test_strcmp (void)
check (*cp == '\0', ntest); \ check (*cp == '\0', ntest); \
} while (0) } while (0)
void static void
test_strcpy (void) test_strcpy (void)
{ {
int i; int i;
@ -175,7 +175,7 @@ test_strcpy (void)
SIMPLE_COPY(strcpy, 16, "6666666666666666", 57); SIMPLE_COPY(strcpy, 16, "6666666666666666", 57);
} }
void static void
test_stpcpy (void) test_stpcpy (void)
{ {
it = "stpcpy"; it = "stpcpy";
@ -257,7 +257,7 @@ test_stpcpy (void)
SIMPLE_COPY(stpcpy, 16, "6666666666666666", 59); SIMPLE_COPY(stpcpy, 16, "6666666666666666", 59);
} }
void static void
test_stpncpy (void) test_stpncpy (void)
{ {
it = "stpncpy"; it = "stpncpy";
@ -272,7 +272,7 @@ test_stpncpy (void)
check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8); check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8);
} }
void static void
test_strcat (void) test_strcat (void)
{ {
it = "strcat"; it = "strcat";
@ -302,7 +302,7 @@ test_strcat (void)
equal (one, "cd", 9); equal (one, "cd", 9);
} }
void static void
test_strncat (void) test_strncat (void)
{ {
/* First test it as strcat, with big counts, then test the count /* First test it as strcat, with big counts, then test the count
@ -344,7 +344,7 @@ test_strncat (void)
equal (one, "abcdgh", 12); /* Count and length equal. */ equal (one, "abcdgh", 12); /* Count and length equal. */
} }
void static void
test_strncmp (void) test_strncmp (void)
{ {
/* First test as strcmp with big counts, then test count code. */ /* First test as strcmp with big counts, then test count code. */
@ -364,7 +364,7 @@ test_strncmp (void)
check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */ check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */
} }
void static void
test_strncpy (void) test_strncpy (void)
{ {
/* Testing is a bit different because of odd semantics. */ /* Testing is a bit different because of odd semantics. */
@ -406,7 +406,7 @@ test_strncpy (void)
equal (one, "hi there", 15); /* Stomped on source? */ equal (one, "hi there", 15); /* Stomped on source? */
} }
void static void
test_strlen (void) test_strlen (void)
{ {
it = "strlen"; it = "strlen";
@ -427,7 +427,7 @@ test_strlen (void)
} }
} }
void static void
test_strchr (void) test_strchr (void)
{ {
it = "strchr"; it = "strchr";
@ -456,7 +456,7 @@ test_strchr (void)
} }
} }
void static void
test_strchrnul (void) test_strchrnul (void)
{ {
const char *os; const char *os;
@ -490,7 +490,7 @@ test_strchrnul (void)
} }
} }
void static void
test_rawmemchr (void) test_rawmemchr (void)
{ {
it = "rawmemchr"; it = "rawmemchr";
@ -517,7 +517,7 @@ test_rawmemchr (void)
} }
} }
void static void
test_index (void) test_index (void)
{ {
it = "index"; it = "index";
@ -534,7 +534,7 @@ test_index (void)
check (index (one, '\0') == one, 8); /* NUL in empty string. */ check (index (one, '\0') == one, 8); /* NUL in empty string. */
} }
void static void
test_strrchr (void) test_strrchr (void)
{ {
it = "strrchr"; it = "strrchr";
@ -563,7 +563,7 @@ test_strrchr (void)
} }
} }
void static void
test_memrchr (void) test_memrchr (void)
{ {
size_t l; size_t l;
@ -609,7 +609,7 @@ test_memrchr (void)
} }
} }
void static void
test_rindex (void) test_rindex (void)
{ {
it = "rindex"; it = "rindex";
@ -626,7 +626,7 @@ test_rindex (void)
check (rindex (one, '\0') == one, 8); /* NUL in empty string. */ check (rindex (one, '\0') == one, 8); /* NUL in empty string. */
} }
void static void
test_strpbrk (void) test_strpbrk (void)
{ {
it = "strpbrk"; it = "strpbrk";
@ -655,7 +655,7 @@ test_strpbrk (void)
check(strpbrk(one, "efgh") == one+6, 17); /* And yet another. */ check(strpbrk(one, "efgh") == one+6, 17); /* And yet another. */
} }
void static void
test_strstr (void) test_strstr (void)
{ {
it = "strstr"; it = "strstr";
@ -682,7 +682,7 @@ test_strstr (void)
check(strstr(one, "bbca") == one+1, 16); /* With overlap. */ check(strstr(one, "bbca") == one+1, 16); /* With overlap. */
} }
void static void
test_strspn (void) test_strspn (void)
{ {
it = "strspn"; it = "strspn";
@ -693,7 +693,7 @@ test_strspn (void)
check(strspn("abc", "") == 0, 5); /* Null search list. */ check(strspn("abc", "") == 0, 5); /* Null search list. */
} }
void static void
test_strcspn (void) test_strcspn (void)
{ {
it = "strcspn"; it = "strcspn";
@ -704,7 +704,7 @@ test_strcspn (void)
check(strcspn("abc", "") == 3, 5); /* Null search list. */ check(strcspn("abc", "") == 3, 5); /* Null search list. */
} }
void static void
test_strtok (void) test_strtok (void)
{ {
it = "strtok"; it = "strtok";
@ -754,7 +754,7 @@ test_strtok (void)
equal(one+4, "c", 33); equal(one+4, "c", 33);
} }
void static void
test_strtok_r (void) test_strtok_r (void)
{ {
it = "strtok_r"; it = "strtok_r";
@ -804,7 +804,7 @@ test_strtok_r (void)
equal(one+4, "c", 33); equal(one+4, "c", 33);
} }
void static void
test_strsep (void) test_strsep (void)
{ {
char *ptr; char *ptr;
@ -937,7 +937,7 @@ test_strsep (void)
check(cp == NULL, 88); check(cp == NULL, 88);
} }
void static void
test_memcmp (void) test_memcmp (void)
{ {
it = "memcmp"; it = "memcmp";
@ -951,7 +951,7 @@ test_memcmp (void)
check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */ check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */
} }
void static void
test_memchr (void) test_memchr (void)
{ {
it = "memchr"; it = "memchr";
@ -994,7 +994,7 @@ test_memchr (void)
} }
} }
void static void
test_memcpy (void) test_memcpy (void)
{ {
int i; int i;
@ -1031,7 +1031,7 @@ test_memcpy (void)
} }
} }
void static void
test_mempcpy (void) test_mempcpy (void)
{ {
int i; int i;
@ -1068,7 +1068,7 @@ test_mempcpy (void)
} }
} }
void static void
test_memmove (void) test_memmove (void)
{ {
it = "memmove"; it = "memmove";
@ -1102,7 +1102,7 @@ test_memmove (void)
equal(one, "abcdefgh", 9); /* 100% overlap. */ equal(one, "abcdefgh", 9); /* 100% overlap. */
} }
void static void
test_memccpy (void) test_memccpy (void)
{ {
/* First test like memcpy, then the search part The SVID, the only /* First test like memcpy, then the search part The SVID, the only
@ -1144,7 +1144,7 @@ test_memccpy (void)
equal(two, "xbcdlebee", 15); equal(two, "xbcdlebee", 15);
} }
void static void
test_memset (void) test_memset (void)
{ {
int i; int i;
@ -1166,7 +1166,7 @@ test_memset (void)
/* Non-8bit fill character. */ /* Non-8bit fill character. */
memset (one, 0x101, sizeof (one)); memset (one, 0x101, sizeof (one));
for (i = 0; i < sizeof (one); ++i) for (i = 0; i < (int) sizeof (one); ++i)
check (one[i] == '\01', 7); check (one[i] == '\01', 7);
/* Test for more complex versions of memset, for all alignments and /* Test for more complex versions of memset, for all alignments and
@ -1206,7 +1206,7 @@ test_memset (void)
} }
} }
void static void
test_bcopy (void) test_bcopy (void)
{ {
/* Much like memcpy. Berklix manual is silent about overlap, so /* Much like memcpy. Berklix manual is silent about overlap, so
@ -1230,7 +1230,7 @@ test_bcopy (void)
equal(one, "hi there", 5); /* Stomped on source? */ equal(one, "hi there", 5); /* Stomped on source? */
} }
void static void
test_bzero (void) test_bzero (void)
{ {
it = "bzero"; it = "bzero";
@ -1245,7 +1245,7 @@ test_bzero (void)
equal(one, "abcdef", 4); /* Zero-length copy. */ equal(one, "abcdef", 4); /* Zero-length copy. */
} }
void static void
test_bcmp (void) test_bcmp (void)
{ {
it = "bcmp"; it = "bcmp";
@ -1258,7 +1258,7 @@ test_bcmp (void)
check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */ check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */
} }
void static void
test_strerror (void) test_strerror (void)
{ {
int f; int f;
@ -1386,5 +1386,6 @@ main (void)
status = EXIT_FAILURE; status = EXIT_FAILURE;
printf("%Zd errors.\n", errors); printf("%Zd errors.\n", errors);
} }
exit(status);
return status;
} }