Skip to content
Snippets Groups Projects
Commit 99b9af87 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

COMP: VLAs are not supported by MSVC (C99).

Just use a string, and removed inline from the protected methods -
should be private if we want to inline them.

Change-Id: I72b03b417e009862574e5ef27506dec64f73455f
parent 124e036a
No related branches found
No related tags found
No related merge requests found
......@@ -394,18 +394,11 @@ void vtkBlueObeliskDataParser::CharacterDataHandler(const char *data,
}
//----------------------------------------------------------------------------
inline void vtkBlueObeliskDataParser::SetCurrentValue(const char *data,
int length)
void vtkBlueObeliskDataParser::SetCurrentValue(const char *data, int length)
{
char str[length + 1];
str[length] = 0;
std::string str(data, data+length);
for (int i = 0; i < length; ++i)
{
str[i] = data[i];
}
this->SetCurrentValue(str);
this->SetCurrentValue(str.c_str());
}
//----------------------------------------------------------------------------
......@@ -477,9 +470,8 @@ void vtkBlueObeliskDataParser::SetCurrentValue(const char *data)
}
//----------------------------------------------------------------------------
inline void
vtkBlueObeliskDataParser::ResizeArrayIfNeeded(vtkAbstractArray *arr,
vtkIdType ind)
void vtkBlueObeliskDataParser::ResizeArrayIfNeeded(vtkAbstractArray *arr,
vtkIdType ind)
{
if (ind >= arr->GetNumberOfTuples())
{
......@@ -488,28 +480,27 @@ vtkBlueObeliskDataParser::ResizeArrayIfNeeded(vtkAbstractArray *arr,
}
//----------------------------------------------------------------------------
inline void vtkBlueObeliskDataParser::ResizeAndSetValue(vtkStdString *val,
vtkStringArray *arr,
vtkIdType ind)
void vtkBlueObeliskDataParser::ResizeAndSetValue(vtkStdString *val,
vtkStringArray *arr,
vtkIdType ind)
{
vtkBlueObeliskDataParser::ResizeArrayIfNeeded(arr, ind);
arr->SetValue(ind, val->c_str());
}
//----------------------------------------------------------------------------
inline void vtkBlueObeliskDataParser::ResizeAndSetValue(float val,
vtkFloatArray *arr,
vtkIdType ind)
void vtkBlueObeliskDataParser::ResizeAndSetValue(float val,
vtkFloatArray *arr,
vtkIdType ind)
{
vtkBlueObeliskDataParser::ResizeArrayIfNeeded(arr, ind);
arr->SetValue(ind, val);
}
//----------------------------------------------------------------------------
inline void
vtkBlueObeliskDataParser::ResizeAndSetValue(unsigned short val,
vtkUnsignedShortArray *arr,
vtkIdType ind)
void vtkBlueObeliskDataParser::ResizeAndSetValue(unsigned short val,
vtkUnsignedShortArray *arr,
vtkIdType ind)
{
vtkBlueObeliskDataParser::ResizeArrayIfNeeded(arr, ind);
arr->SetValue(ind, val);
......
......@@ -138,13 +138,14 @@ int vtkMoleculeToAtomBallFilter::RequestData(
spherePolys->InitTraversal();
while (spherePolys->GetNextCell(numCellPoints, cellPoints) != 0)
{
vtkIdType newCellPoints[numCellPoints];
vtkIdType *newCellPoints = new vtkIdType[numCellPoints];
for (vtkIdType i = 0; i < numCellPoints; ++i)
{
// The new point ids should be offset by the pointOffset above
newCellPoints[i] = cellPoints[i] + pointOffset;
}
polys->InsertNextCell(numCellPoints, newCellPoints);
delete [] newCellPoints;
}
}
......
......@@ -177,13 +177,14 @@ int vtkMoleculeToBondStickFilter::RequestData(
cylPolys->InitTraversal();
while (cylPolys->GetNextCell(numCellPoints, cellPoints) != 0)
{
vtkIdType newCellPoints[numCellPoints];
vtkIdType *newCellPoints = new vtkIdType[numCellPoints];
for (vtkIdType i = 0; i < numCellPoints; ++i)
{
// The new point ids should be offset by the pointOffset above
newCellPoints[i] = cellPoints[i] + pointOffset;
}
polys->InsertNextCell(numCellPoints, newCellPoints);
delete [] newCellPoints;
}
// Setup for the next cylinder in a multi-bond
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment