2691: Change return type of Site_set::nsites() from unsigned to std:size_t.

* mln/core/concept/box.hh, * mln/core/concept/site_set.hh, * mln/core/site_set/p_array.hh, * mln/core/site_set/p_complex.hh, * mln/core/site_set/p_faces.hh, * mln/core/site_set/p_graph.hh, * mln/core/site_set/p_image.hh, * mln/core/site_set/p_key.hh, * mln/core/site_set/p_line2d.hh, * mln/core/site_set/p_line_graph.hh, * mln/core/site_set/p_priority.hh, * mln/core/site_set/p_queue.hh, * mln/core/site_set/p_queue_fast.hh, * mln/core/site_set/p_run.hh, * mln/core/site_set/p_set.hh: Update declarations. --- milena/ChangeLog | 21 +++++++++++++++++++++ milena/mln/core/concept/box.hh | 6 +++--- milena/mln/core/concept/site_set.hh | 3 +-- milena/mln/core/site_set/p_array.hh | 4 ++-- milena/mln/core/site_set/p_complex.hh | 4 ++-- milena/mln/core/site_set/p_faces.hh | 4 ++-- milena/mln/core/site_set/p_graph.hh | 4 ++-- milena/mln/core/site_set/p_image.hh | 6 +++--- milena/mln/core/site_set/p_key.hh | 6 +++--- milena/mln/core/site_set/p_line2d.hh | 4 ++-- milena/mln/core/site_set/p_line_graph.hh | 4 ++-- milena/mln/core/site_set/p_priority.hh | 6 +++--- milena/mln/core/site_set/p_queue.hh | 4 ++-- milena/mln/core/site_set/p_queue_fast.hh | 4 ++-- milena/mln/core/site_set/p_run.hh | 6 +++--- milena/mln/core/site_set/p_set.hh | 4 ++-- 16 files changed, 55 insertions(+), 35 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 2c1de6a..b0a73d6 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -12,6 +12,27 @@ * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. +2008-10-26 Guillaume Lazzara <z@lrde.epita.fr> + + Change return type of Site_set::nsites() from unsigned to std:size_t. + + * mln/core/concept/box.hh, + * mln/core/concept/site_set.hh, + * mln/core/site_set/p_array.hh, + * mln/core/site_set/p_complex.hh, + * mln/core/site_set/p_faces.hh, + * mln/core/site_set/p_graph.hh, + * mln/core/site_set/p_image.hh, + * mln/core/site_set/p_key.hh, + * mln/core/site_set/p_line2d.hh, + * mln/core/site_set/p_line_graph.hh, + * mln/core/site_set/p_priority.hh, + * mln/core/site_set/p_queue.hh, + * mln/core/site_set/p_queue_fast.hh, + * mln/core/site_set/p_run.hh, + * mln/core/site_set/p_set.hh: + Update declarations. + 2008-10-24 Roland Levillain <roland@lrde.epita.fr> Fix mln::level::stretch w.r.t. the initialization. diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh index 607372e..aabb8a7 100644 --- a/milena/mln/core/concept/box.hh +++ b/milena/mln/core/concept/box.hh @@ -82,7 +82,7 @@ namespace mln * * \warning This method is final for all box classes. */ - unsigned nsites() const; + std::size_t nsites() const; protected: Box(); @@ -157,12 +157,12 @@ namespace mln template <typename E> inline - unsigned + std::size_t Box<E>::nsites() const { if (! exact(this)->is_valid()) return 0; - unsigned count = 1; + std::size_t count = 1; typedef mln_site(E) P; // Helps g++-3.3.5. for (unsigned i = 0; i < P::dim; ++i) count *= exact(this)->len(i); diff --git a/milena/mln/core/concept/site_set.hh b/milena/mln/core/concept/site_set.hh index 40b288e..dff5a11 100644 --- a/milena/mln/core/concept/site_set.hh +++ b/milena/mln/core/concept/site_set.hh @@ -186,8 +186,7 @@ namespace mln { static void run() { - // FIXME: Return type should be std::size_t. - unsigned (E::*m)() const = & E::nsites; + std::size_t (E::*m)() const = & E::nsites; m = 0; } }; diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh index 7e0a95b..31fa521 100644 --- a/milena/mln/core/site_set/p_array.hh +++ b/milena/mln/core/site_set/p_array.hh @@ -125,7 +125,7 @@ namespace mln void change(const psite& p, const P& new_p); /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Append a point \p p. @@ -383,7 +383,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_array<P>::nsites() const { return vect_.size(); diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh index 7b5e815..5f5c656 100644 --- a/milena/mln/core/site_set/p_complex.hh +++ b/milena/mln/core/site_set/p_complex.hh @@ -149,7 +149,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -236,7 +236,7 @@ namespace mln template <unsigned D, typename G> inline - unsigned + std::size_t p_complex<D, G>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh index 0d79798..5827ad4 100644 --- a/milena/mln/core/site_set/p_faces.hh +++ b/milena/mln/core/site_set/p_faces.hh @@ -120,7 +120,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -212,7 +212,7 @@ namespace mln template <unsigned N, unsigned D, typename P> inline - unsigned + std::size_t p_faces<N, D, P>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_graph.hh b/milena/mln/core/site_set/p_graph.hh index b530152..6146d6f 100644 --- a/milena/mln/core/site_set/p_graph.hh +++ b/milena/mln/core/site_set/p_graph.hh @@ -104,7 +104,7 @@ namespace mln /// Required by the mln::Point_Set concept. /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -208,7 +208,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_graph<P>::nsites() const { return nvertices(); diff --git a/milena/mln/core/site_set/p_image.hh b/milena/mln/core/site_set/p_image.hh index 930de2e..b3d9511 100644 --- a/milena/mln/core/site_set/p_image.hh +++ b/milena/mln/core/site_set/p_image.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -149,7 +149,7 @@ namespace mln private: I ima_; - unsigned nsites_; + std::size_t nsites_; }; @@ -198,7 +198,7 @@ namespace mln template <typename I> inline - unsigned + std::size_t p_image<I>::nsites() const { return nsites_; diff --git a/milena/mln/core/site_set/p_key.hh b/milena/mln/core/site_set/p_key.hh index 4b416be..7b294b9 100644 --- a/milena/mln/core/site_set/p_key.hh +++ b/milena/mln/core/site_set/p_key.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln k_t k_; // Number of sites. - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -245,7 +245,7 @@ namespace mln template <typename K, typename P> inline - unsigned + std::size_t p_key<K,P>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_line2d.hh b/milena/mln/core/site_set/p_line2d.hh index 9ad9549..262c2f0 100644 --- a/milena/mln/core/site_set/p_line2d.hh +++ b/milena/mln/core/site_set/p_line2d.hh @@ -112,7 +112,7 @@ namespace mln /// Give the number of points. - unsigned nsites() const; + std::size_t nsites() const; /// Give the point that begins the line. const point2d& begin() const; @@ -252,7 +252,7 @@ namespace mln } inline - unsigned + std::size_t p_line2d::nsites() const { return arr_.nsites(); diff --git a/milena/mln/core/site_set/p_line_graph.hh b/milena/mln/core/site_set/p_line_graph.hh index b9a3ed0..0cd6680 100644 --- a/milena/mln/core/site_set/p_line_graph.hh +++ b/milena/mln/core/site_set/p_line_graph.hh @@ -109,7 +109,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -196,7 +196,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_line_graph<P>::nsites() const { return nedges(); diff --git a/milena/mln/core/site_set/p_priority.hh b/milena/mln/core/site_set/p_priority.hh index 147dece..3a630cf 100644 --- a/milena/mln/core/site_set/p_priority.hh +++ b/milena/mln/core/site_set/p_priority.hh @@ -114,7 +114,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push in the queue with \p priority the element \p e. @@ -181,7 +181,7 @@ namespace mln util::set<P> p_; q_type_ q_; - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -225,7 +225,7 @@ namespace mln template <typename P, typename Q> inline - unsigned + std::size_t p_priority<P,Q>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_queue.hh b/milena/mln/core/site_set/p_queue.hh index babc994..8692f57 100644 --- a/milena/mln/core/site_set/p_queue.hh +++ b/milena/mln/core/site_set/p_queue.hh @@ -108,7 +108,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -195,7 +195,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue<P>::nsites() const { return q_.size(); diff --git a/milena/mln/core/site_set/p_queue_fast.hh b/milena/mln/core/site_set/p_queue_fast.hh index 199edc4..54f8146 100644 --- a/milena/mln/core/site_set/p_queue_fast.hh +++ b/milena/mln/core/site_set/p_queue_fast.hh @@ -110,7 +110,7 @@ namespace mln bool compute_has(const P& p) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -236,7 +236,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue_fast<P>::nsites() const { mln_invariant(end_ >= begin_); diff --git a/milena/mln/core/site_set/p_run.hh b/milena/mln/core/site_set/p_run.hh index 21644eb..f618d89 100644 --- a/milena/mln/core/site_set/p_run.hh +++ b/milena/mln/core/site_set/p_run.hh @@ -128,7 +128,7 @@ namespace mln bool has_index(unsigned short i) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Give the length of the run. unsigned short length() const; @@ -162,7 +162,7 @@ namespace mln P start_; /// The length of the run. - unsigned short len_; + std::size_t len_; }; @@ -307,7 +307,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_run<P>::nsites() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/site_set/p_set.hh b/milena/mln/core/site_set/p_set.hh index 817d56b..041b4a2 100644 --- a/milena/mln/core/site_set/p_set.hh +++ b/milena/mln/core/site_set/p_set.hh @@ -107,7 +107,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_set<P>::nsites() const { return s_.nelements(); -- 1.5.6.5
participants (1)
-
Guillaume Lazzara