From 4b3b5d47300f27dfda25caa9deff3f5ab1560cc8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Mar 2014 09:28:37 +0200 Subject: Resolve Clang, GCC warnings --- tests/cxx/tree/naming/camel/driver.cxx | 6 ++++++ tests/cxx/tree/naming/java/driver.cxx | 11 +++++++++++ tests/cxx/tree/naming/knr/driver.cxx | 6 ++++++ xsd/cxx/elements.cxx | 6 +++++- xsd/cxx/parser/element-validation-source.cxx | 25 +++++++++---------------- xsd/cxx/parser/state-processor.cxx | 2 ++ 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/tests/cxx/tree/naming/camel/driver.cxx b/tests/cxx/tree/naming/camel/driver.cxx index fa174d4..bd29a8f 100644 --- a/tests/cxx/tree/naming/camel/driver.cxx +++ b/tests/cxx/tree/naming/camel/driver.cxx @@ -80,6 +80,8 @@ main () Type::BazSequence s; Type::BazIterator i (s.begin ()); Type::BazConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.baz () != s) return 1; @@ -93,6 +95,8 @@ main () Type::AnySequence s (t.domDocument ()); Type::AnyIterator i (s.begin ()); Type::AnyConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any () != s) return 1; @@ -117,6 +121,8 @@ main () Type::AnyAttributeSet s (t.domDocument ()); Type::AnyAttributeIterator i (s.begin ()); Type::AnyAttributeConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.anyAttribute () != s) return 1; diff --git a/tests/cxx/tree/naming/java/driver.cxx b/tests/cxx/tree/naming/java/driver.cxx index 1e4adde..da9e077 100644 --- a/tests/cxx/tree/naming/java/driver.cxx +++ b/tests/cxx/tree/naming/java/driver.cxx @@ -28,6 +28,7 @@ main () { Gender::Value v; v = Gender::female; + XSD_UNUSED (v); } // Anonymous type. @@ -48,6 +49,7 @@ main () // { Type::FooType* p = 0; + XSD_UNUSED (p); Type::FooOptional o; if (t.getFoo ().present ()) @@ -60,6 +62,7 @@ main () // { Type::BarType* p = 0; + XSD_UNUSED (p); if (t.getBar () != "bar") return 1; @@ -71,9 +74,13 @@ main () // { Type::BazType* p = 0; + XSD_UNUSED (p); + Type::BazSequence s; Type::BazIterator i (s.begin ()); Type::BazConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getBaz () != s) return 1; @@ -87,6 +94,8 @@ main () Type::AnySequence s (t.getDomDocument ()); Type::AnyIterator i (s.begin ()); Type::AnyConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getAny () != s) return 1; @@ -111,6 +120,8 @@ main () Type::AnyAttributeSet s (t.getDomDocument ()); Type::AnyAttributeIterator i (s.begin ()); Type::AnyAttributeConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getAnyAttribute () != s) return 1; diff --git a/tests/cxx/tree/naming/knr/driver.cxx b/tests/cxx/tree/naming/knr/driver.cxx index bb980fc..6f3b07f 100644 --- a/tests/cxx/tree/naming/knr/driver.cxx +++ b/tests/cxx/tree/naming/knr/driver.cxx @@ -80,6 +80,8 @@ main () type::baz_sequence s; type::baz_iterator i (s.begin ()); type::baz_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.baz () != s) return 1; @@ -93,6 +95,8 @@ main () type::any_sequence s (t.dom_document ()); type::any_iterator i (s.begin ()); type::any_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any () != s) return 1; @@ -117,6 +121,8 @@ main () type::any_attribute_set s (t.dom_document ()); type::any_attribute_iterator i (s.begin ()); type::any_attribute_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any_attribute () != s) return 1; diff --git a/xsd/cxx/elements.cxx b/xsd/cxx/elements.cxx index 5ee1f28..c72eb13 100644 --- a/xsd/cxx/elements.cxx +++ b/xsd/cxx/elements.cxx @@ -9,6 +9,7 @@ #include #include #include +#include #include using std::wcerr; @@ -861,7 +862,7 @@ namespace CXX } else { - unsigned int count; + unsigned int count (0); unsigned int tmp[4]; if (u < 0x800) @@ -891,7 +892,10 @@ namespace CXX case 1: { tmp[0] = u | utf8_first_char_mask[count]; + break; } + default: + assert (false); } for (unsigned int j (0); j < count; ++j) diff --git a/xsd/cxx/parser/element-validation-source.cxx b/xsd/cxx/parser/element-validation-source.cxx index 1bc506a..7c3f492 100644 --- a/xsd/cxx/parser/element-validation-source.cxx +++ b/xsd/cxx/parser/element-validation-source.cxx @@ -1037,8 +1037,8 @@ namespace CXX Traversal::Compositor, Context { - CompositorPre (Context& c, SemanticGraph::Complex& type) - : Context (c), type_ (type) + CompositorPre (Context& c) + : Context (c) { } @@ -1065,9 +1065,6 @@ namespace CXX << "vd.state = 0;" << "vd.count = 0;"; } - - private: - SemanticGraph::Complex& type_; }; @@ -1253,8 +1250,8 @@ namespace CXX Traversal::Compositor, Context { - CompositorEndElement (Context& c, SemanticGraph::Complex& type) - : Context (c), type_ (type) + CompositorEndElement (Context& c) + : Context (c) { } @@ -1276,9 +1273,6 @@ namespace CXX << "vs.size--;" // pop << endl; } - - private: - SemanticGraph::Complex& type_; }; @@ -1288,8 +1282,8 @@ namespace CXX Traversal::Compositor, Context { - CompositorPost (Context& c, SemanticGraph::Complex& type) - : Context (c), type_ (type), particle_name_ (c) + CompositorPost (Context& c) + : Context (c), particle_name_ (c) { } @@ -1366,7 +1360,6 @@ namespace CXX } private: - SemanticGraph::Complex& type_; ParticleName particle_name_; }; @@ -1499,7 +1492,7 @@ namespace CXX } { - CompositorEndElement t (*this, c); + CompositorEndElement t (*this); t.dispatch (comp); } @@ -1518,7 +1511,7 @@ namespace CXX << endl; { - CompositorPre t (*this, c); + CompositorPre t (*this); t.dispatch (comp); } @@ -1566,7 +1559,7 @@ namespace CXX } { - CompositorPost t (*this, c); + CompositorPost t (*this); t.dispatch (c.contains_compositor ().compositor ()); } diff --git a/xsd/cxx/parser/state-processor.cxx b/xsd/cxx/parser/state-processor.cxx index 8664886..b15c18f 100644 --- a/xsd/cxx/parser/state-processor.cxx +++ b/xsd/cxx/parser/state-processor.cxx @@ -23,6 +23,7 @@ namespace CXX { typedef vector Particles; + /* void print (Particles const& p) { @@ -46,6 +47,7 @@ namespace CXX wcerr << endl; } + */ // // -- cgit v1.1