Windows build fix.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 19:54:40 +0000 (19:54 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 19:54:40 +0000 (19:54 +0000)
        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertUTF8ToUTF16):
        * kjs/ustring.cpp:
        (KJS::UString::UTF8String):
        * wtf/unicode/UTF8.cpp:
        (WTF::Unicode::ConvertUTF8ToUTF16):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/c/c_utility.cpp
JavaScriptCore/kjs/ustring.cpp
JavaScriptCore/wtf/unicode/UTF8.cpp

index e9931ba76eafca772cac88c949dff00d15626a3b..6186a004a02a5540098931fc5ef636f0f7524803 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-13  Alexey Proskuryakov  <ap@webkit.org>
+
+        Windows build fix.
+
+        * bindings/c/c_utility.cpp:
+        (KJS::Bindings::convertUTF8ToUTF16):
+        * kjs/ustring.cpp:
+        (KJS::UString::UTF8String):
+        * wtf/unicode/UTF8.cpp:
+        (WTF::Unicode::ConvertUTF8ToUTF16):
+
 2007-11-13  Darin Adler  <darin@apple.com>
 
         Reviewed by Geoff.
index 9cc26ccc415890da66e5e0b7e0e1ebe5a6fe803b..81ec7dfe3cac53eac59a32edee72e75d9b11547f 100644 (file)
@@ -71,7 +71,7 @@ void convertUTF8ToUTF16(const NPUTF8* UTF8Chars, int UTF8Length, NPUTF16** UTF16
     
     ConversionResult result = ConvertUTF8ToUTF16(&sourcestart, sourceend, &targetstart, targetend, true);
     
-    *UTF16Length = targetstart - *UTF16Chars;
+    *UTF16Length = targetstart - reinterpret_cast< ::UChar*>(*UTF16Chars);
 
     // Check to see if the conversion was successful
     // Some plugins return invalid UTF-8 in NPVariantType_String, see <http://bugs.webkit.org/show_bug.cgi?id=5163>
index 00390f23f47f910a78b1bc9c1e190b862864971a..936f5c2c759807456b02dc67ee3f65a19cd29d23 100644 (file)
@@ -1281,7 +1281,7 @@ CString UString::UTF8String(bool strict) const
 
   // Convert to runs of 8-bit characters.
   char* p = buffer.data();
-  const ::UChar* d = &data()->uc;
+  const ::UChar* d = reinterpret_cast<const ::UChar*>(&data()->uc);
   ConversionResult result = ConvertUTF16ToUTF8(&d, d + length, &p, p + buffer.size(), strict);
   if (result != conversionOK)
     return CString();
index 527195aee4187403e2b2ce6aa654e34ebe913c8b..be7b8776a95ba543310e33cd18846098b78ee8c2 100644 (file)
@@ -117,7 +117,7 @@ int decodeUTF8Sequence(const char* sequence)
 // as many entries in this table as there are UTF-8 sequence types.
 // (I.e., one byte sequence, two byte... etc.). Remember that sequencs
 // for *legal* UTF-8 will be 4 or fewer bytes total.
-static const char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
 
 ConversionResult ConvertUTF16ToUTF8(
     const UChar** sourceStart, const UChar* sourceEnd, 
@@ -239,7 +239,7 @@ ConversionResult ConvertUTF8ToUTF16(
     UChar* target = *targetStart;
     while (source < sourceEnd) {
         UChar32 ch = 0;
-        unsigned short extraBytesToRead = UTF8SequenceLength(*source) - 1;
+        int extraBytesToRead = UTF8SequenceLength(*source) - 1;
         if (source + extraBytesToRead >= sourceEnd) {
             result = sourceExhausted;
             break;