fix cast to bool
[smatch.git] / validation / alternate-keywords.c
blob2e91a354d2fb5049087995533f51476c4126272e
2 extern float strtof(const char *__restrict__ ptr, char **__restrict__ endptr);
3 extern double strtod(const char *__restrict ptr, char **__restrict endptr);
4 /* restrict: -std=c99 or -std=gnu99 or -std=c11 */
5 extern long double strtold(const char *restrict ptr, char **restrict endptr);
7 extern int (*funcs[])(void);
9 /* typeof: no -std or -std=gnu90 or -std=gnu99 or -std=gnu11 */
10 extern typeof (funcs[0]) f0;
11 extern __typeof (funcs[1]) f1;
12 extern __typeof__(funcs[2]) f2;
14 typedef unsigned short uint16_t;
15 typedef unsigned int uint32_t;
16 typedef unsigned long long uint64_t;
18 static __inline__ uint16_t swap16(uint16_t val)
20 return ((((uint16_t)(val) & (uint16_t)0x00ffU) << 8) |
21 (((uint16_t)(val) & (uint16_t)0xff00U) >> 8));
24 static __inline uint32_t swap32(uint32_t val)
26 return ((((uint32_t)(val) & (uint32_t)0x000000ffUL) << 24) |
27 (((uint32_t)(val) & (uint32_t)0x0000ff00UL) << 8) |
28 (((uint32_t)(val) & (uint32_t)0x00ff0000UL) >> 8) |
29 (((uint32_t)(val) & (uint32_t)0xff000000UL) >> 24));
32 /* inline: no -std or -std=gnu90 or -std=c99 or -std=c11 */
33 static inline uint64_t swap64(uint64_t val)
35 return ((((uint64_t)(val) & (uint64_t)0x00000000000000ffULL) << 56) |
36 (((uint64_t)(val) & (uint64_t)0x000000000000ff00ULL) << 40) |
37 (((uint64_t)(val) & (uint64_t)0x0000000000ff0000ULL) << 24) |
38 (((uint64_t)(val) & (uint64_t)0x00000000ff000000ULL) << 8) |
39 (((uint64_t)(val) & (uint64_t)0x000000ff00000000ULL) >> 8) |
40 (((uint64_t)(val) & (uint64_t)0x0000ff0000000000ULL) >> 24) |
41 (((uint64_t)(val) & (uint64_t)0x00ff000000000000ULL) >> 40) |
42 (((uint64_t)(val) & (uint64_t)0xff00000000000000ULL) >> 56));
45 * check-name: alternate keywords