Commit 20808418 authored by George Zagaris's avatar George Zagaris
Browse files

COMP: Fix compiler warnings

Fix some compiler warnings related to unreferenced variables
when compiled in Release mode. These variables are used mainly
in asserts, so, when compiled in Release mode the compiler
typically throws a warning that the variable is not used.
parent 6c628e99
......@@ -79,6 +79,9 @@ vtkAMRBox::vtkAMRBox(int dim, const int *lo, const int *hi)
(dim==this->GetDimensionality() ) );
assert( "post: Dimension expected to be 2 or 3" &&
( (this->GetDimensionality()==2) || (this->GetDimensionality()==3) ) );
// Avoid compiler warnings when compiled in Release
static_cast<void>(dim);
}
//-----------------------------------------------------------------------------
......@@ -99,6 +102,9 @@ vtkAMRBox::vtkAMRBox(int dim, const int *dims)
// this->BuildAMRBox( dims[0],dims[1],dims[2],dims[3],dims[4],dims[5] );
assert( "post: AMR box dimension does not match expected dimension" &&
(dim==this->GetDimensionality() ) );
// Avoid compiler warnings when compiled in Release
static_cast<void>(dim);
}
......@@ -146,6 +152,7 @@ int vtkAMRBox::GetCellLinearIndex( const int i, const int j, const int k )
ijk[2]=k-this->LoCorner[2];
int N1,N2,idx;
idx = 0;
switch( this->Dimension )
{
case 1:
......@@ -1522,6 +1529,9 @@ void vtkAMRBox::Deserialize( unsigned char* buffer, const vtkIdType &bytesize )
assert( "pre: input buffer is NULL" && (buffer != NULL) );
assert( "pre: buffer bytesize is 0" && (bytesize >0) );
// Avoid compiler warning when compiled in Release
static_cast<void>(bytesize);
// STEP 0: set pointer to traverse the buffer
unsigned char *ptr = buffer;
......
......@@ -255,6 +255,9 @@ void vtkAMRUtilities::DeserializeMetaData(
assert( "Buffer to deserialize is NULL" && (buffer != NULL) );
assert( "Expected numBytes > 0" && (numBytes > 0) );
// Avoid compiler warnings when compiled in Release
static_cast<void>(numBytes);
unsigned char *ptr = buffer;
int N = 0;
......
Supports Markdown
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