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 --- xsd/cxx/elements.cxx | 6 +++++- xsd/cxx/parser/element-validation-source.cxx | 25 +++++++++---------------- xsd/cxx/parser/state-processor.cxx | 2 ++ 3 files changed, 16 insertions(+), 17 deletions(-) (limited to 'xsd/cxx') 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