@@ -1542,8 +1542,8 @@ void NxsCharactersBlock::CreateDatatypeMapperObjects(const NxsPartition & dtPart
15421542 mixedTypeMapping.clear ();
15431543 if (datatype != mixed)
15441544 {
1545- NxsDiscreteDatatypeMapper d (datatype, symbols, missing, gap, matchchar, respectingCase, userEquates);
1546- datatype = d. GetDatatype ();
1545+ auto d = std::make_shared<NxsDiscreteDatatypeMapper> (datatype, symbols, missing, gap, matchchar, respectingCase, userEquates);
1546+ datatype = d-> GetDatatype ();
15471547 DatatypeMapperAndIndexSet das (d, NxsUnsignedSet ());
15481548 datatypeMapperVec.clear ();
15491549 datatypeMapperVec.push_back (das);
@@ -1560,7 +1560,7 @@ void NxsCharactersBlock::CreateDatatypeMapperObjects(const NxsPartition & dtPart
15601560 std::string mt;
15611561 if (*cIt == standard)
15621562 mt.assign (" 0123456789" ); /* mrbayes is the only program to support MIXED and it uses a default (not extendable) symbols list of 0123456789 rather than 01*/
1563- NxsDiscreteDatatypeMapper d (*cIt, mt, missing, gap, matchchar, respectingCase, userEquates);
1563+ auto d = std::make_shared<NxsDiscreteDatatypeMapper> (*cIt, mt, missing, gap, matchchar, respectingCase, userEquates);
15641564 const NxsUnsignedSet & indexSet = pIt->second ;
15651565 DatatypeMapperAndIndexSet das (d, pIt->second );
15661566 NxsUnsignedSet & mappedInds = mixedTypeMapping[*cIt];
@@ -1669,27 +1669,27 @@ bool NxsCharactersBlock::AugmentedSymbolsToMixed()
16691669
16701670 /* copy the incoming matrix and mapper */
16711671 VecDatatypeMapperAndIndexSet mdm = datatypeMapperVec;
1672- const NxsDiscreteDatatypeMapper & oldMapper = mdm[0 ].first ;
1672+ const NxsDiscreteDatatypeMapper & oldMapper = * mdm[0 ].first ;
16731673 if (oldMapper.GetUserDefinedEquatesBeforeConversion ())
16741674 return false ; /* dealing with equates correctly is not implemented below, so we'll bale out */
16751675
16761676 /* add the new mappers */
16771677 std::map<char , NxsString> noEquates;
16781678 datatypeMapperVec.clear ();
1679- NxsDiscreteDatatypeMapper o (odt, origSymb, missing, gap, matchchar, respectingCase, noEquates);
1679+ auto o = std::make_shared<NxsDiscreteDatatypeMapper> (odt, origSymb, missing, gap, matchchar, respectingCase, noEquates);
16801680 datatypeMapperVec.push_back (DatatypeMapperAndIndexSet (o, origTypeChars));
1681- NxsDiscreteDatatypeMapper s (NxsCharactersBlock::standard, augmentSymbols, missing, gap, matchchar, respectingCase, noEquates);
1681+ auto s = std::make_shared<NxsDiscreteDatatypeMapper> (NxsCharactersBlock::standard, augmentSymbols, missing, gap, matchchar, respectingCase, noEquates);
16821682 datatypeMapperVec.push_back (DatatypeMapperAndIndexSet (s, stdTypeChars));
16831683
16841684
1685- NxsDiscreteDatatypeMapper & newOrigTMapper = datatypeMapperVec[0 ].first ;
1686- NxsDiscreteDatatypeMapper & newStdTMapper = datatypeMapperVec[1 ].first ;
1685+ NxsDiscreteDatatypeMapper & newOrigTMapper = * datatypeMapperVec[0 ].first ;
1686+ NxsDiscreteDatatypeMapper & newStdTMapper = * datatypeMapperVec[1 ].first ;
16871687
16881688 /* now we recode discrete matrix with new state codes */
16891689 const NxsDiscreteStateCell nOrigStates = (NxsDiscreteStateCell) origSymb.size ();
16901690 std::map<NxsDiscreteStateCell, NxsDiscreteStateCell> oldToNewStateCode;
16911691 NxsDiscreteStateMatrix::iterator rowIt = discreteMatrix.begin ();
1692- for (unsigned colIndex = 0 ; rowIt != discreteMatrix.end (); ++colIndex, ++rowIt)
1692+ for (; rowIt != discreteMatrix.end (); ++rowIt)
16931693 {
16941694 NxsDiscreteStateRow & row = *rowIt;
16951695 unsigned column = 0 ;
@@ -2298,7 +2298,7 @@ void NxsCharactersBlock::HandleFormat(
22982298 if (*b)
22992299 {
23002300 DatatypeMapperAndIndexSet &mapper = datatypeMapperVec.at (mapInd);
2301- mapper.first . SetWasRestrictionDataype (true );
2301+ mapper.first -> SetWasRestrictionDataype (true );
23022302 }
23032303 }
23042304 }
@@ -3352,7 +3352,6 @@ NxsDiscreteStateCell NxsCharactersBlock::HandleTokenState(
33523352 */
33533353 NxsStringVector::const_iterator ci_begin = bagIter->second .begin ();
33543354 NxsStringVector::const_iterator ci_end = bagIter->second .end ();
3355- NxsStringVector::const_iterator cit;
33563355 NxsDiscreteStateCell k = 0 ;
33573356 for (; ci_begin != ci_end; ++ci_begin, ++k)
33583357 {
@@ -4943,7 +4942,7 @@ void NxsCharactersBlock::WriteFormatCommand(std::ostream &out) const
49434942 first = false ;
49444943 else
49454944 out << " , " ;
4946- out << GetNameOfDatatype (mIt ->first . GetDatatype ()) << ' :' ;
4945+ out << GetNameOfDatatype (mIt ->first -> GetDatatype ()) << ' :' ;
49474946 NxsSetReader::WriteSetAsNexusValue (mIt ->second , out);
49484947 }
49494948 out << ' )' ;
0 commit comments