Commit 3cc4d9fc authored by Sean McBride's avatar Sean McBride

Fix -Wimplicit-fallthrough warnings; introduce VTK_FALLTHROUGH

Fixed all clang -Wimplicit-fallthrough warnings:
- Some fixed by adding missing breaks
- Other fixed by adding VTK_FALLTHROUGH statement

Under (modern) clang with C++11:
 #define VTK_FALLTHROUGH [[clang::fallthrough]]

Otherwise:
 #define VTK_FALLTHROUGH ((void)0)

VTK_FALLTHROUGH serves two purposes:
 - under clang, suppresses -Wimplicit-fallthrough warnings
 - makes code more self-documenting
parent 2177e64e
......@@ -706,6 +706,7 @@ void vtkChartXYZ::DetermineWhichAxesToLabel()
break;
case 2:
++k;
break;
default:
break;
}
......
......@@ -190,15 +190,14 @@ void vtkDataArrayTemplate<T>::PrintSelf(ostream& os, vtkIndent indent)
template <typename T> vtkDataArrayTemplate<T> *
vtkDataArrayTemplate<T>::FastDownCast(vtkAbstractArray *src)
{
switch (src->GetArrayType())
if ((src->GetArrayType() == vtkAbstractArray::DataArrayTemplate) &&
(src->GetDataType() == vtkTypeTraits<ValueType>::VTK_TYPE_ID))
{
case vtkAbstractArray::DataArrayTemplate:
if (src->GetDataType() == vtkTypeTraits<ValueType>::VTK_TYPE_ID)
{
return static_cast<vtkDataArrayTemplate<ValueType>*>(src);
}
default:
return NULL;
return static_cast<vtkDataArrayTemplate<ValueType>*>(src);
}
else
{
return NULL;
}
}
......
......@@ -831,5 +831,20 @@ virtual double *Get##name() \
// class is wrapped externally.
#define VTK_WRAP_EXTERN
//----------------------------------------------------------------------------
// Switch case fall-through policy.
// Use "VTK_FALLTHROUGH;" to annotate deliberate fall-through in switches,
// use it analogously to "break;". The trailing semi-colon is required.
#if __cplusplus >= 201103L && defined(__has_warning)
# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
# define VTK_FALLTHROUGH [[clang::fallthrough]]
# endif
#endif
#ifndef VTK_FALLTHROUGH
# define VTK_FALLTHROUGH ((void)0)
#endif
#endif
// VTK-HeaderTest-Exclude: vtkSetGet.h
......@@ -68,9 +68,9 @@ vtkTypedDataArray<Scalar>::FastDownCast(vtkAbstractArray *source)
{
return static_cast<vtkTypedDataArray<Scalar>*>(source);
}
default:
return NULL;
break;
}
return NULL;
}
#endif //vtkTypedDataArray_txx
......@@ -925,6 +925,7 @@ vtkHyperTree* vtkHyperTree::CreateInstance( unsigned int factor,
default:
vtkGenericWarningMacro( "Bad dimension " << dimension );
}
break;
case 3:
switch ( dimension )
{
......@@ -937,6 +938,7 @@ vtkHyperTree* vtkHyperTree::CreateInstance( unsigned int factor,
default:
vtkGenericWarningMacro( "Bad dimension " << dimension );
}
break;
default:
vtkGenericWarningMacro( "Bad branching factor " << factor );
}
......
......@@ -1108,9 +1108,11 @@ void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* sc,
case 3:
lowK = ( k == 0 ) ? 0 : -1;
highK = ( k + 1 < this->GridSize[2] ) ? 1 : 0;
VTK_FALLTHROUGH;
case 2:
lowJ = ( j == 0 ) ? 0 : -1;
highJ = ( j + 1 < this->GridSize[1] ) ? 1 : 0;
VTK_FALLTHROUGH;
case 1:
lowI = ( i == 0 ) ? 0 : -1;
highI = ( i + 1 < this->GridSize[0] ) ? 1 : 0;
......@@ -1713,11 +1715,12 @@ void vtkHyperTreeGrid::TraverseDualLeaf( vtkHyperTreeGridSuperCursor* superCurso
int cursorIdx = 0;
switch ( this->Dimension )
{
// Warning: Run through is intended! Do NOT add break statements
case 3:
cursorIdx += 9 * ( ( ( cornerIdx >> 2 ) & 1 ) + ( ( leafIdx >> 2 ) & 1 ) );
VTK_FALLTHROUGH;
case 2:
cursorIdx += 3 * ( ( ( cornerIdx >> 1 ) & 1 ) + ( ( leafIdx >> 1 ) & 1 ) );
VTK_FALLTHROUGH;
case 1:
cursorIdx += ( cornerIdx & 1) + ( leafIdx & 1);
}
......
......@@ -116,11 +116,11 @@ void vtkUnstructuredGridCellIterator::CatchUpSkippedCells()
this->SkippedCells--;
}
assert(this->SkippedCells == 1);
// Fall through to first case
VTK_FALLTHROUGH;
case 1:
this->ConnectivityPtr += *this->ConnectivityPtr + 1;
--this->SkippedCells;
// fall through to 0 case
VTK_FALLTHROUGH;
case 0:
// do nothing.
break;
......
......@@ -355,6 +355,7 @@ void vtkMoleculeMapper::UpdateAtomGlyphPolyData()
default:
vtkWarningMacro(<<"Unknown radius type: " << this->AtomicRadiusType
<<". Falling back to 'VDWRadius' ("<<VDWRadius<<").");
VTK_FALLTHROUGH;
case VDWRadius:
for (vtkIdType i = 0; i < numAtoms; ++i)
{
......
......@@ -1347,7 +1347,7 @@ int vtkTessellatorFilter::RequestData(
cp->EvaluateLocation( dummySubId, pts[p] + 3, pts[p], weights );
this->Subdivider->EvaluateFields( pts[p], weights, 6 );
}
// fall through
VTK_FALLTHROUGH;
case VTK_QUADRATIC_HEXAHEDRON:
for ( p = 20; p < 27; ++p )
{
......
......@@ -519,14 +519,8 @@ int vtkDataSetSurfaceFilter::StructuredExecute(vtkDataSet *input,
break;
}
case VTK_UNIFORM_GRID:
{
// same as vtk_image_data
}
case VTK_STRUCTURED_POINTS:
{
// same as vtk_image_data
}
case VTK_IMAGE_DATA:
case VTK_IMAGE_DATA:
{
dataType = VTK_DOUBLE;
break;
......@@ -534,6 +528,7 @@ int vtkDataSetSurfaceFilter::StructuredExecute(vtkDataSet *input,
default:
dataType = VTK_DOUBLE;
vtkWarningMacro("Invalid data set type.");
break;
}
outPoints->SetDataType(dataType);
......
......@@ -989,6 +989,7 @@ void vtkGreedyTerrainDecimation::UpdateTriangle(vtkIdType tri, int ij1[2], int i
{
break;
}
VTK_FALLTHROUGH;
case VTK_TOP_TRIANGLE:
//Start scanning the upper triangle
......
......@@ -163,30 +163,31 @@ int vtkPolyDataSilhouette::RequestData(
// Compute the sort vector
switch( this->Direction )
{
case VTK_DIRECTION_SPECIFIED_VECTOR :
vector[0] = this->Vector[0];
vector[1] = this->Vector[1];
vector[2] = this->Vector[2];
break;
case VTK_DIRECTION_SPECIFIED_ORIGIN :
origin[0] = this->Origin[0];
origin[1] = this->Origin[1];
origin[2] = this->Origin[2];
vectorMode = false;
break;
case VTK_DIRECTION_CAMERA_ORIGIN :
vectorMode = false;
case VTK_DIRECTION_CAMERA_VECTOR :
if ( this->Camera == NULL)
{
vtkErrorMacro(<<"Need a camera when direction is set to VTK_DIRECTION_CAMERA_*");
return 0;
}
this->ComputeProjectionVector(vector, origin);
break;
case VTK_DIRECTION_SPECIFIED_VECTOR :
vector[0] = this->Vector[0];
vector[1] = this->Vector[1];
vector[2] = this->Vector[2];
break;
case VTK_DIRECTION_SPECIFIED_ORIGIN :
origin[0] = this->Origin[0];
origin[1] = this->Origin[1];
origin[2] = this->Origin[2];
vectorMode = false;
break;
case VTK_DIRECTION_CAMERA_ORIGIN :
vectorMode = false;
VTK_FALLTHROUGH;
case VTK_DIRECTION_CAMERA_VECTOR :
if ( this->Camera == NULL)
{
vtkErrorMacro(<<"Need a camera when direction is set to VTK_DIRECTION_CAMERA_*");
return 0;
}
this->ComputeProjectionVector(vector, origin);
break;
}
vtkIdType nPolys = input->GetNumberOfPolys();
......
......@@ -187,6 +187,7 @@ int vtkConeSource::RequestData(
x[2] = this->Radius;
pts[2] = newPoints->InsertNextPoint(x);
newPolys->InsertNextCell(3,pts);
VTK_FALLTHROUGH;
case 1:
x[0] = xbot;
......
......@@ -1046,13 +1046,15 @@ void vtkHyperTreeGridSource::SubdivideFromQuadric( vtkHyperTreeCursor* cursor,
double newSize[] = { 0., 0., 0. };
switch ( this->Dimension )
{
// Warning: Run through is intended! Do NOT add break statements
case 3:
newSize[2] = size[2] / this->BranchFactor;
VTK_FALLTHROUGH;
case 2:
newSize[1] = size[1] / this->BranchFactor;
VTK_FALLTHROUGH;
case 1:
newSize[0] = size[0] / this->BranchFactor;
break;
}
int newChildIdx = 0;
......
......@@ -292,7 +292,7 @@ bool vtkPCAAssessFunctor::InitializePCA( vtkTable* inData,
case vtkPCAStatistics::NUM_BASIS_SCHEMES:
default:
vtkGenericWarningMacro( "Unknown basis scheme " << basisScheme << ". Using FULL_BASIS." );
// fall through
VTK_FALLTHROUGH;
case vtkPCAStatistics::FULL_BASIS:
this->BasisSize = m;
break;
......
......@@ -6107,26 +6107,29 @@ void vtkExodusIIReader::SetAllArrayStatus( int otyp, int status )
{
this->SetAssemblyArrayStatus( i, status );
}
VTK_FALLTHROUGH;
case PART:
numObj = this->GetNumberOfPartArrays();
for ( i = 0; i < numObj; ++i )
{
this->SetPartArrayStatus( i, status );
}
VTK_FALLTHROUGH;
case MATERIAL:
numObj = this->GetNumberOfMaterialArrays();
for ( i = 0; i < numObj; ++i )
{
this->SetMaterialArrayStatus( i, status );
}
VTK_FALLTHROUGH;
case HIERARCHY:
numObj = this->GetNumberOfHierarchyArrays();
for ( i = 0; i < numObj; ++i )
{
this->SetHierarchyArrayStatus( i, status );
}
break;
default:
;
break;
}
}
......
......@@ -357,6 +357,7 @@ int vtkGL2PSExporter::GetGL2PSSort()
{
default:
vtkDebugMacro(<<"Invalid sort settings, using NO_SORT.");
VTK_FALLTHROUGH;
case NO_SORT:
return GL2PS_NO_SORT;
case SIMPLE_SORT:
......@@ -372,6 +373,7 @@ int vtkGL2PSExporter::GetGL2PSFormat()
{
default:
vtkDebugMacro(<<"Invalid output format. Using postscript.");
VTK_FALLTHROUGH;
case PS_FILE:
return GL2PS_PS;
case EPS_FILE:
......@@ -391,6 +393,7 @@ const char *vtkGL2PSExporter::GetFileExtension()
{
default:
vtkDebugMacro(<<"Invalid output format. Using postscript.");
VTK_FALLTHROUGH;
case PS_FILE:
return "ps";
case EPS_FILE:
......
......@@ -1080,7 +1080,7 @@ public:
isExpanded = true;
break;
}
// fall through
VTK_FALLTHROUGH;
default:
wasPathSeparator = (c == '/' || c == '\\');
expandedPath += c;
......@@ -1175,7 +1175,7 @@ public:
this->PutBack(c);
return true;
}
// fall through
VTK_FALLTHROUGH;
case '.':
// scalar token
if (c == '.' && charI < MAXLEN)
......@@ -3070,17 +3070,22 @@ vtkFoamEntryValue::vtkFoamEntryValue(
switch (this->Superclass::Type)
{
case VECTORLIST:
{
vtkFloatArray *fa = vtkFloatArray::SafeDownCast(value.ToVTKObject());
if(fa->GetNumberOfComponents() == 6)
{
vtkFloatArray *fa = vtkFloatArray::SafeDownCast(value.ToVTKObject());
if(fa->GetNumberOfComponents() == 6)
{
// create deepcopies for vtkObjects to avoid duplicated mainpulation
vtkFloatArray *newfa = vtkFloatArray::New();
newfa->DeepCopy(fa);
this->Superclass::VtkObjectPtr = newfa;
break;
}
// create deepcopies for vtkObjects to avoid duplicated mainpulation
vtkFloatArray *newfa = vtkFloatArray::New();
newfa->DeepCopy(fa);
this->Superclass::VtkObjectPtr = newfa;
}
else
{
this->Superclass::VtkObjectPtr = value.ToVTKObject();
this->Superclass::VtkObjectPtr->Register(0);
}
}
break;
case LABELLIST:
case SCALARLIST:
case STRINGLIST:
......
......@@ -1497,6 +1497,7 @@ int vtkLSDynaReader::ReadHeaderInformation( int curAdapt )
break;
case 7:
p->ReadRigidRoadMvmt = 1;
VTK_FALLTHROUGH;
case 5:
p->Dict["MATTYP"] = 1;
p->ConnectivityUnpacked = 1;
......
......@@ -1540,6 +1540,7 @@ size_t vtkXMLWriter::GetWordTypeSize(int dataType)
case VTK_STRING:
size = sizeof(vtkStdString::value_type);
break;
default:
vtkWarningMacro("Unsupported data type: " << dataType);
......@@ -1557,7 +1558,7 @@ const char* vtkXMLWriter::GetWordTypeName(int dataType)
// These string values must match vtkXMLDataElement::GetWordTypeAttribute().
switch (dataType)
{
case VTK_STRING: return "String";
case VTK_STRING: return "String";
case VTK_FLOAT: return "Float32";
case VTK_DOUBLE: return "Float64";
case VTK_ID_TYPE:
......
......@@ -325,9 +325,15 @@ void vtkXMLWriterC_SetCoordinates(vtkXMLWriterC* self, int axis,
{
switch(axis)
{
case 0: dataObject->SetXCoordinates(array);
case 1: dataObject->SetYCoordinates(array);
case 2: dataObject->SetZCoordinates(array);
case 0:
dataObject->SetXCoordinates(array);
break;
case 1:
dataObject->SetYCoordinates(array);
break;
case 2:
dataObject->SetZCoordinates(array);
break;
}
}
}
......
......@@ -759,9 +759,11 @@ void vtkImageNLCRowInterpolate<F, T>::Tricubic(
case 4:
iX3 = iX[3];
fX3 = fX[3];
VTK_FALLTHROUGH;
case 3:
iX2 = iX[2];
fX2 = fX[2];
VTK_FALLTHROUGH;
case 2:
iX1 = iX[1];
fX1 = fX[1];
......
......@@ -260,10 +260,13 @@ static void vtkImageMapToColorsExecute(vtkImageMapToColors *self,
{
case 4:
outPtr2[3] = nanColor[3];
VTK_FALLTHROUGH;
case 3:
outPtr2[2] = nanColor[2];
VTK_FALLTHROUGH;
case 2:
outPtr2[1] = nanColor[1];
VTK_FALLTHROUGH;
case 1:
outPtr2[0] = nanColor[0];
}
......
......@@ -1774,6 +1774,7 @@ void vtkGetSetPixelsFunc(
default:
*setpixels = 0;
}
break;
case 2:
switch (dataType)
{
......@@ -1783,6 +1784,7 @@ void vtkGetSetPixelsFunc(
default:
*setpixels = 0;
}
break;
case 3:
switch (dataType)
{
......@@ -1792,6 +1794,7 @@ void vtkGetSetPixelsFunc(
default:
*setpixels = 0;
}
break;
case 4:
switch (dataType)
{
......@@ -1801,6 +1804,7 @@ void vtkGetSetPixelsFunc(
default:
*setpixels = 0;
}
break;
default:
switch (dataType)
{
......
......@@ -49,14 +49,19 @@ void vtkThresholdTable::PrintSelf(ostream& os, vtkIndent indent)
{
case ACCEPT_LESS_THAN:
os << "Accept less than";
break;
case ACCEPT_GREATER_THAN:
os << "Accept greater than";
break;
case ACCEPT_BETWEEN:
os << "Accept between";
break;
case ACCEPT_OUTSIDE:
os << "Accept outside";
break;
default:
os << "Undefined";
break;
}
os << endl;
}
......
......@@ -438,7 +438,7 @@ void vtkCosmicTreeLayoutStrategy::LayoutChildren(
// Unit size means we can stop descending when depth == 0... all entries in radii are initialized to 1.0
if ( depth < 0 && this->LayoutDepth >= 0 )
return;
// fall through:
VTK_FALLTHROUGH;
case LEAVES:
// We must descend all the way down to the leaves, regardless of LayoutDepth.
for ( childIdx = 0; childIdx < numberOfChildren; ++ childIdx )
......
......@@ -374,15 +374,21 @@ void vtkTextRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
case LowerLeftCorner:
os << "LowerLeftCorner\n";
break;
case LowerRightCorner:
os << "LowerRightCorner\n";
break;
case LowerCenter:
os << "LowerCenter\n";
break;
case UpperLeftCorner:
os << "UpperLeftCorner\n";
break;
case UpperRightCorner:
os << "UpperRightCorner\n";
break;
case UpperCenter:
os << "UpperCenter\n";
break;
}
}
......@@ -1473,6 +1473,7 @@ vtkImageData *vtkOpenGLContextDevice2D::GenerateMarker(int shape, int width,
}
default: // Maintaining old behavior, which produces plus for unknown shape
vtkWarningMacro(<<"Invalid marker shape: " << shape);
VTK_FALLTHROUGH;
case VTK_MARKER_PLUS:
{
int center = (width + 1) / 2;
......
......@@ -199,14 +199,19 @@ double *vtkCoordinate::GetComputedWorldValue(vtkViewport* viewport)
{
case VTK_DISPLAY:
viewport->DisplayToNormalizedDisplay(val[0],val[1]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_DISPLAY:
viewport->NormalizedDisplayToViewport(val[0],val[1]);
VTK_FALLTHROUGH;
case VTK_VIEWPORT:
viewport->ViewportToNormalizedViewport(val[0],val[1]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_VIEWPORT:
viewport->NormalizedViewportToView(val[0],val[1],val[2]);
VTK_FALLTHROUGH;
case VTK_VIEW:
viewport->ViewToWorld(val[0],val[1],val[2]);
break;
}
if (this->ReferenceCoordinate && this->CoordinateSystem == VTK_WORLD)
......@@ -360,10 +365,13 @@ double *vtkCoordinate::GetComputedDoubleDisplayValue(vtkViewport* viewport)
val[2] += refValue[2];
}
viewport->WorldToView(val[0],val[1],val[2]);
VTK_FALLTHROUGH;
case VTK_VIEW:
viewport->ViewToNormalizedViewport(val[0],val[1],val[2]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_VIEWPORT:
viewport->NormalizedViewportToViewport(val[0],val[1]);
VTK_FALLTHROUGH;
case VTK_VIEWPORT:
if ((this->CoordinateSystem == VTK_NORMALIZED_VIEWPORT ||
this->CoordinateSystem == VTK_VIEWPORT) &&
......@@ -374,9 +382,10 @@ double *vtkCoordinate::GetComputedDoubleDisplayValue(vtkViewport* viewport)
val[1] += refValue[1];
}
viewport->ViewportToNormalizedDisplay(val[0],val[1]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_DISPLAY:
viewport->NormalizedDisplayToDisplay(val[0],val[1]);
break; // do not remove this break statement!
break;
case VTK_USERDEFINED:
this->GetComputedUserDefinedValue(viewport);
val[0] = this->ComputedUserDefinedValue[0];
......
......@@ -900,14 +900,19 @@ void vtkTextActor::SpecifiedToDisplay(double *pos, vtkViewport *vport,
{
case VTK_WORLD:
vport->WorldToView(pos[0], pos[1], pos[2]);
VTK_FALLTHROUGH;
case VTK_VIEW:
vport->ViewToNormalizedViewport(pos[0], pos[1], pos[2]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_VIEWPORT:
vport->NormalizedViewportToViewport(pos[0], pos[1]);
VTK_FALLTHROUGH;
case VTK_VIEWPORT:
vport->ViewportToNormalizedDisplay(pos[0], pos[1]);
VTK_FALLTHROUGH;
case VTK_NORMALIZED_DISPLAY:
vport->NormalizedDisplayToDisplay(pos[0], pos[1]);
VTK_FALLTHROUGH;
case VTK_DISPLAY:
break;
}
......
......@@ -90,6 +90,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkStdString cleanString(str);
......@@ -150,6 +151,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkUnicodeString cleanString(str);
......@@ -207,6 +209,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkStdString cleanString(str);
......@@ -267,6 +270,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkUnicodeString cleanString(str);
......@@ -318,6 +322,7 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkStdString cleanString(str);
......@@ -372,6 +377,7 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkUnicodeString cleanString(str);
......@@ -426,6 +432,7 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkStdString cleanString(str);
......@@ -482,6 +489,7 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkUnicodeString cleanString(str);
......@@ -533,6 +541,7 @@ bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkStdString cleanString(str);
......@@ -584,6 +593,7 @@ bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
}
}
vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
VTK_FALLTHROUGH;
case FreeType:
{
vtkUnicodeString cleanString(str);
......
......@@ -351,7 +351,7 @@ void vtkGL2PSContextDevice2D::DrawCrossMarkers(bool highlight, float *points,
for (int i = 0; i < n; ++i)
{
float *point = points + (i * 2);
if (colors)
if (colors)
{
color[3] = 255;
switch (nc_comps)
......@@ -362,6 +362,7 @@ void vtkGL2PSContextDevice2D::DrawCrossMarkers(bool highlight, float *points,
break;
case 2:
color[3] = colors[i * nc_comps + 1];
VTK_FALLTHROUGH;
case 1:
memset(color, colors[i * nc_comps], 3);
break;
......@@ -435,6 +436,7 @@ void vtkGL2PSContextDevice2D::DrawPlusMarkers(bool highlight, float *points,
break;
case 2:
color[3] = colors[i * nc_comps + 1];
VTK_FALLTHROUGH;
case 1:
memset(color, colors[i * nc_comps], 3);
break;
......@@ -499,6 +501,7 @@ void vtkGL2PSContextDevice2D::DrawSquareMarkers(bool /*highlight*/,
break;
case 2: