Commit 0118dd63 authored by Robert Maynard's avatar Robert Maynard

Correct warnings found inside the vtkm module by dashboards.

parent 33dafe58
......@@ -210,12 +210,22 @@ target_include_directories(vtkAcceleratorsVTKm PUBLIC ${VTKm_INCLUDE_DIRS})
vtk_module_link_libraries(vtkAcceleratorsVTKm LINK_PRIVATE ${VTKm_LIBRARIES})
target_compile_options(vtkAcceleratorsVTKm PRIVATE ${VTKm_COMPILE_OPTIONS})
# MSVC has limits on obj size that are exceeded by this module so we need
# a flag to ignore those limits
if (WIN32)
if (MSVC)
# MSVC has limits on obj size that are exceeded by this module so we need
# a flag to ignore those limits
target_compile_options(vtkAcceleratorsVTKm PRIVATE /bigobj)
#C4702 Generates numerous false positives with template code about
# unreachable code
#C4512 Generates numerous warning that implicit assignment operators can't
# be constructed. This is understood and we don't care.
#C4510 Generates numerous warning that implicit constructors can't
# be constructed. This is understood and we don't care.
target_compile_options(vtkAcceleratorsVTKm PRIVATE -wd4702 -wd4512 -wd4510)
endif()
#install the required headers to make your own vtkm-vtk filter
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
install(DIRECTORY
......
......@@ -45,9 +45,9 @@ vtkmAverageToPoints::~vtkmAverageToPoints()
}
//------------------------------------------------------------------------------
int vtkmAverageToPoints::RequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
int vtkmAverageToPoints::RequestData(vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
......
......@@ -125,7 +125,6 @@ typename vtkm::exec::ReverseConnectivityVTK<Device>
if(!this->ReverseConnectivityBuilt)
{
const vtkm::Id numberOfCells = this->GetNumberOfCells();
const vtkm::Id connectivityLength = this->Connectivity.GetNumberOfValues();
const vtkm::Id numberOfPointsPerCell = this->DetermineNumberOfPoints();
const vtkm::Id rconnSize = numberOfCells*numberOfPointsPerCell;
......
......@@ -64,7 +64,7 @@ int vtkmCleanGrid::FillInputPortInformation(int, vtkInformation* info)
}
//------------------------------------------------------------------------------
int vtkmCleanGrid::RequestData(vtkInformation* request,
int vtkmCleanGrid::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
......
......@@ -133,10 +133,10 @@ int vtkmClip::RequestData(vtkInformation *,
// Convert inputs to vtkm objects:
vtkm::cont::DataSet in = tovtkm::Convert(input,
tovtkm::FieldsFlag::PointsAndCells);
vtkm::cont::Field field = tovtkm::Convert(scalars, assoc);
vtkm::cont::Field inField = tovtkm::Convert(scalars, assoc);
if (field.GetAssociation() != vtkm::cont::Field::ASSOC_POINTS ||
field.GetName() == std::string())
if (inField.GetAssociation() != vtkm::cont::Field::ASSOC_POINTS ||
inField.GetName() == std::string())
{
vtkErrorMacro("Invalid scalar array; array missing or not a point array.");
return 1;
......@@ -161,7 +161,7 @@ int vtkmClip::RequestData(vtkInformation *,
else
{
fieldFilter.SetClipValue(this->ClipValue);
result = fieldFilter.Execute(in, field, policy);
result = fieldFilter.Execute(in, inField, policy);
}
if (!result.IsDataSetValid())
......
......@@ -91,13 +91,13 @@ int vtkmContour::RequestData(vtkInformation* request,
// we need to map the given property to the data set
int association = this->GetInputArrayAssociation(0, inputVector);
vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector);
vtkm::cont::Field field = tovtkm::Convert(inputArray, association);
vtkm::cont::Field inField = tovtkm::Convert(inputArray, association);
const bool dataSetValid =
in.GetNumberOfCoordinateSystems() > 0 && in.GetNumberOfCellSets() > 0;
const bool fieldValid =
(field.GetAssociation() != vtkm::cont::Field::ASSOC_ANY) &&
(field.GetName() != std::string());
(inField.GetAssociation() != vtkm::cont::Field::ASSOC_ANY) &&
(inField.GetName() != std::string());
if (!dataSetValid)
......@@ -114,7 +114,7 @@ int vtkmContour::RequestData(vtkInformation* request,
if (dataSetValid && fieldValid)
{
vtkmInputFilterPolicy policy;
result = filter.Execute(in, field, policy);
result = filter.Execute(in, inField, policy);
if (!result.IsDataSetValid())
{
......
......@@ -103,7 +103,7 @@ int vtkmExternalFaces::ProcessRequest(vtkInformation* request,
}
//------------------------------------------------------------------------------
int vtkmExternalFaces::RequestData(vtkInformation* request,
int vtkmExternalFaces::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
......
......@@ -94,7 +94,7 @@ int vtkmExtractVOI::RequestData(
vtkm::filter::ExtractStructured filter;
filter.SetVOI(voi[0], voi[1], voi[2], voi[3], voi[4], voi[5]);
filter.SetSampleRate(this->SampleRate[0], this->SampleRate[1], this->SampleRate[2]);
filter.SetIncludeBoundary(this->IncludeBoundary);
filter.SetIncludeBoundary( (this->IncludeBoundary != 0 ) );
vtkm::filter::Result result = filter.Execute(in, policy);
if (!result.IsDataSetValid())
......
......@@ -88,8 +88,8 @@ void vtkmGradient::PrintSelf(ostream& os, vtkIndent indent)
//------------------------------------------------------------------------------
int vtkmGradient::RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation* outInfo = outputVector->GetInformationObject(0);
......
......@@ -88,9 +88,9 @@ int vtkmPolyDataNormals::RequestData(
if (!unsupported)
{
vtkm::filter::SurfaceNormals filter;
filter.SetGenerateCellNormals(this->ComputeCellNormals);
filter.SetGenerateCellNormals((this->ComputeCellNormals != 0));
filter.SetCellNormalsName("Normals");
filter.SetGeneratePointNormals(this->ComputePointNormals);
filter.SetGeneratePointNormals((this->ComputePointNormals != 0));
filter.SetPointNormalsName("Normals");
auto result = filter.Execute(in, policy);
......
......@@ -73,19 +73,19 @@ int vtkmThreshold::RequestData(vtkInformation* request,
// we need to map the given property to the data set
int association = this->GetInputArrayAssociation(0, inputVector);
vtkDataArray* inputArray = this->GetInputArrayToProcess(0, inputVector);
vtkm::cont::Field field = tovtkm::Convert(inputArray, association);
vtkm::cont::Field inField = tovtkm::Convert(inputArray, association);
const bool dataSetValid =
in.GetNumberOfCoordinateSystems() > 0 && in.GetNumberOfCellSets() > 0;
const bool fieldValid =
(field.GetAssociation() != vtkm::cont::Field::ASSOC_ANY);
(inField.GetAssociation() != vtkm::cont::Field::ASSOC_ANY);
vtkm::filter::Result result;
bool convertedDataSet = false;
if (dataSetValid && fieldValid)
{
vtkmInputFilterPolicy policy;
result = filter.Execute(in, field, policy);
result = filter.Execute(in, inField, policy);
// convert other scalar arrays
if (result.IsDataSetValid())
......
......@@ -270,7 +270,6 @@ template <> struct CopyArrayContents<1>
template <typename IteratorType, typename U>
void operator()(IteratorType iter, U* array, vtkIdType numValues) const
{
typedef typename IteratorType::value_type T;
// fast path for single component arrays, can't steal the memory
// since the storage types isn't one we know
for (vtkIdType i = 0; i < numValues; ++i, ++iter)
......
......@@ -214,7 +214,7 @@ struct CellInfoCopyWorklet : public vtkm::worklet::WorkletMapPointToCell
{
CellInfoCopyWorklet(vtkm::Id* size, vtkIdTypeArray* conn,
vtkUnsignedCharArray* types, vtkIdTypeArray* locations)
: ConnIndex(size), ConnArray(conn), Shapes(types), Locations(locations)
: ConnIndex(size), ConnArray(conn), Locations(locations), Shapes(types)
{
}
......
......@@ -17,6 +17,7 @@
#define vtkmlib_ImplicitFunctionConverter_h
#include "vtkAcceleratorsVTKmModule.h"
#include "vtkmConfig.h" //required for general vtkm setup
#include "vtkType.h" // For vtkMTimeType
#include <memory> // For std::shared_ptr
......@@ -47,6 +48,10 @@ private:
mutable vtkMTimeType MTime;
};
#ifdef VTKM_MSVC
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT
std::shared_ptr<vtkm::cont::ImplicitFunction>;
#endif
}
#endif // vtkmlib_ImplicitFunctionConverter_h
......@@ -79,7 +79,7 @@ void Storage<ValueType_, tovtkm::vtkAOSArrayContainerTag>::Allocate(
VTKM_ASSERT(this->AllocatedSize == 0);
}
}
catch (std::bad_alloc& err)
catch (std::bad_alloc&)
{
// Make sure our state is OK.
this->Array = NULL;
......@@ -165,7 +165,7 @@ void Storage<ValueType_, tovtkm::vtkSOAArrayContainerTag>::Allocate(
VTKM_ASSERT(this->AllocatedSize == 0);
}
}
catch (std::bad_alloc& err)
catch (std::bad_alloc&)
{
// Make sure our state is OK.
this->Array = NULL;
......@@ -249,7 +249,7 @@ void Storage<ValueType_, tovtkm::vtkCellArrayContainerTag>::Allocate(
VTKM_ASSERT(this->AllocatedSize == 0);
}
}
catch (std::bad_alloc& err)
catch (std::bad_alloc&)
{
// Make sure our state is OK.
this->Array = NULL;
......
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