diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-11 11:20:16 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-11 12:19:29 (GMT) |
commit | 1c4a75de75157f0ffa0a75d8c5f177bf45119c50 (patch) | |
tree | c255dc388c78cc67d15891303b4e52e6357a555d /src/3rdparty/webkit | |
parent | 1056df7f11e4c7964a72e89d02bd3016ccd2c9f1 (diff) | |
download | Qt-1c4a75de75157f0ffa0a75d8c5f177bf45119c50.zip Qt-1c4a75de75157f0ffa0a75d8c5f177bf45119c50.tar.gz Qt-1c4a75de75157f0ffa0a75d8c5f177bf45119c50.tar.bz2 |
Fix compile error on 64Bit
Added new overload with int64 parameter.
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp | 31 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.h | 3 |
2 files changed, 34 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]; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h index d01b75d..f2572a9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h @@ -256,6 +256,9 @@ namespace JSC { } static UString from(int); +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) + static UString from(int64_t i); +#endif static UString from(unsigned int); static UString from(long); static UString from(double); |