Commit 22842158 authored by David E. DeMarle's avatar David E. DeMarle

silence all of the type conversion problem warnings

parent 370ca8b5
......@@ -80,7 +80,7 @@ std::vector<unsigned int> XdmfAggregate::getDimensions() const
if (isSame)
{
testDims.push_back(mArrays.size());
testDims.push_back(static_cast<unsigned int>(mArrays.size()));
return testDims;
}
else
......
......@@ -238,7 +238,7 @@ XdmfGeometryGetOrigin(XDMFGEOMETRY * geometry)
{
shared_ptr<XdmfGeometry> & refGeometry = *(shared_ptr<XdmfGeometry> *)(geometry);
std::vector<double> tempVector = refGeometry->getOrigin();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
double * returnArray = new double[returnSize]();
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -250,7 +250,7 @@ int
XdmfGeometryGetOriginSize(XDMFGEOMETRY * geometry)
{
shared_ptr<XdmfGeometry> & refGeometry = *(shared_ptr<XdmfGeometry> *)(geometry);
return refGeometry->getOrigin().size();
return static_cast<int>(refGeometry->getOrigin().size());
}
int XdmfGeometryGetType(XDMFGEOMETRY * geometry)
......
......@@ -882,7 +882,7 @@ XdmfGridTemplate::populateItem(const std::map<std::string, std::string> & itemPr
mNumSteps = controllerTotal / mTrackedArrays[0]->getSize();
}
else {
mNumSteps = mDataControllers.size() / mTrackedArrays.size();
mNumSteps = static_cast<unsigned int>(mDataControllers.size() / mTrackedArrays.size());
}
}
......
......@@ -281,7 +281,7 @@ XdmfItemFactory::createItem(const std::string & itemTag,
XdmfStringUtils::split(dimensionsString, dimensionsVector);
dimensionsArray->insert(0,
&(dimensionsVector[0]),
dimensionsVector.size());
static_cast<unsigned int>(dimensionsVector.size()));
if(typeVal.compare("2DCORECTMESH") == 0 ||
typeVal.compare("3DCORECTMESH") == 0 ||
typeVal.compare("CORECTMESH") == 0) {
......
......@@ -459,7 +459,7 @@ XDMFMAP ** XdmfMapNewFromIdVector(int ** globalNodeIds, int * numIdsOnNode, int
insertedAttributeVector.push_back(insertedAttribute);
}
std::vector<shared_ptr<XdmfMap> > generatedMaps = XdmfMap::New(insertedAttributeVector);
unsigned int returnSize = generatedMaps.size();
unsigned int returnSize = static_cast<unsigned int>(generatedMaps.size());
XDMFMAP ** returnArray = (XDMFMAP **)malloc(sizeof(XDMFMAP *) * (returnSize+1));
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = (XDMFMAP *) new shared_ptr<XdmfMap>(generatedMaps[i]);
......@@ -521,19 +521,19 @@ int * XdmfMapRetrieveLocalNodeIds(XDMFMAP * map, int remoteTaskId)
int XdmfMapRetrieveNumberLocalNodeIds(XDMFMAP * map, int remoteTaskId)
{
shared_ptr<XdmfMap> & refMap = *(shared_ptr<XdmfMap> *)(map);
return refMap->getMap()[remoteTaskId].size();
return static_cast<int>(refMap->getMap()[remoteTaskId].size());
}
int XdmfMapRetrieveNumberRemoteTaskIds(XDMFMAP * map)
{
shared_ptr<XdmfMap> & refMap = *(shared_ptr<XdmfMap> *)(map);
return refMap->getMap().size();
return static_cast<int>(refMap->getMap().size());
}
int XdmfMapRetrieveNumberRemoteNodeIds(XDMFMAP * map, int remoteTaskId, int localNodeId)
{
shared_ptr<XdmfMap> & refMap = *(shared_ptr<XdmfMap> *)(map);
return refMap->getMap()[remoteTaskId][localNodeId].size();
return static_cast<int>(refMap->getMap()[remoteTaskId][localNodeId].size());
}
int * XdmfMapRetrieveRemoteTaskIds(XDMFMAP * map)
......
......@@ -359,7 +359,7 @@ XdmfRectilinearGrid::getDimensions() const
shared_ptr<XdmfArray> dimensions = XdmfArray::New();
std::vector<shared_ptr<XdmfArray> > heldCoordinates =
((XdmfRectilinearGridImpl*)mImpl)->mCoordinates;
dimensions->reserve(heldCoordinates.size());
dimensions->reserve(static_cast<unsigned int>(heldCoordinates.size()));
for (unsigned int i = 0; i < heldCoordinates.size(); ++i)
{
dimensions->pushBack(heldCoordinates[i]->getSize());
......@@ -423,7 +423,7 @@ XdmfRectilinearGrid::setCoordinates(const unsigned int axisIndex,
if(mImpl->mCoordinates.size() <= axisIndex) {
mImpl->mCoordinates.reserve(axisIndex + 1);
unsigned int numArraysToInsert =
axisIndex - mImpl->mCoordinates.size() + 1;
axisIndex - static_cast<unsigned int>(mImpl->mCoordinates.size()) + 1;
for(unsigned int i=0; i<numArraysToInsert; ++i) {
mImpl->mCoordinates.push_back(XdmfArray::New());
}
......@@ -507,7 +507,7 @@ int XdmfRectilinearGridGetNumberCoordinates(XDMFRECTILINEARGRID * grid, int * st
XDMF_ERROR_WRAP_START(status)
shared_ptr<XdmfRectilinearGrid> & refGrid = *(shared_ptr<XdmfRectilinearGrid> *)(grid);
std::vector<shared_ptr<XdmfArray> > heldCoordinates = refGrid->getCoordinates();
return heldCoordinates.size();
return static_cast<int>(heldCoordinates.size());
XDMF_ERROR_WRAP_END(status)
return 0;
}
......
......@@ -661,7 +661,7 @@ XdmfTemplate::getNumberSteps() const
unsigned int
XdmfTemplate::getNumberTrackedArrays() const
{
return mTrackedArrays.size();
return static_cast<unsigned int>(mTrackedArrays.size());
}
XdmfArray *
......@@ -820,7 +820,7 @@ XdmfTemplate::populateItem(const std::map<std::string, std::string> & itemProper
// mNumSteps = controllerTotal / mTrackedArrays[0]->getSize();
}
else {
mNumSteps = mDataControllers.size() / mTrackedArrays.size();
mNumSteps = static_cast<unsigned int>(mDataControllers.size() / mTrackedArrays.size());
}
this->setStep(0);
}
......@@ -1042,11 +1042,11 @@ XdmfTemplate::setStep(unsigned int stepId)
arrayIndex = i;
}
else {
arrayIndex = i+(stepId*mTrackedArrays.size());
arrayIndex = i+(stepId*static_cast<unsigned int>(mTrackedArrays.size()));
}
}
else {
arrayIndex = i+(stepId*mTrackedArrays.size());
arrayIndex = i+(stepId*static_cast<unsigned int>(mTrackedArrays.size()));
}
if (mDataControllers[arrayIndex].size() > 0) {
if(mHeavyWriter) {
......@@ -1106,12 +1106,12 @@ XdmfTemplate::setStep(unsigned int stepId)
if(mTrackedArrayTypes[i] == XdmfArrayType::String()) {
std::vector<std::string> tokens;
XdmfStringUtils::split(content, tokens);
mTrackedArrays[i]->insert(0, &(tokens[0]), tokens.size());
mTrackedArrays[i]->insert(0, &(tokens[0]), static_cast<unsigned int>(tokens.size()));
}
else {
std::vector<double> tokens;
XdmfStringUtils::split(content, tokens);
mTrackedArrays[i]->insert(0, &(tokens[0]), tokens.size());
mTrackedArrays[i]->insert(0, &(tokens[0]), static_cast<unsigned int>(tokens.size()));
}
}
}
......@@ -1210,7 +1210,7 @@ XdmfTemplate::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
arrayInfo << "\"" << mDataTypes[i] << "\"" << mDataDescriptions[i];
++i;
}
dataInfoArray->insert(0, arrayInfo.str().c_str(), arrayInfo.str().length());
dataInfoArray->insert(0, arrayInfo.str().c_str(), static_cast<unsigned int>(arrayInfo.str().length()));
dataInfoArray->insert(dataInfoArray->getSize(), 0);
dataInfoArray->accept(visitor);
......
......@@ -521,7 +521,7 @@ XdmfTopologyType::calculateHypercubeNumElements(unsigned int numDims,
// The calculation has 3 parts
// First is the 2 taken to the power of
// the object's dimensionality minus the element's dimensionality.
unsigned int part1 = std::pow((double)2, (double)(numDims - elementNumDims));
unsigned int part1 = static_cast<unsigned int>(std::pow((double)2, (double)(numDims - elementNumDims)));
// The second part is numDims!/(numDims-elementdims)!
unsigned int part2 = 1;
for (unsigned int i = numDims; i > (numDims - elementNumDims); --i)
......
......@@ -229,7 +229,7 @@ public:
unsigned int
operator()(const shared_ptr<std::vector<T> > & array) const
{
return array->capacity();
return static_cast<unsigned int>(array->capacity());
}
template<typename T>
......@@ -328,7 +328,7 @@ public:
std::string
operator()(const shared_ptr<std::vector<T> > & array) const
{
return getValuesString(&(array->operator[](0)), array->size());
return getValuesString(&(array->operator[](0)), static_cast<int>(array->size()));
}
template<typename T>
......@@ -540,7 +540,7 @@ public:
unsigned int
operator()(const shared_ptr<std::vector<T> > & array) const
{
return array->size();
return static_cast<unsigned int>(array->size());
}
template<typename T>
......@@ -655,8 +655,8 @@ std::string
XdmfArray::getDimensionsString() const
{
const std::vector<unsigned int> dimensions = this->getDimensions();
return GetValuesString(dimensions.size()).getValuesString(&dimensions[0],
dimensions.size());
return GetValuesString(static_cast<int>(dimensions.size())).getValuesString(&dimensions[0],
static_cast<int>(dimensions.size()));
}
std::map<std::string, std::string>
......@@ -1188,12 +1188,12 @@ XdmfArray::populateItem(const std::map<std::string, std::string> & itemPropertie
if(arrayType == XdmfArrayType::String()) {
std::vector<std::string> tokens;
XdmfStringUtils::split(contentVals[contentIndex], tokens);
this->insert(0, &(tokens[0]), tokens.size());
this->insert(0, &(tokens[0]), static_cast<unsigned int>(tokens.size()));
}
else {
std::vector<double> tokens;
XdmfStringUtils::split(contentVals[contentIndex], tokens);
this->insert(0, &(tokens[0]), tokens.size());
this->insert(0, &(tokens[0]), static_cast<unsigned int>(tokens.size()));
}
}
}
......@@ -1479,7 +1479,7 @@ XdmfArrayGetDimensions(XDMFARRAY * array)
{
shared_ptr<XdmfArray> & refArray = *(shared_ptr<XdmfArray> *)(array);
std::vector<unsigned int> tempVector = refArray->getDimensions();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray =
(unsigned int *) malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
......@@ -1517,7 +1517,7 @@ unsigned int
XdmfArrayGetNumberDimensions(XDMFARRAY * array)
{
shared_ptr<XdmfArray> & refArray = *(shared_ptr<XdmfArray> *)(array);
return refArray->getDimensions().size();
return static_cast<unsigned int>(refArray->getDimensions().size());
}
unsigned int
......
......@@ -230,13 +230,13 @@ public:
std::string contentString(content);
// find first nonwhitespace
unsigned int start = 0;
int check = contentString.find_first_not_of(" \t\n\r\f\v");
int check = static_cast<int>(contentString.find_first_not_of(" \t\n\r\f\v"));
if (check >= 0)
{
start = check;
}
unsigned int end = contentString.size();
check = contentString.find_last_not_of(" \t\n\r\f\v");
unsigned int end = static_cast<unsigned int>(contentString.size());
check = static_cast<int>(contentString.find_last_not_of(" \t\n\r\f\v"));
if (check >= 0)
{
end = check;
......
......@@ -234,7 +234,7 @@ XdmfFunction::addFunction(std::string name,
XdmfError::message(XdmfError::WARNING,
"Warning: Function Overwritten");
}
return arrayFunctions.size();
return static_cast<int>(arrayFunctions.size());
}
int
......@@ -283,7 +283,7 @@ XdmfFunction::addOperation(char newoperator,
mSupportedOperations.push_back(newoperator);
mOperationPriority[newoperator] = priority;
}
return operations.size();
return static_cast<int>(operations.size());
}
shared_ptr<XdmfArray>
......@@ -1409,7 +1409,7 @@ class XdmfCFunctionInternalImpl : public XdmfFunction::XdmfFunctionInternal {
for (unsigned int i = 0; i < valueVector.size(); ++i) {
valueArray[i] = (XDMFARRAY *)(&valueVector[i]);
}
shared_ptr<XdmfArray> * ptr = (shared_ptr<XdmfArray> *)((*mInternalFunction)(valueArray, valueVector.size()));
shared_ptr<XdmfArray> * ptr = (shared_ptr<XdmfArray> *)((*mInternalFunction)(valueArray, static_cast<unsigned int>(valueVector.size())));
shared_ptr<XdmfArray> ptrCopy = *ptr;
delete ptr;
delete [] valueArray;
......@@ -1560,7 +1560,7 @@ char * XdmfFunctionGetExpression(XDMFFUNCTION * function)
unsigned int XdmfFunctionGetNumberVariables(XDMFFUNCTION * function)
{
shared_ptr<XdmfFunction> & refFunction = *(shared_ptr<XdmfFunction> *)(function);
return refFunction->getVariableList().size();
return static_cast<unsigned int>(refFunction->getVariableList().size());
}
int XdmfFunctionGetOperationPriority(char operation)
......@@ -1586,7 +1586,7 @@ char ** XdmfFunctionGetSupportedFunctions()
unsigned int XdmfFunctionGetNumberSupportedFunctions()
{
return XdmfFunction::getSupportedFunctions().size();
return static_cast<unsigned int>(XdmfFunction::getSupportedFunctions().size());
}
char * XdmfFunctionGetValidDigitChars()
......
......@@ -88,7 +88,7 @@ XdmfHDF5Controller::XdmfHDF5Controller(const std::string & hdf5FilePath,
break;
}
}
unsigned int endOfPrefix = (mDataSetPath.size()) - i;
unsigned int endOfPrefix = static_cast<unsigned int>(mDataSetPath.size()) - i;
mDataSetPrefix = mDataSetPath.substr(0, endOfPrefix);
if (mDataSetPrefix.compare(mDataSetPath) != 0) {
mDataSetId = atoi(mDataSetPath.substr(endOfPrefix).c_str());
......@@ -209,7 +209,7 @@ XdmfHDF5Controller::read(XdmfArray * const array, const int fapl)
// description - in this case we cannot properly take a hyperslab
// selection, so we assume we are reading the entire dataset and
// check whether that is ok to do
const int numberValuesHDF5 = H5Sget_select_npoints(dataspace);
const int numberValuesHDF5 = static_cast<int>(H5Sget_select_npoints(dataspace));
const int numberValuesXdmf =
std::accumulate(mDimensions.begin(),
mDimensions.end(),
......@@ -235,7 +235,7 @@ XdmfHDF5Controller::read(XdmfArray * const array, const int fapl)
}
const hssize_t numVals = H5Sget_select_npoints(dataspace);
hid_t memspace = H5Screate_simple(mDimensions.size(),
hid_t memspace = H5Screate_simple(static_cast<int>(mDimensions.size()),
&count[0],
NULL);
......@@ -304,7 +304,7 @@ XdmfHDF5Controller::read(XdmfArray * const array, const int fapl)
H5P_DEFAULT,
data);
for(hssize_t i=0; i<numVals; ++i) {
array->insert<std::string>(i, data[i]);
array->insert<std::string>(static_cast<unsigned int>(i), data[i]);
}
status = H5Dvlen_reclaim(datatype,
dataspace,
......
......@@ -93,7 +93,7 @@ XdmfHDF5Writer::XdmfHDF5WriterImpl::openFile(const std::string & filePath,
hsize_t numObjects;
/*herr_t status = */H5Gget_num_objs(mHDF5Handle,
&numObjects);
toReturn = numObjects;
toReturn = static_cast<int>(numObjects);
}
else {
toReturn = mDataSetId;
......@@ -338,7 +338,7 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
}
else {
// If the array has been split
int dimensionIndex = previousDimensions.size() - 1;
int dimensionIndex = static_cast<int>(previousDimensions.size()) - 1;
// Loop previous dimensions in
int j = 0;
for (j = 0; j < dimensionIndex; ++j) {
......@@ -443,8 +443,8 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Dimension in HDF5 Write.\n");
}
blockSizeSubtotal +=
array.getValue<std::string>(amountAlreadyWritten + k).size();
blockSizeSubtotal += static_cast<unsigned int>(
array.getValue<std::string>(amountAlreadyWritten + k).size());
}
dimensionIndex++;
}
......@@ -557,8 +557,8 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
XdmfError::message(XdmfError::FATAL,
"Error: Invalid Dimension in HDF5 Write.\n");
}
blockSizeSubtotal +=
array.getValue<std::string>(amountAlreadyWritten + k).size();
blockSizeSubtotal += static_cast<unsigned int>(
array.getValue<std::string>(amountAlreadyWritten + k).size());
}
dimensionIndex++;
}
......@@ -764,7 +764,7 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
}
else if (previousDimensions.size() < partialDimensions.size()) {
unsigned int overflowDimensions = 1;
for (unsigned int j = previousDimensions.size() - 1;
for (size_t j = previousDimensions.size() - 1;
j < partialDimensions.size();
++j) {
overflowDimensions *= partialDimensions[j];
......@@ -773,7 +773,7 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
}
else if (previousDimensions.size() > partialDimensions.size()) {
unsigned int overflowDimensions = 1;
for (unsigned int j = partialDimensions.size() - 1;
for (size_t j = partialDimensions.size() - 1;
j < previousDimensions.size();
++j) {
overflowDimensions *= previousDimensions[j];
......@@ -789,7 +789,7 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
}
else if (previousDataSizes.size() < partialDataSizes.size()) {
unsigned int overflowDataSizes = 1;
for (unsigned int j = previousDataSizes.size() - 1;
for (size_t j = previousDataSizes.size() - 1;
j < partialDataSizes.size();
++j) {
overflowDataSizes *= partialDataSizes[j];
......@@ -798,7 +798,7 @@ XdmfHDF5Writer::controllerSplitting(XdmfArray & array,
}
else if (previousDataSizes.size() > partialDataSizes.size()) {
unsigned int overflowDataSizes = 1;
for (unsigned int j = partialDataSizes.size() - 1;
for (size_t j = partialDataSizes.size() - 1;
j < previousDataSizes.size();
++j) {
overflowDataSizes *= previousDataSizes[j];
......@@ -990,7 +990,7 @@ XdmfHDF5Writer::getDataSetSize(const std::string & fileName, const std::string &
if (handle != mImpl->mHDF5Handle) {
H5Fclose(handle);
}
return checksize;
return static_cast<int>(checksize);
}
int
......@@ -1387,7 +1387,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
std::vector<hsize_t> maximum_dims(curDimensions.size(), H5S_UNLIMITED);
// Create a new dataspace
dataspace = H5Screate_simple(current_dims.size(),
dataspace = H5Screate_simple(static_cast<int>(current_dims.size()),
&current_dims[0],
&maximum_dims[0]);
hid_t property = H5Pcreate(H5P_DATASET_CREATE);
......@@ -1421,7 +1421,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
status = H5Pset_deflate(property, mDeflateFactor);
}
status = H5Pset_chunk(property, current_dims.size(), &chunk_size[0]);
status = H5Pset_chunk(property, static_cast<int>(current_dims.size()), &chunk_size[0]);
// Use that dataspace to create a new dataset
dataset = H5Dcreate(mImpl->mHDF5Handle,
dataSetPath.str().c_str(),
......@@ -1515,7 +1515,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
std::vector<hsize_t> currStart(curStart.begin(),
curStart.end());
memspace = H5Screate_simple(count.size(),
memspace = H5Screate_simple(static_cast<int>(count.size()),
&(count[0]),
NULL);
status = H5Sselect_hyperslab(dataspace,
......@@ -1577,7 +1577,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
H5P_DEFAULT);
hid_t checkspace = H5S_ALL;
checkspace = H5Dget_space(checkset);
newSize = H5Sget_simple_extent_npoints(checkspace);
newSize = static_cast<unsigned int>(H5Sget_simple_extent_npoints(checkspace));
status = H5Dclose(checkset);
if(checkspace != H5S_ALL) {
status = H5Sclose(checkspace);
......
......@@ -170,7 +170,7 @@ unsigned int * XdmfHeavyDataControllerGetDataspaceDimensions(XDMFHEAVYDATACONTRO
{
shared_ptr<XdmfHeavyDataController> & refController = *(shared_ptr<XdmfHeavyDataController> *)(controller);
std::vector<unsigned int> tempVector = refController->getDataspaceDimensions();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -182,7 +182,7 @@ unsigned int * XdmfHeavyDataControllerGetDimensions(XDMFHEAVYDATACONTROLLER * co
{
shared_ptr<XdmfHeavyDataController> & refController = *(shared_ptr<XdmfHeavyDataController> *)(controller);
std::vector<unsigned int> tempVector = refController->getDimensions();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -207,7 +207,7 @@ char * XdmfHeavyDataControllerGetName(XDMFHEAVYDATACONTROLLER * controller)
unsigned int XdmfHeavyDataControllerGetNumberDimensions(XDMFHEAVYDATACONTROLLER * controller)
{
shared_ptr<XdmfHeavyDataController> & refController = *(shared_ptr<XdmfHeavyDataController> *)(controller);
return refController->getDimensions().size();
return static_cast<unsigned int>(refController->getDimensions().size());
}
unsigned int XdmfHeavyDataControllerGetSize(XDMFHEAVYDATACONTROLLER * controller)
......@@ -220,7 +220,7 @@ unsigned int * XdmfHeavyDataControllerGetStart(XDMFHEAVYDATACONTROLLER * control
{
shared_ptr<XdmfHeavyDataController> & refController = *(shared_ptr<XdmfHeavyDataController> *)(controller);
std::vector<unsigned int> tempVector = refController->getStart();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) *returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -232,7 +232,7 @@ unsigned int * XdmfHeavyDataControllerGetStride(XDMFHEAVYDATACONTROLLER * contro
{
shared_ptr<XdmfHeavyDataController> & refController = *(shared_ptr<XdmfHeavyDataController> *)(controller);
std::vector<unsigned int> tempVector = refController->getStride();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......
......@@ -241,7 +241,7 @@ public :
unsigned int \
ParentClass::getNumber##ChildName##s() const \
{ \
return m##ChildName##s.size(); \
return static_cast<unsigned int>(m##ChildName##s.size()); \
} \
\
void \
......
......@@ -289,7 +289,7 @@ unsigned int * XdmfSubsetGetDimensions(XDMFSUBSET * subset)
{
shared_ptr<XdmfSubset> & refSubset = *(shared_ptr<XdmfSubset> *)(subset);
std::vector<unsigned int> tempVector = refSubset->getDimensions();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -300,7 +300,7 @@ unsigned int * XdmfSubsetGetDimensions(XDMFSUBSET * subset)
unsigned int XdmfSubsetGetNumberDimensions(XDMFSUBSET * subset)
{
shared_ptr<XdmfSubset> & refSubset = *(shared_ptr<XdmfSubset> *)(subset);
return refSubset->getDimensions().size();
return static_cast<unsigned int>(refSubset->getDimensions().size());
}
XDMFARRAY * XdmfSubsetGetReferenceArray(XDMFSUBSET * subset)
......@@ -320,7 +320,7 @@ unsigned int * XdmfSubsetGetStart(XDMFSUBSET * subset)
{
shared_ptr<XdmfSubset> & refSubset = *(shared_ptr<XdmfSubset> *)(subset);
std::vector<unsigned int> tempVector = refSubset->getStart();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int*)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......@@ -332,7 +332,7 @@ unsigned int * XdmfSubsetGetStride(XDMFSUBSET * subset)
{
shared_ptr<XdmfSubset> & refSubset = *(shared_ptr<XdmfSubset> *)(subset);
std::vector<unsigned int> tempVector = refSubset->getStride();
unsigned int returnSize = tempVector.size();
unsigned int returnSize = static_cast<unsigned int>(tempVector.size());
unsigned int * returnArray = (unsigned int *)malloc(sizeof(unsigned int) * returnSize);
for (unsigned int i = 0; i < returnSize; ++i) {
returnArray[i] = tempVector[i];
......
......@@ -288,7 +288,7 @@ int main()
char ** functionsSupported = XdmfFunctionGetSupportedFunctions();
for (i = 0; i < numSupportedFunctions; ++i)
for (i = 0; i < (int)numSupportedFunctions; ++i)
{
printf("%s\n", functionsSupported[i]);
}
......@@ -309,7 +309,7 @@ int main()
assert(strcmp(functionsSupported[13], "SUM") == 0);
assert(strcmp(functionsSupported[14], "TAN") == 0);
for (i = 0; i < numSupportedFunctions; ++i) {
for (i = 0; i < (int)numSupportedFunctions; ++i) {
free(functionsSupported[i]);
}
free(functionsSupported);
......@@ -401,7 +401,7 @@ XDMFARRAY * maximum(XDMFARRAY ** values, unsigned int numValues)
double * currentValPtr;
int i;
int j;
for (i = 0; i < numValues; ++i) {
for (i = 0; i < (int)numValues; ++i) {
limit = XdmfArrayGetSize(values[i]);
for (j = 0; j < limit; ++j) {
currentValPtr = (double *)XdmfArrayGetValue(values[i], j, XDMF_ARRAY_TYPE_FLOAT64, &status);
......
......@@ -45,7 +45,7 @@ int main(int, char **)
XdmfBinaryController::New("binary.bin",
XdmfArrayType::Int32(),
XdmfBinaryController::NATIVE,
sizeof(int) * dummyData.size(),
static_cast<unsigned int>(sizeof(int) * dummyData.size()),
std::vector<unsigned int>(1, 4));
shared_ptr<XdmfArray> testArray = XdmfArray::New();
......
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