PageRenderTime 29ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/li_stdint.i

#
Swig | 67 lines | 58 code | 9 blank | 0 comment | 0 complexity | 2305203e2da5e97d1c0f06e7132c0b4b MD5 | raw file
 1%module li_stdint
 2
 3%include <stdint.i>
 4
 5%inline %{
 6  struct StdInts {
 7    int8_t   int8_member;
 8    int16_t  int16_member;
 9    int32_t  int32_member;
10    int64_t  int64_member;
11    uint8_t  uint8_member;
12    uint16_t uint16_member;
13    uint32_t uint32_member;
14    uint64_t uint64_member;
15  };
16
17  int8_t   int8_td (int8_t  i) { return i; }
18  int16_t  int16_td(int16_t i) { return i; }
19  int32_t  int32_td(int32_t i) { return i; }
20  int64_t  int64_td(int64_t i) { return i; }
21  uint8_t  uint8_td (int8_t  i) { return i; }
22  uint16_t uint16_td(int16_t i) { return i; }
23  uint32_t uint32_td(int32_t i) { return i; }
24  uint64_t uint64_td(int64_t i) { return i; }
25
26  struct StdIntFasts {
27    int_fast8_t   int_fast8_member;
28    int_fast16_t  int_fast16_member;
29    int_fast32_t  int_fast32_member;
30    int_fast64_t  int_fast64_member;
31    uint_fast8_t  uint_fast8_member;
32    uint_fast16_t uint_fast16_member;
33    uint_fast32_t uint_fast32_member;
34    uint_fast64_t uint_fast64_member;
35  };
36
37  int_fast8_t   int_fast8_td (int_fast8_t  i) { return i; }
38  int_fast16_t  int_fast16_td(int_fast16_t i) { return i; }
39  int_fast32_t  int_fast32_td(int_fast32_t i) { return i; }
40  int_fast64_t  int_fast64_td(int_fast64_t i) { return i; }
41  uint_fast8_t  uint_fast8_td (int_fast8_t  i) { return i; }
42  uint_fast16_t uint_fast16_td(int_fast16_t i) { return i; }
43  uint_fast32_t uint_fast32_td(int_fast32_t i) { return i; }
44  uint_fast64_t uint_fast64_td(int_fast64_t i) { return i; }
45
46  struct StdIntLeasts {
47    int_least8_t   int_least8_member;
48    int_least16_t  int_least16_member;
49    int_least32_t  int_least32_member;
50    int_least64_t  int_least64_member;
51    uint_least8_t  uint_least8_member;
52    uint_least16_t uint_least16_member;
53    uint_least32_t uint_least32_member;
54    uint_least64_t uint_least64_member;
55  };
56
57  int_least8_t   int_least8_td (int_least8_t  i) { return i; }
58  int_least16_t  int_least16_td(int_least16_t i) { return i; }
59  int_least32_t  int_least32_td(int_least32_t i) { return i; }
60  int_least64_t  int_least64_td(int_least64_t i) { return i; }
61  uint_least8_t  uint_least8_td (int_least8_t  i) { return i; }
62  uint_least16_t uint_least16_td(int_least16_t i) { return i; }
63  uint_least32_t uint_least32_td(int_least32_t i) { return i; }
64  uint_least64_t uint_least64_td(int_least64_t i) { return i; }
65
66%}
67