From b8258ac6380ae5e8b13daad21ff06c9dcdbcfe6b Mon Sep 17 00:00:00 2001 From: Etienne Renault Date: Tue, 26 Sep 2017 17:54:07 +0200 Subject: [PATCH] twacube: move useless unsigned int to unsigned * spot/twacube/twacube.cc, spot/twacube/twacube.hh: here. --- spot/twacube/twacube.cc | 26 +++++++++++++------------- spot/twacube/twacube.hh | 32 ++++++++++++++++---------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/spot/twacube/twacube.cc b/spot/twacube/twacube.cc index c0fdfbf23..3864c0c2b 100644 --- a/spot/twacube/twacube.cc +++ b/spot/twacube/twacube.cc @@ -25,14 +25,14 @@ namespace spot cstate::cstate(cstate&& s) noexcept: id_(std::move(s.id_)) { } - cstate::cstate(unsigned int id): id_(id) + cstate::cstate(unsigned id): id_(id) { } cstate::~cstate() { } - unsigned int cstate::label() + unsigned cstate::label() { return id_; } @@ -60,7 +60,7 @@ namespace spot twacube::~twacube() { spot::cubeset cs = get_cubeset(); - for (unsigned int i = 1; i <= theg_.num_edges(); ++i) + for (unsigned i = 1; i <= theg_.num_edges(); ++i) cs.release(theg_.edge_data(i).cube_); } @@ -79,17 +79,17 @@ namespace spot return aps_; } - unsigned int twacube::new_state() + unsigned twacube::new_state() { return theg_.new_state(); } - void twacube::set_initial(unsigned int init) + void twacube::set_initial(unsigned init) { init_ = init; } - unsigned int twacube::get_initial() + unsigned twacube::get_initial() { if (theg_.num_states() == 0) new_state(); @@ -97,14 +97,14 @@ namespace spot return init_; } - cstate* twacube::state_from_int(unsigned int i) + cstate* twacube::state_from_int(unsigned i) { return &theg_.state_data(i); } void - twacube::create_transition(unsigned int src, const cube& cube, - const acc_cond::mark_t& mark, unsigned int dst) + twacube::create_transition(unsigned src, const cube& cube, + const acc_cond::mark_t& mark, unsigned dst) { theg_.new_edge(src, dst, cube, mark); } @@ -118,10 +118,10 @@ namespace spot bool twacube::succ_contiguous() const { - unsigned int i = 1; + unsigned i = 1; while (i <= theg_.num_edges()) { - unsigned int j = i; + unsigned j = i; // Walk first bucket of successors while (j <= theg_.num_edges() && @@ -129,7 +129,7 @@ namespace spot ++j; // Remove the next bucket - unsigned int itmp = j; + unsigned itmp = j; // Look if there are some transitions missing in this bucket. while (j <= theg_.num_edges()) @@ -148,7 +148,7 @@ namespace spot { spot::cubeset cs = twa.get_cubeset(); os << "init : " << twa.init_ << '\n'; - for (unsigned int i = 1; i <= twa.theg_.num_edges(); ++i) + for (unsigned i = 1; i <= twa.theg_.num_edges(); ++i) os << twa.theg_.edge_storage(i).src << "->" << twa.theg_.edge_storage(i).dst << " : " << cs.dump(twa.theg_.edge_data(i).cube_, twa.aps_) diff --git a/spot/twacube/twacube.hh b/spot/twacube/twacube.hh index 0000d478a..8d69f74e3 100644 --- a/spot/twacube/twacube.hh +++ b/spot/twacube/twacube.hh @@ -36,11 +36,11 @@ namespace spot cstate() {} cstate(const cstate& s) = delete; cstate(cstate&& s) noexcept; - cstate(unsigned int id); + cstate(unsigned id); virtual ~cstate(); - unsigned int label(); + unsigned label(); private: - unsigned int id_; + unsigned id_; }; /// \brief Class for representing a transition. @@ -64,7 +64,7 @@ namespace spot typedef graph_t::edge_storage_t edge_storage_t; trans_index(trans_index& ci) = delete; - trans_index(unsigned int state, graph_t& g): + trans_index(unsigned state, graph_t& g): st_(g.state_storage(state)) { reset(); @@ -97,7 +97,7 @@ namespace spot /// \brief Returns the current transition according to a specific /// \a seed. The \a seed is traditionnally the thread identifier. - inline unsigned int current(unsigned int seed = 0) const + inline unsigned current(unsigned seed = 0) const { // no-swarming : since twacube are dedicated for parallelism, i.e. // swarming, we expect swarming is activated. @@ -114,7 +114,7 @@ namespace spot } private: - unsigned int idx_; ///< The current transition + unsigned idx_; ///< The current transition const graph_t::state_storage_t& st_; ///< The underlying states }; @@ -137,23 +137,23 @@ namespace spot std::vector get_ap(); /// \brief This method creates a new state. - unsigned int new_state(); + unsigned new_state(); /// \brief Updates the initial state to \a init - void set_initial(unsigned int init); + void set_initial(unsigned init); /// \brief Returns the id of the initial state in the automaton. - unsigned int get_initial(); + unsigned get_initial(); /// \brief Accessor for a state from its id. - cstate* state_from_int(unsigned int i); + cstate* state_from_int(unsigned i); /// \brief create a transition between state \a src and state \a dst, /// using \a cube as the labelling cube and \a mark as the acceptance mark. - void create_transition(unsigned int src, + void create_transition(unsigned src, const cube& cube, const acc_cond::mark_t& mark, - unsigned int dst); + unsigned dst); /// \brief Accessor the cube's manipulator. const cubeset& get_cubeset() const; @@ -175,20 +175,20 @@ namespace spot /// \brief Returns the storage associated to a transition. const graph_t::edge_storage_t& trans_storage(std::shared_ptr ci, - unsigned int seed = 0) const + unsigned seed = 0) const { return theg_.edge_storage(ci->current(seed)); } /// \brief Returns the data associated to a transition. const transition& trans_data(std::shared_ptr ci, - unsigned int seed = 0) const + unsigned seed = 0) const { return theg_.edge_data(ci->current(seed)); } ///< \brief Returns the successor of state \a i. - std::shared_ptr succ(unsigned int i) + std::shared_ptr succ(unsigned i) { return std::make_shared(i, theg_); } @@ -196,7 +196,7 @@ namespace spot friend SPOT_API std::ostream& operator<<(std::ostream& os, const twacube& twa); private: - unsigned int init_; ///< The Id of the initial state + unsigned init_; ///< The Id of the initial state acc_cond acc_; ///< The acceptance contidion const std::vector aps_; ///< The name of atomic propositions graph_t theg_; ///< The underlying graph