variable initialization inside a switch case does not compile on some versions of gcc; fixed
This commit is contained in:
parent
75c77d8a3a
commit
3bc21101aa
|
@ -353,16 +353,18 @@ xmlpp::Node *
|
||||||
OptionsContainer :: createNode(OptionItemString optionItem) throw ()
|
OptionsContainer :: createNode(OptionItemString optionItem) throw ()
|
||||||
{
|
{
|
||||||
xmlpp::Element * rootNode = optionsDocument.get_root_node();
|
xmlpp::Element * rootNode = optionsDocument.get_root_node();
|
||||||
|
xmlpp::Element * element = 0;
|
||||||
|
xmlpp::Node * attribute = 0;
|
||||||
|
|
||||||
// only supports the serialDeviceName option item, for now
|
// only supports the serialDeviceName option item, for now
|
||||||
switch (optionItem) {
|
switch (optionItem) {
|
||||||
case serialDeviceName :
|
case serialDeviceName :
|
||||||
xmlpp::Element * element = dynamic_cast<xmlpp::Element*>(
|
element = dynamic_cast<xmlpp::Element*>(
|
||||||
getNode("serialPort"));
|
getNode("serialPort"));
|
||||||
if (!element) {
|
if (!element) {
|
||||||
element = rootNode->add_child("serialPort");
|
element = rootNode->add_child("serialPort");
|
||||||
}
|
}
|
||||||
xmlpp::Node * attribute = dynamic_cast<xmlpp::Attribute*>(
|
attribute = dynamic_cast<xmlpp::Attribute*>(
|
||||||
getNode("serialPort/@path"));
|
getNode("serialPort/@path"));
|
||||||
if (!attribute) {
|
if (!attribute) {
|
||||||
attribute = element->set_attribute("path", "");
|
attribute = element->set_attribute("path", "");
|
||||||
|
|
Loading…
Reference in New Issue