Ignore:
Timestamp:
11/07/14 17:51:01 (9 years ago)
Author:
Maciej Komosinski
Message:

Sources support both 32-bit and 64-bit, and more compilers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/oper_fx.cpp

    r197 r247  
    5858        if (p->type(i)[0] == 'd')
    5959        {
    60                 long _mn = 0, _mx = 1, _def = 0;
     60                paInt _mn = 0, _mx = 1, _def = 0;
    6161                defined = p->getMinMax(i, _mn, _mx, _def);
    6262                if (defined == 1) _mx = _mn + 1;
     
    150150void GenoOperators::setIntFromDoubleWithProbabilisticDithering(ParamInterface &p, int index, double value) //TODO
    151151{
    152         p.setInt(index, value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!)
     152        p.setInt(index, (paInt)value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!)
    153153}
    154154
     
    187187NeuroClass* GenoOperators::parseNeuroClass(char*& s)
    188188{
    189         int len = strlen(s);
     189        int len = (int)strlen(s);
    190190        int Len = 0;
    191191        NeuroClass *I = NULL;
     
    193193        {
    194194                const char *n = Neuro::getClass(i)->name;
    195                 int l = strlen(n);
     195                int l = (int)strlen(n);
    196196                if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = Neuro::getClass(i); Len = l; }
    197197        }
     
    210210int GenoOperators::neuroClassProp(char*& s, NeuroClass *nc, bool also_v1_N_props)
    211211{
    212         int len = strlen(s);
     212        int len = (int)strlen(s);
    213213        int Len = 0, I = -1;
    214214        if (nc)
     
    218218                {
    219219                        const char *n = p.id(i);
    220                         int l = strlen(n);
     220                        int l = (int)strlen(n);
    221221                        if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; }
    222222                        if (also_v1_N_props) //recognize old properties symbols /=!
     
    225225                                        if (strcmp(n, "in") == 0) n = "="; else
    226226                                                if (strcmp(n, "fo") == 0) n = "!";
    227                                 l = strlen(n);
     227                                l = (int)strlen(n);
    228228                                if (len >= l && l > Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; }
    229229                        }
     
    235235        {
    236236                const char *n = p.id(i);
    237                 int l = strlen(n);
     237                int l = (int)strlen(n);
    238238                if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = i; Len = l; }
    239239        }
Note: See TracChangeset for help on using the changeset viewer.