From 2a6f06ae44a80a5ebdc1b6188b11634fbb0e8741 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Feb 2015 13:51:23 +0200 Subject: Fix to use traditional const style --- common/callback/driver.cxx | 4 ++-- common/composite-id/test.hxx | 32 ++++++++++++++++---------------- common/container/basics/test.hxx | 2 +- common/optimistic/test.hxx | 2 +- common/relationship/query/test.hxx | 2 +- common/threads/driver.cxx | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 12 ++++++------ common/virtual/test.hxx | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) (limited to 'common') diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index b85729c..8cc918d 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -115,7 +115,7 @@ main (int argc, char* argv[]) o1->data++; o2->data++; db->update (o1.get ()); - db->update (static_cast (*o2)); + db->update (static_cast (*o2)); t.commit (); } cout << "***" << endl; @@ -127,7 +127,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); auto_ptr o1 (db->load (1)); auto_ptr o2 (db->load (2)); - db->erase (static_cast (o1.get ())); + db->erase (static_cast (o1.get ())); db->erase (*o2); t.commit (); } diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index be5d45a..427a162 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -14,7 +14,7 @@ struct scomp { scomp () {} - scomp (std::string const& s1, std::string const& s2, std::string const& s3) + scomp (const std::string& s1, const std::string& s2, const std::string& s3) : str1 (s1), str2 (s2), str3 (s3) { } @@ -75,7 +75,7 @@ namespace test1 struct object { object () {} - object (scomp const& i, unsigned long n): id (i), num (n) {} + object (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; @@ -101,7 +101,7 @@ namespace test2 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -111,7 +111,7 @@ namespace test2 struct object2 { object2 (): o1 (0) {} - object2 (ncomp const& i): id (i), o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} ~object2 () {delete o1;} #pragma db id @@ -124,7 +124,7 @@ namespace test2 struct object3 { object3 () {} - object3 (ncomp const& i): id (i) {} + object3 (const ncomp& i): id (i) {} ~object3 () { @@ -155,7 +155,7 @@ namespace test2 struct object4 { object4 () {} - object4 (ncomp const& i): id (i) {} + object4 (const ncomp& i): id (i) {} #pragma db id ncomp id; @@ -208,7 +208,7 @@ namespace test3 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -221,7 +221,7 @@ namespace test3 struct object2 { object2 (): o1 (0) {} - object2 (ncomp const& i): id (i), o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} ~object2 () {delete o1;} #pragma db id @@ -252,7 +252,7 @@ namespace test4 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -265,7 +265,7 @@ namespace test4 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -302,7 +302,7 @@ namespace test5 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -314,7 +314,7 @@ namespace test5 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -352,7 +352,7 @@ namespace test6 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -364,7 +364,7 @@ namespace test6 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -400,7 +400,7 @@ namespace test7 struct object { object () {} - object (scomp const& i, unsigned long n): id (i), num (n) {} + object (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; @@ -427,7 +427,7 @@ namespace test8 struct object1 { object1 () {} - object1 (scomp const& i, unsigned long n): id (i), num (n) {} + object1 (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 8ac8290..b2dd4b4 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -71,7 +71,7 @@ typedef std::map comp_str_map; struct comp_hash { std::size_t - operator() (comp const& x) const {return nh (x.num) + sh (x.str);} + operator() (const comp& x) const {return nh (x.num) + sh (x.str);} std::hash nh; std::hash sh; diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 81d41e4..b9c04cc 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -38,7 +38,7 @@ struct object_version struct container { container (): ver (123) {} - container (std::string const& id): id_ (id), ver (123) {} + container (const std::string& id): id_ (id), ver (123) {} #pragma db id std::string id_; diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 7375e2d..1b8bbe8 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -132,7 +132,7 @@ struct employer #pragma db object pointer(shared_ptr) struct country { - country (const std::string& c, std::string const& n) + country (const std::string& c, const std::string& n) : code (c), name (n) { } diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index f1a83d5..bf12707 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -96,7 +96,7 @@ struct task t.commit (); break; } - catch (deadlock const&) {} + catch (const deadlock&) {} } for (unsigned long j (0); j < sub_iteration_count; ++j) diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index f568d6c..7af255c 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -19,7 +19,7 @@ struct employer; #pragma db object struct country { - country (const std::string& c, std::string const& n) + country (const std::string& c, const std::string& n) : code (c), name (n) { } diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index e1eaed0..c91b8ef 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -188,7 +188,7 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view5 const& v (*i); + const view5& v (*i); assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && @@ -196,7 +196,7 @@ main (int argc, char* argv[]) } assert (++i != r.end ()); { - view5 const& v (*i); + const view5& v (*i); assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && @@ -419,12 +419,12 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view1 const& v (*i); + const view1& v (*i); assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); } assert (++i != r.end ()); { - view1 const& v (*i); + const view1& v (*i); assert (v.o1->n == 234 && !v.o2); } assert (++i == r.end ()); @@ -454,12 +454,12 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view2 const& v (*i); + const view2& v (*i); assert (v.o3->n == 123 && v.o4->s == "abc" && v.o4->o3 == v.o3); } assert (++i != r.end ()); { - view2 const& v (*i); + const view2& v (*i); assert (v.o3->n == 234 && !v.o4); } assert (++i == r.end ()); diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index 69eaa7e..cf4db0f 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -145,7 +145,7 @@ namespace test3 struct name { name () {} - name (std::string const& f, std::string const& l) + name (const std::string& f, const std::string& l) : first (f), last(l) {} std::string first; -- cgit v1.1