Skip to content

Commit

Permalink
Fix various compiler warnings with CGNS reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshayachit committed Mar 29, 2017
1 parent ff4a159 commit cd8aaee
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 55 deletions.
Expand Up @@ -30,7 +30,7 @@

int TestOutput(vtkMultiBlockDataSet* mb, int nCells, VTKCellType type)
{
int nBlocks = mb->GetNumberOfBlocks();
unsigned int nBlocks = mb->GetNumberOfBlocks();
vtk_assert(nBlocks > 0);
for (unsigned int i = 0; i < nBlocks; ++i)
{
Expand Down
Expand Up @@ -34,7 +34,7 @@ int TestOutput(vtkMultiBlockDataSet* mb, int nCells, VTKCellType type);

int TestOutputData(vtkMultiBlockDataSet* mb, int nCells, int nArrays)
{
int nBlocks = mb->GetNumberOfBlocks();
unsigned int nBlocks = mb->GetNumberOfBlocks();
vtk_assert(nBlocks > 0);
for (unsigned int i = 0; i < nBlocks; ++i)
{
Expand Down Expand Up @@ -64,14 +64,10 @@ int TestReadCGNSSolution(int argc, char* argv[])

const char* solution = argv[2];
vtkNew<vtkCGNSReader> reader;
vtkInformation* inf = reader->GetInformation();

reader->SetFileName(solution);
reader->Update();

reader->UpdateInformation();
reader->EnableAllCellArrays();
reader->EnableAllPointArrays();

reader->Update();

vtkMultiBlockDataSet* mb = reader->GetOutput();
Expand Down
8 changes: 4 additions & 4 deletions ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.cxx
Expand Up @@ -1168,7 +1168,7 @@ int vtkCGNSReader::GetUnstructuredZone(
//---------------------------------------------------------------------
// Read the number of sections, for the zone.
int nsections = 0;
nsections = elemIdList.size();
nsections = static_cast<int>(elemIdList.size());

std::vector<SectionInformation> sectionInfoList(nsections);

Expand Down Expand Up @@ -1741,7 +1741,7 @@ int vtkCGNSReader::GetUnstructuredZone(
mzone->SetBlock(0, ugrid);
ugrid->Delete();
vtkMultiBlockDataSet* mpatch = vtkMultiBlockDataSet::New();
mpatch->SetNumberOfBlocks(bndSec.size());
mpatch->SetNumberOfBlocks(static_cast<unsigned int>(bndSec.size()));

int bndNum = 0;
for (std::vector<int>::iterator iter = bndSec.begin(); iter != bndSec.end(); ++iter)
Expand Down Expand Up @@ -2128,7 +2128,7 @@ int vtkCGNSReader::RequestData(vtkInformation* vtkNotUsed(request),
nSelectedBases = this->BaseSelection->GetNumberOfArraysEnabled();
rootNode->SetNumberOfBlocks(nSelectedBases);
blockIndex = 0;
for (int numBase = 0; numBase < baseIds.size(); numBase++)
for (int numBase = 0; numBase < static_cast<int>(baseIds.size()); numBase++)
{
int cellDim = 0;
int physicalDim = 0;
Expand Down Expand Up @@ -2367,7 +2367,7 @@ int vtkCGNSReader::RequestData(vtkInformation* vtkNotUsed(request),
}

//------------------------------------------------------------------------------
int vtkCGNSReader::RequestInformation(vtkInformation* request,
int vtkCGNSReader::RequestInformation(vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
{

Expand Down
10 changes: 5 additions & 5 deletions ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.h
Expand Up @@ -53,7 +53,7 @@ class VTKPVVTKEXTENSIONSCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDa
public:
static vtkCGNSReader* New();
vtkTypeMacro(vtkCGNSReader, vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

//@{
/**
Expand Down Expand Up @@ -150,10 +150,10 @@ class VTKPVVTKEXTENSIONSCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDa
vtkCGNSReader();
~vtkCGNSReader();

virtual int FillOutputPortInformation(int port, vtkInformation* info);

virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
virtual int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
int FillOutputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) VTK_OVERRIDE;
int RequestInformation(
vtkInformation*, vtkInformationVector**, vtkInformationVector*) VTK_OVERRIDE;

vtkDataArraySelection* BaseSelection;
vtkDataArraySelection* PointDataArraySelection;
Expand Down
58 changes: 29 additions & 29 deletions ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.cxx
Expand Up @@ -315,40 +315,40 @@ int GetVTKElemType(
// 16,17,18,19,20,21,22,23,24,25,26};

// CGNS --> VTK ordering of Elements
static const int NODE_ToVTK[1] = { 0 };

static const int BAR_2_ToVTK[2] = { 0, 1 };

static const int BAR_3_ToVTK[3] = { 0, 1, 2 };

static const int BAR_4_ToVTK[4] = { 0, 1, 2, 3 };

static const int TRI_3_ToVTK[3] = { 0, 1, 2 };

static const int TRI_6_ToVTK[6] = { 0, 1, 2, 3, 4, 5 };

static const int QUAD_4_ToVTK[4] = { 0, 1, 2, 3 };

static const int QUAD_8_ToVTK[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };

static const int QUAD_9_ToVTK[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };

static const int TETRA_4_ToVTK[4] = { 0, 1, 2, 3 };

static const int TETRA_10_ToVTK[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

static const int PYRA_5_ToVTK[5] = { 0, 1, 2, 3, 4 };

static const int PYRA_14_ToVTK[14] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };

static const int PENTA_6_ToVTK[6] = { 0, 1, 2, 3, 4, 5 };
// static const int NODE_ToVTK[1] = { 0 };
//
// static const int BAR_2_ToVTK[2] = { 0, 1 };
//
// static const int BAR_3_ToVTK[3] = { 0, 1, 2 };
//
// static const int BAR_4_ToVTK[4] = { 0, 1, 2, 3 };
//
// static const int TRI_3_ToVTK[3] = { 0, 1, 2 };
//
// static const int TRI_6_ToVTK[6] = { 0, 1, 2, 3, 4, 5 };
//
// static const int QUAD_4_ToVTK[4] = { 0, 1, 2, 3 };
//
// static const int QUAD_8_ToVTK[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
//
// static const int QUAD_9_ToVTK[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
//
// static const int TETRA_4_ToVTK[4] = { 0, 1, 2, 3 };
//
// static const int TETRA_10_ToVTK[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
//
// static const int PYRA_5_ToVTK[5] = { 0, 1, 2, 3, 4 };
//
// static const int PYRA_14_ToVTK[14] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
//
// static const int PENTA_6_ToVTK[6] = { 0, 1, 2, 3, 4, 5 };

static const int PENTA_15_ToVTK[15] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 9, 10, 11 };

static const int PENTA_18_ToVTK[18] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 9, 10, 11, 15, 16,
17 };

static const int HEXA_8_ToVTK[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
// static const int HEXA_8_ToVTK[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };

static const int HEXA_20_ToVTK[20] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13,
14, 15 };
Expand Down Expand Up @@ -853,7 +853,7 @@ static void BroadcastSelection(
CGNSRead::BroadcastString(controller, key, rank);
selection[key] = false;
controller->Broadcast(&tmp, 1, 0);
selection[key] = (bool)tmp;
selection[key] = (tmp != 0);
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.h
Expand Up @@ -274,16 +274,6 @@ class vtkCGNSMetaData
std::vector<double> GlobalTime;
};

//------------------------------------------------------------------------------
// sort variables by name helper function
static int sortVariablesByName(const void* vOne, const void* vTwo)
{
Variable* varOne = (Variable*)vOne;
Variable* varTwo = (Variable*)vTwo;

return (strcmp(varOne->name, varTwo->name));
}

//------------------------------------------------------------------------------
// compare name return true if name1 == name2
inline bool compareName(const char_33 nameOne, const char_33 nameTwo)
Expand Down

0 comments on commit cd8aaee

Please sign in to comment.