Skip to content

Commit

Permalink
Some int -> size_t tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 28, 2019
1 parent 1788e2e commit 6d6d11b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core/pal/problem.cpp
Expand Up @@ -292,7 +292,7 @@ void Problem::init_sol_falp()
LabelPosition *retainedLabel = nullptr;
int p;

for ( i = 0; i < static_cast< int >( mFeatureCount ); i++ ) // forearch hidden feature
for ( std::size_t i = 0; i < mFeatureCount; i++ ) // forearch hidden feature
{
if ( mSol.activeLabelIds[i] == -1 )
{
Expand Down Expand Up @@ -783,10 +783,9 @@ void Problem::chain_search()

QList<LabelPosition *> Problem::getSolution( bool returnInactive, QList<LabelPosition *> *unlabeled )
{
int i;
QList<LabelPosition *> solList;

for ( i = 0; i < static_cast< int >( mFeatureCount ); i++ )
for ( std::size_t i = 0; i < mFeatureCount; i++ )
{
if ( mSol.activeLabelIds[i] != -1 )
{
Expand Down Expand Up @@ -817,8 +816,6 @@ void Problem::solution_cost()

int nbOv;

int i;

LabelPosition::CountContext context;
context.inactiveCost = mInactiveCost;
context.nbOv = &nbOv;
Expand All @@ -829,7 +826,7 @@ void Problem::solution_cost()

int nbHidden = 0;

for ( i = 0; i < static_cast< int >( mFeatureCount ); i++ )
for ( std::size_t i = 0; i < mFeatureCount; i++ )
{
if ( mSol.activeLabelIds[i] == -1 )
{
Expand Down

0 comments on commit 6d6d11b

Please sign in to comment.