Index: cpp/frams/genetics/genoconv.cpp
===================================================================
--- cpp/frams/genetics/genoconv.cpp	(revision 841)
+++ cpp/frams/genetics/genoconv.cpp	(revision 955)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -57,7 +57,7 @@
 		pe->flags = 0;
 		std::string descr = "f";
-		descr += gk->in_format;
+		descr += gk->in_format.c_str();
 		descr += " --> f";
-		descr += gk->out_format;
+		descr += gk->out_format.c_str();
 		descr += "  :  ";
 		descr += gk->name;
@@ -101,5 +101,5 @@
 }
 
-GenoConverter *GenoConvManager::findConverters(SListTempl<GenoConverter*>* result, char in, char out, int enabled, char* name)
+GenoConverter *GenoConvManager::findConverters(SListTempl<GenoConverter*>* result, const SString& in, const SString& out, int enabled, char* name)
 {
 	GenoConverter *gk, *retval = 0;
@@ -107,6 +107,6 @@
 	for (; gk = (GenoConverter*)converters(i); i++)
 	{
-		if ((in != -1) && (in != gk->in_format)) continue;
-		if ((out != -1) && (out != gk->out_format)) continue;
+		if ((in != Geno::UNKNOWN_FORMAT) && (in != gk->in_format)) continue;
+		if ((out != Geno::UNKNOWN_FORMAT) && (out != gk->out_format)) continue;
 		if ((enabled != -1) && (enabled != gk->enabled)) continue;
 		if ((name) && (strcmp(name, gk->name))) continue;
@@ -123,5 +123,5 @@
 /// (can be NULL if you don't need this information)
 
-char *GenoConvManager::getPath(char in, char out, char *path, int maxlen, int *mapavailable)
+GenoConverter **GenoConvManager::getPath(const SString& in, const SString& out, GenoConverter **path, int maxlen, int *mapavailable)
 {
 	if (!maxlen) return 0;
@@ -132,5 +132,5 @@
 		if ((gk->enabled) && (gk->in_format == in))
 		{
-			*path = (char)i;
+			*path = gk;
 			if (gk->out_format == out)
 			{
@@ -142,5 +142,5 @@
 			{
 				int mapavail;
-				char *ret = getPath(gk->out_format, out, path + 1, maxlen - 1, &mapavail);
+				GenoConverter **ret = getPath(gk->out_format, out, path + 1, maxlen - 1, &mapavail);
 				if (ret)
 				{
@@ -155,29 +155,18 @@
 }
 
-char *GenoConvManager::getFormatPath(char in, char out, char *path, int maxlen, int *mapavailable)
-{
-	char *ret = getPath(in, out, path, maxlen, mapavailable);
-	if (ret)
-	{
-		for (char*t = path; t <= ret; t++)
-			*t = ((GenoConverter*)converters(*t))->out_format;
-	}
-	return ret;
-}
-
-Geno GenoConvManager::convert(Geno &in, char format, MultiMap *map, bool using_checkpoints, bool *converter_missing)
+Geno GenoConvManager::convert(Geno &in, SString format, MultiMap *map, bool using_checkpoints, bool *converter_missing)
 {
 	if (in.getFormat() == format) { if (converter_missing) *converter_missing = false; return in; }
-	char path[10];
+	GenoConverter *path[10];
 	int dep;
-	char *ret;
-	if (in.isInvalid()) { if (converter_missing) *converter_missing = false; return Geno("", 0, "", "invalid genotype cannot be converted"); }
+	GenoConverter **ret;
+	if (in.isInvalid()) { if (converter_missing) *converter_missing = false; return Geno("", Geno::INVALID_FORMAT, "", "invalid genotype cannot be converted"); }
 	int mapavail;
 	for (dep = 1; dep < (int)sizeof(path); dep++) //iterative deepening
 		if (ret = getPath(in.getFormat(), format, path, dep, &mapavail)) break;
-	if (!ret) { if (converter_missing) *converter_missing = true; return Geno("", 0, "", "converter not found"); }
+	if (!ret) { if (converter_missing) *converter_missing = true; return Geno("", Geno::INVALID_FORMAT, "", "converter not found"); }
 	if (converter_missing) *converter_missing = false;
 	if (!map) mapavail = 0;
-	char *t = path;
+	GenoConverter **t = path;
 	SString tmp;
 	tmp = in.getGenes();
@@ -186,10 +175,10 @@
 	for (; t <= ret; t++)
 	{
-		GenoConverter *gk = (GenoConverter*)converters(*t);
+		GenoConverter *gk = *t;
 		tmp = gk->convert(tmp, mapavail ? &tmpmap : 0, using_checkpoints);
 		if (!tmp.len())
 		{
-			string t = ssprintf("f%c->f%c conversion failed (%s)", gk->in_format, gk->out_format, gk->name);
-			return Geno(0, 0, 0, t.c_str());
+			string t = ssprintf("f%s->f%s conversion failed (%s)", gk->in_format.c_str(), gk->out_format.c_str(), gk->name);
+			return Geno("", Geno::INVALID_FORMAT, "", t.c_str());
 		}
 		if (mapavail)
