Commit dcaaaae2 authored by Sean McBride's avatar Sean McBride

Fixed & supressed various cppcheck 1.89 warnings

Fixed:
passedByValue,IO/ADIOS2/VTX/schema/vtk/VTXvtkBase.cxx:44,performance,Function parameter 'type' should be passed by const reference.
passedByValue,IO/ADIOS2/VTX/schema/VTXSchema.cxx:32,performance,Function parameter 'type' should be passed by const reference.
passedByValue,IO/ADIOS2/VTX/schema/VTXSchema.h:68,performance,Function parameter 'type' should be passed by const reference.
redundantInitialization,Wrapping/Tools/vtkParseHierarchy.c:1154,style,Redundant initialization for 'newname'. The initialized value is overwritten before it is read.
unreadVariable,IO/ADIOS2/VTX/schema/vtk/VTXvtkBase.cxx:86,style,Variable 'foundTime' is assigned a value that is never used.
unsignedLessThanZero,IO/Geometry/vtkGLTFUtils.cxx:335,style,Checking if unsigned expression 'chunkInfo.size()' is less than zero.
parent 9f8ec53e
This diff is collapsed.
......@@ -29,7 +29,7 @@ namespace vtx
{
// PUBLIC
VTXSchema::VTXSchema(
const std::string type, const std::string& schema, adios2::IO& io, adios2::Engine& engine)
const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine)
: Type(type)
, Schema(schema)
, IO(io)
......
......@@ -65,7 +65,7 @@ public:
* @param engine manages stream input
*/
VTXSchema(
const std::string type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
// can't use = default, due to forward class not defined
virtual ~VTXSchema();
......
......@@ -41,7 +41,7 @@ const std::map<types::DataSetType, std::string> VTXvtkBase::DataSetTypes = {
};
VTXvtkBase::VTXvtkBase(
const std::string type, const std::string& schema, adios2::IO& io, adios2::Engine& engine)
const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine)
: VTXSchema(type, schema, io, engine)
{
}
......@@ -69,8 +69,6 @@ bool VTXvtkBase::ReadDataSets(
void VTXvtkBase::InitTimes()
{
bool foundTime = false;
for (types::Piece& piece : this->Pieces)
{
for (auto& itDataSet : piece)
......@@ -83,7 +81,6 @@ void VTXvtkBase::InitTimes()
const std::vector<std::string>& vecComponents = itDataArray.second.VectorVariables;
const std::string& variableName = vecComponents.front();
GetTimes(variableName);
foundTime = true;
return;
}
}
......@@ -91,10 +88,7 @@ void VTXvtkBase::InitTimes()
}
// ADIOS2 will just use steps
if (!foundTime)
{
GetTimes();
}
GetTimes();
}
std::string VTXvtkBase::DataSetType(const types::DataSetType type) const noexcept
......
......@@ -43,7 +43,7 @@ class VTXvtkBase : public VTXSchema
{
public:
VTXvtkBase(
const std::string type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
// can't use = default, due to forward class not defined
virtual ~VTXvtkBase();
......
......@@ -332,7 +332,7 @@ bool vtkGLTFUtils::ValidateGLBFile(const std::string& magic, uint32_t version, u
{
return false;
}
if (chunkInfo.size() <= 0)
if (chunkInfo.size() == 0)
{
return false;
}
......
......@@ -1151,7 +1151,7 @@ const char *vtkParseHierarchy_ExpandTypedefsInName(
char text[128];
char *cp;
size_t n, m;
const char *newname = name;
const char *newname = NULL;
HierarchyEntry *entry = NULL;
/* note: unlike ExpandTypedefsInValue, this does not yet recurse
......@@ -1193,7 +1193,6 @@ const char *vtkParseHierarchy_ExpandTypedefsInName(
entry = vtkParseHierarchy_FindEntry(info, name);
}
newname = NULL;
if (entry && entry->IsTypedef && entry->Typedef->Class)
{
newname = entry->Typedef->Class;
......
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