,cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@7139 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-02 18:04:34 +00:00
parent c1498bc874
commit 91cd8d30c1
4 changed files with 10 additions and 5 deletions

View file

@ -192,7 +192,7 @@ template<> void Jsonize(JsonIO& io, int& var)
{
double v = IntDbl(var);
Jsonize(io, v);
if(io.IsLoading())
if(io.IsLoading()) {
if(IsNull(v))
var = Null;
else
@ -200,17 +200,19 @@ template<> void Jsonize(JsonIO& io, int& var)
var = (int)v;
else
throw JsonizeError("number is not integer");
}
}
template<> void Jsonize(JsonIO& io, int16& var)
{
double v = var;
Jsonize(io, v);
if(io.IsLoading())
if(io.IsLoading()) {
if(v >= -32768 && v <= 32767 && (int)v == v)
var = (int16)v;
else
throw JsonizeError("16-bit integer expected");
}
}
template<> void Jsonize(JsonIO& io, bool& var)