diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-08-14 08:08:30 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-08-14 08:08:30 (GMT) |
commit | 0b2ee937495f2746816676d094be42b674eed900 (patch) | |
tree | 2bd907157ac544ae12085526bfa7693ec8f0026a /src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp | |
parent | 03330a4a6b4ebf0860f722b041185fb3ae469d3d (diff) | |
parent | 8785117eea4bbaa9ec846d7b8dd51219c41bd570 (diff) | |
download | Qt-0b2ee937495f2746816676d094be42b674eed900.zip Qt-0b2ee937495f2746816676d094be42b674eed900.tar.gz Qt-0b2ee937495f2746816676d094be42b674eed900.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp index 118751e..f64219c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp @@ -942,6 +942,37 @@ UString UString::from(int i) return UString(p, static_cast<int>(end - p)); } +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +UString UString::from(int64_t i) +{ + UChar buf[1 + sizeof(i) * 3]; + UChar* end = buf + sizeof(buf) / sizeof(UChar); + UChar* p = end; + + if (i == 0) + *--p = '0'; + else if (i == LLONG_MIN) { + char minBuf[1 + sizeof(i) * 3]; + snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", LLONG_MIN); + return UString(minBuf); + } else { + bool negative = false; + if (i < 0) { + negative = true; + i = -i; + } + while (i) { + *--p = static_cast<unsigned short>((i % 10) + '0'); + i /= 10; + } + if (negative) + *--p = '-'; + } + + return UString(p, static_cast<int>(end - p)); +} +#endif + UString UString::from(unsigned int u) { UChar buf[sizeof(u) * 3]; |