Changeset 1299 for cpp/frams/genetics/fL


Ignore:
Timestamp:
03/29/24 23:34:00 (9 months ago)
Author:
Maciej Komosinski
Message:

More reasonable usage of size_t, int, and unsigned int, and their conversions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fL/fL_matheval.cpp

    r896 r1299  
    648648        if (type == 0)
    649649        {
    650                 count = operatorstrings.size();
     650                count = int(operatorstrings.size());
    651651        }
    652652        else if (type == 2)
    653653        {
    654                 count = operatorstrings.size() - arithmeticoperatorscount;
     654                count = int(operatorstrings.size()) - arithmeticoperatorscount;
    655655        }
    656656        randop += rndUint(count);
     
    662662        if (varcount > 0)
    663663        {
    664                 int currsize = postfixlist.size();
     664                size_t currsize = postfixlist.size();
    665665                int varid = rndUint(varcount);
    666666                postfixlist.push_back(vars[varid]);
     
    704704                std::list<Token *>::iterator it = postfixlist.begin();
    705705                // insertion can be applied from 1st occurrence
    706                 int insertlocation = 1 + rndUint(postfixlist.size() - 1);
     706                int insertlocation = 1 + rndUint((int)postfixlist.size() - 1);
    707707                std::advance(it, insertlocation);
    708708                Operator *rndop;
Note: See TracChangeset for help on using the changeset viewer.