Commit 278cd5b1 authored by Ken Martin's avatar Ken Martin

more size_t to vtkIdTYpe warnings

shut up warnings on mun
parent f3d0404e
......@@ -147,7 +147,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# the following warnings when built with the MS compilers. Qt guys should
# fix their code. Until they do, keep the Qt chatter off the VTK dashboard
# results:
"[Qq]t([Cc]ore|[Gg]ui).*warning C4127: conditional expression is constant"
"[Qq]t([Cc]ore|[Gg]ui).*(warning|note)"
"[Qq]t.*h.*warning.*declaration of .* shadows a member of .this"
"[Qq]t.*h.*warning.*(copy constructor|assignment operator) could not be generated"
"warning C4244: 'initializing' : conversion from 'qint64' to 'int', possible loss of data"
......@@ -157,6 +157,8 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"[Qq]t.*q.*h.*note: while compiling"
"[Qq]t.*q.*h.*note: see reference"
"[Qq]t.*ui_"
"[Qq]t.*note: see reference"
"[Qq]t.*warning C4714"
# Specifically for HP compiler, mask out
"Utilities.(vtkjpeg|vtksqlite).*warning.*more strictly aligned type"
......
......@@ -344,7 +344,7 @@ vtkAxis* vtkChartParallelCoordinates::GetAxis(int index)
//-----------------------------------------------------------------------------
vtkIdType vtkChartParallelCoordinates::GetNumberOfAxes()
{
return this->Storage->Axes.size();
return static_cast<vtkIdType>(this->Storage->Axes.size());
}
//-----------------------------------------------------------------------------
......
......@@ -1601,7 +1601,7 @@ vtkIdType vtkChartXYZ::AddPlot(vtkPlot3D * plot)
this->AddItem(plot);
plot->SetChart(this);
this->Plots.push_back(plot);
vtkIdType plotIndex = this->Plots.size() - 1;
vtkIdType plotIndex = static_cast<vtkIdType>(this->Plots.size() - 1);
// the first plot added to the chart defines the names of the axes
if (plotIndex == 0)
......
......@@ -67,7 +67,7 @@ vtkVector2f vtkContextPolygon::GetPoint(vtkIdType index) const
//-----------------------------------------------------------------------------
vtkIdType vtkContextPolygon::GetNumberOfPoints() const
{
return d->points.size();
return static_cast<vtkIdType>(d->points.size());
}
//-----------------------------------------------------------------------------
......
......@@ -313,7 +313,7 @@ class vtkPlotBarSegment : public vtkObject {
(targetPoint.GetY() < 0 && targetPoint.GetY() > low->pos.GetY()))
{
*location = low->pos;
return low->index;
return static_cast<vtkIdType>(low->index);
}
}
// Is the left side of the bar beyond the point?
......@@ -386,7 +386,7 @@ class vtkPlotBarSegment : public vtkObject {
(targetMax.GetY() < 0 && low->pos.GetY() <= targetMax.GetY()) ||
(targetMin.GetY() < 0 && targetMax.GetY() > 0))
{
selected.push_back(low->index);
selected.push_back(static_cast<int>(low->index));
}
}
// Is the left side of the bar beyond the box?
......@@ -403,7 +403,7 @@ class vtkPlotBarSegment : public vtkObject {
}
else
{
this->Bar->GetSelection()->SetNumberOfTuples(selected.size());
this->Bar->GetSelection()->SetNumberOfTuples(static_cast<vtkIdType>(selected.size()));
vtkIdType *ptr =
static_cast<vtkIdType *>(this->Bar->GetSelection()->GetVoidPointer(0));
for (size_t i = 0; i < selected.size(); ++i)
......
......@@ -163,7 +163,7 @@ bool vtkPlotParallelCoordinates::Paint(vtkContext2D *painter)
{
line[j].Set(this->Storage->AxisPos[j], (*this->Storage)[j][i]);
}
painter->GetPen()->SetColor(this->Colors->GetPointer(nc));
painter->GetPen()->SetColor(this->Colors->GetPointer(static_cast<vtkIdType>(nc)));
painter->DrawPoly(line[0].GetData(), static_cast<int>(cols));
}
}
......@@ -252,7 +252,7 @@ bool vtkPlotParallelCoordinates::SetSelectionRange(int axis, float low,
if (col[i] >= low && col[i] <= high)
{
// Remove this point - no longer selected
this->Selection->InsertNextValue(i);
this->Selection->InsertNextValue(static_cast<vtkIdType>(i));
}
}
this->Storage->SelectionInitialized = true;
......
......@@ -440,7 +440,7 @@ bool vtkPlotPoints::SelectPoints(const vtkVector2f& min, const vtkVector2f& max)
if (low->pos.GetX() >= min.GetX() && low->pos.GetX() <= max.GetX() &&
low->pos.GetY() >= min.GetY() && low->pos.GetY() <= max.GetY())
{
selected.push_back(low->index);
selected.push_back(static_cast<int>(low->index));
}
else if (low->pos.GetX() > max.GetX())
{
......@@ -448,7 +448,7 @@ bool vtkPlotPoints::SelectPoints(const vtkVector2f& min, const vtkVector2f& max)
}
++low;
}
this->Selection->SetNumberOfTuples(selected.size());
this->Selection->SetNumberOfTuples(static_cast<vtkIdType>(selected.size()));
vtkIdType *ptr = static_cast<vtkIdType *>(this->Selection->GetVoidPointer(0));
for (size_t i = 0; i < selected.size(); ++i)
{
......
......@@ -93,7 +93,8 @@ bool vtkPlotPoints3D::Paint(vtkContext2D *painter)
this->SelectedPoints.reserve(nSelected);
for (size_t i = 0; i < nSelected; ++i)
{
this->SelectedPoints.push_back(this->Points[this->Selection->GetValue(i)]);
this->SelectedPoints.push_back(this->Points[
this->Selection->GetValue(static_cast<vtkIdType>(i))]);
}
this->SelectedPointsBuildTime.Modified();
}
......
......@@ -60,7 +60,7 @@ void vtkParallelAMRUtilities::DistributeProcessInformation(vtkOverlappingAMR* am
myBlocks.push_back(iter->GetCurrentFlatIndex());
}
vtkIdType myNumBlocks = myBlocks.size();
vtkIdType myNumBlocks = static_cast<vtkIdType>(myBlocks.size());
std::vector<vtkIdType> numBlocks(numProcs,0);
numBlocks[myRank] = myNumBlocks;
......
......@@ -148,7 +148,7 @@ int vtkPeriodicFilter::RequestData(vtkInformation *vtkNotUsed(request),
if (controller)
{
controller->AllReduce(&this->PeriodNumbers.front(), reducedPeriodNumbers,
this->PeriodNumbers.size(), vtkCommunicator::MAX_OP);
static_cast<vtkIdType>(this->PeriodNumbers.size()), vtkCommunicator::MAX_OP);
int i = 0;
iter->InitTraversal();
while (!iter->IsDoneWithTraversal() && this->Indices.size() > 0)
......
......@@ -321,7 +321,7 @@ int vtkSelectionSource::RequestData(
vtkIdType numCommonElems = 0;
if (!this->Internal->StringIDs.empty())
{
numCommonElems = this->Internal->StringIDs[0].size();
numCommonElems = static_cast<vtkIdType>(this->Internal->StringIDs[0].size());
}
if (piece+1 >= (int)this->Internal->StringIDs.size() &&
numCommonElems == 0)
......@@ -349,7 +349,7 @@ int vtkSelectionSource::RequestData(
if (!selSet.empty())
{
// Create the selection list
selectionList->SetNumberOfTuples(selSet.size());
selectionList->SetNumberOfTuples(static_cast<vtkIdType>(selSet.size()));
// iterate over ids and insert to the selection list
vtkSelectionSourceInternals::StringIDSetType::iterator iter =
selSet.begin();
......@@ -382,7 +382,7 @@ int vtkSelectionSource::RequestData(
vtkIdType numCommonElems = 0;
if (!this->Internal->IDs.empty())
{
numCommonElems = this->Internal->IDs[0].size();
numCommonElems = static_cast<vtkIdType>(this->Internal->IDs[0].size());
}
if (piece+1 >= (int)this->Internal->IDs.size() &&
numCommonElems == 0)
......@@ -411,7 +411,7 @@ int vtkSelectionSource::RequestData(
if (!selSet.empty())
{
// Create the selection list
selectionList->SetNumberOfTuples(selSet.size());
selectionList->SetNumberOfTuples(static_cast<vtkIdType>(selSet.size()));
// iterate over ids and insert to the selection list
vtkSelectionSourceInternals::IDSetType::iterator iter =
selSet.begin();
......@@ -433,7 +433,8 @@ int vtkSelectionSource::RequestData(
// Create the selection list
vtkDoubleArray* selectionList = vtkDoubleArray::New();
selectionList->SetNumberOfComponents(3);
selectionList->SetNumberOfValues(this->Internal->Locations.size());
selectionList->SetNumberOfValues(
static_cast<vtkIdType>(this->Internal->Locations.size()));
std::vector<double>::iterator iter =
this->Internal->Locations.begin();
......@@ -458,7 +459,8 @@ int vtkSelectionSource::RequestData(
// Create the selection list
vtkDoubleArray* selectionList = vtkDoubleArray::New();
selectionList->SetNumberOfComponents(1);
selectionList->SetNumberOfValues(this->Internal->Thresholds.size());
selectionList->SetNumberOfValues(
static_cast<vtkIdType>(this->Internal->Thresholds.size()));
std::vector<double>::iterator iter =
this->Internal->Thresholds.begin();
......@@ -494,7 +496,8 @@ int vtkSelectionSource::RequestData(
oProperties->Set(vtkSelectionNode::CONTENT_TYPE(), this->ContentType);
vtkUnsignedIntArray* selectionList = vtkUnsignedIntArray::New();
selectionList->SetNumberOfComponents(1);
selectionList->SetNumberOfTuples(this->Internal->Blocks.size());
selectionList->SetNumberOfTuples(
static_cast<vtkIdType>(this->Internal->Blocks.size()));
vtkSelectionSourceInternals::IDSetType::iterator iter;
vtkIdType cc=0;
for (iter = this->Internal->Blocks.begin();
......
......@@ -427,7 +427,8 @@ int LSDynaFamily::BufferChunk( WordType wType, vtkIdType chunkSizeInWords )
this->ChunkWord = 0;
while ( bytesLeft )
{
bytesRead = VTK_LSDYNA_READ(this->FD,(void*) buf,bytesLeft);
bytesRead = static_cast<vtkIdType>(
VTK_LSDYNA_READ(this->FD,(void*) buf,bytesLeft));
this->ChunkValid += bytesRead;
if ( bytesRead < bytesLeft )
{
......@@ -705,7 +706,7 @@ vtkIdType LSDynaFamily::GetStateSize() const
//-----------------------------------------------------------------------------
vtkIdType LSDynaFamily::GetNumberOfFiles()
{
return this->Files.size();
return static_cast<vtkIdType>(this->Files.size());
}
//-----------------------------------------------------------------------------
......
......@@ -900,7 +900,7 @@ void vtkLSDynaPart::BuildCells()
//make the unstrucuted grid data structures point to the
//Cells vectors underlying memory
vtkIdType cellDataSize = this->Cells->dataSize();
vtkIdType cellDataSize = static_cast<vtkIdType>(this->Cells->dataSize());
//copy the contents from the part into a cell array.
vtkIdTypeArray *cellArray = vtkIdTypeArray::New();
......
......@@ -2405,9 +2405,9 @@ int vtkLSDynaReader::RequestInformation( vtkInformation* vtkNotUsed(request),
{
p->CurrentState = 0;
}
else if ( p->CurrentState >= (int) p->TimeValues.size() )
else if ( p->CurrentState >= static_cast<vtkIdType>(p->TimeValues.size()) )
{
p->CurrentState = p->TimeValues.size() - 1;
p->CurrentState = static_cast<vtkIdType>(p->TimeValues.size() - 1);
}
int newAdaptLevel = p->Fam.TimeAdaptLevel( p->CurrentState );
......@@ -3143,7 +3143,7 @@ int vtkLSDynaReader::ReadPartTitlesFromRootFile()
//make sure that the root files has room left for the amount of data we are going to request
//if it doesn't we know it can't have part names
vtkIdType numParts = p->PartIds.size();
vtkIdType numParts = static_cast<vtkIdType>(p->PartIds.size());
vtkIdType partTitlesByteSize = p->Fam.GetWordSize() * (2 + numParts); //NType + NUMPRop + (header part ids)
partTitlesByteSize += (numParts * 72); //names are constant at 72 bytes each independent of word size
......
......@@ -893,8 +893,8 @@ void vtkMINCImageAttributes::SetAttributeValueAsString(
vtkCharArray *array = vtkCharArray::New();
// Allocate an extra byte to store a null terminator.
array->Resize(length + 1);
char *dest = array->WritePointer(0, length);
array->Resize(static_cast<vtkIdType>(length + 1));
char *dest = array->WritePointer(0, static_cast<vtkIdType>(length));
strncpy(dest, value, length);
dest[length] = '\0';
this->SetAttributeValueAsArray(variable, attribute, array);
......
......@@ -469,7 +469,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
// NetCDF leaves it up to us to decide whether NC_BYTE
// should be signed.
vtkUnsignedCharArray *ucharArray = vtkUnsignedCharArray::New();
ucharArray->SetNumberOfValues(attlength);
ucharArray->SetNumberOfValues(static_cast<vtkIdType>(attlength));
nc_get_att_uchar(ncid, varid, attname,
ucharArray->GetPointer(0));
dataArray = ucharArray;
......@@ -481,8 +481,8 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
vtkCharArray *charArray = vtkCharArray::New();
// The netcdf standard doesn't enforce null-termination
// of string attributes, so we add a null here.
charArray->Resize(attlength + 1);
char *dest = charArray->WritePointer(0, attlength);
charArray->Resize(static_cast<vtkIdType>(attlength + 1));
char *dest = charArray->WritePointer(0, static_cast<vtkIdType>(attlength));
nc_get_att_text(ncid, varid, attname, dest);
dest[attlength] = '\0';
dataArray = charArray;
......@@ -491,7 +491,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
case NC_SHORT:
{
vtkShortArray *shortArray = vtkShortArray::New();
shortArray->SetNumberOfValues(attlength);
shortArray->SetNumberOfValues(static_cast<vtkIdType>(attlength));
nc_get_att_short(ncid, varid, attname,
shortArray->GetPointer(0));
dataArray = shortArray;
......@@ -500,7 +500,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
case NC_INT:
{
vtkIntArray *intArray = vtkIntArray::New();
intArray->SetNumberOfValues(attlength);
intArray->SetNumberOfValues(static_cast<vtkIdType>(attlength));
nc_get_att_int(ncid, varid, attname,
intArray->GetPointer(0));
dataArray = intArray;
......@@ -509,7 +509,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
case NC_FLOAT:
{
vtkFloatArray *floatArray = vtkFloatArray::New();
floatArray->SetNumberOfValues(attlength);
floatArray->SetNumberOfValues(static_cast<vtkIdType>(attlength));
nc_get_att_float(ncid, varid, attname,
floatArray->GetPointer(0));
dataArray = floatArray;
......@@ -518,7 +518,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
case NC_DOUBLE:
{
vtkDoubleArray *doubleArray = vtkDoubleArray::New();
doubleArray->SetNumberOfValues(attlength);
doubleArray->SetNumberOfValues(static_cast<vtkIdType>(attlength));
nc_get_att_double(ncid, varid, attname,
doubleArray->GetPointer(0));
dataArray = doubleArray;
......@@ -574,7 +574,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
return 0;
}
this->ImageAttributes->AddDimension(dimname, dimlength);
this->ImageAttributes->AddDimension(dimname, static_cast<vtkIdType>(dimlength));
int dimIndex = this->IndexFromDimensionName(dimname);
......@@ -640,7 +640,7 @@ int vtkMINCImageReader::ReadMINCFileAttributes()
start[i] = 0;
count[i] = dimlength;
size *= dimlength;
size *= static_cast<vtkIdType>(dimlength);
}
doubleArray->SetNumberOfValues(size);
......@@ -1039,7 +1039,7 @@ void vtkMINCImageReaderExecuteChunk(
break;
}
dimprod *= count[idim];
dimprod *= static_cast<vtkIdType>(count[idim]);
}
// Save the count and permuted increment of this dimension.
......@@ -1241,7 +1241,7 @@ void vtkMINCImageReader::ExecuteDataWithInformation(vtkDataObject *output,
if (idim < nminmaxdims || hitChunkSizeLimit)
{
// Number of chunks is product of dimensions in minmax.
nchunks *= count[idim];
nchunks *= static_cast<vtkIdType>(count[idim]);
// Only set nchunkdims once
if (nchunkdimsIsSet == 0)
......@@ -1252,7 +1252,7 @@ void vtkMINCImageReader::ExecuteDataWithInformation(vtkDataObject *output,
}
else
{
chunkSize *= count[idim];
chunkSize *= static_cast<vtkIdType>(count[idim]);
}
}
......@@ -1299,11 +1299,12 @@ void vtkMINCImageReader::ExecuteDataWithInformation(vtkDataObject *output,
count2[idim] = 1;
if (idim < nminmaxdims)
{
minmaxIdx += start2[idim]*minmaxInc;
minmaxInc *= length[idim];
minmaxIdx += static_cast<vtkIdType>(start2[idim]*minmaxInc);
minmaxInc *= static_cast<vtkIdType>(length[idim]);
}
chunkOffset += (start2[idim] - start[idim])*permutedInc[idim];
chunkProd *= count[idim];
chunkOffset += static_cast<vtkIdType>(
(start2[idim] - start[idim])*permutedInc[idim]);
chunkProd *= static_cast<vtkIdType>(count[idim]);
}
// Get the min and max values to apply to this chunk
......
......@@ -1408,7 +1408,7 @@ void vtkMINCImageWriterExecuteChunk(
// Also need to break if the spatial dimension
// corresponding to idim has flipped.
dimprod *= count[idim];
dimprod *= static_cast<vtkIdType>(count[idim]);
}
T2 *outPtr = buffer;
......@@ -1688,7 +1688,7 @@ int vtkMINCImageWriter::WriteMINCData(
if (idim < nminmaxdims)
{
// Number of chunks is product of dimensions in minmax.
nchunks *= count[idim];
nchunks *= static_cast<vtkIdType>(count[idim]);
// After each chunk, we will increment inPtr by chunkInc.
if (chunkInc == 0)
......@@ -1706,7 +1706,7 @@ int vtkMINCImageWriter::WriteMINCData(
}
else
{
chunkSize *= count[idim];
chunkSize *= static_cast<vtkIdType>(count[idim]);
}
}
......@@ -1750,10 +1750,11 @@ int vtkMINCImageWriter::WriteMINCData(
count2[idim] = 1;
if (permutedInc[idim] != 0)
{
minmaxIdx += (start2[idim] - start[idim])*minmaxInc;
minmaxInc *= count[idim];
minmaxIdx += static_cast<vtkIdType>(
(start2[idim] - start[idim])*minmaxInc);
minmaxInc *= static_cast<vtkIdType>(count[idim]);
}
chunkProd *= count[idim];
chunkProd *= static_cast<vtkIdType>(count[idim]);
}
// Space to store the computed min and max of each chunk.
......
......@@ -350,7 +350,7 @@ int vtkNetCDFCFReader::vtkDimensionInfo::LoadMetaData(int ncFD)
double v1 = this->Coordinates->GetValue(i);
this->Bounds->SetValue(i, 0.5*(v0+v1));
}
this->Bounds->SetValue(dimLen,
this->Bounds->SetValue(static_cast<vtkIdType>(dimLen),
this->Coordinates->GetValue(static_cast<vtkIdType>(dimLen-1))+0.5*this->Spacing);
}
}
......
......@@ -367,7 +367,7 @@ int vtkPDataSetWriter::WriteImageMetaData(vtkImageData * input,
int nRanks = this->Controller->GetNumberOfProcesses();
int nPiecesTotal = 0;
vtkIdType nPieces = this->Extents.size();
vtkIdType nPieces = static_cast<vtkIdType>(this->Extents.size());
vtkIdType* offsets = 0;
vtkIdType* nPiecesAll = 0;
......
......@@ -276,7 +276,8 @@ void vtkImageGaussianSmooth::ExecuteAxis(int axis,
switch (outData->GetScalarType())
{
vtkTemplateMacro(
outIncA *= vtkImageGaussianSmoothGetTypeSize(static_cast<VTK_TT*>(0))
outIncA *= static_cast<vtkIdType>(
vtkImageGaussianSmoothGetTypeSize(static_cast<VTK_TT*>(0)))
);
default:
vtkErrorMacro("Unknown scalar type");
......
......@@ -156,7 +156,7 @@ int vtkTableToArray::RequestData(
}
vtkDenseArray<double>* const array = vtkDenseArray<double>::New();
array->Resize(table->GetNumberOfRows(), columns.size());
array->Resize(table->GetNumberOfRows(), static_cast<vtkIdType>(columns.size()));
array->SetDimensionLabel(0, "row");
array->SetDimensionLabel(1, "column");
......@@ -164,7 +164,8 @@ int vtkTableToArray::RequestData(
{
for(size_t j = 0; j != columns.size(); ++j)
{
array->SetValue(i, j, columns[j]->GetVariantValue(i).ToDouble());
array->SetValue(i, static_cast<vtkIdType>(j),
columns[j]->GetVariantValue(i).ToDouble());
}
}
......
......@@ -48,7 +48,7 @@ public:
vtkIdType GetNumberOfPoints() const
{
return this->points.size();
return static_cast<vtkIdType>(this->points.size());
}
void Clear()
......
......@@ -149,7 +149,7 @@ void vtkContextScene::PaintIds()
}
for (size_t i = 0; i < size; ++i)
{
this->LastPainter->ApplyId(i+1);
this->LastPainter->ApplyId(static_cast<vtkIdType>(i+1));
(*this->Children)[i]->Paint(this->LastPainter);
}
this->Storage->IsDirty = false;
......
......@@ -418,7 +418,7 @@ void vtkUnstructuredGridPartialPreIntegration::Integrate(
for (int j = 0; j < numscalars; j++)
{
std::vector<double> &cp = this->TransferFunctions[j].ControlPoints;
vtkIdType numcp = cp.size();
vtkIdType numcp = static_cast<vtkIdType>(cp.size());
double minscalar, maxscalar;
if (nearScalars[j] < farScalars[j])
{
......
......@@ -199,7 +199,8 @@ void vtkGraphItem::PaintBuffers(vtkContext2D *painter)
{
return;
}
vtkIdType numEdges = this->Internal->EdgePositions.size();
vtkIdType numEdges = static_cast<vtkIdType>(
this->Internal->EdgePositions.size());
for (vtkIdType edgeIdx = 0; edgeIdx < numEdges; ++edgeIdx)
{
if (this->Internal->EdgePositions[edgeIdx].empty())
......
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