Commit ed0d41db authored by loki@webkit.org's avatar loki@webkit.org

Avoid increasing required alignment of target type warning

https://bugs.webkit.org/show_bug.cgi?id=43963

Reviewed by Gavin Barraclough.

Fix alignment warnings on Qt.

WebCore: 

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertQVariantToValue):
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::getImageData):
(WebCore::putImageData):
* platform/image-decoders/ImageDecoder.h:
(WebCore::RGBA32Buffer::getAddr):
* platform/text/qt/TextCodecQt.cpp:
(WebCore::TextCodecQt::decode):

WebKit/qt: 

* Api/qwebelement.cpp:
(QWebElement::evaluateJavaScript):
* Api/qwebframe.cpp:
(QWebFrame::addToJavaScriptWindowObject):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent abc07dbb
2010-08-25 Gabor Loki <loki@webkit.org>
Reviewed by Gavin Barraclough.
Avoid increasing required alignment of target type warning
https://bugs.webkit.org/show_bug.cgi?id=43963
Fix alignment warnings on Qt.
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertQVariantToValue):
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::getImageData):
(WebCore::putImageData):
* platform/image-decoders/ImageDecoder.h:
(WebCore::RGBA32Buffer::getAddr):
* platform/text/qt/TextCodecQt.cpp:
(WebCore::TextCodecQt::decode):
2010-08-25 Kent Tamura <tkent@chromium.org>
Reviewed by Shinichiro Hamaji
......@@ -16,7 +35,7 @@
* rendering/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
2010-08-16 Gabor Loki <loki@webkit.org>
2010-08-25 Gabor Loki <loki@webkit.org>
Reviewed by Gavin Barraclough.
......@@ -905,7 +905,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
JSValue val = convertQVariantToValue(exec, root.get(), i.value());
if (val) {
PutPropertySlot slot;
ret->put(exec, Identifier(exec, (const UChar *)s.constData(), s.length()), val, slot);
ret->put(exec, Identifier(exec, reinterpret_cast_ptr<const UChar *>(s.constData()), s.length()), val, slot);
// ### error case?
}
++i;
......
......@@ -216,11 +216,11 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
const uchar* bits = image.bits();
#endif
quint32* destRows = reinterpret_cast<quint32*>(&data[desty * rect.width() + destx]);
quint32* destRows = reinterpret_cast_ptr<quint32*>(&data[desty * rect.width() + destx]);
if (multiplied == Unmultiplied) {
for (int y = 0; y < numRows; ++y) {
const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine);
const quint32* scanLine = reinterpret_cast_ptr<const quint32*>(bits + (y + originy) * bytesPerLine);
for (int x = 0; x < numColumns; x++) {
QRgb pixel = scanLine[x + originx];
int alpha = qAlpha(pixel);
......@@ -242,7 +242,7 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
}
} else {
for (int y = 0; y < numRows; ++y) {
const quint32* scanLine = reinterpret_cast<const quint32*>(bits + (y + originy) * bytesPerLine);
const quint32* scanLine = reinterpret_cast_ptr<const quint32*>(bits + (y + originy) * bytesPerLine);
for (int x = 0; x < numColumns; x++) {
QRgb pixel = scanLine[x + originx];
// Convert RGB to BGR.
......@@ -318,11 +318,11 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint&
uchar* bits = image.bits();
const int bytesPerLine = image.bytesPerLine();
const quint32* srcScanLine = reinterpret_cast<const quint32*>(source->data()->data()->data() + originy * srcBytesPerRow + originx * 4);
const quint32* srcScanLine = reinterpret_cast_ptr<const quint32*>(source->data()->data()->data() + originy * srcBytesPerRow + originx * 4);
if (multiplied == Unmultiplied) {
for (int y = 0; y < numRows; ++y) {
quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine);
quint32* destScanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
for (int x = 0; x < numColumns; x++) {
// Premultiply and convert BGR to RGB.
quint32 pixel = srcScanLine[x];
......@@ -332,7 +332,7 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint&
}
} else {
for (int y = 0; y < numRows; ++y) {
quint32* destScanLine = reinterpret_cast<quint32*>(bits + y * bytesPerLine);
quint32* destScanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
for (int x = 0; x < numColumns; x++) {
// Convert BGR to RGB.
quint32 pixel = srcScanLine[x];
......
......@@ -145,7 +145,7 @@ namespace WebCore {
#elif PLATFORM(QT)
m_image = m_pixmap.toImage();
m_pixmap = QPixmap();
return reinterpret_cast<QRgb*>(m_image.scanLine(y)) + x;
return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x;
#else
return m_bytes.data() + (y * width()) + x;
#endif
......
......@@ -110,7 +110,7 @@ String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /*
int size = end - buf;
size = qMin(size, MaxInputChunkSize);
QString decoded = m_codec->toUnicode(buf, size, &m_state);
unicode.append(reinterpret_cast<const UChar*>(decoded.unicode()), decoded.length());
unicode.append(reinterpret_cast_ptr<const UChar*>(decoded.unicode()), decoded.length());
buf += size;
}
......
......@@ -739,7 +739,7 @@ QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
return QVariant();
JSC::ScopeChain& scopeChain = state->dynamicGlobalObject()->globalScopeChain();
JSC::UString script((const UChar*)scriptSource.data(), scriptSource.length());
JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
JSC::Completion completion = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue);
if ((completion.complType() != JSC::ReturnValue) && (completion.complType() != JSC::Normal))
return QVariant();
......
......@@ -496,7 +496,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
JSC::Bindings::QtInstance::getQtInstance(object, root, ownership)->createRuntimeObject(exec);
JSC::PutPropertySlot slot;
window->put(exec, JSC::Identifier(exec, (const UChar *) name.constData(), name.length()), runtimeObject, slot);
window->put(exec, JSC::Identifier(exec, reinterpret_cast_ptr<const UChar*>(name.constData()), name.length()), runtimeObject, slot);
}
/*!
......
2010-08-25 Gabor Loki <loki@webkit.org>
Reviewed by Gavin Barraclough.
Avoid increasing required alignment of target type warning
https://bugs.webkit.org/show_bug.cgi?id=43963
Fix alignment warnings on Qt.
* Api/qwebelement.cpp:
(QWebElement::evaluateJavaScript):
* Api/qwebframe.cpp:
(QWebFrame::addToJavaScriptWindowObject):
2010-08-24 Andras Becsi <abecsi@inf.u-szeged.hu>
Reviewed by Simon Hausmann.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment