Changeset 732 for cpp/frams/genetics/geno.cpp
- Timestamp:
- 02/15/18 00:42:07 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/geno.cpp
r534 r732 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2018 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 32 32 name = genname; 33 33 txt = comment; 34 setGenesAndFormat(genstring, genformat);34 setGenesAndFormat(genstring, genformat); 35 35 } 36 36 … … 54 54 mapinshift = end + 1; 55 55 gencopy = genstring.substr(end + 1); 56 if ((end >0) && (genstring[end-1]=='\r')) end--;56 if ((end > 0) && (genstring[end - 1] == '\r')) end--; 57 57 error_end = end; 58 58 if (end != 3) genformat = INVALID_FORMAT; … … 82 82 break; 83 83 } 84 if (!isalnum(genformat)) genformat =INVALID_FORMAT;84 if (!isalnum(genformat)) genformat = INVALID_FORMAT; 85 85 if (genformat == INVALID_FORMAT) 86 86 { … … 93 93 cut = genstring.substr(0, error_end); 94 94 int lf = cut.indexOf('\n'); 95 if (lf >= 0) { if ((lf >0)&&(cut[lf-1]=='\r')) lf--; cut = cut.substr(0, lf); }95 if (lf >= 0) { if ((lf > 0) && (cut[lf - 1] == '\r')) lf--; cut = cut.substr(0, lf); } 96 96 sstringQuote(cut); 97 97 logPrintf("Geno", "init", LOG_ERROR, "Invalid genotype format declaration: '%s'%s", cut.c_str(), name.len() ? SString::sprintf(" in '%s'", name.c_str()).c_str() : ""); … … 226 226 { 227 227 bool converter_missing; 228 Geno f0geno = g.getConverted('0', NULL, &converter_missing);228 Geno f0geno = g.getConverted('0', NULL, false, &converter_missing); 229 229 if (converter_missing) 230 230 return -1;//no result … … 295 295 } 296 296 297 Geno Geno::getConverted(char otherformat, MultiMap *m, bool *converter_missing)297 Geno Geno::getConverted(char otherformat, MultiMap *m, bool using_checkpoints, bool *converter_missing) 298 298 { 299 299 if (otherformat == getFormat()) { if (converter_missing) *converter_missing = false; return *this; } … … 302 302 if (converters) 303 303 { 304 if ((otherformat == '0') && (!m) )304 if ((otherformat == '0') && (!m) && (!using_checkpoints)) 305 305 { 306 306 if (!f0gen) 307 f0gen = new Geno(converters->convert(*this, otherformat, NULL, converter_missing));307 f0gen = new Geno(converters->convert(*this, otherformat, NULL, using_checkpoints, converter_missing)); 308 308 else 309 309 { … … 313 313 } 314 314 else 315 return converters->convert(*this, otherformat, m, converter_missing);315 return converters->convert(*this, otherformat, m, using_checkpoints, converter_missing); 316 316 } 317 317 #endif
Note: See TracChangeset
for help on using the changeset viewer.