/*!
Returns the bit pattern for an infinite number as a double.
*/
-static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
-static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
#ifdef QT_ARMFPA
-static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
#endif
Q_CORE_EXPORT double qInf()
{
#ifdef QT_ARMFPA
+ static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
return qt_armfpa_inf_bytes.d;
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+ return qt_be_inf_bytes.d;
#else
- return (QSysInfo::ByteOrder == QSysInfo::BigEndian
- ? qt_be_inf_bytes.d
- : qt_le_inf_bytes.d);
+ static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+ return qt_le_inf_bytes.d;
#endif
}
/*!
Returns the bit pattern of a signalling NaN as a double.
*/
-static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } };
-static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } };
-#ifdef QT_ARMFPA
-static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } };
-#endif
Q_CORE_EXPORT double qSNaN()
{
#ifdef QT_ARMFPA
+ static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } };
return qt_armfpa_snan_bytes.d;
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } };
+ return qt_be_snan_bytes.d;
#else
- return (QSysInfo::ByteOrder == QSysInfo::BigEndian
- ? qt_be_snan_bytes.d
- : qt_le_snan_bytes.d);
+ static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } };
+ return qt_le_snan_bytes.d;
#endif
}
/*!
Returns the bit pattern of a quiet NaN as a double.
*/
-static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } };
-static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } };
-#ifdef QT_ARMFPA
-static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } };
-#endif
Q_CORE_EXPORT double qQNaN()
{
#ifdef QT_ARMFPA
+ static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } };
return qt_armfpa_qnan_bytes.d;
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } };
+ return qt_be_qnan_bytes.d;
#else
- return (QSysInfo::ByteOrder == QSysInfo::BigEndian
- ? qt_be_qnan_bytes.d
- : qt_le_qnan_bytes.d);
+ static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } };
+ return qt_le_qnan_bytes.d;
#endif
}
void QDataStream::setByteOrder(ByteOrder bo)
{
byteorder = bo;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- noswap = (byteorder == BigEndian);
- else
- noswap = (byteorder == LittleEndian);
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ noswap = (byteorder == BigEndian);
+#else
+ noswap = (byteorder == LittleEndian);
+#endif
}
/*!
Q_UNUSED(source);
Q_UNUSED(target);
error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented
-#endif // Q_OS_LINUX
return false;
+#endif // Q_OS_LINUX
}
//static
#ifndef QT_BOOTSTRAPPED
case QMetaType::QUrl:
delete static_cast< NS(QUrl)* >(data);
-#endif
break;
+#endif
case QMetaType::QLocale:
delete static_cast< NS(QLocale)* >(data);
break;
case 'Y':
case 'Z':
return ucs4 + 32;
- default:
- return ucs4;
}
return ucs4;
}
case 'y':
case 'z':
return ucs4 - 32;
- default:
- return ucs4;
}
return ucs4;
}
{
Q_D(const QTimeLine);
switch (d->easingCurve.type()) {
- default:
case QEasingCurve::InOutSine:
return EaseInOutCurve;
case QEasingCurve::InCurve:
return SineCurve;
case QEasingCurve::CosineCurve:
return CosineCurve;
+ default:
+ return EaseInOutCurve;
}
- return EaseInOutCurve;
}
void QTimeLine::setCurveShape(CurveShape shape)
{
switch (shape) {
- default:
case EaseInOutCurve:
setEasingCurve(QEasingCurve(QEasingCurve::InOutSine));
break;
case CosineCurve:
setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
break;
+ default:
+ setEasingCurve(QEasingCurve(QEasingCurve::InOutSine));
+ break;
}
}
return -1;
int fa = 0;
- QChar ac;
while ((fa = text.indexOf(QLatin1Char('&'), fa)) != -1) {
++fa;
if (fa < text.length()) {
if (text.at(fa) == QLatin1Char('&')) {
++fa;
continue;
- } else {
- return fa - 1;
- break;
}
+ return fa - 1;
}
}
}
return QVariant();
}
- break;
case Qt::DisplayRole: {
QOptionTreeItem* itm;
return cups->unicodeString(itm->description);
else if (itm->type == QOptionTreeItem::Option && itm->selected > -1)
return cups->unicodeString(itm->selDescription);
- else
- return QVariant();
+ return QVariant();
}
- break;
default:
return QVariant();
}
- if (role != Qt::DisplayRole)
- return QVariant();
+ return QVariant();
}
QModelIndex QPPDOptionsModel::index(int row, int column, const QModelIndex& parent) const
bool QGraphicsSceneBspTreeIndex::event(QEvent *event)
{
Q_D(QGraphicsSceneBspTreeIndex);
- switch (event->type()) {
- case QEvent::Timer:
- if (d->indexTimerId && static_cast<QTimerEvent *>(event)->timerId() == d->indexTimerId) {
- if (d->restartIndexTimer) {
- d->restartIndexTimer = false;
- } else {
- // this call will kill the timer
- d->_q_updateIndex();
- }
+ if (event->type() == QEvent::Timer) {
+ if (d->indexTimerId && static_cast<QTimerEvent *>(event)->timerId() == d->indexTimerId) {
+ if (d->restartIndexTimer) {
+ d->restartIndexTimer = false;
+ } else {
+ // this call will kill the timer
+ d->_q_updateIndex();
}
- // Fallthrough intended - support timers in subclasses.
- default:
- return QObject::event(event);
+ }
}
- return true;
+ return QObject::event(event);
}
QT_END_NAMESPACE
int nr = in->read((char*)data, length);
if (nr <= 0) {
png_error(png_ptr, "Read Error");
- return;
+ break;
}
length -= nr;
}
uint nr = out->write((char*)data, length);
if (nr != length) {
png_error(png_ptr, "Write Error");
- return;
}
}
if (image.isNull())
return;
}
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- png_set_swap_alpha(png_ptr);
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ png_set_swap_alpha(png_ptr);
+#endif
png_read_update_info(png_ptr, info_ptr);
} else {
return;
}
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- png_set_swap_alpha(png_ptr);
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ png_set_swap_alpha(png_ptr);
+#endif
png_read_update_info(png_ptr, info_ptr);
}
// Swap ARGB to RGBA (normal PNG format) before saving on
// BigEndian machines
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- png_set_swap_alpha(png_ptr);
- }
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ png_set_swap_alpha(png_ptr);
+#endif
// Qt==ARGB==Big(ARGB)==Little(BGRA). But RGB888 is RGB regardless
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian
*image = generated;
}
+
+static void qConvert32BitOrder(void *buffer, int width)
+{
+ uint32 *target = reinterpret_cast<uint32 *>(buffer);
+ for (int32 x=0; x<width; ++x) {
+ uint32 p = target[x];
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ target[x] = (p & 0xff000000) >> 24
+ | (p & 0x00ff0000) << 8
+ | (p & 0x0000ff00) << 8
+ | (p & 0x000000ff) << 8;
+#else
+ // convert between ARGB and ABGR
+ target[x] = (p & 0xff000000)
+ | ((p & 0x00ff0000) >> 16)
+ | (p & 0x0000ff00)
+ | ((p & 0x000000ff) << 16);
+#endif
+ }
+}
+
QTiffHandler::QTiffHandler() : QImageIOHandler()
{
compression = NoCompression;
const int stopOnError = 1;
if (TIFFReadRGBAImageOriented(tiff, width, height, reinterpret_cast<uint32 *>(image->bits()), ORIENTATION_TOPLEFT, stopOnError)) {
for (uint32 y=0; y<height; ++y)
- convert32BitOrder(image->scanLine(y), width);
+ qConvert32BitOrder(image->scanLine(y), width);
} else {
TIFFClose(tiff);
return false;
int chunkStart = y;
int chunkEnd = y + chunk.height();
while (y < chunkEnd) {
- if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
- convert32BitOrder(chunk.scanLine(y - chunkStart), width);
- else
- convert32BitOrderBigEndian(chunk.scanLine(y - chunkStart), width);
+ qConvert32BitOrder(chunk.scanLine(y - chunkStart), width);
if (TIFFWriteScanline(tiff, reinterpret_cast<uint32 *>(chunk.scanLine(y - chunkStart)), y) != 1) {
TIFFClose(tiff);
|| option == ImageFormat;
}
-void QTiffHandler::convert32BitOrder(void *buffer, int width)
-{
- uint32 *target = reinterpret_cast<uint32 *>(buffer);
- for (int32 x=0; x<width; ++x) {
- uint32 p = target[x];
- // convert between ARGB and ABGR
- target[x] = (p & 0xff000000)
- | ((p & 0x00ff0000) >> 16)
- | (p & 0x0000ff00)
- | ((p & 0x000000ff) << 16);
- }
-}
-
-void QTiffHandler::convert32BitOrderBigEndian(void *buffer, int width)
-{
- uint32 *target = reinterpret_cast<uint32 *>(buffer);
- for (int32 x=0; x<width; ++x) {
- uint32 p = target[x];
- target[x] = (p & 0xff000000) >> 24
- | (p & 0x00ff0000) << 8
- | (p & 0x0000ff00) << 8
- | (p & 0x000000ff) << 8;
- }
-}
-
QT_END_NAMESPACE
LzwCompression = 1
};
private:
- void convert32BitOrder(void *buffer, int width);
- void convert32BitOrderBigEndian(void *buffer, int width);
int compression;
};
QFontEngine *fontEngine = ti.fontEngine;
#if defined(Q_WS_X11)
-
-
if (fontEngine->type() != QFontEngine::Freetype) {
QPaintEngineEx::drawTextItem(p, ti);
return;
if (!drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), fontEngine))
QPaintEngine::drawTextItem(p, ti);
-
- return;
-#endif
-
+#else
QPaintEngineEx::drawTextItem(p, ti);
+#endif
}
/*!
return (rule.hasContentsSize())
? rule.size(sz)
: rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w));
- break;
case CT_Slider:
if (rule.hasBorder() || rule.hasBox() || rule.hasGeometry())
return sr;
} else if (sc == SC_ScrollBarSubPage) {
return QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
- } else { // SC_ScrollBarAddPage
- return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
}
- break;
+ // SC_ScrollBarAddPage
+ return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
}
case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break;
case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break;
cr = horizontal ? QRect(cr.x() + sliderPos, cr.y(), len, thickness)
: QRect(cr.x(), cr.y() + sliderPos, thickness, len);
return subRule2.borderRect(cr);
- break; }
+ }
case SC_SliderTickmarks:
// TODO...
default:
case PM_DockWidgetFrameWidth:
ret = 4;
break;
- break;
-
#endif // QT_NO_MENU
case PM_SplitterWidth:
switch (metric) {
case HB_FontAscent:
return fe->ascent().value();
- break;
default:
return 0;
}
qWarning("%s: Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.",
qPrintable(m_option.messagePrefix()));
return QLatin1String("QIcon()");
- break;
}
return pixCall(type, s);
}
break;
}
return n;
- } break;
+ }
case '\r':
if ((c = filterCarriageReturn()) == 0)
return n;