Make cpp.py less braindead.

The old code ignored operator precedence (!), despite having two tables
of operator precedence. The code's still pretty awful, but I've cleaned
it up enough to fix this, the most important bug.

This patch lets us correctly clean the uapi unistd.h, stat.h, and swab.h files,
and also fixes the mess we were already making of various old kernel
header files. I've added a bunch more tests, fixed the existing tests that
the existing script was already failing (!), and changed the script so that
the tests are run every time the script is run.

We can probably remove some of the old kernel header files that we were
parsing incorrectly, but we can worry about that later.

Bug: 11253477
Change-Id: Ie66c65b3a7ae13b4e98ed8038a6a534f06eae0e5
diff --git a/libc/kernel/uapi/asm-generic/stat.h b/libc/kernel/uapi/asm-generic/stat.h
index a0a9a25..a94c69d 100644
--- a/libc/kernel/uapi/asm-generic/stat.h
+++ b/libc/kernel/uapi/asm-generic/stat.h
@@ -48,7 +48,7 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned int __unused5;
 };
-#if __BITS_PER_LONG != (64 || defined(__ARCH_WANT_STAT64))
+#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
 struct stat64 {
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long long st_dev;
diff --git a/libc/kernel/uapi/asm-generic/swab.h b/libc/kernel/uapi/asm-generic/swab.h
index 8279332..bcbc94f 100644
--- a/libc/kernel/uapi/asm-generic/swab.h
+++ b/libc/kernel/uapi/asm-generic/swab.h
@@ -21,7 +21,7 @@
 #include <asm/bitsperlong.h>
 #if __BITS_PER_LONG == 32
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#if defined(__GNUC__) && (!defined(__STRICT_ANSI__) || defined(__KERNEL__))
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 #define __SWAB_64_THRU_32__
 #endif
 #endif
diff --git a/libc/kernel/uapi/asm-generic/unistd.h b/libc/kernel/uapi/asm-generic/unistd.h
index 0197836..781941b 100644
--- a/libc/kernel/uapi/asm-generic/unistd.h
+++ b/libc/kernel/uapi/asm-generic/unistd.h
@@ -21,7 +21,7 @@
 #define __SYSCALL(x, y)
 #endif
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#if __BITS_PER_LONG == (32 || defined(__SYSCALL_COMPAT))
+#if __BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)
 #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
 #else
 #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
@@ -407,7 +407,7 @@
 #define __NR_syscalls (__NR_signalfd+1)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
-#if __BITS_PER_LONG == (32 || defined(__SYSCALL_COMPAT)) && defined(__ARCH_WANT_SYSCALL_OFF_T)
+#if (__BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)) && defined(__ARCH_WANT_SYSCALL_OFF_T)
 #define __NR_sendfile 1046
 #define __NR_ftruncate 1047
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@@ -473,7 +473,7 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __NR_syscalls (__NR_fork+1)
 #endif
-#if __BITS_PER_LONG == (64 && !defined(__SYSCALL_COMPAT))
+#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
 #define __NR_fcntl __NR3264_fcntl
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __NR_statfs __NR3264_statfs
diff --git a/libc/kernel/uapi/linux/v4l2-dv-timings.h b/libc/kernel/uapi/linux/v4l2-dv-timings.h
index 803850f..2c9ec89 100644
--- a/libc/kernel/uapi/linux/v4l2-dv-timings.h
+++ b/libc/kernel/uapi/linux/v4l2-dv-timings.h
@@ -18,7 +18,7 @@
  ****************************************************************************/
 #ifndef _V4L2_DV_TIMINGS_H
 #define _V4L2_DV_TIMINGS_H
-#if __GNUC__ < (4 || __GNUC__ == (4 && __GNUC_MINOR__ < 6))
+#if __GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 6
 #define V4L2_INIT_BT_TIMINGS(_width, args...)   { .bt = { _width , ## args } }
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #else