Commit 2ef1a2c8 authored by Chuck Atkins's avatar Chuck Atkins
Browse files

COMP: Remove unreachable break; statements following returns

This resolves PGI ~ 600 warnings "#111-D: statement is unreachable"

Change-Id: I9937c4f22eec4e9f56b6b770e35a6a1ca7390974
parent 71ef2ea6
......@@ -321,16 +321,9 @@ int vtkAbstractArray::GetDataTypeSize(int type)
);
case VTK_BIT:
return 0;
break;
case VTK_STRING:
return 0;
break;
case VTK_UNICODE_STRING:
return 0;
break;
default:
vtkGenericWarningMacro(<<"Unsupported data type!");
......@@ -385,12 +378,10 @@ vtkAbstractArray* vtkAbstractArray::CreateArray(int dataType)
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return vtk__Int64Array::New();
break;
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
case VTK_UNSIGNED___INT64:
return vtkUnsigned__Int64Array::New();
break;
# endif
#endif
......
......@@ -678,7 +678,6 @@ vtkFieldData* vtkDataObject::GetAttributesAsFieldData(int type)
{
case FIELD:
return this->FieldData;
break;
}
return 0;
}
......@@ -710,7 +709,6 @@ vtkIdType vtkDataObject::GetNumberOfElements(int type)
{
case FIELD:
return this->FieldData->GetNumberOfTuples();
break;
}
return 0;
}
......@@ -651,10 +651,8 @@ vtkFieldData* vtkDataSet::GetAttributesAsFieldData(int type)
{
case POINT:
return this->GetPointData();
break;
case CELL:
return this->GetCellData();
break;
}
return this->Superclass::GetAttributesAsFieldData(type);
}
......@@ -666,10 +664,8 @@ vtkIdType vtkDataSet::GetNumberOfElements(int type)
{
case POINT:
return this->GetNumberOfPoints();
break;
case CELL:
return this->GetNumberOfCells();
break;
}
return this->Superclass::GetNumberOfElements(type);;
}
......
......@@ -311,7 +311,6 @@ void vtkGenericAdaptorCell::Contour(vtkContourValues *contourValues,
default:
assert("check: impossible case" && 0);
return;
break;
}
int currComp=attributes->GetActiveComponent();
......@@ -413,7 +412,6 @@ void vtkGenericAdaptorCell::Contour(vtkContourValues *contourValues,
default:
assert("TODO: dimension 1 and 0" && 0);
return;
break;
}
vtkIdType npts, *pts = 0;
......@@ -557,7 +555,6 @@ void vtkGenericAdaptorCell::Clip(double value,
default:
assert("check: impossible case" && 0);
return;
break;
}
int currComp=attributes->GetActiveComponent();
......@@ -640,7 +637,6 @@ void vtkGenericAdaptorCell::Clip(double value,
default:
assert("TODO: dimension 1 and 0" && 0);
return;
break;
}
vtkIdType npts, *pts = 0;
......@@ -785,7 +781,6 @@ void vtkGenericAdaptorCell::Tessellate(vtkGenericAttributeCollection *attributes
default:
assert("check: impossible case" && 0);
return;
break;
}
double *locals=this->GetParametricCoords();
this->InternalIds->Reset();
......
......@@ -1792,10 +1792,8 @@ vtkFieldData* vtkGraph::GetAttributesAsFieldData(int type)
{
case VERTEX:
return this->GetVertexData();
break;
case EDGE:
return this->GetEdgeData();
break;
}
return this->Superclass::GetAttributesAsFieldData(type);
}
......@@ -1807,10 +1805,8 @@ vtkIdType vtkGraph::GetNumberOfElements(int type)
{
case VERTEX:
return this->GetNumberOfVertices();
break;
case EDGE:
return this->GetNumberOfEdges();
break;
}
return this->Superclass::GetNumberOfElements(type);;
}
......
......@@ -2169,7 +2169,6 @@ vtkCell *vtkHyperOctree::GetCell(vtkIdType cellId)
default:
return NULL;
break;
}
if (this->DualGridFlag)
......
......@@ -238,7 +238,6 @@ vtkCell *vtkImageData::GetCell(vtkIdType cellId)
default:
vtkErrorMacro("Invalid DataDescription.");
return NULL;
break;
}
// Extract point coordinates and point ids
......
......@@ -217,7 +217,6 @@ vtkCell *vtkRectilinearGrid::GetCell(vtkIdType cellId)
default:
vtkErrorMacro(<<"Invalid DataDescription.");
return NULL;
break;
}
......
......@@ -275,7 +275,6 @@ vtkCell *vtkStructuredGrid::GetCell(vtkIdType cellId)
default:
vtkErrorMacro(<<"Invalid DataDescription.");
return NULL;
break;
}
// Extract point coordinates and point ids. NOTE: the ordering of the vtkQuad
......
......@@ -663,7 +663,6 @@ vtkFieldData* vtkTable::GetAttributesAsFieldData(int type)
{
case ROW:
return this->GetRowData();
break;
}
return this->Superclass::GetAttributesAsFieldData(type);
}
......@@ -675,7 +674,6 @@ vtkIdType vtkTable::GetNumberOfElements(int type)
{
case ROW:
return this->GetNumberOfRows();
break;
}
return this->Superclass::GetNumberOfElements(type);;
}
......@@ -301,8 +301,7 @@ vtkCell *vtkUniformGrid::GetCell(vtkIdType cellId)
default:
vtkErrorMacro(<<"Invalid DataDescription.");
return NULL;
break;
}
}
// Extract point coordinates and point ids
// Ids are relative to extent min.
......@@ -602,8 +601,7 @@ vtkCell *vtkUniformGrid::FindAndGetCell(double x[3],
default:
vtkErrorMacro(<<"Invalid DataDescription.");
return NULL;
break;
}
}
cell->InterpolateFunctions(pcoords,weights);
npts = 0;
......
......@@ -122,7 +122,6 @@ int vtkExtractSelectedIds::RequestData(
{
case vtkSelectionNode::CELL:
return this->ExtractCells(node, input, output);
break;
case vtkSelectionNode::POINT:
return this->ExtractPoints(node, input, output);
}
......
......@@ -91,13 +91,10 @@ const char *vtkClipClosedSurface::GetScalarModeAsString()
{
case VTK_CCS_SCALAR_MODE_NONE:
return "None";
break;
case VTK_CCS_SCALAR_MODE_COLORS:
return "Colors";
break;
case VTK_CCS_SCALAR_MODE_LABELS:
return "Labels";
break;
}
return "";
}
......
......@@ -266,7 +266,6 @@ int vtkQuadratureSchemeDictionaryGenerator::Generate(
<< "with no definition provided. Add a definition " << " in "
<< __FILE__ << ". Aborting." << endl;
return 0;
break;
}
// The definition must apear in the dictionary associated
......
......@@ -165,22 +165,18 @@ int vtkGreedyTerrainDecimation::SatisfiesErrorMeasure(double error)
{
case VTK_ERROR_NUMBER_OF_TRIANGLES:
if ( this->Mesh->GetNumberOfPolys() >= this->NumberOfTriangles ) return 1;
break;
case VTK_ERROR_SPECIFIED_REDUCTION:
{
double reduction = (double)this->Mesh->GetNumberOfPolys()/this->MaximumNumberOfTriangles;
if ( (1.0 - reduction) <= this->Reduction ) return 1;
}
break;
case VTK_ERROR_ABSOLUTE:
if ( error <= this->AbsoluteError ) return 1;
break;
case VTK_ERROR_RELATIVE:
if ( (error/this->Length) <= this->RelativeError ) return 1;
break;
}
return 0;
......
......@@ -222,52 +222,36 @@ mxClassID vtkMatlabMexAdapter::GetMatlabDataType(vtkDataArray* da)
{
case VTK_BIT:
return(mxUINT8_CLASS);
break;
case VTK_CHAR:
return(mxINT8_CLASS);
break;
case VTK_SIGNED_CHAR:
return(mxCHAR_CLASS);
break;
case VTK_UNSIGNED_CHAR:
return(mxUINT8_CLASS);
break;
case VTK_SHORT:
return(mxINT16_CLASS);
break;
case VTK_UNSIGNED_SHORT:
return(mxUINT16_CLASS);
break;
case VTK_INT:
return(mxINT32_CLASS);
break;
case VTK_ID_TYPE:
return(mxINT32_CLASS);
break;
case VTK_UNSIGNED_INT:
return(mxUINT32_CLASS);
break;
case VTK_LONG:
return(mxINT64_CLASS);
break;
case VTK_UNSIGNED_LONG:
return(mxUINT64_CLASS);
break;
case VTK_LONG_LONG:
return(mxINT64_CLASS);
break;
case VTK_UNSIGNED_LONG_LONG:
return(mxUINT64_CLASS);
break;
case VTK_FLOAT:
return(mxSINGLE_CLASS);
break;
case VTK_DOUBLE:
return(mxDOUBLE_CLASS);
break;
default:
return(mxDOUBLE_CLASS);
break;
}
}
......@@ -279,43 +263,30 @@ vtkDataArray* vtkMatlabMexAdapter::GetVTKDataType(mxClassID cid)
{
case mxCHAR_CLASS:
return(vtkCharArray::New());
break;
case mxLOGICAL_CLASS:
return(vtkUnsignedShortArray::New());
break;
case mxDOUBLE_CLASS:
return(vtkDoubleArray::New());
break;
case mxSINGLE_CLASS:
return(vtkFloatArray::New());
break;
case mxINT8_CLASS:
return(vtkTypeInt8Array::New());
break;
case mxUINT8_CLASS:
return(vtkTypeUInt8Array::New());
break;
case mxINT16_CLASS:
return(vtkTypeInt16Array::New());
break;
case mxUINT16_CLASS:
return(vtkTypeUInt16Array::New());
break;
case mxINT32_CLASS:
return(vtkTypeInt32Array::New());
break;
case mxUINT32_CLASS:
return(vtkTypeUInt32Array::New());
break;
case mxINT64_CLASS:
return(vtkTypeInt64Array::New());
break;
case mxUINT64_CLASS:
return(vtkTypeUInt64Array::New());
break;
default:
return(vtkDoubleArray::New());
break;
}
}
......@@ -616,43 +587,30 @@ vtkArray* vtkMatlabMexAdapter::mxArrayTovtkArray(mxArray* mxa)
{
case mxCHAR_CLASS:
return(CopymxArrayToVTKArray<char>(mxa,VTK_CHAR));
break;
case mxLOGICAL_CLASS:
return(CopymxArrayToVTKArray<unsigned char>(mxa, VTK_BIT));
break;
case mxDOUBLE_CLASS:
return(CopymxArrayToVTKArray<double>(mxa,VTK_DOUBLE));
break;
case mxSINGLE_CLASS:
return(CopymxArrayToVTKArray<float>(mxa,VTK_FLOAT));
break;
case mxINT8_CLASS:
return(CopymxArrayToVTKArray<short>(mxa,VTK_SHORT));
break;
case mxUINT8_CLASS:
return(CopymxArrayToVTKArray<unsigned char>(mxa,VTK_UNSIGNED_CHAR));
break;
case mxINT16_CLASS:
return(CopymxArrayToVTKArray<short>(mxa,VTK_SHORT));
break;
case mxUINT16_CLASS:
return(CopymxArrayToVTKArray<unsigned short>(mxa,VTK_UNSIGNED_SHORT));
break;
case mxINT32_CLASS:
return(CopymxArrayToVTKArray<int>(mxa,VTK_INT));
break;
case mxUINT32_CLASS:
return(CopymxArrayToVTKArray<unsigned int>(mxa,VTK_UNSIGNED_INT));
break;
case mxINT64_CLASS:
return(CopymxArrayToVTKArray<long>(mxa,VTK_LONG));
break;
case mxUINT64_CLASS:
return(CopymxArrayToVTKArray<unsigned long>(mxa,VTK_UNSIGNED_LONG));
break;
default:
return(CopymxArrayToVTKArray<double>(mxa,VTK_DOUBLE));
break;
}
}
......
......@@ -242,16 +242,8 @@ int vtkBivariateLinearTableThreshold::ApplyThreshold(vtkTable* tableToThreshold,
default:
vtkErrorMacro(<<"Threshold type not defined: "<<this->LinearThresholdType);
return 0;
break;
}
if (!thresholdFunc)
{
vtkErrorMacro(<<"No threshold function specified.");
return 0;
}
acceptedIds->Initialize();
int numTuples = a1->GetNumberOfTuples();
double v1,v2;
......
......@@ -97,22 +97,21 @@ vtkFieldData* vtkComputeQuartiles::GetInputFieldData(vtkDataObject* input)
case vtkDataObject::FIELD_ASSOCIATION_POINTS:
case vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS:
return vtkDataSet::SafeDownCast(input)->GetPointData();
break;
case vtkDataObject::FIELD_ASSOCIATION_CELLS:
return vtkDataSet::SafeDownCast(input)->GetCellData();
break;
case vtkDataObject::FIELD_ASSOCIATION_NONE:
return input->GetFieldData();
break;
case vtkDataObject::FIELD_ASSOCIATION_VERTICES:
return vtkGraph::SafeDownCast(input)->GetVertexData();
break;
case vtkDataObject::FIELD_ASSOCIATION_EDGES:
return vtkGraph::SafeDownCast(input)->GetEdgeData();
break;
case vtkDataObject::FIELD_ASSOCIATION_ROWS:
return vtkTable::SafeDownCast(input)->GetRowData();
break;
}
return 0;
}
......
......@@ -253,25 +253,27 @@ int vtkRInterface::EvalRscript(const char *string, bool showRoutput)
}
}
break;
case PARSE_INCOMPLETE:
vtkErrorMacro(<<"R parse status is PARSE_INCOMPLETE");
/* need to read another line */
break;
case PARSE_NULL:
vtkErrorMacro(<<"R parse status is PARSE_NULL");
return 1;
break;
case PARSE_ERROR:
vtkErrorMacro(<<"R parse status is PARSE_ERROR");
return 1;
break;
case PARSE_EOF:
vtkErrorMacro(<<"R parse status is PARSE_EOF");
break;
default:
vtkErrorMacro(<<"R parse status is NOT DOCUMENTED");
return 1;
break;
}
UNPROTECT(2);
this->FillOutputBuffer();
......
......@@ -293,13 +293,10 @@ QVariant vtkQtAnnotationLayersModelAdapter::data(const QModelIndex &idx, int rol
{
case 1:
return QVariant(numItems);
break;
case 2:
return QVariant(a->GetInformation()->Get(vtkAnnotation::LABEL()));
break;
default:
return QVariant();
break;
}
}
else if (role == Qt::DecorationRole)
......@@ -308,10 +305,8 @@ QVariant vtkQtAnnotationLayersModelAdapter::data(const QModelIndex &idx, int rol
{
case 0:
return QColor(annColor[0], annColor[1], annColor[2]);
break;
default:
return QVariant();
break;
}
}
......@@ -360,16 +355,12 @@ QVariant vtkQtAnnotationLayersModelAdapter::headerData(int section, Qt::Orientat
{
case 0:
return QVariant("C");
break;
case 1:
return QVariant("# Items");
break;
case 2:
return QVariant("Label");
break;
default:
return QVariant();
break;
}
}
......
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