3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-14 21:01:49 +00:00

Fix syntax errors in mpz.h

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-09 15:16:45 +00:00
parent 7ed69045bc
commit 6e545ac56a

View file

@ -136,7 +136,6 @@ protected:
friend class mpz_stack;
public:
mpz(int v = 0) noexcept : m_value(static_cast<uintptr_t>(static_cast<intptr_t>(v)) << 1) {}
}
mpz(mpz_type* ptr) noexcept {
SASSERT(ptr);
@ -155,15 +154,11 @@ public:
}
void set(int v) {
if (is_small()) {
m_value = static_cast<uintptr_t>(static_cast<intptr_t>(v)) << 1;
} else {
bool is_negative = v < 0;
c.set_sign(is_negative ? -1 : 1);
auto *p = ptr();
p->m_digits[0] = static_cast<digit_t>(is_negative ? -v : v);
p->m_size = 1;
}
m_value = static_cast<uintptr_t>(static_cast<intptr_t>(v)) << 1;
}
void swap(mpz & other) noexcept {
std::swap(m_value, other.m_value);
}
inline bool is_small() const {
@ -598,6 +593,9 @@ public:
}
void set(mpz & a, int val) {
if (!is_small(a)) {
deallocate(a);
}
a.set(val);
}