Index: cpp/frams/util/extvalue.cpp
===================================================================
--- cpp/frams/util/extvalue.cpp	(revision 512)
+++ cpp/frams/util/extvalue.cpp	(revision 522)
@@ -104,19 +104,19 @@
 }
 
-bool ExtObject::callDelegate(const char* delegate,ExtValue *args,ExtValue *ret)
-{
-Param tmp;
-ParamInterface *pi=getParamInterface(tmp);
-if (pi)
-	{
-	int f=pi->findId(delegate);
-	if (f>=0)
-		{
-		pi->call(f,args,ret);
-		return true;
-		}
-	}
-logPrintf("Genotype","get", LOG_ERROR, "Could not call delegate '%s.%s'", pi?pi->getName():"NULL",delegate);
-return false;
+bool ExtObject::callDelegate(const char* delegate, ExtValue *args, ExtValue *ret)
+{
+	Param tmp;
+	ParamInterface *pi = getParamInterface(tmp);
+	if (pi)
+	{
+		int f = pi->findId(delegate);
+		if (f >= 0)
+		{
+			pi->call(f, args, ret);
+			return true;
+		}
+	}
+	logPrintf("Genotype", "get", LOG_ERROR, "Could not call delegate '%s.%s'", pi ? pi->getName() : "NULL", delegate);
+	return false;
 }
 
@@ -205,69 +205,73 @@
 
 	if (ref >= 0)
-		{
-		switch(format)
-			{
-			case NativeSerialization: return SString::sprintf("^%d", ref);
-			case JSONSerialization: return SString("null");
-			}
-		}
+	{
+		switch (format)
+		{
+		case NativeSerialization: return SString::sprintf("^%d", ref);
+		case JSONSerialization: return SString("null");
+		}
+	}
 
 	if (isEmpty()) return SString("null");
 	{
-	VectorObject *vec = VectorObject::fromObject(*this, false);
-	if (vec)
-		{ ret=vec->serialize(format); goto finally; }
-	}
-	{
-	DictionaryObject *dic = DictionaryObject::fromObject(*this, false);
-	if (dic)
-		{ ret=dic->serialize(format); goto finally; }
-	}
-	{
-	Param tmp_param;
-	ParamInterface *p = getParamInterface(tmp_param);
-	int m = p->findId("toVector");
-	if (m < 0)
-		m = p->findId("toDictionary");
-	if (m >= 0)
-	{
-		ExtObject o(p->getObject(m));
-		switch(format)
-			{
-			case NativeSerialization: ret=SString(interfaceName())+o.serialize(format); break;
-			case JSONSerialization: ret=SString::sprintf("{\"class\":\"%s\",\"data\":%s}",interfaceName(),o.serialize(format).c_str()); break;
-			}
-		goto finally;
-	}
-	m = p->findId("toString");
-	if (m >= 0)
-	{
-		SString str = p->getString(m);
-		sstringQuote(str);
-		switch(format)
-			{
-			case NativeSerialization: ret=SString(interfaceName())+"\"" +str+"\""; break;
-			case JSONSerialization: ret=SString::sprintf("{\"class\":\"%s\",\"data\":\"%s\"}",interfaceName(),str.c_str()); break;
-			}
-		goto finally;
-	}
+		VectorObject *vec = VectorObject::fromObject(*this, false);
+		if (vec)
+		{
+			ret = vec->serialize(format); goto finally;
+		}
+	}
+	{
+		DictionaryObject *dic = DictionaryObject::fromObject(*this, false);
+		if (dic)
+		{
+			ret = dic->serialize(format); goto finally;
+		}
+	}
+	{
+		Param tmp_param;
+		ParamInterface *p = getParamInterface(tmp_param);
+		int m = p->findId("toVector");
+		if (m < 0)
+			m = p->findId("toDictionary");
+		if (m >= 0)
+		{
+			ExtObject o(p->getObject(m));
+			switch (format)
+			{
+			case NativeSerialization: ret = SString(interfaceName()) + o.serialize(format); break;
+			case JSONSerialization: ret = SString::sprintf("{\"class\":\"%s\",\"data\":%s}", interfaceName(), o.serialize(format).c_str()); break;
+			}
+			goto finally;
+		}
+		m = p->findId("toString");
+		if (m >= 0)
+		{
+			SString str = p->getString(m);
+			sstringQuote(str);
+			switch (format)
+			{
+			case NativeSerialization: ret = SString(interfaceName()) + "\"" + str + "\""; break;
+			case JSONSerialization: ret = SString::sprintf("{\"class\":\"%s\",\"data\":\"%s\"}", interfaceName(), str.c_str()); break;
+			}
+			goto finally;
+		}
 	}
 
 	tlsGetRef(ExtObject_serialization).remove(*this);//undo nonserializable reference
-	switch(format)
-		{
-		case NativeSerialization: return SString(interfaceName())+SString::sprintf("<%p>",object ? object : paraminterface); break;
-		case JSONSerialization: return SString::sprintf("{\"class\":\"%s\"}",interfaceName()); break;
-		}
-
-  finally: // not 100% "finally", the case of nonserializable reference (directly above) returns directly without going through finally
-
-	switch(format)
-		{
-		case JSONSerialization: 
-			tlsGetRef(ExtObject_serialization).remove(*this);//JSON only tracks recursion, does not track reuse
-			break;
-		case NativeSerialization:; //nop (just to avoid compiler warning)
-		}
+	switch (format)
+	{
+	case NativeSerialization: return SString(interfaceName()) + SString::sprintf("<%p>", object ? object : paraminterface); break;
+	case JSONSerialization: return SString::sprintf("{\"class\":\"%s\"}", interfaceName()); break;
+	}
+
+	finally: // not 100% "finally", the case of nonserializable reference (directly above) returns directly without going through finally
+
+	switch (format)
+	{
+	case JSONSerialization:
+		tlsGetRef(ExtObject_serialization).remove(*this);//JSON only tracks recursion, does not track reuse
+		break;
+	case NativeSerialization:; //nop (just to avoid compiler warning)
+	}
 
 	return ret;
@@ -359,7 +363,7 @@
 void ExtValue::setError(const SString& msg)
 {
-ErrorObject *err=new ErrorObject;
-err->message=msg;
-setObject(ErrorObject::makeDynamicObject(err));
+	ErrorObject *err = new ErrorObject;
+	err->message = msg;
+	setObject(ErrorObject::makeDynamicObject(err));
 }
 
@@ -380,5 +384,5 @@
 static ExtValue::CompareResult compareInvalid(const ExtValue& v)
 {
-	if (v.getType()==TInvalid) return ExtValue::ResultEqualUnordered;
+	if (v.getType() == TInvalid) return ExtValue::ResultEqualUnordered;
 	if ((v.getType() == TInt) && (v.getInt() == 0)) return ExtValue::ResultUnequal_RelaxedEqual;
 	return ExtValue::ResultMismatch; //comparing anything else with invalid is invalid
@@ -406,7 +410,7 @@
 	else if (src.isNull())
 		return compareNull(*this);
-	if (getType()==TInvalid)
+	if (getType() == TInvalid)
 		return compareInvalid(src);
-	else if (src.getType()==TInvalid)
+	else if (src.getType() == TInvalid)
 		return compareInvalid(*this);
 	switch (type)
@@ -961,5 +965,5 @@
 		return odata().serialize(format);
 	case TInvalid:
-		if (format==NativeSerialization)
+		if (format == NativeSerialization)
 			return SString("invalid");
 		// else null --v
@@ -1044,5 +1048,5 @@
 const char* ExtValue::deserialize_inner(const char* in)
 {
-	while(isspace(*in)) in++;
+	while (isspace(*in)) in++;
 	const char* ret = parseNumber(in);
 	if (ret)
@@ -1146,11 +1150,11 @@
 	else if (*in == '<')
 	{ //unserializable object
-		const char* end=in+1;
+		const char* end = in + 1;
 		while (*end)
 			if (*end == '>')
-				{
-				setError(SString("Unserializable class: ")+SString(in+1,end-in-1));
-				return end+1;
-				}
+			{
+			setError(SString("Unserializable class: ") + SString(in + 1, end - in - 1));
+			return end + 1;
+			}
 			else
 				end++;
@@ -1231,5 +1235,5 @@
 	tlsGetRef(ExtObject_serialization).begin();
 	const char* ret = deserialize_inner(in);
-	if (ret) while(isspace(*ret)) ret++;
+	if (ret) while (isspace(*ret)) ret++;
 	tlsGetRef(ExtObject_serialization).end();
 	return ret;
@@ -1261,11 +1265,11 @@
 
 #define FIELDSTRUCT ErrorObject
-static ParamEntry errorobject_paramtab[]=
-{
-{"Error",1,3,"Error",},
-{"message",0,0,"Message","s",FIELD(message),},
-{"newFromString",0,0,"create new object","p oError(s message)",PROCEDURE(p_newfromstring),},
-{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"Textual form","s",GETONLY(toString),},
-{0,0,0,},
+static ParamEntry errorobject_paramtab[] =
+{
+	{ "Error", 1, 3, "Error", },
+	{ "message", 0, 0, "Message", "s", FIELD(message), },
+	{ "newFromString", 0, 0, "create new object", "p oError(s message)", PROCEDURE(p_newfromstring), },
+	{ "toString", 0, PARAM_READONLY | PARAM_NOSTATIC, "Textual form", "s", GETONLY(toString), },
+	{ 0, 0, 0, },
 };
 #undef FIELDSTRUCT
@@ -1282,18 +1286,18 @@
 }
 
-const SString ErrorObject::TO_STRING_PREFIX="Error: ";
+const SString ErrorObject::TO_STRING_PREFIX = "Error: ";
 
 void ErrorObject::get_toString(ExtValue* ret)
 {
-ret->setString(TO_STRING_PREFIX+message);
+	ret->setString(TO_STRING_PREFIX + message);
 }
 
 void ErrorObject::p_newfromstring(ExtValue *args, ExtValue *ret)
 {
-ErrorObject *err=new ErrorObject();
-err->message=args[0].getString();
-if (err->message.startsWith(TO_STRING_PREFIX.c_str()))
-	err->message=err->message.substr(TO_STRING_PREFIX.len());
-*ret = makeDynamicObject(err);
+	ErrorObject *err = new ErrorObject();
+	err->message = args[0].getString();
+	if (err->message.startsWith(TO_STRING_PREFIX.c_str()))
+		err->message = err->message.substr(TO_STRING_PREFIX.len());
+	*ret = makeDynamicObject(err);
 }
 
Index: cpp/frams/util/extvalue.h
===================================================================
--- cpp/frams/util/extvalue.h	(revision 512)
+++ cpp/frams/util/extvalue.h	(revision 522)
@@ -70,5 +70,5 @@
 	void* getTarget() const { return (subtype & 1) ? dbobject : object; }
 	void* getTarget(const char* classname, bool through_barrier = true, bool warn = true) const;
-	bool callDelegate(const char* delegate,ExtValue *args,ExtValue *ret);
+	bool callDelegate(const char* delegate, ExtValue *args, ExtValue *ret);
 	void setEmpty() { decref(); subtype = 0; param = NULL; object = NULL; }
 	int isEmpty() const { return !param; }
@@ -84,5 +84,5 @@
 	SString serialize(SerializationFormat format) const;
 
-	ExtObject(Param *p, void *o) :subtype(2), object(o), param(p) { DEBUG_EXTOBJECT("(Param,void)");}
+	ExtObject(Param *p, void *o) :subtype(2), object(o), param(p) { DEBUG_EXTOBJECT("(Param,void)"); }
 	ExtObject(ParamInterface *p = 0) :subtype(0), object(0), paraminterface(p) { DEBUG_EXTOBJECT("(ParamInterface)"); }
 	ExtObject(Param *p, DestrBase *o) :subtype(1 + 2), dbobject(o), param(p){ DEBUG_EXTOBJECT("(Param,DestrBase)"); incref(); }
@@ -244,15 +244,15 @@
 #define REGISTER_DESERIALIZABLE(name) ExtValue::AddDeserializable<name> deserializable_autoinit_ ## name;
 
-class ErrorObject: public DestrBase
-{
-  public:
-SString message;
-static Param& getParam();
-static Param& getStaticParam() {return getParam();}
-static ExtObject makeDynamicObject(ErrorObject* e);
-static const SString TO_STRING_PREFIX;
+class ErrorObject : public DestrBase
+{
+public:
+	SString message;
+	static Param& getParam();
+	static Param& getStaticParam() { return getParam(); }
+	static ExtObject makeDynamicObject(ErrorObject* e);
+	static const SString TO_STRING_PREFIX;
 #define STATRICKCLASS ErrorObject
-PARAMGETDEF(toString);
-PARAMPROCDEF(p_newfromstring);
+	PARAMGETDEF(toString);
+	PARAMPROCDEF(p_newfromstring);
 #undef STATRICKCLASS
 };
