Commit 8d9c9808 authored by David E. DeMarle's avatar David E. DeMarle

Merge branch 'string-plus-int-fixes' into 'master'

warnings: avoid string + int and use stringstream instead

See merge request !51
parents fba8d541 408900ac
......@@ -28,6 +28,8 @@
#include "XdmfAttributeType.hpp"
#include "XdmfError.hpp"
#include "XdmfArray.hpp"
#include <sstream>
//-----------------------------------------------------------------------------
XDMF_CHILDREN_IMPLEMENTATION(XdmfAttribute, XdmfArray, AuxiliaryArray, Name)
//-----------------------------------------------------------------------------
......@@ -350,8 +352,11 @@ void XdmfAttributeSetCenter(XDMFATTRIBUTE * attribute, int center, int * status)
((XdmfAttribute *)attribute)->setCenter(XdmfAttributeCenter::Node());
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Attribute Center: Code " + center);
{
std::stringstream sstr;
sstr << "Error: Invalid Attribute Center: Code " << center;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
XDMF_ERROR_WRAP_END(status)
......@@ -383,8 +388,11 @@ void XdmfAttributeSetType(XDMFATTRIBUTE * attribute, int type, int * status)
((XdmfAttribute *)attribute)->setType(XdmfAttributeType::NoAttributeType());
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Attribute Type: Code " + type);
{
std::stringstream sstr;
sstr << "Error: Invalid Attribute Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
XDMF_ERROR_WRAP_END(status)
......
......@@ -27,6 +27,8 @@
#include "XdmfFunction.hpp"
#include <boost/tokenizer.hpp>
#include <sstream>
shared_ptr<XdmfGeometry> XdmfGeometry::New()
{
shared_ptr<XdmfGeometry> p(new XdmfGeometry());
......@@ -342,8 +344,11 @@ void XdmfGeometrySetType(XDMFGEOMETRY * geometry, int type, int * status)
((XdmfGeometry *) geometry)->setType(XdmfGeometryType::Spherical());
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Geometry Type: Code " + type);
{
std::stringstream sstr;
sstr << "Error: Invalid Geometry Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
XDMF_ERROR_WRAP_END(status)
......
......@@ -26,6 +26,8 @@
#include "XdmfError.hpp"
#include "string.h"
#include <sstream>
std::map<std::string, shared_ptr<const XdmfGeometryType>(*)()> XdmfGeometryType::mGeometryDefinitions;
// Supported XdmfGeometryTypes
......@@ -184,8 +186,9 @@ unsigned int XdmfGeometryTypeGetDimensions(int type, int * status)
break;
default:
try {
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Geometry Type: Code " + type);
std::stringstream sstr;
sstr << "Error: Invalid Geometry Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
catch (XdmfError & e) {
throw e;
......
......@@ -28,6 +28,8 @@
#include "XdmfSetType.hpp"
#include "XdmfError.hpp"
#include <sstream>
XDMF_CHILDREN_IMPLEMENTATION(XdmfSet, XdmfAttribute, Attribute, Name)
shared_ptr<XdmfSet>
......@@ -239,8 +241,11 @@ void XdmfSetSetType(XDMFSET * set, int type, int * status)
newType = XdmfSetType::Edge();
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Set Type: Code " + type);
{
std::stringstream sstr;
sstr << "Error: Invalid Set Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
((XdmfSet *)set)->setType(newType);
......
......@@ -465,8 +465,11 @@ void XdmfTopologySetType(XDMFTOPOLOGY * topology, int type, int * status)
newType = XdmfTopologyType::Mixed();
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Topology Type: Code " + type);
{
std::stringstream sstr;
sstr << "Error: Invalid Topology Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
......@@ -592,8 +595,11 @@ void XdmfTopologySetPolyType(XDMFTOPOLOGY * topology, int type, int nodes, int *
newType = XdmfTopologyType::Mixed();
break;
default:
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Topology Type: Code " + type);
{
std::stringstream sstr;
sstr << "Error: Invalid Topology Type: Code " << type;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
break;
}
((XdmfTopology *)topology)->setType(newType);
......
......@@ -1532,9 +1532,10 @@ XdmfHDF5Writer::write(XdmfArray & array)
NULL) ;
if(status < 0) {
XdmfError::message(XdmfError::FATAL,
"H5Dset_extent returned failure in "
"XdmfHDF5Writer::write -- status: " + status);
std::stringstream sstr;
sstr << "H5Dset_extent returned failure in "
"XdmfHDF5Writer::write -- status: " << status;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
}
......@@ -1546,9 +1547,10 @@ XdmfHDF5Writer::write(XdmfArray & array)
curArray);
if(status < 0) {
XdmfError::message(XdmfError::FATAL,
"H5Dwrite returned failure in XdmfHDF5Writer::write "
"-- status: " + status);
std::stringstream sstr;
sstr << "H5Dwrite returned failure in XdmfHDF5Writer::write "
"-- status: " << status;
XdmfError::message(XdmfError::FATAL, sstr.str());
}
if(dataspace != H5S_ALL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment