+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.
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>
// 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();
// 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,
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;