mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
deal with compiler warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
66469bb678
commit
2d8b7b5ac6
4 changed files with 13 additions and 14 deletions
|
@ -325,9 +325,9 @@ namespace polysat {
|
||||||
m_vars.insert(v);
|
m_vars.insert(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void conflict::add_lemma(signed_constraint const* cs, unsigned cs_len) {
|
void conflict::add_lemma(signed_constraint const* cs, size_t cs_len) {
|
||||||
clause_builder cb(s);
|
clause_builder cb(s);
|
||||||
for (unsigned i = 0; i < cs_len; ++i)
|
for (size_t i = 0; i < cs_len; ++i)
|
||||||
cb.push(cs[i]);
|
cb.push(cs[i]);
|
||||||
clause_ref lemma = cb.build();
|
clause_ref lemma = cb.build();
|
||||||
SASSERT(lemma);
|
SASSERT(lemma);
|
||||||
|
|
|
@ -199,7 +199,7 @@ namespace polysat {
|
||||||
|
|
||||||
/** Add a side lemma to the conflict; to be learned in addition to the main lemma after conflict resolution finishes. */
|
/** Add a side lemma to the conflict; to be learned in addition to the main lemma after conflict resolution finishes. */
|
||||||
void add_lemma(std::initializer_list<signed_constraint> cs);
|
void add_lemma(std::initializer_list<signed_constraint> cs);
|
||||||
void add_lemma(signed_constraint const* cs, unsigned cs_len);
|
void add_lemma(signed_constraint const* cs, size_t cs_len);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,16 +48,15 @@ show_deref_t<T> show_deref(Ptr const& ptr) {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct repeat {
|
struct repeat {
|
||||||
unsigned count;
|
size_t count;
|
||||||
T const& obj;
|
T const& obj;
|
||||||
repeat(unsigned count, T const& obj): count(count), obj(obj) {}
|
repeat(size_t count, T const& obj): count(count), obj(obj) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::ostream& operator<<(std::ostream& out, repeat<T> const& r) {
|
std::ostream& operator<<(std::ostream& out, repeat<T> const& r) {
|
||||||
for (unsigned i = r.count; i-- > 0; ) {
|
for (size_t i = r.count; i-- > 0; )
|
||||||
out << r.obj;
|
out << r.obj;
|
||||||
}
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +78,7 @@ std::ostream& operator<<(std::ostream& out, pad<T> const& p) {
|
||||||
std::stringstream tmp;
|
std::stringstream tmp;
|
||||||
tmp << p.obj;
|
tmp << p.obj;
|
||||||
std::string s = tmp.str();
|
std::string s = tmp.str();
|
||||||
unsigned n = (s.length() < p.width) ? (p.width - s.length()) : 0;
|
size_t n = (s.length() < p.width) ? (p.width - s.length()) : 0;
|
||||||
switch (p.dir) {
|
switch (p.dir) {
|
||||||
case pad_direction::left:
|
case pad_direction::left:
|
||||||
out << repeat(n, ' ') << s;
|
out << repeat(n, ' ') << s;
|
||||||
|
|
|
@ -62,8 +62,8 @@ public:
|
||||||
SASSERT(other);
|
SASSERT(other);
|
||||||
SASSERT(invariant());
|
SASSERT(invariant());
|
||||||
SASSERT(other->invariant());
|
SASSERT(other->invariant());
|
||||||
unsigned const old_sz1 = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
size_t const old_sz1 = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
||||||
unsigned const old_sz2 = count_if(*other, [](T const&) { return true; });
|
size_t const old_sz2 = count_if(*other, [](T const&) { return true; });
|
||||||
#endif
|
#endif
|
||||||
// have: this -> next -> ...
|
// have: this -> next -> ...
|
||||||
// insert: other -> ... -> other_end
|
// insert: other -> ... -> other_end
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
SASSERT(invariant());
|
SASSERT(invariant());
|
||||||
SASSERT(other->invariant());
|
SASSERT(other->invariant());
|
||||||
unsigned const new_sz = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
size_t const new_sz = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
||||||
SASSERT_EQ(new_sz, old_sz1 + old_sz2);
|
SASSERT_EQ(new_sz, old_sz1 + old_sz2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,8 @@ public:
|
||||||
SASSERT(other);
|
SASSERT(other);
|
||||||
SASSERT(invariant());
|
SASSERT(invariant());
|
||||||
SASSERT(other->invariant());
|
SASSERT(other->invariant());
|
||||||
unsigned const old_sz1 = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
size_t const old_sz1 = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
||||||
unsigned const old_sz2 = count_if(*other, [](T const&) { return true; });
|
size_t const old_sz2 = count_if(*other, [](T const&) { return true; });
|
||||||
#endif
|
#endif
|
||||||
// have: prev -> this -> ...
|
// have: prev -> this -> ...
|
||||||
// insert: other -> ... -> other_end
|
// insert: other -> ... -> other_end
|
||||||
|
@ -102,7 +102,7 @@ public:
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
SASSERT(invariant());
|
SASSERT(invariant());
|
||||||
SASSERT(other->invariant());
|
SASSERT(other->invariant());
|
||||||
unsigned const new_sz = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
size_t const new_sz = count_if(*static_cast<T*>(this), [](T const&) { return true; });
|
||||||
SASSERT_EQ(new_sz, old_sz1 + old_sz2);
|
SASSERT_EQ(new_sz, old_sz1 + old_sz2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue