3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-19 01:32:17 +00:00

Use nullptr.

This commit is contained in:
Bruce Mitchener 2018-02-12 14:05:55 +07:00
parent f01328c65f
commit 76eb7b9ede
625 changed files with 4639 additions and 4639 deletions

View file

@ -30,7 +30,7 @@ class expr_offset {
expr * m_expr;
unsigned m_offset;
public:
expr_offset():m_expr(0), m_offset(0) {}
expr_offset():m_expr(nullptr), m_offset(0) {}
expr_offset(expr * e, unsigned o):m_expr(e), m_offset(o) {}
expr * get_expr() const { return m_expr; }

View file

@ -79,13 +79,13 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
// It is incorrect to cache results between different calls if we are applying a substitution
// modulo a substitution s -> t.
if (m_state == INSERT || s != expr_offset(0,0))
if (m_state == INSERT || s != expr_offset(nullptr,0))
reset_cache();
m_state = APPLY;
unsigned j;
expr * e = 0;
expr * e = nullptr;
unsigned off;
expr_offset n1;
bool visited;
@ -146,7 +146,7 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
bool has_new_args = false;
for (unsigned i = 0; i < num_args; i++) {
expr * arg = to_app(e)->get_arg(i);
expr * new_arg = 0;
expr * new_arg = nullptr;
VERIFY(m_apply_cache.find(expr_offset(arg, off), new_arg));
new_args.push_back(new_arg);
@ -185,10 +185,10 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
}
expr_offset body(q->get_expr(), off);
expr_ref s1_ref(m_manager), t1_ref(m_manager);
if (s.get_expr() != 0) {
if (s.get_expr() != nullptr) {
var_sh(s.get_expr(), num_vars, s1_ref);
}
if (t.get_expr() != 0) {
if (t.get_expr() != nullptr) {
var_sh(t.get_expr(), num_vars, t1_ref);
}
expr_offset s1(s1_ref, s.get_offset());
@ -218,7 +218,7 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
m_new_exprs.push_back(e);
result = e;
if (s != expr_offset(0,0))
if (s != expr_offset(nullptr,0))
reset_cache();
TRACE("subst_bug", tout << "END substitution::apply\nresult:\n" << mk_pp(e, m_manager) << "\nref_count: " << e->get_ref_count() << "\n";);

View file

@ -178,7 +178,7 @@ public:
to the variable x+delta[i].
*/
void apply(unsigned num_actual_offsets, unsigned const * deltas, expr_offset const & n, expr_ref & result) {
apply(num_actual_offsets, deltas, n, expr_offset(0, 0), expr_offset(0, 0), result);
apply(num_actual_offsets, deltas, n, expr_offset(nullptr, 0), expr_offset(nullptr, 0), result);
}
/**

View file

@ -172,7 +172,7 @@ substitution_tree::node * substitution_tree::find_best_child(node * r) {
#ifdef Z3DEBUG
unsigned todo_size = m_todo.size();
#endif
node * best_child = 0;
node * best_child = nullptr;
unsigned max_measure = 0;
node * curr_child = r->m_first_child;
while (curr_child) {
@ -335,7 +335,7 @@ void substitution_tree::insert(app * new_expr) {
else {
mark_used_regs(r->m_subst);
node * best_child = find_best_child(r);
if (best_child == 0) {
if (best_child == nullptr) {
// there is no compatible child
node * n = mk_node_for(new_expr);
n->m_next_sibling = r->m_first_child;
@ -414,7 +414,7 @@ bool substitution_tree::is_fully_compatible(svector<subst> const & sv) {
*/
bool substitution_tree::find_fully_compatible_child(node * r, node * & prev, node * & child) {
SASSERT(!r->m_leaf);
prev = 0;
prev = nullptr;
child = r->m_first_child;
while (child) {
if (is_fully_compatible(child->m_subst))
@ -462,8 +462,8 @@ void substitution_tree::erase(app * e) {
m_todo.push_back(0);
node * r = m_roots[id];
node * parent = 0;
node * prev = 0;
node * parent = nullptr;
node * prev = nullptr;
while (true) {
svector<subst> & sv = r->m_subst;
@ -495,12 +495,12 @@ void substitution_tree::erase(app * e) {
if (m_todo.empty()) {
reset_registers(0);
SASSERT(r->m_expr == e);
if (parent == 0) {
if (parent == nullptr) {
delete_node(r);
m_roots[id] = 0;
}
else if (at_least_3_children(parent)) {
if (prev == 0)
if (prev == nullptr)
parent->m_first_child = r->m_next_sibling;
else
prev->m_next_sibling = r->m_next_sibling;
@ -843,7 +843,7 @@ void substitution_tree::visit(expr * e, st_visitor & st, unsigned in_offset, uns
ptr_vector<node>::iterator end = m_roots.end();
for (; it != end; ++it) {
node * r = *it;
if (r != 0) {
if (r != nullptr) {
var * v = r->m_subst[0].first;
if (v->get_sort() == to_var(e)->get_sort())
if (!visit<Mode>(e, st, r))
@ -878,7 +878,7 @@ void substitution_tree::display(std::ostream & out) const {
ptr_vector<var_ref_vector>::const_iterator end2 = m_vars.end();
for (; it2 != end2; ++it2) {
var_ref_vector * v = *it2;
if (v == 0)
if (v == nullptr)
continue; // m_vars may contain null pointers. See substitution_tree::insert.
unsigned num = v->size();
for (unsigned i = 0; i < num; i++) {

View file

@ -50,7 +50,7 @@ class substitution_tree {
node * m_first_child;
expr * m_expr;
};
node(bool leaf):m_leaf(leaf), m_next_sibling(0), m_first_child(0) {}
node(bool leaf):m_leaf(leaf), m_next_sibling(nullptr), m_first_child(nullptr) {}
};
ast_manager & m_manager;