Commit 01fe9ec2 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'fix-warnings-20160701'

e506474e vtkWindBladeReader: use unsigned for the block size
2c9c5706 vtkWebGLDataSet: use braces
3aba992f TestIncrementalOctreePointLocator: use braces
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1611
parents 2d000780 e506474e
Pipeline #18513 running with stage
......@@ -391,13 +391,21 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
retValue = ( insrtPts->GetNumberOfPoints() == numExPts ) ? 0 : 1;
}
}
if ( xtentPts ) free( xtentPts ); xtentPts = NULL;
if ( xtentPts )
{
free( xtentPts );
xtentPts = NULL;
}
// =======================================================================//
// =======================================================================//
// reclaim this vtkPoints as it will be never used again
if ( insrtPts ) insrtPts->Delete(); insrtPts = NULL;
if ( insrtPts )
{
insrtPts->Delete();
insrtPts = NULL;
}
// =========================================================================
......@@ -893,23 +901,71 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
// memory clearance
dataPnts = NULL; unstruct = NULL;
if ( ptIdList ) ptIdList->Delete(); ptIdList = NULL;
if ( octLocat ) octLocat->Delete(); octLocat = NULL;
if ( ugReader ) ugReader->Delete(); ugReader = NULL;
if ( ptIdList )
{
ptIdList->Delete();
ptIdList = NULL;
}
if ( octLocat )
{
octLocat->Delete();
octLocat = NULL;
}
if ( ugReader )
{
ugReader->Delete();
ugReader = NULL;
}
if ( truthIds ) free( truthIds ); truthIds = NULL;
if ( resltIds ) free( resltIds ); resltIds = NULL;
if ( pDataPts ) free( pDataPts ); pDataPts = NULL;
if ( pLocPnts ) free( pLocPnts ); pLocPnts = NULL;
if ( minDist2 ) free( minDist2 ); minDist2 = NULL;
if ( maxDist2 ) free( maxDist2 ); maxDist2 = NULL;
if ( clzNdst2 ) free( clzNdst2 ); clzNdst2 = NULL;
if ( truthIds )
{
free( truthIds );
truthIds = NULL;
}
if ( resltIds )
{
free( resltIds );
resltIds = NULL;
}
if ( pDataPts )
{
free( pDataPts );
pDataPts = NULL;
}
if ( pLocPnts )
{
free( pLocPnts );
pLocPnts = NULL;
}
if ( minDist2 )
{
free( minDist2 );
minDist2 = NULL;
}
if ( maxDist2 )
{
free( maxDist2 );
maxDist2 = NULL;
}
if ( clzNdst2 )
{
free( clzNdst2 );
clzNdst2 = NULL;
}
if ( diskFile ) fclose( diskFile ); diskFile = NULL;
if ( diskFile )
{
fclose( diskFile );
diskFile = NULL;
}
for ( i = 0; i < 3; i ++ )
{
if ( idxLists[i] ) idxLists[i]->Delete(); idxLists[i] = NULL;
if ( idxLists[i] )
{
idxLists[i]->Delete();
idxLists[i] = NULL;
}
}
......
......@@ -138,8 +138,8 @@ protected:
int* VariableBasicType; // FLOAT or INTEGER
int* VariableByteCount; // Number of bytes in basic type
long int* VariableOffset; // Offset into data file
int BlockSize; // Size of every data block
int GBlockSize; // Size of every data block
unsigned BlockSize; // Size of every data block
unsigned GBlockSize; // Size of every data block
vtkFloatArray** Data; // Actual data arrays
vtkStdString RootDirectory; // Directory where the .wind file is.
......
......@@ -170,7 +170,11 @@ void vtkWebGLDataSet::GenerateBinaryData()
memcpy(&this->binary[pos], &this->NumberOfIndexes, sizeof(this->NumberOfIndexes)); pos+=sizeof(this->NumberOfIndexes); //IndCount
memcpy(&this->binary[pos], this->indexes, this->NumberOfIndexes*sizeof(this->indexes[0])); pos+=this->NumberOfIndexes*sizeof(this->indexes[0]);
memcpy(&this->binary[pos], this->Matrix, sizeof(this->Matrix[0])*16); pos+=sizeof(this->Matrix[0])*16; //Matrix
if (this->tcoords) memcpy(&this->binary[pos], this->tcoords, size*2); pos+=size*2; //TCoord
if (this->tcoords) //TCoord
{
memcpy(&this->binary[pos], this->tcoords, size*2);
pos+=size*2;
}
memcpy(&this->binary[0], &pos, sizeof(pos));
this->binarySize = total;
......
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