aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-03-19 09:28:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-03-19 09:28:37 +0200
commit4b3b5d47300f27dfda25caa9deff3f5ab1560cc8 (patch)
treedeb7e1c36bd53f221e669bdd98eb45a45ef5d363
parent2ff19bd5b0ab8bb13a94177ca6c172ae42e7d534 (diff)
Resolve Clang, GCC warnings
-rw-r--r--tests/cxx/tree/naming/camel/driver.cxx6
-rw-r--r--tests/cxx/tree/naming/java/driver.cxx11
-rw-r--r--tests/cxx/tree/naming/knr/driver.cxx6
-rw-r--r--xsd/cxx/elements.cxx6
-rw-r--r--xsd/cxx/parser/element-validation-source.cxx25
-rw-r--r--xsd/cxx/parser/state-processor.cxx2
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 <memory>
#include <sstream>
#include <fstream>
+#include <cassert>
#include <iostream>
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<SemanticGraph::Particle*> Particles;
+ /*
void
print (Particles const& p)
{
@@ -46,6 +47,7 @@ namespace CXX
wcerr << endl;
}
+ */
//
//