1 typedef _Bool bool;
   2 typedef   signed char schar;
   3 typedef unsigned char uchar;
   4 typedef unsigned short ushort;
   5 typedef unsigned int uint;
   6 typedef unsigned long ulong;
   7 typedef long long longlong;
   8 typedef unsigned long long ulonglong;
   9 
  10 #define DEFINE_CAST(from, to)                   \
  11         static to from##2##to(from x) {         \
  12                 return x;                       \
  13         }
  14 
  15 #define DEFINE_CASTS(from)                      \
  16         DEFINE_CAST(from, bool)                 \
  17         DEFINE_CAST(from, char)                 \
  18         DEFINE_CAST(from, schar)                \
  19         DEFINE_CAST(from, uchar)                \
  20         DEFINE_CAST(from, short)                \
  21         DEFINE_CAST(from, ushort)               \
  22         DEFINE_CAST(from, int)                  \
  23         DEFINE_CAST(from, uint)                 \
  24         DEFINE_CAST(from, long)                 \
  25         DEFINE_CAST(from, ulong)                \
  26         DEFINE_CAST(from, longlong)             \
  27         DEFINE_CAST(from, ulonglong)            \
  28         DEFINE_CAST(from, float)                \
  29         DEFINE_CAST(from, double)
  30 
  31 DEFINE_CASTS(bool)
  32 DEFINE_CASTS(char)
  33 DEFINE_CASTS(schar)
  34 DEFINE_CASTS(uchar)
  35 DEFINE_CASTS(short)
  36 DEFINE_CASTS(ushort)
  37 DEFINE_CASTS(int)
  38 DEFINE_CASTS(uint)
  39 DEFINE_CASTS(long)
  40 DEFINE_CASTS(ulong)
  41 DEFINE_CASTS(longlong)
  42 DEFINE_CASTS(ulonglong)
  43 DEFINE_CASTS(float)
  44 DEFINE_CASTS(double)
  45 
  46 /*
  47  * check-name: Cast code generation
  48  * check-command: sparsec -c $file -o tmp.o
  49  */