Skip to content

Commit dc5dca0

Browse files
authored
Merge pull request #2495 from ERGO-Code/warnings-gcc
Warnings g++ linux
2 parents a8ba8aa + c5767f8 commit dc5dca0

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

highs/interfaces/highs_c_api.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,32 +1320,34 @@ HighsInt Highs_getIis(void* highs, HighsInt* iis_num_col, HighsInt* iis_num_row,
13201320
*iis_num_col = iis.col_index_.size();
13211321
*iis_num_row = iis.row_index_.size();
13221322
if (col_index != nullptr) {
1323-
for (size_t i = 0; i < *iis_num_col; i++) {
1323+
for (size_t i = 0; i < static_cast<size_t>(*iis_num_col); i++) {
13241324
col_index[i] = iis.col_index_[i];
13251325
}
13261326
}
13271327
if (row_index != nullptr) {
1328-
for (size_t i = 0; i < *iis_num_row; i++) {
1328+
for (size_t i = 0; i < static_cast<size_t>(*iis_num_row); i++) {
13291329
row_index[i] = iis.row_index_[i];
13301330
}
13311331
}
13321332
if (col_bound != nullptr) {
1333-
for (size_t i = 0; i < *iis_num_col; i++) {
1333+
for (size_t i = 0; i < static_cast<size_t>(*iis_num_col); i++) {
13341334
col_bound[i] = iis.col_bound_[i];
13351335
}
13361336
}
13371337
if (row_bound != nullptr) {
1338-
for (size_t i = 0; i < *iis_num_row; i++) {
1338+
for (size_t i = 0; i < static_cast<size_t>(*iis_num_row); i++) {
13391339
row_bound[i] = iis.row_bound_[i];
13401340
}
13411341
}
13421342
if (col_status != nullptr) {
1343-
for (size_t i = 0; i < ((Highs*)highs)->getLp().num_col_; i++) {
1343+
for (size_t i = 0;
1344+
i < static_cast<size_t>(((Highs*)highs)->getLp().num_col_); i++) {
13441345
col_status[i] = iis.col_status_[i];
13451346
}
13461347
}
13471348
if (row_status != nullptr) {
1348-
for (size_t i = 0; i < ((Highs*)highs)->getLp().num_row_; i++) {
1349+
for (size_t i = 0;
1350+
i < static_cast<size_t>(((Highs*)highs)->getLp().num_row_); i++) {
13491351
row_status[i] = iis.row_status_[i];
13501352
}
13511353
}

highs/lp_data/HighsLp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
bool HighsLp::isMip() const {
1919
size_t integrality_size = this->integrality_.size();
2020
if (integrality_size) {
21-
assert(integrality_size == this->num_col_);
21+
assert(static_cast<HighsInt>(integrality_size) == this->num_col_);
2222
for (HighsInt iCol = 0; iCol < this->num_col_; iCol++)
2323
if (this->integrality_[iCol] != HighsVarType::kContinuous) return true;
2424
}
@@ -36,7 +36,7 @@ bool HighsLp::hasInfiniteCost(const double infinite_cost) const {
3636
bool HighsLp::hasSemiVariables() const {
3737
size_t integrality_size = this->integrality_.size();
3838
if (integrality_size) {
39-
assert(integrality_size == this->num_col_);
39+
assert(static_cast<HighsInt>(integrality_size) == this->num_col_);
4040
for (HighsInt iCol = 0; iCol < this->num_col_; iCol++)
4141
if (this->integrality_[iCol] == HighsVarType::kSemiContinuous ||
4242
this->integrality_[iCol] == HighsVarType::kSemiInteger)

0 commit comments

Comments
 (0)