Changeset 1280 for cpp/frams/genetics


Ignore:
Timestamp:
09/10/23 01:51:57 (15 months ago)
Author:
Maciej Komosinski
Message:

Added explicit type casts (size_t vs. int etc.)

Location:
cpp/frams/genetics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f9/f9_conv.cpp

    r1157 r1280  
    9292int GenoConv_f90::findVertexAt(vector<XYZ_LOC> &vertices, const XYZ_LOC &vertex)
    9393{
    94         for (size_t i = 0; i < vertices.size(); i++)
     94        for (int i = 0; i < vertices.size(); i++)
    9595                if (vertices[i].same_coordinates(vertex)) return i;
    9696        return -1;
  • cpp/frams/genetics/fF/fF_oper.cpp

    r1130 r1280  
    4949        par.load(gene);
    5050        static const int propsToMutate[] = fF_PROPS_TO_MUTATE;
    51         int which = rndUint(std::size(propsToMutate));
     51        int which = rndUint((unsigned int)std::size(propsToMutate));
    5252        bool mutated_ok = GenoOperators::mutatePropertyNaive(par.param, propsToMutate[which]);
    5353        if (mutated_ok)
  • cpp/frams/genetics/fL/fL_general.cpp

    r1273 r1280  
    555555        //branch->processDefinition(this);
    556556
    557         builtincount = words.size();
     557        builtincount = (int)words.size();
    558558}
    559559
     
    13831383int fL_Builder::countDefinedWords()
    13841384{
    1385         return words.size() - builtincount;
     1385        return (int)words.size() - builtincount;
    13861386}
    13871387
    13881388int fL_Builder::countWordsInLSystem()
    13891389{
    1390         int count = genotype.size();
     1390        size_t count = genotype.size();
    13911391        for (fL_Rule *rul : rules)
    13921392        {
     
    13941394        }
    13951395        count += words.size();
    1396         return count;
     1396        return int(count);
    13971397}
    13981398
Note: See TracChangeset for help on using the changeset viewer.