]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
De-nest test-ffs.c
authorStan Shebs <stanshebs@google.com>
Fri, 19 Jan 2018 17:22:56 +0000 (09:22 -0800)
committerStan Shebs <stanshebs@google.com>
Thu, 25 Jan 2018 00:03:39 +0000 (16:03 -0800)
string/test-ffs.c

index e5e7579a3345874c34098df4584907d2d37ba769..d78d638050b45590d2b127c89ac741eeb5561cd4 100644 (file)
 #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++)                                     \