aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Shebs <stanshebs@google.com>2018-01-19 09:22:56 -0800
committerStan Shebs <stanshebs@google.com>2018-01-24 16:03:39 -0800
commit98e480caca6b95e46406fa13339ce6f06fb2ddd3 (patch)
tree096b2a4976365e05baf315c6f3997ee779c9b545
parente363210bfab5138de567c4b3650de66307d715b5 (diff)
downloadglibc-98e480caca6b95e46406fa13339ce6f06fb2ddd3.tar
glibc-98e480caca6b95e46406fa13339ce6f06fb2ddd3.tar.gz
glibc-98e480caca6b95e46406fa13339ce6f06fb2ddd3.tar.bz2
glibc-98e480caca6b95e46406fa13339ce6f06fb2ddd3.zip
De-nest test-ffs.c
-rw-r--r--string/test-ffs.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/string/test-ffs.c b/string/test-ffs.c
index e5e7579a33..d78d638050 100644
--- a/string/test-ffs.c
+++ b/string/test-ffs.c
@@ -21,27 +21,26 @@
#include <stdio.h>
#include <string.h>
+int failures = 0;
+
+void
+try (const char *name, long long int param, int value, int expected)
+{
+ if (value != expected)
+ {
+ printf ("%s(%#llx) expected %d got %d\n",
+ name, param, expected, value);
+ ++failures;
+ }
+ else
+ printf ("%s(%#llx) as expected %d\n", name, param, value);
+}
+
int
do_test (void)
{
- int failures = 0;
int i;
- auto void try (const char *name, long long int param, int value,
- int expected);
-
- void try (const char *name, long long int param, int value, int expected)
- {
- if (value != expected)
- {
- printf ("%s(%#llx) expected %d got %d\n",
- name, param, expected, value);
- ++failures;
- }
- else
- printf ("%s(%#llx) as expected %d\n", name, param, value);
- }
-
#define TEST(fct, type) \
try (#fct, 0, fct ((type) 0), 0); \
for (i=0 ; i < 8 * sizeof (type); i++) \