buf_size: handle dma_alloc_attrs()
[smatch.git] / validation / backend / cast.c
blob3e677446bc984cd6f0b1067b345c85882fb0fd57
1 typedef unsigned char uchar;
2 typedef unsigned short ushort;
3 typedef unsigned int uint;
4 typedef unsigned long ulong;
5 typedef long long longlong;
6 typedef unsigned long long ulonglong;
8 #define DEFINE_CAST(from, to) \
9 static to from##2##to(from x) { \
10 return x; \
13 #define DEFINE_CASTS(from) \
14 DEFINE_CAST(from, char) \
15 DEFINE_CAST(from, uchar) \
16 DEFINE_CAST(from, short) \
17 DEFINE_CAST(from, ushort) \
18 DEFINE_CAST(from, int) \
19 DEFINE_CAST(from, uint) \
20 DEFINE_CAST(from, long) \
21 DEFINE_CAST(from, ulong) \
22 DEFINE_CAST(from, longlong) \
23 DEFINE_CAST(from, ulonglong) \
25 DEFINE_CAST(from, float) \
26 DEFINE_CAST(from, double)
29 DEFINE_CASTS(char)
30 DEFINE_CASTS(uchar)
31 DEFINE_CASTS(short)
32 DEFINE_CASTS(ushort)
33 DEFINE_CASTS(int)
34 DEFINE_CASTS(uint)
35 DEFINE_CASTS(long)
36 DEFINE_CASTS(ulong)
37 DEFINE_CASTS(longlong)
38 DEFINE_CASTS(ulonglong)
40 DEFINE_CASTS(float)
41 DEFINE_CASTS(double)
45 * check-name: Cast code generation
46 * check-command: ./sparsec -c $file -o tmp.o