fixed more warnings

This commit is contained in:
Jez Higgins 2010-01-10 22:02:43 +00:00
parent 2e82578767
commit 36a305d55b
15 changed files with 69 additions and 68 deletions

View file

@ -23,7 +23,7 @@ public:
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "test", true, 0. 0 },
static const ValueRule rules[] = { { "test", true, 0, 0 },
{ 0, false, 0, 0 } };
std::string test = gatherAttributes(qName, atts, rules)["test"];

View file

@ -20,13 +20,13 @@ public:
} // ForEachHandler
protected:
virtual ForEach* createContainer(const std::string& namespaceURI,
const std::string& localName,
virtual ForEach* createContainer(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "select", true, 0 },
{ 0, false, 0} };
static const ValueRule rules[] = { { "select", true, 0, 0 },
{ 0, false, 0, 0 } };
std::string select = gatherAttributes(qName, atts, rules)["select"];
return new ForEach(context().xpath_expression(select));
@ -39,6 +39,7 @@ protected:
{
if((namespaceURI == StylesheetConstant::NamespaceURI()) &&
(localName == "sort"))
{
if(!done_sort_)
{
context().push(0,
@ -51,6 +52,7 @@ protected:
}
else
throw SAX::SAXException("xsl:sort must immediately follow xsl:for-each");
} // if ...
done_sort_ = true;
return ItemContainerHandler<ForEach>::createChild(namespaceURI, localName, qName, atts);
} // createChild

View file

@ -15,17 +15,17 @@ public:
{
} // ForeignElementHandler
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */,
const SAX::Attributes<std::string>& /* atts */)
{
++depth_;
} // startElement
virtual void endElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName)
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
if(--depth_ == 0)
context_.pop();

View file

@ -17,13 +17,13 @@ public:
{
} // IfHandler
virtual If* createContainer(const std::string& namespaceURI,
const std::string& localName,
virtual If* createContainer(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "test", true, 0 },
{ 0, false, 0} };
static const ValueRule rules[] = { { "test", true, 0, 0 },
{ 0, false, 0, 0 } };
std::string test = gatherAttributes(qName, atts, rules)["test"];
return new If(ItemContainerHandler<If>::context().xpath_expression(test));

View file

@ -51,7 +51,6 @@ public:
if(no_content_)
throw SAX::SAXException("xsl:include must be empty");
bool start_pass_through = false;
if(namespaceURI == StylesheetConstant::NamespaceURI())
{
if(localName == "import")
@ -121,8 +120,8 @@ public:
private:
std::string validate_href(const std::string& qName, const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "href", true, 0 },
{ 0, false, 0 } };
static const ValueRule rules[] = { { "href", true, 0, 0 },
{ 0, false, 0, 0 } };
std::string href = gatherAttributes(qName, atts, rules)["href"];
no_content_ = true;
// std::cout << "Base : " << context_->currentBase() << ", href : " << href << "\n";
@ -171,8 +170,8 @@ private:
current_includes_.pop_back();
} // include_stylesheet
SAX::DefaultHandler<std::string>* compiler_;
CompilationContext* context_;
SAX::DefaultHandler<std::string>* compiler_;
bool no_content_;
typedef std::vector<std::string> HrefStack;

View file

@ -25,7 +25,7 @@ protected:
const SAX::Attributes<std::string>& atts)
{
std::vector<InlineAttribute> inlineAtts;
for(unsigned int i = 0; i != atts.getLength(); ++i)
for(int i = 0; i != atts.getLength(); ++i)
{
if(atts.getQName(i).find("xmlns:") == 0)
continue;

View file

@ -55,9 +55,9 @@ public:
throw SAX::SAXException(qName + " <- Sorry, don't know about that yet :)");
} // startElement
virtual void endElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName)
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
context_.parentContainer().add_item(container_);
context_.pop();

View file

@ -18,18 +18,18 @@ public:
{
} // KeyHandler
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
if(key_ != 0)
throw SAX::SAXException(qName + " can not contain elements");
static const ValueRule rules[] = { { "name", true, 0 },
{ "match", true, 0 },
{ "use", true, 0 },
{ 0, false, 0 } };
static const ValueRule rules[] = { { "name", true, 0, 0 },
{ "match", true, 0, 0 },
{ "use", true, 0, 0 },
{ 0, false, 0, 0 } };
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
name_ = context_.processInternalQName(attrs["name"]).clarkName();
@ -39,9 +39,9 @@ public:
key_ = new Key(matches, use);
} // startElement
virtual void endElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName)
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
context_.stylesheet().add_key(name_, key_);
context_.pop();

View file

@ -18,13 +18,13 @@ public:
} // MessageHandler
protected:
virtual Message* createContainer(const std::string& namespaceURI,
const std::string& localName,
virtual Message* createContainer(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "terminate", false, No, AllowedYesNo },
{ 0, false, 0} };
{ 0, false, 0, 0 } };
return new Message(gatherAttributes(qName, atts, rules)["terminate"] == Yes);
} // createContainer
}; // class MessageHandler

View file

@ -17,16 +17,16 @@ public:
{
} // NamespaceAliasHandler
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
if(!done_)
{
static const ValueRule rules[] = { { "stylesheet-prefix", true, 0 },
{ "result-prefix", true, 0 },
{ 0, false, 0} };
static const ValueRule rules[] = { { "stylesheet-prefix", true, 0, 0 },
{ "result-prefix", true, 0, 0 },
{ 0, false, 0, 0 } };
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
std::string stylesheet_prefix = attrs["stylesheet-prefix"];
@ -52,9 +52,9 @@ public:
throw SAX::SAXException(qName + " can not contain elements");
} // startElement
virtual void endElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName)
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
context_.pop();
} // endElement

View file

@ -16,8 +16,8 @@ public:
{
} // OutputHandler
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
virtual void startElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
@ -25,16 +25,16 @@ public:
{
static const char* AllowedMethods[] = { "xml", "html", "text", 0 };
static const ValueRule rules[] = { { "method", false, "xml", AllowedMethods },
{ "version", false, "1.0" },
{ "encoding", false, "UTF-8" },
{ "version", false, "1.0", 0 },
{ "encoding", false, "UTF-8", 0 },
{ "omit-xml-declaration", false, No, AllowedYesNo },
{ "standalone", false, "", AllowedYesNo },
{ "doctype-public", false, ""},
{ "doctype-system", false, ""},
{ "cdata-section-elements", false, ""},
{ "doctype-public", false, "", 0},
{ "doctype-system", false, "", 0},
{ "cdata-section-elements", false, "", 0},
{ "indent", false, No, AllowedYesNo },
{ "media-type", false, "" },
{ 0, false, 0 } };
{ "media-type", false, "", 0 },
{ 0, false, 0, 0 } };
settings_ = gatherAttributes(qName, atts, rules);
cdataElements_ = extractCDATAElements(settings_["cdata-section-elements"]);
@ -44,9 +44,9 @@ public:
throw SAX::SAXException(qName + " can not contain elements");
} // startElement
virtual void endElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName)
virtual void endElement(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& /* qName */)
{
context_.stylesheet().output_settings(settings_, cdataElements_);
context_.pop();

View file

@ -17,13 +17,13 @@ public:
{
} // ProcessingInstructionHandler
virtual ProcessingInstruction* createContainer(const std::string& namespaceURI,
const std::string& localName,
virtual ProcessingInstruction* createContainer(const std::string& /* namespaceURI */,
const std::string& /* localName */,
const std::string& qName,
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "name", true, 0 },
{ 0, false, 0} };
static const ValueRule rules[] = { { "name", true, 0, 0 },
{ 0, false, 0, 0} };
std::string name = gatherAttributes(qName, atts, rules)["name"];
return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath_attribute_value_template(name));

View file

@ -139,8 +139,8 @@ public:
Arabica::XPath::NodeSetXPathFunction<std::string>(0, 0, args) { }
protected:
virtual Arabica::XPath::NodeSet<std::string> doEvaluate(const DOM::Node<std::string>& context,
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const
virtual Arabica::XPath::NodeSet<std::string> doEvaluate(const DOM::Node<std::string>& /* context */,
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const
{
Arabica::XPath::NodeSet<std::string> set;
set.push_back(executionContext.currentNode());
@ -156,8 +156,8 @@ public:
Arabica::XPath::StringXPathFunction<std::string>(1, 1, args) { }
protected:
virtual std::string doEvaluate(const DOM::Node<std::string>& context,
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const
virtual std::string doEvaluate(const DOM::Node<std::string>& /* context */,
const Arabica::XPath::ExecutionContext<std::string>& /* executionContext */) const
{
// This is a minimal, but I think conformant, implementation
return "";

View file

@ -364,16 +364,16 @@ private:
int buffering_;
bool pending_element_;
int pending_attribute_;
bool pending_text_;
int pending_attribute_;
bool text_mode_;
Output* warning_sink_;
CDATAElements cdataElements_;
std::stack<QName> element_stack_;
std::string target_;
SAX::AttributesImpl<std::string, Arabica::default_string_adaptor<std::string> > atts_;
std::stringstream buffer_;
bool text_mode_;
NamespaceStack namespaceStack_;
Output* warning_sink_;
}; // class Output
} // namespace XSLT

View file

@ -116,7 +116,7 @@ bool operator>(const Precedence& lhs, const Precedence& rhs)
std::ostream& operator<<(std::ostream& os, const Precedence& prec)
{
os << '(' << prec.precedence_[0];
for(int i = 1; i != prec.precedence_.size(); ++i)
for(size_t i = 1; i != prec.precedence_.size(); ++i)
os << ',' << prec.precedence_[i];
os << ')';
return os;