Index: cpp/frams/util/extvalue.cpp
===================================================================
--- cpp/frams/util/extvalue.cpp	(revision 337)
+++ cpp/frams/util/extvalue.cpp	(revision 348)
@@ -269,5 +269,5 @@
 			if (tmp.len() > 30) tmp = tmp.substr(0, 30) + "...";
 			if (type == TString) tmp = SString("\"") + tmp + SString("\"");
-			FMprintf("ExtValue", "getObjectTarget", FMLV_WARN, "%s object expected, %s found", classname, (const char*)tmp);
+			FMprintf("ExtValue", "getObjectTarget", FMLV_WARN, "%s object expected, %s found", classname, tmp.c_str());
 		}
 		return NULL;
@@ -329,6 +329,6 @@
 static ExtValue::CompareResult compareString(const SString &a, const SString &b)
 {
-	const char* s1 = (const char*)a;
-	const char* s2 = (const char*)b;
+	const char* s1 = a.c_str();
+	const char* s2 = b.c_str();
 	return longsign(strcmp(s1, s2));
 }
@@ -415,9 +415,9 @@
 			if (context->v1 && context->v2)
 				msg += SString::sprintf(": %s %s %s",
-				(const char*)context->v1->typeAndValue(),
+				context->v1->typeAndValue().c_str(),
 				cmp_op_names[op - CmpFIRST],
-				(const char*)context->v2->typeAndValue());
-		}
-		FMprintf("ExtValue", "interpretCompare", FMLV_ERROR, "%s", (const char*)msg);
+				context->v2->typeAndValue().c_str());
+		}
+		FMprintf("ExtValue", "interpretCompare", FMLV_ERROR, "%s", msg.c_str());
 		ret = -1;
 	}
@@ -448,5 +448,5 @@
 		{
 		case TDouble:
-			FMprintf("ExtValue", "add", FMLV_WARN, "Adding %s to %s", (const char*)src.typeAndValue(), (const char*)typeAndValue());
+			FMprintf("ExtValue", "add", FMLV_WARN, "Adding %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 			setDouble(double(getInt()) + src.getDouble());
 			return;
@@ -487,5 +487,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "add", FMLV_ERROR, "Can't add %s to %s", (const char*)src.typeAndValue(), (const char*)typeAndValue());
+	FMprintf("ExtValue", "add", FMLV_ERROR, "Can't add %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 }
 
@@ -502,5 +502,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "subtract", FMLV_WARN, "Subtracting %s from %s", (const char*)src.typeAndValue(), (const char*)typeAndValue());
+			FMprintf("ExtValue", "subtract", FMLV_WARN, "Subtracting %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 			setDouble(double(getInt()) - src.getDouble());
 			return;
@@ -520,5 +520,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "subtract", FMLV_ERROR, "Can't subtract %s from %s", (const char*)src.typeAndValue(), (const char*)typeAndValue());
+	FMprintf("ExtValue", "subtract", FMLV_ERROR, "Can't subtract %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 }
 
@@ -535,5 +535,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "multiply", FMLV_WARN, "Multiplying %s by %s", (const char*)typeAndValue(), (const char*)src.typeAndValue());
+			FMprintf("ExtValue", "multiply", FMLV_WARN, "Multiplying %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 			setDouble(double(getInt())*src.getDouble());
 			return;
@@ -591,5 +591,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "multiply", FMLV_WARN, "Can't multiply %s by %s", (const char*)typeAndValue(), (const char*)src.typeAndValue());
+	FMprintf("ExtValue", "multiply", FMLV_WARN, "Can't multiply %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 }
 
@@ -621,5 +621,5 @@
 	if (a == 0.0)
 	{
-		FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Division by zero: %s/0.0", (const char*)getString());
+		FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Division by zero: %s/0.0", getString().c_str());
 		setInvalid();
 	}
@@ -630,5 +630,5 @@
 		if (!finite(tmp))
 		{
-			FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Overflow %s/%g", (const char*)getString(), a); setInvalid();
+			FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid();
 		}
 		else
@@ -652,5 +652,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "divide", FMLV_WARN, "Dividing %s by %s", (const char*)typeAndValue(), (const char*)src.typeAndValue());
+			FMprintf("ExtValue", "divide", FMLV_WARN, "Dividing %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 			divDouble(src.ddata());
 			return;
@@ -674,5 +674,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "divide", FMLV_ERROR, "Can't divide %s by %s", (const char*)typeAndValue(), (const char*)src.typeAndValue());
+	FMprintf("ExtValue", "divide", FMLV_ERROR, "Can't divide %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 }
 
@@ -687,5 +687,5 @@
 	//            ^-cur     ^-next
 	//            ^^^^^^^^^^___sub
-	const char* begin = (const char*)fmt, *end = begin + fmt.len(), *curr = begin;
+	const char* begin = fmt.c_str(), *end = begin + fmt.len(), *curr = begin;
 	int type = 0;
 
@@ -733,7 +733,7 @@
 		switch (type)
 		{
-		case 'd': a = args.getNext(); ret += SString::sprintf((const char*)sub, a ? a->getInt() : 0); break;
-		case 'f': a = args.getNext(); ret += SString::sprintf((const char*)sub, a ? a->getDouble() : 0); break;
-		case 's': {a = args.getNext(); SString tmp; if (a) tmp = a->getString(); ret += SString::sprintf((const char*)sub, (const char*)tmp); } break;
+		case 'd': a = args.getNext(); ret += SString::sprintf(sub.c_str(), a ? a->getInt() : 0); break;
+		case 'f': a = args.getNext(); ret += SString::sprintf(sub.c_str(), a ? a->getDouble() : 0); break;
+		case 's': {a = args.getNext(); SString tmp; if (a) tmp = a->getString(); ret += SString::sprintf(sub.c_str(), tmp.c_str()); } break;
 		case 't': case 'T':
 		{
@@ -779,5 +779,5 @@
 
 	case TObj: case TUnknown: case TInvalid:
-		FMprintf("ExtValue", "modulo", FMLV_WARN, "Can't apply modulo to %s", (const char*)typeDescription());
+		FMprintf("ExtValue", "modulo", FMLV_WARN, "Can't apply modulo to %s", typeDescription().c_str());
 
 	default:;
@@ -835,7 +835,7 @@
 	case TInt: return idata();
 	case TDouble: return (int)ddata();
-	case TString: return getInt((const char*)sdata());
+	case TString: return getInt(sdata().c_str());
 	case TObj:
-		FMprintf("ExtValue", "getInt", FMLV_WARN, "Getting integer value from object reference (%s)", (const char*)getString());
+		FMprintf("ExtValue", "getInt", FMLV_WARN, "Getting integer value from object reference (%s)", getString().c_str());
 		return (paInt)(intptr_t)odata().param;
 	default:;
@@ -850,7 +850,7 @@
 	case TDouble: return ddata();
 	case TInt: return (double)idata();
-	case TString: return getDouble((const char*)sdata());
+	case TString: return getDouble(sdata().c_str());
 	case TObj:
-		FMprintf("ExtValue", "getDouble", FMLV_WARN, "Getting floating point value from object reference (%s)", (const char*)getString());
+		FMprintf("ExtValue", "getDouble", FMLV_WARN, "Getting floating point value from object reference (%s)", getString().c_str());
 		return (double)(intptr_t)odata().param;
 	default:;
@@ -1095,5 +1095,5 @@
 		ExtValue tmp;
 		ret = tmp.deserialize(ret);
-		ParamInterface *cls = findDeserializableClass(clsname);
+		ParamInterface *cls = findDeserializableClass(clsname.c_str());
 		if (cls && (tmp.getType() != TUnknown) && (tmp.getType() != TInvalid))
 		{
@@ -1134,5 +1134,5 @@
 		}
 		setEmpty();
-		FMprintf("ExtValue", "deserialize", FMLV_WARN, "object of class \"%s\" could not be deserialized", (const char*)clsname);
+		FMprintf("ExtValue", "deserialize", FMLV_WARN, "object of class \"%s\" could not be deserialized", clsname.c_str());
 		return ret;
 	}
