static const struct ToLongData
{
const wxChar *str;
- union
- {
#ifdef wxLongLong_t
- wxLongLong_t llvalue;
- wxULongLong_t ullvalue;
+ wxLongLong_t value;
+#else
+ long value;
#endif // wxLongLong_t
- long lvalue;
- unsigned long ulvalue;
- };
-
int flags;
+ long LValue() const { return value; }
+ unsigned long ULValue() const { return value; }
+#ifdef wxLongLong_t
+ wxLongLong_t LLValue() const { return value; }
+ wxULongLong_t ULLValue() const { return (wxULongLong_t)value; }
+#endif // wxLongLong_t
+
bool IsOk() const { return !(flags & Number_Invalid); }
} longData[] =
{
CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToLong(&l) );
if ( ld.IsOk() )
- CPPUNIT_ASSERT_EQUAL( ld.lvalue, l );
+ CPPUNIT_ASSERT_EQUAL( ld.LValue(), l );
}
}
CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToULong(&ul) );
if ( ld.IsOk() )
- CPPUNIT_ASSERT_EQUAL( ld.ulvalue, ul );
+ CPPUNIT_ASSERT_EQUAL( ld.ULValue(), ul );
}
}
CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToLongLong(&l) );
if ( ld.IsOk() )
- CPPUNIT_ASSERT_EQUAL( ld.llvalue, l );
+ CPPUNIT_ASSERT_EQUAL( ld.LLValue(), l );
}
}
CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToULongLong(&ul) );
if ( ld.IsOk() )
- CPPUNIT_ASSERT_EQUAL( ld.ullvalue, ul );
+ CPPUNIT_ASSERT_EQUAL( ld.ULLValue(), ul );
}
}