--- OS-2.10.2/src/OSCommonInterfaces/OSMatrix.cpp.orig 2019-06-24 14:21:05.271203523 -0600 +++ OS-2.10.2/src/OSCommonInterfaces/OSMatrix.cpp 2019-06-24 14:32:44.598840889 -0600 @@ -57,7 +57,7 @@ MatrixNode::~MatrixNode() #endif if (inumberOfChildren > 0 && m_mChildren != NULL) { - for (int i=0; imatrixType != that->matrixType) return false; if (this->nType != that->nType) return false; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) if (!this->m_mChildren[i]->IsEqual(that->m_mChildren[i])) return false; @@ -201,7 +201,7 @@ bool MatrixType::matrixHasBase() bool MatrixType::matrixHasElements() { if (inumberOfChildren == 0 || m_mChildren == NULL) return false; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_constantElements) return true; if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_varRefElements ) return true; @@ -216,7 +216,7 @@ bool MatrixType::matrixHasElements() bool MatrixType::matrixHasTransformations() { if (inumberOfChildren == 0 || m_mChildren == NULL) return false; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_transformation) return true; } @@ -226,7 +226,7 @@ bool MatrixType::matrixHasTransformation bool MatrixType::matrixHasBlocks() { if (inumberOfChildren == 0 || m_mChildren == NULL) return false; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_blocks) return true; } @@ -237,7 +237,7 @@ int MatrixType::getNumberOfElementConst { int k = 0; if (inumberOfChildren == 0 || m_mChildren == NULL) return 0; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_constantElements) k++; if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_varRefElements) k++; @@ -253,7 +253,7 @@ int MatrixType::getNumberOfTransformati { int k = 0; if (inumberOfChildren == 0 || m_mChildren == NULL) return 0; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_transformation) k++; } @@ -264,7 +264,7 @@ int MatrixType::getNumberOfBlocksConstr { int k = 0; if (inumberOfChildren == 0 || m_mChildren == NULL) return 0; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_blocks) k++; } @@ -2149,7 +2149,7 @@ bool MatrixType::processBlockPartition() int imerge_R; int imerge_C; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_blocks) { @@ -2274,7 +2274,7 @@ ExpandedMatrixBlocks* MatrixType::getBlo #endif // Try to find a collection of blocks that matches the criteria - for (int kount = 0; kount < ExpandedMatrixByBlocks.size(); kount++) + for (size_t kount = 0; kount < ExpandedMatrixByBlocks.size(); kount++) { if (rowPartitionSize != ExpandedMatrixByBlocks[kount]->rowOffsetSize || colPartitionSize != ExpandedMatrixByBlocks[kount]->colOffsetSize || @@ -2351,7 +2351,7 @@ bool MatrixType::processBlocks(int* rowO MatrixBlock* tmpChild; int tmpBlockNumber = 0; int tmpBlockSize; - for (int j=0; j<((MatrixBlocks*)m_mChildren[0])->inumberOfChildren; j++) + for (unsigned int j=0; j<((MatrixBlocks*)m_mChildren[0])->inumberOfChildren; j++) { tmpChild = (MatrixBlock*)((MatrixBlocks*)m_mChildren[0])->m_mChildren[j]; if (rowMajor) @@ -2376,7 +2376,7 @@ bool MatrixType::processBlocks(int* rowO // go through blocks again and store pointers tmpBlockNumber = 0; - for (int j=0; j<((MatrixBlocks*)m_mChildren[0])->inumberOfChildren; j++) + for (unsigned int j=0; j<((MatrixBlocks*)m_mChildren[0])->inumberOfChildren; j++) { tmpChild = (MatrixBlock*)((MatrixBlocks*)m_mChildren[0])->m_mChildren[j]; if (rowMajor) @@ -2446,7 +2446,7 @@ none_found: bool coarseningCandidate; int k = 0; - for (int k = 0; k < ExpandedMatrixByBlocks.size(); k++) + for (size_t k = 0; k < ExpandedMatrixByBlocks.size(); k++) { refinementCandidate = true; int itarget = 0; @@ -2792,7 +2792,7 @@ ExpandedMatrixBlocks* MatrixType::disass returnArray->colOffsetSize = colPartitionSize; returnArray->blocks = new GeneralSparseMatrix*[tmpBlocks.size()]; - for (int i=0; iblocks[i] = tmpBlocks[i]; returnArray->blockRows[i] = tmpBlockRows[i]; @@ -3021,7 +3021,7 @@ ENUM_MATRIX_TYPE OSMatrix::getMatrixType if (matrixType == ENUM_MATRIX_TYPE_unknown) { matrixType = ENUM_MATRIX_TYPE_empty; - for (int i=0; igetMatrixType()); } return matrixType; @@ -3410,7 +3410,7 @@ bool OSMatrix::processBlocks(int* rowOff bool OSMatrix::alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) { bool accumulator = true; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_baseMatrix) accumulator &= m_mChildren[i]->alignsOnBlockBoundary(firstRow, firstColumn, nRows, nCols); else if (m_mChildren[i]->nType == ENUM_MATRIX_CONSTRUCTOR_TYPE_blocks) @@ -3695,7 +3695,7 @@ std::string OSMatrix::getMatrixNodeInXML if (inumberOfChildren > 0) { outStr << ">" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; } @@ -3785,7 +3785,7 @@ std::string OSMatrixWithMatrixVarIdx::ge if (inumberOfChildren > 0) { outStr << ">" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; } @@ -3836,7 +3836,7 @@ std::string OSMatrixWithMatrixObjIdx::ge if (inumberOfChildren > 0) { outStr << ">" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; } @@ -3886,7 +3886,7 @@ std::string OSMatrixWithMatrixConIdx::ge if (inumberOfChildren > 0) { outStr << ">" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; } @@ -6195,7 +6195,7 @@ ENUM_MATRIX_TYPE MatrixBlocks::getMatrix if (matrixType == ENUM_MATRIX_TYPE_unknown) { matrixType = ENUM_MATRIX_TYPE_empty; - for (int i=0; igetMatrixType()); } return matrixType; @@ -6212,7 +6212,7 @@ std::string MatrixBlocks::getMatrixNodeI outStr << writeIntVectorData(rowOffset, true, false); outStr << "" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; @@ -6321,7 +6321,7 @@ ENUM_MATRIX_TYPE MatrixBlock::getMatrixT if (matrixType == ENUM_MATRIX_TYPE_unknown) { matrixType = ENUM_MATRIX_TYPE_empty; - for (int i=0; igetMatrixType()); } @@ -6343,7 +6343,7 @@ std::string MatrixBlock::getMatrixNodeIn if (inumberOfChildren > 0) { outStr << ">" << std::endl; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) outStr << m_mChildren[i]->getMatrixNodeInXML(); outStr << "" << std::endl; } --- OS-2.10.2/src/OSCommonInterfaces/OSnLNode.cpp.orig 2017-12-08 06:52:50.000000000 -0700 +++ OS-2.10.2/src/OSCommonInterfaces/OSnLNode.cpp 2019-06-24 14:38:21.032899938 -0600 @@ -175,7 +175,7 @@ ExprNode::~ExprNode() #endif if (inumberOfChildren > 0 && m_mChildren != NULL) { - for (int i=0; i 0 && m_mMatrixChildren != NULL) { - for (int i=0; i stackVec; - int kount = 0; + size_t kount = 0; while(kount <= nlNodeVec.size() - 1) { int numMtxKids = nlNodeVec[kount]->inumberOfMatrixChildren; @@ -520,7 +520,7 @@ OSnLNode* OSnLNode::copyNodeAndDescendan if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = /*(OSnLNode)*/m_mChildren[i]->copyNodeAndDescendants(); } @@ -529,7 +529,7 @@ OSnLNode* OSnLNode::copyNodeAndDescendan if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -1755,7 +1755,7 @@ OSnLNode* OSnLNodeNumber::copyNodeAndDes if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -1764,7 +1764,7 @@ OSnLNode* OSnLNodeNumber::copyNodeAndDes if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -2113,7 +2113,7 @@ OSnLNode* OSnLNodeVariable::copyNodeAndD if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = /*(OSnLNode)*/m_mChildren[i]->copyNodeAndDescendants(); } @@ -2122,7 +2122,7 @@ OSnLNode* OSnLNodeVariable::copyNodeAndD if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -2414,7 +2414,7 @@ OSnLMNode* OSnLMNode::copyNodeAndDescend if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -2423,7 +2423,7 @@ OSnLMNode* OSnLMNode::copyNodeAndDescend if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -2509,7 +2509,7 @@ OSnLMNode* OSnLMNode::createExpressionTr OSnLMNode* OSnLMNode::createExpressionTreeFromPostfix(std::vector nlNodeVec) { std::vector stackVec; - int kount = 0; + size_t kount = 0; while(kount <= nlNodeVec.size() - 1) { @@ -3278,7 +3278,7 @@ OSnLMNode* OSnLMNodeMatrixLowerTriangle: if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -3287,7 +3287,7 @@ OSnLMNode* OSnLMNodeMatrixLowerTriangle: if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -3434,7 +3434,7 @@ OSnLMNode* OSnLMNodeMatrixUpperTriangle: if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -3443,7 +3443,7 @@ OSnLMNode* OSnLMNodeMatrixUpperTriangle: if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -3680,7 +3680,7 @@ OSnLMNode* OSnLMNodeMatrixReference::cop if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -3689,7 +3689,7 @@ OSnLMNode* OSnLMNodeMatrixReference::cop if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -3862,7 +3862,7 @@ OSnLMNode* OSnLMNodeMatrixVar::copyNodeA if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -3871,7 +3871,7 @@ OSnLMNode* OSnLMNodeMatrixVar::copyNodeA if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -4041,7 +4041,7 @@ OSnLMNode* OSnLMNodeMatrixObj::copyNodeA if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -4050,7 +4050,7 @@ OSnLMNode* OSnLMNodeMatrixObj::copyNodeA if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } @@ -4222,7 +4222,7 @@ OSnLMNode* OSnLMNodeMatrixCon::copyNodeA if (inumberOfChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfChildren; i++) + for (unsigned int i=0; i < inumberOfChildren; i++) { ndcopy->m_mChildren[i] = m_mChildren[i]->copyNodeAndDescendants(); } @@ -4231,7 +4231,7 @@ OSnLMNode* OSnLMNodeMatrixCon::copyNodeA if (inumberOfMatrixChildren > 0) { ndcopy->m_mChildren = new OSnLNode*[inumberOfChildren]; - for (int i=0; i < inumberOfMatrixChildren; i++) + for (unsigned int i=0; i < inumberOfMatrixChildren; i++) { ndcopy->m_mMatrixChildren[i] = m_mMatrixChildren[i]->copyNodeAndDescendants(); } --- OS-2.10.2/src/OSCommonInterfaces/OSResult.cpp.orig 2017-12-08 06:52:50.000000000 -0700 +++ OS-2.10.2/src/OSCommonInterfaces/OSResult.cpp 2019-06-24 14:34:06.093401806 -0600 @@ -6812,7 +6812,7 @@ bool OSResult::setMatrixVarValuesBlockEl ->m_mChildren[0] == NULL) return false; if (blkno < 0 || - blkno >= ((MatrixBlocks*)optimization->solution[solIdx]->matrixProgramming->matrixVariables + (unsigned int)blkno >= ((MatrixBlocks*)optimization->solution[solIdx]->matrixProgramming->matrixVariables ->values->matrixVar[idx]->m_mChildren[0])->inumberOfChildren) return false; if ( ((MatrixBlocks*)optimization->solution[solIdx]->matrixProgramming->matrixVariables @@ -7106,7 +7106,7 @@ bool OSResult::setMatrixVariablesOtherRe ->matrixVar[matrixVarIdx]->m_mChildren[0] == NULL) return false; if (blkno < 0 || - blkno > ((MatrixBlocks*)optimization->solution[solIdx]->matrixProgramming->matrixVariables + (unsigned int)blkno > ((MatrixBlocks*)optimization->solution[solIdx]->matrixProgramming->matrixVariables ->other[otherIdx]->matrixVar[matrixVarIdx]->m_mChildren[0])->inumberOfChildren) return false; --- OS-2.10.2/src/OSModelInterfaces/OSnl2OS.cpp.orig 2017-12-08 06:52:50.000000000 -0700 +++ OS-2.10.2/src/OSModelInterfaces/OSnl2OS.cpp 2019-06-24 14:41:21.181718773 -0600 @@ -670,10 +670,10 @@ bool OSnl2OS::createOSObjects() if (nlExprs.size()) { Nl** ppsNl = new Nl*[ nlExprs.size() ]; - for (i = 0; i < nlExprs.size(); i++) + for (size_t k = 0; k < nlExprs.size(); k++) { - ppsNl[i] = new Nl(nlExprs[i]); // See above note about shallow copy - ppsNl[i]->m_bDeleteExpressionTree = true; + ppsNl[k] = new Nl(nlExprs[k]); // See above note about shallow copy + ppsNl[k]->m_bDeleteExpressionTree = true; } if (osinstance->instanceData->nonlinearExpressions == NULL) osinstance->instanceData->nonlinearExpressions = new NonlinearExpressions(); --- OS-2.10.2/src/OSParsers/OSParseosil.y.orig 2019-04-10 15:58:21.819875109 -0600 +++ OS-2.10.2/src/OSParsers/OSParseosil.y 2019-06-24 14:45:01.218833235 -0600 @@ -3917,7 +3917,7 @@ matrixBlocksContent: GREATERTHAN colOffs matrixBlocksEnd: BLOCKSEND { - if ( ((MatrixBlocks*)osglData->mtxBlocksVec.back())->inumberOfChildren != + if ( (int)((MatrixBlocks*)osglData->mtxBlocksVec.back())->inumberOfChildren != osglData->nBlocksVec.back()) parserData->parser_errors += addErrorMsg( NULL, osinstance, parserData, osglData, osnlData, "Number of blocks does not agree with attribute value numberOfBlocks"); --- OS-2.10.2/src/OSParsers/OSParseosrl.y.orig 2015-07-02 13:09:18.000000000 -0600 +++ OS-2.10.2/src/OSParsers/OSParseosrl.y 2019-06-24 14:45:18.147534296 -0600 @@ -5800,7 +5800,7 @@ matrixBlocksContent: GREATERTHAN colOffs matrixBlocksEnd: BLOCKSEND { - if ( ((MatrixBlocks*)osglData->mtxBlocksVec.back())->inumberOfChildren != + if ( (int)((MatrixBlocks*)osglData->mtxBlocksVec.back())->inumberOfChildren != osglData->nBlocksVec.back()) parserData->parser_errors += addErrorMsg( NULL, osresult, parserData, osglData, osnlData, "Number of blocks does not agree with attribute value numberOfBlocks"); --- OS-2.10.2/src/OSSolverService.cpp.orig 2017-12-08 06:52:50.000000000 -0700 +++ OS-2.10.2/src/OSSolverService.cpp 2019-06-24 14:46:18.240473149 -0600 @@ -223,7 +223,7 @@ int main(int argC, const char* argV[]) { addQuotes = false; if (argV[i][0] != '\"') - for (int k=0; k