Summary: | [Qt][Win] Fix UString related build problem in Source/WebCore/bridge/qt/qt_instance.cpp | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Csaba Osztrogonác <ossy> | ||||||||||||||
Component: | Tools / Tests | Assignee: | Csaba Osztrogonác <ossy> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Blocker | CC: | hausmann, kent.hansen, ossy, vestbo | ||||||||||||||
Priority: | P1 | Keywords: | Qt, QtTriaged | ||||||||||||||
Version: | 420+ | ||||||||||||||||
Hardware: | All | ||||||||||||||||
OS: | All | ||||||||||||||||
Bug Depends on: | |||||||||||||||||
Bug Blocks: | 88300 | ||||||||||||||||
Attachments: |
|
Description
Csaba Osztrogonác
2012-06-05 01:28:42 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. 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?
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());
Created attachment 146260 [details]
Patch
fixed patch
Comment on attachment 146260 [details] Patch Attachment 146260 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12913198 Created attachment 146261 [details]
Patch
typo fixed
Comment on attachment 146261 [details] Patch Attachment 146261 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12920154 Created attachment 146264 [details]
Patch
typo fixed - 2nd attempt
Created attachment 146265 [details]
Patch
typo fixed - 3rd attempt. It's not my day. :)
Comment on attachment 146265 [details] Patch Attachment 146265 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12922134 Comment on attachment 146265 [details]
Patch
It isn't my day. :( I'll try again once I'm in a better shape ...
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? Created attachment 146285 [details]
Patch
It is my last attempt. I can't copy/paste anything today ... :-/
Comment on attachment 146285 [details] Patch Clearing flags on attachment: 146285 Committed r119969: <http://trac.webkit.org/changeset/119969> All reviewed patches have been landed. Closing bug. |