Commit bb8bb077 authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot

Merge topic 'cppcheck-fixes3'

44fbfe3b Misc cleanup looking at cppcheck issues
5b2b51fe Fixed most ‘passedByValue’ cppcheck warnings
fb7a3909 Fixed many 'redundantAssignment' cppcheck warnings
6eedef44 Fixed ‘clarifyCalculation’ cppcheck warnings
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !1273
parents 5f229e2e 44fbfe3b
......@@ -34,7 +34,6 @@ unpreciseMathCall
memsetClassFloat
// There are just too many of these to manage, so suppress them all. Can look again one day.
clarifyCalculation
cstyleCast
invalidscanf
noCopyConstructor
......@@ -79,6 +78,12 @@ nullPointerRedundantCheck:Filters/General/vtkMultiThreshold.cxx
oppositeInnerCondition:Rendering/VolumeOpenGL/vtkOpenGLVolumeTextureMapper3D.cxx
pointerPositive:Common/DataModel/vtkUnstructuredGridCellIterator.cxx
redundantAssignInSwitch:Wrapping/Tools/vtkWrapPythonOverload.c
redundantAssignment:Filters/General/vtkApproximatingSubdivisionFilter.cxx
redundantAssignment:Filters/General/vtkInterpolatingSubdivisionFilter.cxx
redundantAssignment:Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
redundantAssignment:Rendering/OpenGL2/vtkRenderbuffer.cxx
redundantAssignment:Rendering/OpenGL2/vtkTextureObject.cxx
redundantAssignment:Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
stlIfStrFind:Infovis/Core/vtkPipelineGraphSource.cxx
unassignedVariable:Common/Transforms/vtkHomogeneousTransform.cxx
unassignedVariable:Filters/Core/vtkFlyingEdges3D.cxx
......@@ -98,6 +103,7 @@ unsafeClassCanLeak:GUISupport/Qt/QVTKInteractorInternal.h
unsafeClassCanLeak:Interaction/Widgets/vtkBiDimensionalRepresentation.h
unusedAllocatedMemory:IO/Legacy/vtkDataWriter.cxx
unusedStructMember:Common/Misc/vtkHeap.cxx
unusedStructMember:IO/Image/vtkMRCReader.cxx
uselessAssignmentArg:Common/DataModel/vtkReebGraph.cxx
uselessAssignmentPtrArg:Filters/General/vtkYoungsMaterialInterface.cxx
uselessAssignmentPtrArg:IO/Parallel/vtkPImageWriter.cxx
......@@ -111,7 +117,6 @@ memleakOnRealloc
noConstructor
operatorEq
postfixOperator
unusedStructMember
// To investigate further...
memleak:Wrapping/Tools/vtkParsePreprocess.c
......
......@@ -1667,17 +1667,16 @@ double vtkAxis::LogScaleTickMark(double number,
bool &niceValue,
int &order)
{
double result(0.0);
niceValue = false;
// We need to retrive the order of our number.
order = static_cast<int>(floor(log10(number)));
// We retrive the basis of our number depending on roundUp and return it as
// result.
number = number * pow(10.0, static_cast<double>(order*(-1)));
result = roundUp ? ceil(number) : floor(number);
double result = roundUp ? ceil(number) : floor(number);
// If result is 1.0, 2.0 or 5.0 we mark the result as "nice value".
niceValue = false;
if (result == 1.0 || result == 2.0 || result == 5.0)
{
niceValue = true;
......
......@@ -75,7 +75,7 @@ private:
double data[3];
};
static ostream &operator<<(ostream &os, const Triple t)
static ostream &operator<<(ostream &os, const Triple &t)
{
os << t[0] << ", " << t[1] << ", " << t[2];
return os;
......
......@@ -251,11 +251,10 @@ int TestAMRBoxIntersection()
// Save the initial
A0 = A;
bool doesIntersect = false;
B = A;
B.Shrink( 2 );
doesIntersect = A.Intersect( B );
bool doesIntersect = A.Intersect( B );
if( !doesIntersect || (A != B) )
{
std::cerr << "ERROR: Intersecting a fully encompassing box failed!\n";
......
......@@ -255,6 +255,7 @@ bool TestMixedDispatch()
int result = dispatcher.Go(as<vtkDataArray>(doubleArray.GetPointer()));
result = dispatcher.Go(intArray.GetPointer());
test_expression(result==2,"unexpected");
result = dispatcher.Go(doubleArray.GetPointer());
test_expression(result==3,"statefull functor failed with int and double");
......
......@@ -99,9 +99,7 @@ int TestStaticCellLinks( int, char *[] )
extract->Update();
// Grab the output, build links on unstructured grid
vtkSmartPointer<vtkUnstructuredGrid> ugrid =
vtkSmartPointer<vtkUnstructuredGrid>::New();
ugrid = extract->GetOutput();
vtkSmartPointer<vtkUnstructuredGrid> ugrid = extract->GetOutput();
vtkStaticCellLinksTemplate<int> slinks;
slinks.BuildLinks(ugrid);
......@@ -157,9 +155,7 @@ int TestStaticCellLinks( int, char *[] )
ss->SetPhiResolution(10);
ss->Update();
vtkSmartPointer<vtkPolyData> pdata =
vtkSmartPointer<vtkPolyData>::New();
pdata = ss->GetOutput();
vtkSmartPointer<vtkPolyData> pdata = ss->GetOutput();
slinks.Initialize(); //reuse
slinks.BuildLinks(pdata);
......
......@@ -254,11 +254,9 @@ vtkIdType vtkIncrementalOctreePointLocator::FindClosestInsertedPoint
double miniDist2 = this->OctreeMaxDimSize * this->OctreeMaxDimSize * 4.0;
double elseDist2; // inter-node search
vtkIdType elsePntId; // inter-node search
vtkIdType pointIndx = -1;
vtkIncrementalOctreeNode * pLeafNode = NULL;
pLeafNode = this->GetLeafContainer( this->OctreeRootNode, x );
pointIndx = this->FindClosestPointInLeafNode( pLeafNode, x, &miniDist2 );
vtkIncrementalOctreeNode * pLeafNode = this->GetLeafContainer( this->OctreeRootNode, x );
vtkIdType pointIndx = this->FindClosestPointInLeafNode( pLeafNode, x, &miniDist2 );
if ( miniDist2 > 0.0 )
{
......
......@@ -568,10 +568,6 @@ int vtkPolygon::ParameterizePolygon(double *p0, double *p10, double& l10,
{
p[j] = x1[j] - p0[j];
}
#ifdef BAD_WITH_NODEBUG
s = vtkMath::Dot(p,p10) / l10;
t = vtkMath::Dot(p,p20) / l20;
#endif
s = (p[0]*p10[0] + p[1]*p10[1] + p[2]*p10[2]) / l10;
t = (p[0]*p20[0] + p[1]*p20[1] + p[2]*p20[2]) / l20;
sbounds[0] = (s<sbounds[0]?s:sbounds[0]);
......@@ -602,11 +598,6 @@ int vtkPolygon::ParameterizePolygon(double *p0, double *p10, double& l10,
#define VTK_POLYGON_MAX_ITER 10 //Maximum iterations for ray-firing
#define VTK_POLYGON_VOTE_THRESHOLD 2
#ifndef TRUE
#define FALSE 0
#define TRUE 1
#endif
//----------------------------------------------------------------------------
// Determine whether point is inside polygon. Function uses ray-casting
// to determine if point is inside polygon. Works for arbitrary polygon shape
......@@ -619,7 +610,7 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
{
double *x1, *x2, xray[3], u, v;
double rayMag, mag=1, ray[3];
int testResult, rayOK, status, numInts, i;
int testResult, status, numInts, i;
int iterNumber;
int maxComp, comps[2];
int deltaVotes;
......@@ -710,7 +701,8 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
//
// Generate ray
//
for (rayOK = FALSE; rayOK == FALSE; )
bool rayOK;
for (rayOK = false; rayOK == false; )
{
ray[comps[0]] = vtkMath::Random(-rayMag, rayMag);
ray[comps[1]] = vtkMath::Random(-rayMag, rayMag);
......@@ -718,7 +710,7 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
n[comps[1]]*ray[comps[1]]) / n[maxComp];
if ( (mag = vtkMath::Norm(ray)) > rayMag*VTK_TOL )
{
rayOK = TRUE;
rayOK = true;
}
}
......
......@@ -42,8 +42,8 @@
namespace
{
//----------------------------------------------------------------------------
inline static bool vtkReebGraphVertexSoS(const std::pair<int, double> v0,
const std::pair<int, double> v1)
inline static bool vtkReebGraphVertexSoS(const std::pair<int, double> &v0,
const std::pair<int, double> &v1)
{
return ((v0.second < v1.second)
|| ((v0.second == v1.second)&&(v0.first < v1.first)));
......
......@@ -556,11 +556,11 @@ double vtkTimerLog::GetUniversalTime()
//----------------------------------------------------------------------------
double vtkTimerLog::GetCPUTime()
{
double currentCPUTime = 1.0;
#ifndef _WIN32_WCE
currentCPUTime = static_cast<double>(clock()) /static_cast<double>(CLOCKS_PER_SEC);
return static_cast<double>(clock()) /static_cast<double>(CLOCKS_PER_SEC);
#else
return 1.0;
#endif
return currentCPUTime;
}
//----------------------------------------------------------------------------
......
......@@ -69,13 +69,8 @@ int vtkSimpleBondPerceiver::RequestData(
output->ShallowCopyAttributes(input);
// Get pointers to data
vtkSmartPointer<vtkUnsignedShortArray> numArr =
vtkSmartPointer<vtkUnsignedShortArray>::New();
vtkSmartPointer<vtkPoints> posArr =
vtkSmartPointer<vtkPoints>::New();
posArr = output->GetAtomicPositionArray();
numArr = output->GetAtomicNumberArray();
vtkSmartPointer<vtkPoints> posArr = output->GetAtomicPositionArray();
vtkSmartPointer<vtkUnsignedShortArray> numArr = output->GetAtomicNumberArray();
// Cache atomic radii
vtkNew<vtkPeriodicTable> pTab;
......
......@@ -141,15 +141,13 @@ vtkOverlappingAMR* GetAMRDataSet()
double h[3];
int ndim[3];
int blockId = -1;
int level = -1;
// Root Block -- Block 0,0
ndim[0] = 6; ndim[1] = 5; ndim[2] = 1;
h[0] = h[1] = h[2] = 1.0;
blockId = 0;
level = 0;
int blockId = 0;
int level = 0;
vtkUniformGrid *root = AMRCommon::GetGrid(origin, h, ndim);
vtkAMRBox box(origin, ndim, h, data->GetOrigin(), data->GetGridDescription());
AttachPulseToGrid( root );
......
......@@ -138,15 +138,13 @@ vtkOverlappingAMR* GetAMRDataSet()
double origin[3];
double h[3];
int ndim[3];
int blockId = -1;
int level = -1;
// Root Block -- Block 0
ndim[0] = 6; ndim[1] = ndim[2] = 5;
h[0] = h[1] = h[2] = 1.0;
origin[0] = origin[1] = origin[2] = -2.0;
blockId = 0;
level = 0;
int blockId = 0;
int level = 0;
vtkUniformGrid *root = AMRCommon::GetGrid(origin,h,ndim);
vtkAMRBox box(origin,ndim,h,data->GetOrigin(), data->GetGridDescription());
AttachPulseToGrid( root );
......
......@@ -107,12 +107,12 @@ OpenGLScene::OpenGLScene(QGLContext* ctx, QObject* p)
trans->addAnimation(new QBoolAnimation(1.0, mTreeRingView, "enabled")); // enable at end of transition
// non animated transitions
trans = state1->addTransition(this, SIGNAL(enterState4()), state4);
trans = state2->addTransition(this, SIGNAL(enterState4()), state4);
trans = state3->addTransition(this, SIGNAL(enterState4()), state4);
trans = state4->addTransition(this, SIGNAL(enterState1()), state1);
trans = state4->addTransition(this, SIGNAL(enterState2()), state2);
trans = state4->addTransition(this, SIGNAL(enterState3()), state3);
state1->addTransition(this, SIGNAL(enterState4()), state4);
state2->addTransition(this, SIGNAL(enterState4()), state4);
state3->addTransition(this, SIGNAL(enterState4()), state4);
state4->addTransition(this, SIGNAL(enterState1()), state1);
state4->addTransition(this, SIGNAL(enterState2()), state2);
state4->addTransition(this, SIGNAL(enterState3()), state3);
machine.start();
......
......@@ -532,9 +532,9 @@ bool vtkAMRCutPlane::PlaneIntersectsAMRBox( double plane[4], double bounds[6] )
for( int i=0; i < 8; ++i )
{
// Get box coordinates
double x = ( i&1 ? bounds[1] : bounds[0] );
double y = ( i&2 ? bounds[3] : bounds[2] );
double z = ( i&3 ? bounds[5] : bounds[4] );
double x = ( i&1 ) ? bounds[1] : bounds[0];
double y = ( i&2 ) ? bounds[3] : bounds[2];
double z = ( i&3 ) ? bounds[5] : bounds[4];
// Plug-in coordinates to the plane equation
double v = plane[3] - plane[0]*x - plane[1]*y - plane[2]*z;
......
......@@ -260,9 +260,9 @@ bool vtkAMRSliceFilter::PlaneIntersectsAMRBox(double plane[4],double bounds[6])
for( int i=0; i < 8; ++i )
{
// Get box coordinates
double x = ( i&1 ? bounds[1] : bounds[0] );
double y = ( i&2 ? bounds[3] : bounds[2] );
double z = ( i&3 ? bounds[5] : bounds[4] );
double x = ( i&1 ) ? bounds[1] : bounds[0];
double y = ( i&2 ) ? bounds[3] : bounds[2];
double z = ( i&3 ) ? bounds[5] : bounds[4];
// Plug-in coordinates to the plane equation
double v = plane[3] - plane[0]*x - plane[1]*y - plane[2]*z;
......
......@@ -131,7 +131,7 @@ int strcmp_null(const char* s1, const char* s2)
//////////////////////////////////////////////////////////////////////////////
// Prints and checks point/cell data
//////////////////////////////////////////////////////////////////////////////
int PrintAndCheck(const std::vector<vtkPolyData*> inputs, vtkDataSet* output,
int PrintAndCheck(const std::vector<vtkPolyData*>& inputs, vtkDataSet* output,
vtkDataSetAttributes*(*selector)(vtkDataSet*))
{
vtkDataSetAttributes* dataArrays = selector(output);
......@@ -356,7 +356,7 @@ vtkDataSetAttributes* CellDataSelector(vtkDataSet* ds)
//////////////////////////////////////////////////////////////////////////////
// Returns 1 on success, 0 otherwise
//////////////////////////////////////////////////////////////////////////////
int AppendDatasetsAndPrint(const std::vector<vtkPolyData*> inputs)
int AppendDatasetsAndPrint(const std::vector<vtkPolyData*>& inputs)
{
vtkNew<vtkAppendFilter> append;
for (size_t inputIndex = 0; inputIndex < inputs.size(); ++inputIndex)
......
......@@ -79,7 +79,7 @@ namespace
// Returns 1 on success, 0 otherwise
//////////////////////////////////////////////////////////////////////////////
int AppendDatasetsAndCheck(
const std::vector<vtkSmartPointer<vtkStructuredGrid> > inputs,
const std::vector<vtkSmartPointer<vtkStructuredGrid> >& inputs,
int outputExtent[6])
{
vtkNew<vtkStructuredGridAppend> append;
......
......@@ -34,8 +34,7 @@
double exponential_distribution(const int i, const double beta)
{
double xi=0.0;
xi = ( ( exp( i*beta ) - 1 ) /( exp( beta ) - 1 ) );
double xi = ( ( exp( i*beta ) - 1 ) /( exp( beta ) - 1 ) );
return( xi );
}
......
......@@ -380,7 +380,6 @@ vtkDataObject* vtkExtractSelection::RequestDataFromBlock(
tp->SetOutput(tempSel);
subFilter->SetInputConnection(1, tp->GetOutputPort());
tp->Delete();
tp = 0;
vtkDataObject* inputCopy = input->NewInstance();
inputCopy->ShallowCopy(input);
......
......@@ -129,7 +129,6 @@ int vtkProbeSelectedLocations::RequestData(vtkInformation *vtkNotUsed(request),
subFilter->SetInputConnection(1, tp->GetOutputPort());
inputClone->Delete();
tp->Delete();
tp = 0;
tp = vtkTrivialProducer::New();
tp->SetOutput(tempInput);
......
......@@ -213,7 +213,7 @@ int TestQuadraturePoints(int argc,char *argv[])
camera->Elevation(95.0);
camera->SetViewUp(0.0,0.0,1.0);
camera->Azimuth(180.0);
camera=0;
// Setup upper right pane.
vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New();
ren1->SetViewport(0.5,0.5,1.0,1.0);
......@@ -228,7 +228,7 @@ int TestQuadraturePoints(int argc,char *argv[])
camera->OrthogonalizeViewUp();
camera->Elevation(-10.0);
camera->Azimuth(55.0);
camera=0;
// Setup lower right pane.
vtkSmartPointer<vtkRenderer> ren2 = vtkSmartPointer<vtkRenderer>::New();
ren2->SetViewport(0.5,0.0,1.0,0.5);
......@@ -236,7 +236,7 @@ int TestQuadraturePoints(int argc,char *argv[])
ren2->SetBackground(0.328125, 0.347656, 0.425781);
ren2->AddActor(surfaceActor);
ren2->ResetCamera();
camera=0;
// If interactive mode then we show wireframes for
// reference.
if (testHelper->IsInteractiveModeSpecified())
......
......@@ -708,8 +708,7 @@ bool CompareFieldsForGrid( vtkUniformGrid *grid )
grid->GetCellData()->GetArray( "EXPECTED-CellXYZ" ) );
assert( "pre: expectedCellData is NULL" && (expectedCellData != NULL) );
bool status = true;
status = CheckArrays( computedCellData, expectedCellData );
bool status = CheckArrays( computedCellData, expectedCellData );
if( !status )
{
return status;
......
......@@ -41,7 +41,6 @@
int TestPUnstructuredGridConnectivity(int argc, char* argv[])
{
int rc = 0;
double ellapsed = 0.0;
vtkTimerLog* timer = vtkTimerLog::New();
// STEP 0: Initialize
......@@ -64,7 +63,7 @@ int TestPUnstructuredGridConnectivity(int argc, char* argv[])
timer->StartTimer();
ghostGen->BuildGhostZoneConnectivity();
timer->StopTimer();
ellapsed = timer->GetElapsedTime();
double ellapsed = timer->GetElapsedTime();
vtkMPIUtilities::Printf(cntrl,"[DONE]\n");
// get some performance statistics
......
......@@ -219,8 +219,7 @@ vtkMultiBlockDataSet* GetDataSet(
//------------------------------------------------------------------------------
double exponential_distribution(const int i, const double beta)
{
double xi=0.0;
xi = ( ( exp( i*beta ) - 1 ) /( exp( beta ) - 1 ) );
double xi = ( ( exp( i*beta ) - 1 ) /( exp( beta ) - 1 ) );
return( xi );
}
......
......@@ -31,8 +31,8 @@
namespace
{
//----------------------------------------------------------------------------
inline static bool vtkReebGraphVertexSoS(const std::pair<int, double> v0,
const std::pair<int, double> v1)
inline static bool vtkReebGraphVertexSoS(const std::pair<int, double>& v0,
const std::pair<int, double>& v1)
{
return ((v0.second < v1.second)
|| ((v0.second == v1.second)&&(v0.first < v1.first)));
......
......@@ -119,14 +119,14 @@ public:
#endif
ParseStatus status;
SEXP cmdSexp, cmdexpr = R_NilValue;
int error;
SEXP cmdSexp;
PROTECT(cmdSexp = allocVector(STRSXP, 1));
SET_STRING_ELT(cmdSexp, 0, mkChar(rcommand.c_str()));
cmdexpr = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue));
SEXP cmdexpr = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue));
for(int i = 0; i < length(cmdexpr); i++)
{
R_tryEval(VECTOR_ELT(cmdexpr, i),NULL,&error);
......@@ -227,15 +227,15 @@ int vtkRInterface::EvalRscript(const char *string, bool showRoutput)
{
ParseStatus status;
SEXP cmdSexp, cmdexpr = R_NilValue;
SEXP ans;
int i;
int error;
SEXP cmdSexp;
PROTECT(cmdSexp = allocVector(STRSXP, 1));
SET_STRING_ELT(cmdSexp, 0, mkChar(string));
cmdexpr = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue));
SEXP cmdexpr = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue));
switch (status)
{
case PARSE_OK:
......
......@@ -35,7 +35,7 @@ namespace ADIOS
{
//----------------------------------------------------------------------------
std::ostream& operator<<(std::ostream& os, const ArrayDim d)
std::ostream& operator<<(std::ostream& os, const ArrayDim& d)
{
if(d.ValueS.empty())
{
......
......@@ -482,7 +482,7 @@ void vtkADIOSWriter::Define(const std::string& path,
}
//----------------------------------------------------------------------------
bool vtkADIOSWriter::UpdateMTimeTable(const std::string path,
bool vtkADIOSWriter::UpdateMTimeTable(const std::string& path,
const vtkObject* value)
{
unsigned long &mtimeCurrent = this->LastUpdated[path];
......
......@@ -185,7 +185,7 @@ protected:
int RequestExtent[6];
// Used to determine whether or not the data getting written is stale
bool UpdateMTimeTable(const std::string path, const vtkObject* value);
bool UpdateMTimeTable(const std::string& path, const vtkObject* value);
std::map<std::string, unsigned long> LastUpdated;
private:
bool WriteInternal();
......
......@@ -113,7 +113,7 @@ int vtkAMREnzoReader::GetIndexFromArrayName( std::string arrayName )
}
//-----------------------------------------------------------------------------
double vtkAMREnzoReader::GetConversionFactor( const std::string name )
double vtkAMREnzoReader::GetConversionFactor( const std::string &name )
{
if( this->label2idx.find( name ) != this->label2idx.end() )
{
......@@ -132,7 +132,7 @@ double vtkAMREnzoReader::GetConversionFactor( const std::string name )
//-----------------------------------------------------------------------------
void vtkAMREnzoReader::ParseLabel(
const std::string labelString, int &idx, std::string &label)
const std::string &labelString, int &idx, std::string &label)
{
std::vector< std::string > strings;
......@@ -153,7 +153,7 @@ void vtkAMREnzoReader::ParseLabel(
//-----------------------------------------------------------------------------
void vtkAMREnzoReader::ParseCFactor(
const std::string labelString, int &idx, double &factor )
const std::string &labelString, int &idx, double &factor )
{
std::vector< std::string > strings;
......
......@@ -73,18 +73,18 @@ protected:
// Description:
// Given the label string, this method parses the attribute label and
// the string index.
void ParseLabel(const std::string labelString,int &idx,std::string &label);
void ParseLabel(const std::string &labelString, int &idx, std::string &label);
// Description:
// Given the label string, this method parses the corresponding attribute
// index and conversion factor
void ParseCFactor(const std::string labelString, int &idx, double &factor );
void ParseCFactor(const std::string &labelString, int &idx, double &factor );
// Description:
// Given the variable name, return the conversion factor used to convert
// the data to CGS. These conversion factors are read directly from the
// parameters file when the filename is set.
double GetConversionFactor( const std::string name );
double GetConversionFactor( const std::string& name );
// Description:
// See vtkAMRBaseReader::ReadMetaData
......
......@@ -637,7 +637,6 @@ void vtkX3DExporter::WriteATextActor2D(vtkActor2D *anTextActor2D,
ta = static_cast<vtkTextActor*>(anTextActor2D);
tp = ta->GetTextProperty();
ds = NULL;
ds = ta->GetInput();
if (ds==NULL)
......
......@@ -357,21 +357,25 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
0 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
err = greenBand->RasterIO(
GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
1 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
err = blueBand->RasterIO(
GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
2 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
err = alphaBand->RasterIO(
GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
3 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
}
else
{
......@@ -383,14 +387,17 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
0 * bandSpace), destWidth, destHeight,
this->TargetDataType, 0, 0);
assert(err == CE_None);
err = greenBand->RasterIO(GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
1 * bandSpace), destWidth, destHeight,
this->TargetDataType, 0,0);
assert(err == CE_None);
err = blueBand->RasterIO(GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
2 * bandSpace), destWidth, destHeight,
this->TargetDataType, 0,0);
assert(err == CE_None);
}
}
else if (greyBand)
......@@ -406,11 +413,13 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
0 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
err = alphaBand->RasterIO(
GF_Read, windowX, windowY, windowWidth, windowHeight,
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
1 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
}
else
{
......@@ -422,6 +431,7 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast<void*>(reinterpret_cast<GByte*>(&rawUniformGridData[0]) +
0 * bandSpace), destWidth, destHeight,
this->TargetDataType, pixelSpace, lineSpace);
assert(err == CE_None);
}
}
else
......@@ -429,8 +439,7 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
std::cerr << "Unknown raster band type \n";
return;
}
((void)err);//unused
assert(err == CE_None);
(void)err; //unused
const double* d = GetGeoCornerPoints();
double geoSpacing[] = {(d[4]-d[0])/this->Reader->RasterDimensions[0],
......
......@@ -147,7 +147,7 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
( argc, argv, "Data/post.vtk" );
ugReader = vtkUnstructuredGridReader::New();
ugReader->SetFileName( fileName );
delete [] fileName; fileName = NULL;
delete [] fileName;
ugReader->Update();
unstruct = ugReader->GetOutput();
dataPnts = unstruct->GetPoints();
......
......@@ -3001,14 +3001,13 @@ static int cgmImageColorAllocate(cgmImagePtr im, int r, int g, int b)
#ifdef VTK_NOT_DEFINED
static int cgmImageColor16(cgmImagePtr im)
{
int si, ei, li;
si = cgmImageAddColorIndex(im, 255, 255, 255);
int si = cgmImageAddColorIndex(im, 255, 255, 255);
if (si == -1)
{
return 0;
}
li = -1; ei=si;
ei = cgmImageAddColorIndex(im, 0, 0, 0);
int li = -1;
int ei = cgmImageAddColorIndex(im, 0, 0, 0);
if (ei != -1)
{
li = ei;
......
......@@ -1307,7 +1307,6 @@ void vtkTecplotReader::GetDataArraysList()
int guessedYid = -1;
int guessedZid = -1;
bool tokenReady = false;