ICU-1028 os/390 fix, which uses EBCDIC instead of ASCII

X-SVN-Rev: 7291
This commit is contained in:
George Rhoten 2001-12-03 22:35:02 +00:00
parent 192e7744fe
commit f0a28aa373
3 changed files with 12 additions and 0 deletions

View file

@ -216,6 +216,7 @@ static const uint8_t digitInfo[] = {
0xa1u, 0xa2u, 0xa3u, 0, 0, 0, 0, 0,
};
#ifdef RBNF_DEBUG
llong llong::atoll(const char* str, uint32_t radix)
{
if (radix > 36) {
@ -241,6 +242,7 @@ llong llong::atoll(const char* str, uint32_t radix)
}
return result;
}
#endif
llong llong::utoll(const UChar* str, uint32_t radix)
{
@ -269,6 +271,7 @@ llong llong::utoll(const UChar* str, uint32_t radix)
return result;
}
#ifdef RBNF_DEBUG
uint32_t llong::lltoa(char* buf, uint32_t len, uint32_t radix, UBool raw) const
{
if (radix > 36) {
@ -314,6 +317,7 @@ uint32_t llong::lltoa(char* buf, uint32_t len, uint32_t radix, UBool raw) const
return len;
}
#endif
uint32_t llong::lltou(UChar* buf, uint32_t len, uint32_t radix, UBool raw) const
{

View file

@ -216,11 +216,15 @@ public:
inline llong abs() const;
// simple construction from ASCII and Unicode strings
#ifdef RBNF_DEBUG
static llong atoll(const char* str, uint32_t radix = 10);
#endif
static llong utoll(const UChar* str, uint32_t radix = 10);
// output as ASCII or Unicode strings or as raw values, preceeding '-' if signed
#ifdef RBNF_DEBUG
uint32_t lltoa(char* buffer, uint32_t buflen, uint32_t radix = 10, UBool raw = FALSE) const;
#endif
uint32_t lltou(UChar* buffer, uint32_t buflen, uint32_t radix = 10, UBool raw = FALSE) const;
private:

View file

@ -836,6 +836,7 @@ void IntlTestRBNF::TestLLong()
LLAssert(n.abs() == llong(0, 1));
}
#ifdef RBNF_DEBUG
logln("Testing atoll");
// atoll
const char empty[] = "";
@ -850,6 +851,7 @@ void IntlTestRBNF::TestLLong()
LLAssert(llong::atoll(neg_12345) == -llong(0, 12345));
LLAssert(llong::atoll(big1, 16) == llong(0x12345678, 0x9abcdef0));
LLAssert(llong::atoll(big2, 16) == llong(0xffffffff, 0xffffffff));
#endif
// u_atoll
const UChar uempty[] = { 0 };
@ -865,6 +867,7 @@ void IntlTestRBNF::TestLLong()
LLAssert(llong::utoll(ubig1, 16) == llong(0x12345678, 0x9abcdef0));
LLAssert(llong::utoll(ubig2, 16) == llong(0xffffffff, 0xffffffff));
#ifdef RBNF_DEBUG
logln("Testing lltoa");
// lltoa
{
@ -874,6 +877,7 @@ void IntlTestRBNF::TestLLong()
LLAssert(((-llong(0, 12345)).lltoa(buf, (uint32_t)sizeof(buf)) == 6) && (strcmp(buf, neg_12345) == 0));
LLAssert((llong(0x12345678, 0x9abcdef0).lltoa(buf, (uint32_t)sizeof(buf), 16) == 16) && (strcmp(buf, big1) == 0));
}
#endif
logln("Testing u_lltoa");
// u_lltoa