00001 #ifndef DIVINE_TYPES_HH
00002 #define DIVINE_TYPES_HH
00003
00004 #include <cstddef>
00005 #include "divine-int.hh"
00006
00007
00008
00009
00010 namespace divine {
00011
00013 typedef uint64_t ulong_long_int_t;
00015 typedef int64_t slong_long_int_t;
00017 typedef uint32_t ulong_int_t;
00019 typedef int32_t slong_int_t;
00021 typedef uint16_t ushort_int_t;
00023 typedef int16_t sshort_int_t;
00026 typedef uint8_t byte_t;
00028 typedef uint8_t ubyte_t;
00030 typedef int8_t sbyte_t;
00033
00036 typedef std::size_t size_int_t;
00037
00038 #ifndef __INT64_C
00039 # if __WORDSIZE == 64
00040 # define __INT64_C(c) c ## L
00041 # else
00042 # define __INT64_C(c) c ## LL
00043 # endif
00044 #endif
00045
00046 #ifndef __UINT64_C
00047 # if __WORDSIZE == 64
00048 # define __UINT64_C(c) c ## UL
00049 # else
00050 # define __UINT64_C(c) c ## ULL
00051 # endif
00052 #endif
00053
00054 #ifndef INT8_MIN
00055 # define INT8_MIN (-128)
00056 #endif
00057 #ifndef INT16_MIN
00058 # define INT16_MIN (-32767-1)
00059 #endif
00060 #ifndef INT32_MIN
00061 # define INT32_MIN (-2147483647-1)
00062 #endif
00063 #ifndef INT64_MIN
00064 # define INT64_MIN (-__INT64_C(9223372036854775807)-1)
00065 #endif
00066
00067 #ifndef INT8_MAX
00068 # define INT8_MAX (127)
00069 #endif
00070 #ifndef INT16_MAX
00071 # define INT16_MAX (32767)
00072 #endif
00073 #ifndef INT32_MAX
00074 # define INT32_MAX (2147483647)
00075 #endif
00076 #ifndef INT64_MAX
00077 # define INT64_MAX (__INT64_C(9223372036854775807))
00078 #endif
00079
00080
00081 #ifndef UINT8_MAX
00082 # define UINT8_MAX (255)
00083 #endif
00084 #ifndef UINT16_MAX
00085 # define UINT16_MAX (65535)
00086 #endif
00087 #ifndef UINT32_MAX
00088 # define UINT32_MAX (4294967295U)
00089 #endif
00090 #ifndef UINT64_MAX
00091 # define UINT64_MAX (__UINT64_C(18446744073709551615))
00092 #endif
00093
00094 #ifndef SIZE_MAX
00095 # if __WORDSIZE == 64
00096 # define SIZE_MAX (18446744073709551615UL)
00097 # else
00098 # define SIZE_MAX (4294967295U)
00099 # endif
00100 #endif
00101
00103 const int LONG_LONG_INT_BYTES = sizeof(ulong_long_int_t);
00105 const int LONG_INT_BYTES = sizeof(ulong_int_t);
00107 const int SHORT_INT_BYTES = sizeof(ushort_int_t);
00109 const int BYTE_BYTES = sizeof(ubyte_t);
00110
00112 const int LONG_LONG_INT_BITS = 8*LONG_LONG_INT_BYTES;
00114 const int LONG_INT_BITS = 8*LONG_INT_BYTES;
00116 const int SHORT_INT_BITS = 8*SHORT_INT_BYTES;
00118 const int BYTE_BITS = 8*BYTE_BYTES;
00119
00121 const ulong_long_int_t MAX_ULONG_LONG_INT = UINT64_MAX;
00123 const ulong_long_int_t MIN_ULONG_LONG_INT = ulong_long_int_t(0);
00125 const slong_long_int_t MAX_SLONG_LONG_INT = INT64_MAX;
00127 const slong_long_int_t MIN_SLONG_LONG_INT = INT64_MIN;
00129 const ulong_int_t MAX_ULONG_INT = UINT32_MAX;
00131 const ulong_int_t MIN_ULONG_INT = ulong_int_t(0);
00133 const slong_int_t MAX_SLONG_INT = INT32_MAX;
00135 const slong_int_t MIN_SLONG_INT = INT32_MIN;
00137 const ushort_int_t MAX_USHORT_INT = UINT16_MAX;
00139 const ushort_int_t MIN_USHORT_INT = ushort_int_t(0);
00141 const sshort_int_t MAX_SSHORT_INT = INT16_MAX;
00143 const sshort_int_t MIN_SSHORT_INT = INT16_MIN;
00145 const byte_t MAX_BYTE = UINT8_MAX;
00147 const byte_t MIN_BYTE = 0;
00149 const ubyte_t MAX_UBYTE = UINT8_MAX;
00151 const ubyte_t MIN_UBYTE = 0;
00153 const sbyte_t MAX_SBYTE = INT8_MAX;
00155 const sbyte_t MIN_SBYTE = INT8_MIN;
00157 const size_int_t MAX_SIZE_INT = SIZE_MAX;
00159 const size_int_t MIN_SIZE_INT = 0;
00160
00162 const size_int_t NO_ID = MAX_SIZE_INT;
00163
00164
00165
00166
00167
00168
00169
00170
00171
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00188
00189
00190
00191
00192
00193
00194 typedef slong_int_t all_values_t;
00195
00196 }
00197
00198 #endif