From 0a95a3e57d152f154af5d07d537e0c99b374a20f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Aug 2010 12:07:03 +0200 Subject: Make use of const style consistent --- odb/database.hxx | 10 +++++----- odb/database.txx | 10 +++++----- odb/exception.cxx | 2 +- odb/exception.hxx | 2 +- odb/shared-ptr.hxx | 8 ++++---- odb/shared-ptr/base.cxx | 2 +- odb/shared-ptr/base.hxx | 8 ++++---- odb/shared-ptr/base.ixx | 4 ++-- odb/shared-ptr/base.txx | 32 ++++++++++++++++---------------- 9 files changed, 39 insertions(+), 39 deletions(-) (limited to 'odb') diff --git a/odb/database.hxx b/odb/database.hxx index 0a993d5..1f08daf 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -35,21 +35,21 @@ namespace odb // template typename object_traits::pointer_type - load (typename object_traits::id_type const& id); + load (const typename object_traits::id_type& id); template void - load (typename object_traits::id_type const& id, T& object); + load (const typename object_traits::id_type& id, T& object); // Return NULL/false if not found. // template typename object_traits::pointer_type - find (typename object_traits::id_type const& id); + find (const typename object_traits::id_type& id); template bool - find (typename object_traits::id_type const& id, T& object); + find (const typename object_traits::id_type& id, T& object); // Save the state of a modified objects. // @@ -66,7 +66,7 @@ namespace odb template void - erase (typename object_traits::id_type const& id); + erase (const typename object_traits::id_type& id); // Object query API. // diff --git a/odb/database.txx b/odb/database.txx index bec3234..377df21 100644 --- a/odb/database.txx +++ b/odb/database.txx @@ -26,7 +26,7 @@ namespace odb template typename object_traits::pointer_type database:: - load (typename object_traits::id_type const& id) + load (const typename object_traits::id_type& id) { typedef object_traits traits; @@ -40,7 +40,7 @@ namespace odb template void database:: - load (typename object_traits::id_type const& id, T& obj) + load (const typename object_traits::id_type& id, T& obj) { if (!find (id, obj)) throw object_not_persistent (); @@ -48,7 +48,7 @@ namespace odb template typename object_traits::pointer_type database:: - find (typename object_traits::id_type const& id) + find (const typename object_traits::id_type& id) { if (!transaction::has_current ()) throw not_in_transaction (); @@ -58,7 +58,7 @@ namespace odb template bool database:: - find (typename object_traits::id_type const& id, T& obj) + find (const typename object_traits::id_type& id, T& obj) { if (!transaction::has_current ()) throw not_in_transaction (); @@ -85,7 +85,7 @@ namespace odb template void database:: - erase (typename object_traits::id_type const& id) + erase (const typename object_traits::id_type& id) { if (!transaction::has_current ()) throw not_in_transaction (); diff --git a/odb/exception.cxx b/odb/exception.cxx index 52d8370..330e70a 100644 --- a/odb/exception.cxx +++ b/odb/exception.cxx @@ -9,7 +9,7 @@ namespace odb { - char const* exception:: + const char* exception:: what () const throw () { return typeid (*this).name (); diff --git a/odb/exception.hxx b/odb/exception.hxx index ff3fc63..c8e2f35 100644 --- a/odb/exception.hxx +++ b/odb/exception.hxx @@ -14,7 +14,7 @@ namespace odb { // By default return the exception type name ( typeid (*this).name () ). // - virtual char const* + virtual const char* what () const throw (); }; } diff --git a/odb/shared-ptr.hxx b/odb/shared-ptr.hxx index 7290a00..f6096f7 100644 --- a/odb/shared-ptr.hxx +++ b/odb/shared-ptr.hxx @@ -28,7 +28,7 @@ namespace odb { } - shared_ptr (shared_ptr const& x) + shared_ptr (const shared_ptr& x) : base (x), x_ (x.x_) { if (x_ != 0) @@ -36,7 +36,7 @@ namespace odb } template - shared_ptr (shared_ptr const& x) + shared_ptr (const shared_ptr& x) : base (x), x_ (x.x_) { if (x_ != 0) @@ -44,7 +44,7 @@ namespace odb } shared_ptr& - operator= (shared_ptr const& x) + operator= (const shared_ptr& x) { if (x_ != x.x_) { @@ -63,7 +63,7 @@ namespace odb template shared_ptr& - operator= (shared_ptr const& x) + operator= (const shared_ptr& x) { if (x_ != x.x_) { diff --git a/odb/shared-ptr/base.cxx b/odb/shared-ptr/base.cxx index 11fa1c2..56fc32c 100644 --- a/odb/shared-ptr/base.cxx +++ b/odb/shared-ptr/base.cxx @@ -16,7 +16,7 @@ odb::share exclusive = odb::share (2); // namespace odb { - char const* not_shared:: + const char* not_shared:: what () const throw () { return "object is not shared"; diff --git a/odb/shared-ptr/base.hxx b/odb/shared-ptr/base.hxx index 8c1b62b..6fdc32e 100644 --- a/odb/shared-ptr/base.hxx +++ b/odb/shared-ptr/base.hxx @@ -39,16 +39,16 @@ namespace odb { struct not_shared: exception { - virtual char const* + virtual const char* what () const throw (); }; struct shared_base { shared_base (); - shared_base (shared_base const&); + shared_base (const shared_base&); shared_base& - operator= (shared_base const&); + operator= (const shared_base&); void _inc_ref (); @@ -82,7 +82,7 @@ namespace odb template inline std::size_t - ref_count (X const*); + ref_count (const X*); } #include diff --git a/odb/shared-ptr/base.ixx b/odb/shared-ptr/base.ixx index 992e156..ee27fbe 100644 --- a/odb/shared-ptr/base.ixx +++ b/odb/shared-ptr/base.ixx @@ -30,13 +30,13 @@ namespace odb } inline shared_base:: - shared_base (shared_base const&) + shared_base (const shared_base&) : counter_ (1) { } inline shared_base& shared_base:: - operator= (shared_base const&) + operator= (const shared_base&) { return *this; } diff --git a/odb/shared-ptr/base.txx b/odb/shared-ptr/base.txx index 0f823f8..5cf85f3 100644 --- a/odb/shared-ptr/base.txx +++ b/odb/shared-ptr/base.txx @@ -49,7 +49,7 @@ namespace odb template std::size_t* - counter (X const* p) + counter (const X* p) { return bits::locator::counter (const_cast (p)); } @@ -81,14 +81,14 @@ namespace odb template struct counter_ops { - counter_ops (X const* p) : counter_ (p ? bits::counter (p) : 0) {} - counter_ops (counter_ops const& x) : counter_ (x.counter_) {} + counter_ops (const X* p) : counter_ (p ? bits::counter (p) : 0) {} + counter_ops (const counter_ops& x) : counter_ (x.counter_) {} template - counter_ops (counter_ops const& x) : counter_ (x.counter_) {} + counter_ops (const counter_ops& x) : counter_ (x.counter_) {} counter_ops& - operator= (counter_ops const& x) + operator= (const counter_ops& x) { counter_ = x.counter_; return *this; @@ -96,14 +96,14 @@ namespace odb template counter_ops& - operator= (counter_ops const& x) + operator= (const counter_ops& x) { counter_ = x.counter_; return *this; } void - reset (X const* p) + reset (const X* p) { counter_ = p ? bits::counter (p) : 0; } @@ -125,7 +125,7 @@ namespace odb } std::size_t - count (X const*) const + count (const X*) const { return *counter_; } @@ -136,27 +136,27 @@ namespace odb template struct counter_ops { - counter_ops (Y const*) {} - counter_ops (counter_ops const&) {} + counter_ops (const Y*) {} + counter_ops (const counter_ops&) {} template - counter_ops (counter_ops const&) {} + counter_ops (const counter_ops&) {} counter_ops& - operator= (counter_ops const&) + operator= (const counter_ops&) { return *this; } template counter_ops& - operator= (counter_ops const&) + operator= (const counter_ops&) { return *this; } void - reset (Y const*) {} + reset (const Y*) {} void inc (shared_base* p) {p->_inc_ref ();} @@ -169,7 +169,7 @@ namespace odb } std::size_t - count (shared_base const* p) const {return p->_ref_count ();} + count (const shared_base* p) const {return p->_ref_count ();} }; } @@ -192,7 +192,7 @@ namespace odb template inline std::size_t - ref_count (X const* p) + ref_count (const X* p) { bits::counter_ops::r, X> c (p); return c.count (p); -- cgit v1.1