RESOLVED FIXED Bug 88310
[Qt][Win] Fix UString related build problem in Source/WebCore/bridge/qt/qt_instance.cpp
https://bugs.webkit.org/show_bug.cgi?id=88310
Summary [Qt][Win] Fix UString related build problem in Source/WebCore/bridge/qt/qt_in...
Csaba Osztrogonác
Reported 2012-06-05 01:28:42 PDT
Source/WebCore/bridge/qt/qt_instance.cpp doesn't build because of some UString related problem. (Details are coming soon.)
Attachments
Patch (1.53 KB, patch)
2012-06-05 07:03 PDT, Csaba Osztrogonác
no flags
Patch (1.56 KB, patch)
2012-06-07 05:25 PDT, Csaba Osztrogonác
no flags
Patch (1.56 KB, patch)
2012-06-07 05:33 PDT, Csaba Osztrogonác
no flags
Patch (1.55 KB, patch)
2012-06-07 05:49 PDT, Csaba Osztrogonác
no flags
Patch (1.57 KB, patch)
2012-06-07 05:52 PDT, Csaba Osztrogonác
no flags
Patch (1.61 KB, patch)
2012-06-07 07:18 PDT, Csaba Osztrogonác
no flags
Csaba Osztrogonác
Comment 1 2012-06-05 06:17:08 PDT
Error log: f:\WebKit\Source\WebCore\bridge\qt\qt_instance.cpp(242) : error C2665: 'JSC::UString::UString' : none of the 11 overloads could convert all the argument types f:\webkit\source\javascriptcore\runtime\UString.h(36): could be 'JSC::UString::UString(const UChar *,unsigned int)' f:\webkit\source\javascriptcore\runtime\UString.h(42): or 'JSC::UString::UString(const LChar *,unsigned int)' f:\webkit\source\javascriptcore\runtime\UString.h(43): or 'JSC::UString::UString(const char *,unsigned int)' while trying to match the argument list '(const ushort *, int)' qt_instance.cpp: ----------------- 240: #if HAVE(QT5) 241: QString sig = QString::fromLatin1(method.methodSignature()); 242: array.add(Identifier(exec, UString(sig.utf16(), sig.length()))); 243: #else 244: array.add(Identifier(exec, method.signature())); 245: #endif Qstring.utf16() returns with const ushort * on all platform, but it works fine on Linux 32/64 bit too. Maybe the sizeof(ushort) is different on win.
Csaba Osztrogonác
Comment 2 2012-06-05 07:03:01 PDT
Created attachment 145782 [details] Patch It's only a speculative fix, I'm not sure if it is proper or not. Could you confirm if I'm on good or bad way?
Simon Hausmann
Comment 3 2012-06-05 14:17:01 PDT
Comment on attachment 145782 [details] Patch So what's happening here is that method.methodSignature() returns a QByteArray (latin1 encoded string), that is converted to a utf-16 encoded QString, which is then supposed to get converted to a UString - except that the compiler is confused. Fortunately UString supports also latin1 encoded 8-bit strings, so I think the much simpler fix is to avoid conversion from 8-bit latin1 to utf-16 and instead construct the UString straight from 8-bit, i.e. QByteArray sig = method.methodSignature(); .... UString(sig.constData(), sig.length());
Csaba Osztrogonác
Comment 4 2012-06-07 05:25:01 PDT
Created attachment 146260 [details] Patch fixed patch
Early Warning System Bot
Comment 5 2012-06-07 05:31:05 PDT
Csaba Osztrogonác
Comment 6 2012-06-07 05:33:58 PDT
Created attachment 146261 [details] Patch typo fixed
Early Warning System Bot
Comment 7 2012-06-07 05:40:09 PDT
Csaba Osztrogonác
Comment 8 2012-06-07 05:49:57 PDT
Created attachment 146264 [details] Patch typo fixed - 2nd attempt
Csaba Osztrogonác
Comment 9 2012-06-07 05:52:55 PDT
Created attachment 146265 [details] Patch typo fixed - 3rd attempt. It's not my day. :)
Early Warning System Bot
Comment 10 2012-06-07 06:06:27 PDT
Csaba Osztrogonác
Comment 11 2012-06-07 06:08:12 PDT
Comment on attachment 146265 [details] Patch It isn't my day. :( I'll try again once I'm in a better shape ...
Csaba Osztrogonác
Comment 12 2012-06-07 07:13:41 PDT
Kent updated this part of code after renaming by http://trac.webkit.org/changeset/116102 (and reviewed by Tor Arne) 96f2365cf4cebc074c3171878dcd25ce19ee7486 was "Rename QMetaMethod::signature() to methodSignature()" in Qt5/qtbase I've lost the labyrinth of QString/QByteArray/latin1/utf8/utf16 things, I can't fix it myself, I gave it up. :( Could you guys pick up this bug?
Csaba Osztrogonác
Comment 13 2012-06-07 07:18:32 PDT
Created attachment 146285 [details] Patch It is my last attempt. I can't copy/paste anything today ... :-/
Csaba Osztrogonác
Comment 14 2012-06-11 03:24:44 PDT
Comment on attachment 146285 [details] Patch Clearing flags on attachment: 146285 Committed r119969: <http://trac.webkit.org/changeset/119969>
Csaba Osztrogonác
Comment 15 2012-06-11 03:24:52 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.