mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
Remove int64, uint64 typedefs in favor of int64_t / uint64_t.
This commit is contained in:
parent
16a2ad9afd
commit
2fa304d8de
80 changed files with 437 additions and 449 deletions
|
@ -29,23 +29,11 @@ Revision History:
|
|||
#define SIZE_MAX std::numeric_limits<std::size_t>::max()
|
||||
#endif
|
||||
|
||||
#ifndef uint64
|
||||
typedef unsigned long long uint64;
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(uint64) == 8, "64 bits please");
|
||||
|
||||
#ifndef int64
|
||||
typedef long long int64;
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(int64) == 8, "64 bits");
|
||||
|
||||
#ifndef INT64_MIN
|
||||
#define INT64_MIN static_cast<int64>(0x8000000000000000ull)
|
||||
#define INT64_MIN static_cast<int64_t>(0x8000000000000000ull)
|
||||
#endif
|
||||
#ifndef INT64_MAX
|
||||
#define INT64_MAX static_cast<int64>(0x7fffffffffffffffull)
|
||||
#define INT64_MAX static_cast<int64_t>(0x7fffffffffffffffull)
|
||||
#endif
|
||||
#ifndef UINT64_MAX
|
||||
#define UINT64_MAX 0xffffffffffffffffull
|
||||
|
@ -110,7 +98,7 @@ inline unsigned next_power_of_two(unsigned v) {
|
|||
\brief Return the position of the most significant bit.
|
||||
*/
|
||||
unsigned log2(unsigned v);
|
||||
unsigned uint64_log2(uint64 v);
|
||||
unsigned uint64_log2(uint64_t v);
|
||||
|
||||
static_assert(sizeof(unsigned) == 4, "unsigned are 32 bits");
|
||||
|
||||
|
@ -136,11 +124,11 @@ static inline unsigned get_num_1bits(unsigned v) {
|
|||
|
||||
// Remark: on gcc, the operators << and >> do not produce zero when the second argument >= 64.
|
||||
// So, I'm using the following two definitions to fix the problem
|
||||
static inline uint64 shift_right(uint64 x, uint64 y) {
|
||||
static inline uint64_t shift_right(uint64_t x, uint64_t y) {
|
||||
return y < 64ull ? (x >> y) : 0ull;
|
||||
}
|
||||
|
||||
static inline uint64 shift_left(uint64 x, uint64 y) {
|
||||
static inline uint64_t shift_left(uint64_t x, uint64_t y) {
|
||||
return y < 64ull ? (x << y) : 0ull;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue