nullptr cleanup for -Wzero-as-null-pointer-constant
Fixes #106. * m4/gccwarn.m4: Use -Wzero-as-null-pointer-constant if supported. * src/bin/autfilt.cc, src/bin/common_aoutput.cc, src/bin/common_finput.cc, src/bin/common_finput.hh, src/bin/common_output.cc, src/bin/common_output.hh, src/bin/common_post.cc, src/bin/common_r.hh, src/bin/common_range.hh, src/bin/common_setup.cc, src/bin/common_trans.cc, src/bin/dstar2tgba.cc, src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc, src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/ltlfilt.cc, src/bin/ltlgrind.cc, src/bin/randaut.cc, src/bin/randltl.cc, src/bin/spot-x.cc, src/kripke/kripkeexplicit.cc, src/ltlast/formula.cc, src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh, src/ltlvisit/relabel.cc, src/ltlvisit/relabel.hh, src/ltlvisit/simplify.cc, src/ltlvisit/snf.hh, src/misc/fixpool.hh, src/misc/mspool.hh, src/misc/hash.hh, src/misc/optionmap.cc, src/misc/satsolver.cc, src/misc/tmpfile.cc, src/misc/tmpfile.hh, src/priv/bddalloc.cc, src/ta/ta.hh, src/ta/taexplicit.cc, src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/tgtaexplicit.hh, src/ta/tgtaproduct.cc, src/taalgos/minimize.cc, src/taalgos/reachiter.cc, src/taalgos/tgba2ta.cc, src/tests/complementation.cc, src/tests/ikwiad.cc, src/tests/randtgba.cc, src/tests/reduc.cc, src/twa/bdddict.cc, src/twa/bddprint.cc, src/twa/taatgba.cc, src/twa/twa.cc, src/twa/twagraph.hh, src/twa/twaproduct.cc, src/twa/twasafracomplement.cc, src/twaalgos/bfssteps.cc, src/twaalgos/compsusp.cc, src/twaalgos/dtgbasat.cc, src/twaalgos/emptiness.cc, src/twaalgos/gtec/ce.cc, src/twaalgos/gv04.cc, src/twaalgos/ltl2taa.cc, src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/magic.cc, src/twaalgos/minimize.cc, src/twaalgos/ndfs_result.hxx, src/twaalgos/postproc.cc, src/twaalgos/postproc.hh, src/twaalgos/reachiter.cc, src/twaalgos/reducerun.cc, src/twaalgos/safety.hh, src/twaalgos/sccfilter.hh, src/twaalgos/se05.cc, src/twaalgos/simulation.cc, src/twaalgos/tau03.cc, src/twaalgos/tau03opt.cc, src/twaalgos/translate.cc, src/twaalgos/translate.hh, utf8/utf8/core.h, bench/stutter/stutter_invariance_formulas.cc, iface/ltsmin/ltsmin.cc, iface/ltsmin/modelcheck.cc: Use nullptr to fix the warning.
This commit is contained in:
parent
51a3cfcede
commit
1729a79ac7
87 changed files with 755 additions and 717 deletions
|
|
@ -105,7 +105,7 @@ namespace spot
|
|||
virtual spot::state*
|
||||
get_artificial_initial_state() const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// \brief Get an iterator over the successors of \a state.
|
||||
|
|
|
|||
|
|
@ -117,26 +117,21 @@ namespace spot
|
|||
transitions_by_condition.find(condition.id());
|
||||
|
||||
if (i == transitions_by_condition.end())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return nullptr;
|
||||
else
|
||||
{
|
||||
return i->second;
|
||||
}
|
||||
|
||||
return i->second;
|
||||
}
|
||||
|
||||
void
|
||||
state_ta_explicit::add_transition(state_ta_explicit::transition* t,
|
||||
bool add_at_beginning)
|
||||
{
|
||||
if (transitions_ == 0)
|
||||
if (!transitions_)
|
||||
transitions_ = new transitions;
|
||||
|
||||
transitions* trans_by_condition = get_transitions(t->condition);
|
||||
|
||||
if (trans_by_condition == 0)
|
||||
if (!trans_by_condition)
|
||||
{
|
||||
trans_by_condition = new transitions;
|
||||
transitions_by_condition[(t->condition).id()] = trans_by_condition;
|
||||
|
|
@ -229,7 +224,7 @@ namespace spot
|
|||
state_ta_explicit::is_hole_state() const
|
||||
{
|
||||
state_ta_explicit::transitions* trans = get_transitions();
|
||||
return trans == 0 || trans->empty();
|
||||
return !trans || trans->empty();
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -240,7 +235,7 @@ namespace spot
|
|||
|
||||
int compare_value = tgba_state_->compare(o->tgba_state_);
|
||||
|
||||
if (compare_value != 0)
|
||||
if (compare_value)
|
||||
return compare_value;
|
||||
|
||||
compare_value = tgba_condition_.id() - o->tgba_condition_.id();
|
||||
|
|
@ -275,7 +270,7 @@ namespace spot
|
|||
state_ta_explicit::transitions* trans = get_transitions();
|
||||
state_ta_explicit::transitions::iterator it_trans;
|
||||
|
||||
if (trans != 0)
|
||||
if (trans)
|
||||
for (it_trans = trans->begin(); it_trans != trans->end();)
|
||||
{
|
||||
state_ta_explicit* dest = (*it_trans)->dest;
|
||||
|
|
@ -301,7 +296,7 @@ namespace spot
|
|||
//remove hole successors states
|
||||
state_ta_explicit::transitions* dest_trans =
|
||||
(dest)->get_transitions();
|
||||
bool dest_trans_empty = dest_trans == 0 || dest_trans->empty();
|
||||
bool dest_trans_empty = !dest_trans || dest_trans->empty();
|
||||
if (is_stuttering_transition || (dest_trans_empty
|
||||
&& (!dest_is_livelock_accepting)))
|
||||
{
|
||||
|
|
@ -324,7 +319,7 @@ namespace spot
|
|||
state_ta_explicit::transitions::iterator it_trans;
|
||||
// We don't destroy the transitions in the state's destructor because
|
||||
// they are not cloned.
|
||||
if (trans != 0)
|
||||
if (trans)
|
||||
for (it_trans = trans->begin(); it_trans != trans->end(); ++it_trans)
|
||||
{
|
||||
delete *it_trans;
|
||||
|
|
@ -339,7 +334,7 @@ namespace spot
|
|||
++i;
|
||||
}
|
||||
|
||||
transitions_ = 0;
|
||||
transitions_ = nullptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
|
|
@ -356,7 +351,7 @@ namespace spot
|
|||
get_dict()->register_all_variables_of(&tgba_, this);
|
||||
acc().add_sets(n_acc);
|
||||
acc().set_generalized_buchi();
|
||||
if (artificial_initial_state != 0)
|
||||
if (artificial_initial_state)
|
||||
{
|
||||
state_ta_explicit* is = add_state(artificial_initial_state);
|
||||
assert(is == artificial_initial_state);
|
||||
|
|
@ -396,7 +391,7 @@ namespace spot
|
|||
condition = get_state_condition(s);
|
||||
std::pair<ta::states_set_t::iterator, bool> add_state =
|
||||
initial_states_set_.insert(s);
|
||||
if (get_artificial_initial_state() != 0)
|
||||
if (get_artificial_initial_state())
|
||||
if (add_state.second)
|
||||
{
|
||||
state_ta_explicit* i =
|
||||
|
|
@ -524,7 +519,7 @@ namespace spot
|
|||
state_ta_explicit::transitions* trans = source->get_transitions();
|
||||
state_ta_explicit::transitions::iterator it_trans;
|
||||
|
||||
if (trans != 0)
|
||||
if (trans)
|
||||
for (it_trans = trans->begin(); it_trans != trans->end();)
|
||||
{
|
||||
if (source->get_tgba_condition()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -42,7 +42,7 @@ namespace spot
|
|||
public:
|
||||
ta_explicit(const const_twa_ptr& tgba,
|
||||
unsigned n_acc,
|
||||
state_ta_explicit* artificial_initial_state = 0);
|
||||
state_ta_explicit* artificial_initial_state = nullptr);
|
||||
|
||||
const_twa_ptr
|
||||
get_tgba() const;
|
||||
|
|
@ -145,8 +145,10 @@ namespace spot
|
|||
typedef std::list<transition*> transitions;
|
||||
|
||||
state_ta_explicit(const state* tgba_state, const bdd tgba_condition,
|
||||
bool is_initial_state = false, bool is_accepting_state = false,
|
||||
bool is_livelock_accepting_state = false, transitions* trans = 0) :
|
||||
bool is_initial_state = false,
|
||||
bool is_accepting_state = false,
|
||||
bool is_livelock_accepting_state = false,
|
||||
transitions* trans = nullptr) :
|
||||
tgba_state_(tgba_state), tgba_condition_(tgba_condition),
|
||||
is_initial_state_(is_initial_state), is_accepting_state_(
|
||||
is_accepting_state), is_livelock_accepting_state_(
|
||||
|
|
@ -252,10 +254,10 @@ namespace spot
|
|||
typedef std::shared_ptr<ta_explicit> ta_explicit_ptr;
|
||||
typedef std::shared_ptr<const ta_explicit> const_ta_explicit_ptr;
|
||||
|
||||
inline ta_explicit_ptr make_ta_explicit(const const_twa_ptr& tgba,
|
||||
unsigned n_acc,
|
||||
state_ta_explicit*
|
||||
artificial_initial_state = 0)
|
||||
inline ta_explicit_ptr
|
||||
make_ta_explicit(const const_twa_ptr& tgba,
|
||||
unsigned n_acc,
|
||||
state_ta_explicit* artificial_initial_state = nullptr)
|
||||
{
|
||||
return std::make_shared<ta_explicit>(tgba, n_acc, artificial_initial_state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2011, 2012, 2014 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// Copyright (C) 2011, 2012, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -74,18 +74,18 @@ namespace spot
|
|||
kripke_source_condition = kripke_->state_condition(s->get_kripke_state());
|
||||
|
||||
kripke_succ_it_ = kripke_->succ_iter(s->get_kripke_state());
|
||||
kripke_current_dest_state = 0;
|
||||
ta_succ_it_ = 0;
|
||||
current_state_ = 0;
|
||||
kripke_current_dest_state = nullptr;
|
||||
ta_succ_it_ = nullptr;
|
||||
current_state_ = nullptr;
|
||||
}
|
||||
|
||||
ta_succ_iterator_product::~ta_succ_iterator_product()
|
||||
{
|
||||
delete current_state_;
|
||||
current_state_ = 0;
|
||||
current_state_ = nullptr;
|
||||
delete ta_succ_it_;
|
||||
delete kripke_succ_it_;
|
||||
if (kripke_current_dest_state != 0)
|
||||
if (kripke_current_dest_state)
|
||||
kripke_current_dest_state->destroy();
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ namespace spot
|
|||
if (ta_succ_it_->done())
|
||||
{
|
||||
delete ta_succ_it_;
|
||||
ta_succ_it_ = 0;
|
||||
ta_succ_it_ = nullptr;
|
||||
next_kripke_dest();
|
||||
}
|
||||
}
|
||||
|
|
@ -108,14 +108,14 @@ namespace spot
|
|||
if (!kripke_succ_it_)
|
||||
return;
|
||||
|
||||
if (kripke_current_dest_state == 0)
|
||||
if (!kripke_current_dest_state)
|
||||
{
|
||||
kripke_succ_it_->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
kripke_current_dest_state->destroy();
|
||||
kripke_current_dest_state = 0;
|
||||
kripke_current_dest_state = nullptr;
|
||||
kripke_succ_it_->next();
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ namespace spot
|
|||
if (kripke_succ_it_->done())
|
||||
{
|
||||
delete kripke_succ_it_;
|
||||
kripke_succ_it_ = 0;
|
||||
kripke_succ_it_ = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ namespace spot
|
|||
ta_succ_iterator_product::next()
|
||||
{
|
||||
delete current_state_;
|
||||
current_state_ = 0;
|
||||
current_state_ = nullptr;
|
||||
if (is_stuttering_transition())
|
||||
{
|
||||
next_kripke_dest();
|
||||
|
|
@ -275,7 +275,7 @@ namespace spot
|
|||
spot::state* artificial_initial_state =
|
||||
ta_->get_artificial_initial_state();
|
||||
|
||||
if (artificial_initial_state != 0)
|
||||
if (artificial_initial_state)
|
||||
{
|
||||
ta_succ_iterator* ta_init_it_ = ta_->succ_iter(
|
||||
artificial_initial_state, kripke_init_state_condition);
|
||||
|
|
@ -294,8 +294,8 @@ namespace spot
|
|||
for (it = ta_init_states_set.begin(); it != ta_init_states_set.end(); ++it)
|
||||
{
|
||||
|
||||
if ((artificial_initial_state != 0) || (kripke_init_state_condition
|
||||
== ta_->get_state_condition(*it)))
|
||||
if (artificial_initial_state ||
|
||||
(kripke_init_state_condition == ta_->get_state_condition(*it)))
|
||||
{
|
||||
state_ta_product* stp = new state_ta_product((*it),
|
||||
kripke_init_state->clone());
|
||||
|
|
@ -422,14 +422,14 @@ namespace spot
|
|||
if (!kripke_succ_it_)
|
||||
return;
|
||||
|
||||
if (kripke_current_dest_state == 0)
|
||||
if (!kripke_current_dest_state)
|
||||
{
|
||||
kripke_succ_it_->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
kripke_current_dest_state->destroy();
|
||||
kripke_current_dest_state = 0;
|
||||
kripke_current_dest_state = nullptr;
|
||||
kripke_succ_it_->next();
|
||||
}
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ namespace spot
|
|||
if (kripke_succ_it_->done())
|
||||
{
|
||||
delete kripke_succ_it_;
|
||||
kripke_succ_it_ = 0;
|
||||
kripke_succ_it_ = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -66,10 +66,9 @@ namespace spot
|
|||
typedef std::shared_ptr<tgta_explicit> tgta_explicit_ptr;
|
||||
typedef std::shared_ptr<const tgta_explicit> const_tgta_explicit_ptr;
|
||||
|
||||
inline tgta_explicit_ptr make_tgta_explicit(const const_twa_ptr& tgba,
|
||||
unsigned n_acc,
|
||||
state_ta_explicit*
|
||||
artificial_initial_state = 0)
|
||||
inline tgta_explicit_ptr
|
||||
make_tgta_explicit(const const_twa_ptr& tgba, unsigned n_acc,
|
||||
state_ta_explicit* artificial_initial_state = nullptr)
|
||||
{
|
||||
return std::make_shared<tgta_explicit>(tgba, n_acc,
|
||||
artificial_initial_state);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012, 2014 Laboratoire de Recherche et Développement
|
||||
// de l Epita (LRDE).
|
||||
// Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -81,11 +81,11 @@ namespace spot
|
|||
|
||||
state * tgta_init_state = tgta_->get_init_state();
|
||||
if ((s->right())->compare(tgta_init_state) == 0)
|
||||
source_ = 0;
|
||||
source_ = nullptr;
|
||||
|
||||
if (source_ == 0)
|
||||
if (!source_)
|
||||
{
|
||||
kripke_succ_it_ = 0;
|
||||
kripke_succ_it_ = nullptr;
|
||||
kripke_current_dest_state = kripke_->get_init_state();
|
||||
current_condition_
|
||||
= kripke_->state_condition(kripke_current_dest_state);
|
||||
|
|
@ -101,23 +101,23 @@ namespace spot
|
|||
{
|
||||
kripke_source_condition = kripke_->state_condition(s->left());
|
||||
kripke_succ_it_ = kripke_->succ_iter(s->left());
|
||||
kripke_current_dest_state = 0;
|
||||
tgta_succ_it_ = 0;
|
||||
kripke_current_dest_state = nullptr;
|
||||
tgta_succ_it_ = nullptr;
|
||||
}
|
||||
|
||||
tgta_init_state->destroy();
|
||||
current_state_ = 0;
|
||||
current_state_ = nullptr;
|
||||
}
|
||||
|
||||
tgta_succ_iterator_product::~tgta_succ_iterator_product()
|
||||
{
|
||||
// ta_->free_state(current_state_);
|
||||
if (current_state_ != 0)
|
||||
if (current_state_)
|
||||
current_state_->destroy();
|
||||
current_state_ = 0;
|
||||
current_state_ = nullptr;
|
||||
delete tgta_succ_it_;
|
||||
delete kripke_succ_it_;
|
||||
if (kripke_current_dest_state != 0)
|
||||
if (kripke_current_dest_state)
|
||||
kripke_current_dest_state->destroy();
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ namespace spot
|
|||
if (tgta_succ_it_->done())
|
||||
{
|
||||
delete tgta_succ_it_;
|
||||
tgta_succ_it_ = 0;
|
||||
tgta_succ_it_ = nullptr;
|
||||
next_kripke_dest();
|
||||
}
|
||||
}
|
||||
|
|
@ -140,14 +140,14 @@ namespace spot
|
|||
if (!kripke_succ_it_)
|
||||
return;
|
||||
|
||||
if (kripke_current_dest_state == 0)
|
||||
if (!kripke_current_dest_state)
|
||||
{
|
||||
kripke_succ_it_->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
kripke_current_dest_state->destroy();
|
||||
kripke_current_dest_state = 0;
|
||||
kripke_current_dest_state = nullptr;
|
||||
kripke_succ_it_->next();
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ namespace spot
|
|||
if (kripke_succ_it_->done())
|
||||
{
|
||||
delete kripke_succ_it_;
|
||||
kripke_succ_it_ = 0;
|
||||
kripke_succ_it_ = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ namespace spot
|
|||
tgta_succ_iterator_product::next()
|
||||
{
|
||||
current_state_->destroy();
|
||||
current_state_ = 0;
|
||||
current_state_ = nullptr;
|
||||
|
||||
step_();
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ namespace spot
|
|||
bool
|
||||
tgta_succ_iterator_product::done() const
|
||||
{
|
||||
if (source_ == 0)
|
||||
if (!source_)
|
||||
{
|
||||
return !tgta_succ_it_ || tgta_succ_it_->done();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue