Commit b5dd7763 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

changes to suppress warnings when using -Wall

parent f23f1bef
......@@ -221,17 +221,17 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties,
//this needs to be changed to account for controllers being a vector now
mRemoteTaskIdsControllers.clear();
for (int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); i++)
{
mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i));
}
mLocalNodeIdsControllers.clear();
for (int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); i++)
{
mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i));
}
mRemoteLocalNodeIdsControllers.clear();
for (int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); i++)
{
mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i));
}
......@@ -246,18 +246,18 @@ XdmfMap::read()
mRemoteTaskIdsControllers.size() > 0 &&
mRemoteLocalNodeIdsControllers.size() > 0) {
int localNodeCount = 0;
for (int i = 0; i< mLocalNodeIdsControllers.size(); i++)
unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); i++)
{
localNodeCount += mLocalNodeIdsControllers[i]->getSize();
}
int remoteTaskCount = 0;
for (int i = 0; i< mRemoteTaskIdsControllers.size(); i++)
unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); i++)
{
remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize();
}
int remoteNodeCount = 0;
for (int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++)
unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++)
{
remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize();
}
......@@ -280,21 +280,21 @@ XdmfMap::read()
shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New();
mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get());
for (int i = 1; i < mRemoteTaskIdsControllers.size(); i++)
for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); i++)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteTaskIdsControllers[i]->read(tempArray.get());
remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize());
}
mLocalNodeIdsControllers[0]->read(localNodeIds.get());
for (int i = 1; i < mLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); i++)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mLocalNodeIdsControllers[i]->read(tempArray.get());
localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize());
}
mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get());
for (int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++)
{
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteLocalNodeIdsControllers[i]->read(tempArray.get());
......@@ -323,18 +323,18 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController>
std::vector<shared_ptr<XdmfHeavyDataController> > localNodeIdsControllers,
std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers)
{
int localNodeCount = 0;
for (int i = 0; i< localNodeIdsControllers.size(); i++)
unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< localNodeIdsControllers.size(); i++)
{
localNodeCount += localNodeIdsControllers[i]->getSize();
}
int remoteTaskCount = 0;
for (int i = 0; i< remoteTaskIdsControllers.size(); i++)
unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); i++)
{
remoteTaskCount += remoteTaskIdsControllers[i]->getSize();
}
int remoteNodeCount = 0;
for (int i = 0; i< remoteLocalNodeIdsControllers.size(); i++)
unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); i++)
{
remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize();
}
......@@ -396,15 +396,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
}
}
for (int i = 0; i < mRemoteTaskIdsControllers.size(); i++)
for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); i++)
{
remoteTaskIds->insert(mRemoteTaskIdsControllers[i]);
}
for (int i = 0; i < mLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); i++)
{
localNodeIds->insert(mLocalNodeIdsControllers[i]);
}
for (int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++)
for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++)
{
remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]);
}
......@@ -417,15 +417,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
mRemoteTaskIdsControllers.clear();
mRemoteLocalNodeIdsControllers.clear();
for (int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++)
{
mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i));
}
for (int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++)
{
mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i));
}
for (int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++)
for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++)
{
mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i));
}
......
This diff is collapsed.
......@@ -190,13 +190,13 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%extend XdmfArray {
%{
#include <stack>;
/*These can't be accessed from python so don't worry about security issues.*/
#include <stack>
static std::map<std::string, PyObject *> pythonFunctions;
static std::map<char, PyObject *> pythonOperations;
static int pythonOperationPriority [4];
static std::string pythonSupportedOperations = "";
%}
/*These can't be accessed from python so don't worry about security issues.*/
PyObject * getBuffer() {
void *vp = $self->getValuesInternal();
......@@ -329,15 +329,6 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
/*note, accessing private members is impossible from swig.*/
/*to generate new static functions mark them as static here.*/
static std::vector<std::string> getSupportedFunctions()
{
std::vector<std::string> returnVector = XdmfArray::getSupportedFunctions();
for (std::map<std::string, PyObject *>::iterator functionWalker = pythonFunctions.begin(); functionWalker != pythonFunctions.end(); functionWalker++) {
returnVector.push_back(functionWalker->first);
}
return returnVector;
}
static shared_ptr<XdmfArray> evaluateFunction(std::vector<shared_ptr<XdmfArray> > functValues, std::string functName)
{
if (pythonFunctions.find(functName)!= pythonFunctions.end()) {
......@@ -359,24 +350,6 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
}
}
static std::string getSupportedOperations()
{
std::string returnVector = XdmfArray::getSupportedOperations();
returnVector += pythonSupportedOperations;
return returnVector;
}
static int getOperationPriority(char operation)
{
size_t operationLocation = pythonSupportedOperations.find(operation);
if (operationLocation != std::string::npos) {
return pythonOperationPriority[operationLocation];
}
else {
return XdmfArray::getOperationPriority(operation);
}
}
static shared_ptr<XdmfArray> evaluateOperation(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2, char functName)
{
if (pythonOperations.find(functName)!= pythonOperations.end()) {
......@@ -407,7 +380,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
/*string is parsed left to right
elements of the same priority are evaluated right to left*/
for (int i = 0; i < expression.size(); i++) {
for (unsigned int i = 0; i < expression.size(); i++) {
if (XdmfArray::getValidDigitChars().find(expression[i]) != std::string::npos) {/*found to be a digit*/
/*progress until a non-digit is found*/
int valueStart = i;
......@@ -429,7 +402,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
if (variables.find(expression.substr(valueStart, i + 1 - valueStart)) == variables.end()) {
std::vector<std::string> functionList = XdmfArray::getSupportedFunctions();
bool functionExists = false;
for (int j = 0; j < functionList.size() && !functionExists; j++) {
for (unsigned int j = 0; j < functionList.size() && !functionExists; j++) {
if (functionList[j] == expression.substr(valueStart, i + 1 - valueStart)) {
functionExists = true;
}
......@@ -647,11 +620,10 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
/*if not an already defined python function*/
if (pythonOperations.find(newName) == pythonOperations.end()) {
pythonSupportedOperations.push_back(newName);
int priorityArraySize = sizeof(pythonOperationPriority)/sizeof(int);
unsigned int priorityArraySize = sizeof(pythonOperationPriority)/sizeof(int);
if (pythonSupportedOperations.size()-1 > priorityArraySize) {
int newArray [priorityArraySize*2];
std::copy(pythonOperationPriority, pythonOperationPriority+(priorityArraySize-1), newArray);
delete pythonOperationPriority;
*pythonOperationPriority = *newArray;
}
}
......@@ -666,12 +638,11 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
}
else {
pythonSupportedOperations.push_back(newName);
int priorityArraySize = sizeof(pythonOperationPriority)/sizeof(int);
unsigned int priorityArraySize = sizeof(pythonOperationPriority)/sizeof(int);
if (pythonSupportedOperations.size()-1 > priorityArraySize)
{
int newArray [priorityArraySize*2];
std::copy(pythonOperationPriority, pythonOperationPriority+(priorityArraySize-1), newArray);
delete pythonOperationPriority;
*pythonOperationPriority = *newArray;
}
}
......@@ -725,7 +696,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
/*string is parsed left to right
elements of the same priority are evaluated right to left*/
for (int i = 0; i < expression.size(); i++) {
for (unsigned int i = 0; i < expression.size(); i++) {
if (XdmfArray::getValidDigitChars().find(expression[i]) != std::string::npos) { /*found to be a digit*/
/*progress until a non-digit is found*/
int valueStart = i;
......@@ -747,7 +718,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
if (variables.find(expression.substr(valueStart, i + 1 - valueStart)) == variables.end()) {
std::vector<std::string> functionList = XdmfArray::getSupportedFunctions();
bool functionExists = false;
for (int j = 0; j < functionList.size() && !functionExists; j++) {
for (unsigned int j = 0; j < functionList.size() && !functionExists; j++) {
if (functionList[j] == expression.substr(valueStart, i + 1 - valueStart)) {
functionExists = true;
}
......
......@@ -387,7 +387,7 @@ public:
//insert those controllers into the childArray
int hdf5step = 2;
for (int i = 0; i < controllerParts.size(); i = i + hdf5step) {
for (unsigned int i = 0; i < controllerParts.size(); i = i + hdf5step) {
size_t colonLocation = controllerParts[i].find(":");
if(colonLocation == std::string::npos) {
try {
......
This diff is collapsed.
......@@ -331,6 +331,7 @@ public:
void openFile();
using XdmfHeavyDataWriter::visit;
void visit(XdmfArray & array,
const shared_ptr<XdmfBaseVisitor> visitor);
......
......@@ -40,8 +40,8 @@ XdmfHeavyDataController::XdmfHeavyDataController(const std::string & filePath,
mFilePath(filePath),
mStart(start),
mStride(stride),
mType(type),
mArrayStartOffset(0)
mArrayStartOffset(0),
mType(type)
{
if(!(mStart.size() == mStride.size() &&
mStride.size() == mDimensions.size()))
......
......@@ -317,7 +317,7 @@ XdmfWriter::visit(XdmfArray & array,
throw e;
}
std::stringstream valuesStream;
for(int i = 0; i < array.getNumberHeavyDataControllers(); i++) {
for(unsigned int i = 0; i < array.getNumberHeavyDataControllers(); i++) {
std::string heavyDataPath =
array.getHeavyDataController(i)->getFilePath();
size_t index = heavyDataPath.find_last_of("/\\");
......@@ -330,7 +330,7 @@ XdmfWriter::visit(XdmfArray & array,
}//otherwise the full path is required
}
std::stringstream dimensionStream;
for (int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); j++) {
for (unsigned int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); j++) {
dimensionStream << array.getHeavyDataController(i)->getDimensions()[j];
if (j < array.getHeavyDataController(i)->getDimensions().size() - 1) {
dimensionStream << " ";
......@@ -366,7 +366,7 @@ XdmfWriter::visit(XdmfArray & array,
array.swap(arrayToWrite);
mImpl->mXMLCurrentNode = mImpl->mXMLCurrentNode->last;
this->visit(dynamic_cast<XdmfItem &>(*arrayToWrite.get()), visitor);
for(int i = 0; i<xmlTextValues.size(); i++) {
for(unsigned int i = 0; i<xmlTextValues.size(); i++) {
xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
}
......@@ -375,7 +375,7 @@ XdmfWriter::visit(XdmfArray & array,
}
else {
this->visit(dynamic_cast<XdmfItem &>(array), visitor);
for(int i = 0; i<xmlTextValues.size(); i++) {
for(unsigned int i = 0; i<xmlTextValues.size(); i++) {
xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
}
......@@ -415,7 +415,7 @@ XdmfWriter::visit(XdmfItem & item,
XdmfInformation & xpathinfo = dynamic_cast<XdmfInformation &>(item);
if (xpathinfo.getKey() == "XIncludes") {
shared_ptr<XdmfInformation> outputinfo;
for (int i = 0; i < xpathinfo.getNumberInformations(); i++) {
for (unsigned int i = 0; i < xpathinfo.getNumberInformations(); i++) {
mImpl->mXPathCount++;
outputinfo = xpathinfo.getInformation(i);
mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode,
......
......@@ -20,8 +20,6 @@ int main(int, char **)
array1->insert(2, insertArray3, 0, 10, 4, 1);
array1->insert(3, insertArray4, 0, 10, 4, 1);
printf("array1 contains\n%s\n",array1->getValuesString());
assert(array1->getValuesString().compare("1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 "
"2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 "
"3 4 1 2 3 4") == 0);
......@@ -39,8 +37,6 @@ int main(int, char **)
array2->insert(2, &(insertArray7[0]), 10, 4, 1);
array2->insert(3, &(insertArray8[0]), 10, 4, 1);
printf("array2 contains\n%s\n",array2->getValuesString());
assert(array2->getValuesString().compare("1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 "
"2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 "
"3 4 1 2 3 4") == 0);
......@@ -58,8 +54,6 @@ int main(int, char **)
array3->insert(2, &(insertArray11[0]), 10, 4, 1);
array3->insert(3, &(insertArray12[0]), 10, 4, 1);
printf("array3 contains\n%s\n",array3->getValuesString());
assert(array3->getValuesString().compare("1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 "
"2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 "
"3 4 1 2 3 4") == 0);
......
......@@ -46,14 +46,5 @@ int main(int, char **)
assert(readArray->getValuesString().compare("1 0 3 0 5 0 0 0 0 0 0 0 11 0 13 0 15 0 0 0 0 0 0 0") == 0);
for (int i = 0; i < readArray->getDimensions()[1]; i++)
{
for (int j = 0; j < readArray->getDimensions()[0]; j++)
{
printf("%d ", readArray->getValue<int>(i*readArray->getDimensions()[0]+j));
}
printf("\n");
}
return 0;
}
This diff is collapsed.
......@@ -2292,9 +2292,9 @@ private:
shared_ptr<XdmfGeometry> mGeometry;
shared_ptr<XdmfTime> mTime;
shared_ptr<XdmfTopology> mTopology;
shared_ptr<XdmfArray> mDimensions;
shared_ptr<XdmfArray> mOrigin;
shared_ptr<XdmfArray> mBrick;
shared_ptr<XdmfArray> mOrigin;
shared_ptr<XdmfArray> mDimensions;
shared_ptr<XdmfHeavyDataWriter> mHeavyDataWriter;
std::vector<shared_ptr<XdmfAttribute> > mAttributes;
......
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