Commit 46c70171 authored by Sean McBride's avatar Sean McBride

Fixed all cppcheck operatorEq warnings

Changed some operator= from returning void to returning *this.
parent d03fca63
......@@ -136,8 +136,6 @@ duplInheritedMember
invalidPointerCast
// 6 warnings
noConstructor
// not many
operatorEq
// To investigate further...
memleak:Wrapping/Tools/vtkParsePreprocess.c
......
......@@ -153,7 +153,7 @@ public:
this->Reference = other.Reference;
}
void operator=(const PointEntry &other)
PointEntry& operator=(const PointEntry &other)
{
if(this != &other)
{
......@@ -172,6 +172,7 @@ public:
memcpy(this->Scalar, other.Scalar, sizeof(double)*c);
this->Reference = other.Reference;
}
return *this;
}
};
......@@ -204,11 +205,11 @@ public:
this->CellId = copy.CellId;
}
void operator=(const EdgeEntry& entry)
EdgeEntry& operator=(const EdgeEntry& entry)
{
if(this == &entry)
{
return;
return *this;
}
this->E1 = entry.E1;
this->E2 = entry.E2;
......@@ -216,6 +217,7 @@ public:
this->ToSplit = entry.ToSplit;
this->PtId = entry.PtId;
this->CellId = entry.CellId;
return *this;
}
};
//ETX
......
......@@ -104,10 +104,11 @@ public:
this->Data = bw.Data;
this->Data->Register(NULL);
}
void operator=(const BadWinding &bw) {
BadWinding& operator=(const BadWinding &bw) {
this->Data->UnRegister(NULL);
this->Data = bw.Data;
this->Data->Register(NULL);
return *this;
}
vtkUnstructuredGrid *Data;
......
......@@ -612,11 +612,12 @@ public:
this->Type = STRING;
this->String = new vtkStdString(value);
}
void operator=(const vtkFoamToken& value)
vtkFoamToken& operator=(const vtkFoamToken& value)
{
this->Clear();
this->Type = value.Type;
this->AssignData(value);
return *this;
}
bool operator==(const char value) const
{
......
......@@ -246,12 +246,13 @@ public:
(*this->ReferenceCount)++;
}
void operator=(const vtkSLACReaderAutoCloseNetCDF &src)
vtkSLACReaderAutoCloseNetCDF& operator=(const vtkSLACReaderAutoCloseNetCDF &src)
{
this->UnReference();
this->FileDescriptor = src.FileDescriptor;
this->ReferenceCount = src.ReferenceCount;
(*this->ReferenceCount)++;
return *this;
}
operator int() const { return this->FileDescriptor; }
......
......@@ -199,7 +199,7 @@ public:
vtkFloodFillSeed(const vtkFloodFillSeed &seed) {
store[0]=seed.store[0]; store[1]=seed.store[1]; store[2]=seed.store[2]; };
const int &operator[](int i) const { return store[i]; };
const vtkFloodFillSeed &operator=(const vtkFloodFillSeed &seed) {
vtkFloodFillSeed &operator=(const vtkFloodFillSeed &seed) {
store[0]=seed.store[0]; store[1]=seed.store[1]; store[2]=seed.store[2];
return *this; };
......
......@@ -74,7 +74,7 @@ struct vtkBalloon
this->Image->UnRegister(NULL);
}
}
void operator=(const vtkBalloon &balloon)
vtkBalloon& operator=(const vtkBalloon &balloon)
{
this->Text = balloon.Text;
......@@ -90,6 +90,8 @@ struct vtkBalloon
{
this->Image->Register(NULL);
}
return *this;
}
int operator==(const vtkBalloon &balloon) const
{
......
......@@ -95,7 +95,7 @@ public:
~vtkParallelTimerBuffer();
vtkParallelTimerBuffer(const vtkParallelTimerBuffer &other);
void operator=(const vtkParallelTimerBuffer &other);
vtkParallelTimerBuffer& operator=(const vtkParallelTimerBuffer &other);
// Description:
// Access state and internal data.
......@@ -179,15 +179,16 @@ vtkParallelTimerBuffer::vtkParallelTimerBuffer(const vtkParallelTimerBuffer &oth
}
//-----------------------------------------------------------------------------
void vtkParallelTimerBuffer::operator=(const vtkParallelTimerBuffer &other)
vtkParallelTimerBuffer& vtkParallelTimerBuffer::operator=(const vtkParallelTimerBuffer &other)
{
if (this == &other)
{
return;
return *this;
}
this->Clear();
this->Resize(other.GetSize());
memcpy(this->Data, other.Data, other.GetSize());
return *this;
}
//-----------------------------------------------------------------------------
......
......@@ -91,7 +91,7 @@ public:
{
}
Output(const Output&);
void operator=(const Output&);
Output& operator=(const Output&);
~Output()
{
}
......
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