Changeset 40 for cpp


Ignore:
Timestamp:
12/02/09 22:39:16 (14 years ago)
Author:
Maciej Komosinski
Message:

fixed memory leak and commented out an extra condition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/f8-to-f1/geno_f8.cpp

    r35 r40  
    9494
    9595char* Geno_f8::getSimplest() {
    96         const char* geno = "1\n---\nP0\nP0():X\n";
    97         char* retGeno = (char*)malloc(strlen(geno) + 1);
    98         strcpy(retGeno, geno);
    99         return retGeno;
     96        return "1\n---\nP0\nP0():X\n";
    10097}
    10198
     
    105102        const char* f1genosrc = f1ssgeno;
    106103        Geno f1geno(f1genosrc);
    107         if (this->converter->checkSyntax(geno) && f1geno.isValid()) {
     104        if (/*this->converter->checkSyntax(geno) &&*/ f1geno.isValid()) {
    108105                return GENOPER_OK;
    109106        } else {
     
    10711068int Geno_f8::mutate(char *&g,float& chg, int &method) {
    10721069        SString in = g;
    1073        
     1070
    10741071        /*struct timeval tv;
    10751072        gettimeofday(&tv, NULL);
     
    10801077                return GENOPER_OPFAIL;
    10811078        }
    1082        
     1079
    10831080#if GENO_F8_DEBUG > 0
    10841081        string mutationName = (method == 0) ? "F8_CHANGE_BEGINNING_ARG" : //TODO use mutation_method_names[] here
     
    11001097        //cout << "-------------------- " << mutationName << " --------------------" << endl;
    11011098#endif
    1102        
     1099
    11031100        const char* mutatedTmp;
    11041101        SString ssMutatedTmp;
    1105        
     1102
    11061103        //cout << "mutate 1" << endl;
    11071104        switch (method) {
     
    11571154                        return GENOPER_OPFAIL;
    11581155        }
    1159        
     1156
    11601157        //cout << "mutate 2" << endl;
    11611158        if (ssMutatedTmp.len() < 16) {
Note: See TracChangeset for help on using the changeset viewer.