处理long问题

This commit is contained in:
aozhiwei 2018-10-31 10:25:36 +08:00
parent 24f2912dbf
commit 55c5492183

View File

@ -119,15 +119,21 @@ namespace a8
void XValue::Set(long v)
{
OnReset();
type_ = XVT_INT;
value_.int_value = v;
if (sizeof(long) == 8) {
Set((long long)v);
} else {
Set((int)v);
}
}
void XValue::Set(unsigned int v)
{
OnReset();
type_ = XVT_UINT;
value_.int_value = v;
if (sizeof(long) == 8) {
Set((unsigned long long)v);
} else {
Set((unsigned int)v);
}
}
void XValue::Set(unsigned long v)
@ -407,13 +413,21 @@ namespace a8
XValue::operator long() const
{
if (sizeof(long) == 8) {
return GetInt64();
} else {
return GetInt();
}
}
XValue::operator unsigned long() const
{
if (sizeof(long) == 8) {
return GetUInt64();
} else {
return GetUInt();
}
}
XValue::operator double() const
{