Commit 4cb5e34c authored by Sean McBride's avatar Sean McBride

Fixed all -Wswitch-enum warnings

There were surprisingly few.  The benefit is that when additional enums are added, a warning will point you to consider every switch statement.
parent 545ff6d8
......@@ -176,6 +176,7 @@ vtkRecti vtkContextArea::ComputeExpandedDrawAreaGeometry(vtkContext2D *painter)
topRight.SetY(geo.GetTop() -
static_cast<int>(bounds.GetHeight()));
break;
case vtkAxis::PARALLEL:
default:
abort(); // Shouldn't happen unless vtkAxis::Location is changed.
}
......
......@@ -392,6 +392,7 @@ public:
return !(this->InputCellGhostArray[id] & this->MASKED_CELL_VALUE);
case POINTS:
return this->InputStructuredGrid->IsCellVisible(id) ? true : false;
case NONE:
default:
return 1;
}
......
......@@ -388,8 +388,8 @@ vtkSmartPointer<vtkSelector> vtkExtractSelection::NewSelectionOperator(
return vtkSmartPointer<vtkBlockSelector>::New();
case vtkSelectionNode::USER:
return nullptr;
case vtkSelectionNode::SELECTIONS:
case vtkSelectionNode::QUERY:
default:
return nullptr;
}
......
......@@ -263,6 +263,8 @@ public:
{
case PolygonType::MATERIAL:
return materialIndexToPolyData.find(materialIndex) == materialIndexToPolyData.end();
case PolygonType::NONE:
case PolygonType::TEXTURE:
default:
// for NONE imageURI is empty string
return imageURIToPolyData.find(imageURI) == imageURIToPolyData.end();
......@@ -281,6 +283,8 @@ public:
case PolygonType::MATERIAL:
materialIndexToPolyData[materialIndex] = polyData;
break;
case PolygonType::NONE:
case PolygonType::TEXTURE:
default:
// for NONE imageURI is empty string
imageURIToPolyData[imageURI] = polyData;
......@@ -298,6 +302,8 @@ public:
{
case PolygonType::MATERIAL:
return materialIndexToPolyData[materialIndex];
case PolygonType::NONE:
case PolygonType::TEXTURE:
default:
// for NONE imageURI is empty string
return imageURIToPolyData[imageURI];
......@@ -550,6 +556,7 @@ public:
this->SetField(polyData, "transparency", &material.Transparency, 1);
break;
}
case PolygonType::NONE:
default:
// no fields to set
break;
......
......@@ -61,6 +61,14 @@ vtkLZMADataCompressor::CompressBuffer(unsigned char const* uncompressedData,
case LZMA_UNSUPPORTED_CHECK:
vtkErrorMacro("Specified integrity check is not supported.");
break;
case LZMA_STREAM_END:
case LZMA_NO_CHECK:
case LZMA_MEMLIMIT_ERROR:
case LZMA_FORMAT_ERROR:
case LZMA_DATA_ERROR:
case LZMA_BUF_ERROR:
case LZMA_PROG_ERROR:
case LZMA_GET_CHECK:
default:
vtkErrorMacro("Unknown error.");
}
......@@ -111,6 +119,9 @@ vtkLZMADataCompressor::UncompressBuffer(unsigned char const* compressedData,
case LZMA_PROG_ERROR:
vtkErrorMacro("LZMA program error.");
break;
case LZMA_STREAM_END:
case LZMA_GET_CHECK:
case LZMA_FORMAT_ERROR:
default:
vtkErrorMacro("Unknown error.");
}
......
......@@ -82,6 +82,7 @@ int vtkGraphReader::ReadMeshSimple(const std::string& fname,
builder = undir_builder;
break;
case vtkGraphReader::UnknownGraph:
default:
vtkErrorMacro("ReadGraphType gave invalid result.");
this->CloseVTKFile();
......@@ -116,6 +117,7 @@ int vtkGraphReader::ReadMeshSimple(const std::string& fname,
undir_builder->SetFieldData(field_data);
break;
case vtkGraphReader::UnknownGraph:
default: // Can't happen, would return earlier.
break;
}
......@@ -160,6 +162,7 @@ int vtkGraphReader::ReadMeshSimple(const std::string& fname,
undir_builder->AddVertex();
break;
case vtkGraphReader::UnknownGraph:
default: // Can't happen, would return earlier.
break;
}
......@@ -198,6 +201,7 @@ int vtkGraphReader::ReadMeshSimple(const std::string& fname,
undir_builder->AddEdge(source, target);
break;
case vtkGraphReader::UnknownGraph:
default: // Can't happen, would return earlier.
break;
}
......@@ -421,6 +425,7 @@ vtkDataObject* vtkGraphReader::CreateOutput(vtkDataObject* currentOutput)
}
return vtkMolecule::New();
case vtkGraphReader::UnknownGraph:
default:
vtkErrorMacro("ReadGraphType returned invalid result.");
return nullptr;
......
......@@ -245,6 +245,8 @@ void vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback(
break;
}
case vtkTransformFeedback::Normal_F:
case vtkTransformFeedback::Next_Buffer:
default:
vtkWarningMacro("Unhandled data role: " << it->Role);
}
......
......@@ -397,6 +397,8 @@ bool vtkDualDepthPeelingPass::PostReplaceTranslucentShaderValues(
);
break;
case vtkDualDepthPeelingPass::Inactive:
case vtkDualDepthPeelingPass::NumberOfPasses:
default:
break;
}
......@@ -749,6 +751,8 @@ bool vtkDualDepthPeelingPass::PreReplaceVolumetricShaderValues(
break;
case vtkDualDepthPeelingPass::Inactive:
case vtkDualDepthPeelingPass::NumberOfPasses:
default:
break;
}
......@@ -784,6 +788,8 @@ bool vtkDualDepthPeelingPass::SetTranslucentShaderParameters(
this->Textures[this->DepthSource]->GetTextureUnit());
break;
case vtkDualDepthPeelingPass::Inactive:
case vtkDualDepthPeelingPass::NumberOfPasses:
default:
break;
}
......@@ -827,6 +833,8 @@ bool vtkDualDepthPeelingPass::SetVolumetricShaderParameters(
this->Textures[this->DepthSource]->GetTextureUnit());
break;
case vtkDualDepthPeelingPass::Inactive:
case vtkDualDepthPeelingPass::NumberOfPasses:
default:
break;
}
......
......@@ -66,6 +66,7 @@ bool vtkShader::Compile()
type = GL_FRAGMENT_SHADER;
break;
case vtkShader::Vertex:
case vtkShader::Unknown:
default:
type = GL_VERTEX_SHADER;
break;
......
......@@ -307,6 +307,7 @@ bool vtkShaderProgram::DetachShader(const vtkShader *shader)
return true;
}
#endif
case vtkShader::Unknown:
default:
return false;
}
......
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