,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 79c25b3858
commit 9c17645f95
4 changed files with 10 additions and 5 deletions

View file

@ -1995,7 +1995,7 @@ void CharSetData::Gen()
line[0][c] = c;
for(c = 0; c < 128; c++) {
int q = table[c];
if(q >= 128)
if(q >= 128) {
if(q < 16 * 128) {
int i = q >> 7;
if(!line[i]) {
@ -2007,6 +2007,7 @@ void CharSetData::Gen()
else
if((q & 0xFF00) != 0xEE00)
map.Add(q, c + 128);
}
}
for(c = 0; c < 16; c++)
if(!line[c])

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)

View file

@ -18,7 +18,7 @@ wchar *WString0::Alloc(int& count)
void WString0::Free()
{
if(alloc > 0)
if(alloc > 0) {
if(IsRc()) {
Atomic& rc = Rc();
if(AtomicDec(rc) == 0)
@ -26,6 +26,7 @@ void WString0::Free()
}
else
MemoryFree48(ptr);
}
}
#ifdef _DEBUG

View file

@ -889,11 +889,12 @@ XmlNode& XmlNode::SetAttr(const char *id, int i)
void XmlNode::Shrink()
{
if(attr)
if(attr) {
if(attr->GetCount() == 0)
attr.Clear();
else
attr->Shrink();
}
node.Shrink();
}