Changeset 348 for cpp/frams/model


Ignore:
Timestamp:
04/09/15 23:51:28 (9 years ago)
Author:
Maciej Komosinski
Message:
  • explicit c_str() in SString instead of (const char*) cast
  • genetic converters and GenMan? are now thread-local which enables multi-threaded simulator separation
Location:
cpp/frams/model
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/autoname.cpp

    r343 r348  
    3838        unsigned int s1 = 0, s2 = 0, s3 = 0;
    3939        SString g = model.getGeno().getGene();
    40         const char *x = g;
     40        const char *x = g.c_str();
    4141        for (; *x; x++) { s1 += *x; s2 = s2**x + *x; s3 = (s3^*x) + *x; }
    4242        char* t = buf;
  • cpp/frams/model/model.cpp

    r319 r348  
    331331                FMprintf("Model","build",FMLV_ERROR,
    332332                         geno.getName().len()?"illegal f0 code at line %d (%s)":"illegal f0 code at line %d",
    333                          lnum,(const char*)geno.getName());
     333                         lnum,geno.getName().c_str());
    334334                f0errorposition=lastpos;
    335335                if (convmap) delete convmap;
     
    473473                }
    474474        }
    475 g=Geno(gen,'0');
     475g=Geno(gen.c_str(),'0');
    476476}
    477477
     
    559559int Model::singleStepBuild(const SString &line,const MultiRange* srcrange)
    560560{
    561 int pos=0; const char*t=(const char*)line;
     561int pos=0; const char*t=line.c_str();
    562562for (;*t;t++,pos++)
    563563        if (!strchr(" \r\t",*t)) break;
     
    943943                                FMprintf("Model","internalCheck",FMLV_ERROR,
    944944                                         "delta joint cycle detected at joint#%d (%s)",
    945                                          i,(const char*)geno.getName());
     945                                         i,geno.getName().c_str());
    946946                                }
    947947                        j->resetDeltaMarkers();
     
    979979                        ret=0;
    980980                        FMprintf("Model","internalCheck",FMLV_ERROR,"delta too big in joint #%d (%s)",
    981                                  i,(const char*)geno.getName());
     981                                 i,geno.getName().c_str());
    982982                        }
    983983                        else if (j->d()<getMinJoint().d.x)
     
    985985                        ret=0;
    986986                        FMprintf("Model","internalCheck",FMLV_ERROR,"delta too small in joint #%d (%s)",
    987                                  i,(const char*)geno.getName());
     987                                 i,geno.getName().c_str());
    988988                        }
    989989                                }
     
    993993                {
    994994                FMprintf("Model","internalCheck",FMLV_ERROR,"illegal part references in joint #%d (%s)",
    995                          i,(const char*)geno.getName());
     995                         i,geno.getName().c_str());
    996996                ret=0;
    997997                }
     
    10721072                        {
    10731073                        FMprintf("Model","internalCheck",FMLV_ERROR,"not all parts connected (eg.#0-#%d) (%s)",
    1074                                  i,(const char*)geno.getName());
     1074                                 i,geno.getName().c_str());
    10751075                        ret=0;
    10761076                        break;
     
    10851085                {
    10861086                FMprintf("Model","internalCheck",FMLV_ERROR,"illegal self connection, joint #%d (%s)",
    1087                          i,(const char*)geno.getName());
     1087                         i,geno.getName().c_str());
    10881088                ret=0;
    10891089                break;
     
    10961096                        {
    10971097                        FMprintf("Model","internalCheck",FMLV_ERROR,"illegal duplicate joints #%d and #%d (%s)",
    1098                                  i,k,(const char*)geno.getName());
     1098                                 i,k,geno.getName().c_str());
    10991099                        ret=0;
    11001100                        break;
Note: See TracChangeset for help on using the changeset viewer.