diff options
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/qaccel.cpp | 4 | ||||
-rw-r--r-- | src/kernel/qapplication.cpp | 12 | ||||
-rw-r--r-- | src/kernel/qapplication_x11.cpp | 6 | ||||
-rw-r--r-- | src/kernel/qcursor_x11.cpp | 2 | ||||
-rw-r--r-- | src/kernel/qeventloop_unix.cpp | 8 | ||||
-rw-r--r-- | src/kernel/qeventloop_unix_glib.cpp | 8 | ||||
-rw-r--r-- | src/kernel/qfont_x11.cpp | 2 | ||||
-rw-r--r-- | src/kernel/qimage.cpp | 97 | ||||
-rw-r--r-- | src/kernel/qobject.cpp | 12 | ||||
-rw-r--r-- | src/kernel/qpainter_x11.cpp | 6 | ||||
-rw-r--r-- | src/kernel/qpixmap_x11.cpp | 10 | ||||
-rw-r--r-- | src/kernel/qpngio.cpp | 57 | ||||
-rw-r--r-- | src/kernel/qpointarray.cpp | 12 | ||||
-rw-r--r-- | src/kernel/qpolygonscanner.cpp | 40 | ||||
-rw-r--r-- | src/kernel/qregion_x11.cpp | 152 | ||||
-rw-r--r-- | src/kernel/qrichtext.cpp | 2 | ||||
-rw-r--r-- | src/kernel/qthread_unix.cpp | 5 | ||||
-rw-r--r-- | src/kernel/qtkdeintegration_x11.cpp | 6 | ||||
-rw-r--r-- | src/kernel/qucomextra.cpp | 2 | ||||
-rw-r--r-- | src/kernel/qvariant.cpp | 8 | ||||
-rw-r--r-- | src/kernel/qvariant.h | 17 | ||||
-rw-r--r-- | src/kernel/qwidget.cpp | 6 | ||||
-rw-r--r-- | src/kernel/qwidget_x11.cpp | 55 | ||||
-rw-r--r-- | src/kernel/qwmatrix.cpp | 4 |
24 files changed, 276 insertions, 257 deletions
diff --git a/src/kernel/qaccel.cpp b/src/kernel/qaccel.cpp index 53814dc..fc582f7 100644 --- a/src/kernel/qaccel.cpp +++ b/src/kernel/qaccel.cpp @@ -549,7 +549,7 @@ QAccelPrivate::~QAccelPrivate() static QAccelItem *find_id( QAccelList &list, int id ) { - register QAccelItem *item = list.first(); + QAccelItem *item = list.first(); while ( item && item->id != id ) item = list.next(); return item; @@ -557,7 +557,7 @@ static QAccelItem *find_id( QAccelList &list, int id ) static QAccelItem *find_key( QAccelList &list, const QKeySequence &key ) { - register QAccelItem *item = list.first(); + QAccelItem *item = list.first(); while ( item && !( item->key == key ) ) item = list.next(); return item; diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index d87d2e5..f784c7e 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -1421,7 +1421,7 @@ QStyle& QApplication::style() if ( is_app_running && !is_app_closing && (*app_pal != app_pal_copy) ) { QEvent e( QEvent::ApplicationPaletteChange ); QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets... ++it; sendEvent( w, &e ); @@ -1467,7 +1467,7 @@ void QApplication::setStyle( QStyle *style ) if (old) { if ( is_app_running && !is_app_closing ) { QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets... ++it; if ( !w->testWFlags(WType_Desktop) && // except desktop @@ -1494,7 +1494,7 @@ void QApplication::setStyle( QStyle *style ) if (old) { if ( is_app_running && !is_app_closing ) { QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets... ++it; if ( !w->testWFlags(WType_Desktop) ) { // except desktop @@ -2080,7 +2080,7 @@ void QApplication::setPalette( const QPalette &palette, bool informWidgets, if ( !oldpal || ( *oldpal != pal ) ) { QEvent e( QEvent::ApplicationPaletteChange ); QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets... ++it; if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class @@ -2170,7 +2170,7 @@ void QApplication::setFont( const QFont &font, bool informWidgets, if ( informWidgets && is_app_running && !is_app_closing ) { QEvent e( QEvent::ApplicationFontChange ); QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets... ++it; if ( all || (!className && w->isTopLevel() ) || w->inherits(className) ) // matching class @@ -2780,7 +2780,7 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e) { if ( eventFilters ) { QObjectListIt it( *eventFilters ); - register QObject *obj; + QObject *obj; while ( (obj=it.current()) != 0 ) { // send to all filters ++it; // until one returns TRUE if ( obj->eventFilter(receiver,e) ) diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index a40ca02..cd2b439 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -2894,7 +2894,7 @@ void QApplication::setOverrideCursor( const QCursor &cursor, bool replace ) cursorStack->append( app_cursor ); QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // for all widgets that have if ( w->testWState( WState_OwnCursor ) ) qt_x11_enforce_cursor( w ); @@ -2922,7 +2922,7 @@ void QApplication::restoreOverrideCursor() app_cursor = cursorStack->last(); if ( QWidget::mapper != 0 && !closingDown() ) { QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // set back to original cursors if ( w->testWState( WState_OwnCursor ) ) qt_x11_enforce_cursor( w ); @@ -2986,7 +2986,7 @@ void QApplication::setGlobalMouseTracking( bool enable ) } if ( tellAllWidgets ) { QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) ); - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { if ( app_tracking > 0 ) { // switch on if ( !w->testWState(WState_MouseTracking) ) { diff --git a/src/kernel/qcursor_x11.cpp b/src/kernel/qcursor_x11.cpp index de246a5..465f55f 100644 --- a/src/kernel/qcursor_x11.cpp +++ b/src/kernel/qcursor_x11.cpp @@ -502,7 +502,7 @@ void QCursor::update() const { if ( !initialized ) initialize(); - register QCursorData *d = data; // cheat const! + QCursorData *d = data; // cheat const! if ( d->hcurs ) // already loaded return; diff --git a/src/kernel/qeventloop_unix.cpp b/src/kernel/qeventloop_unix.cpp index 80c8f29..1559287 100644 --- a/src/kernel/qeventloop_unix.cpp +++ b/src/kernel/qeventloop_unix.cpp @@ -211,7 +211,7 @@ static inline void getTime( timeval &t ) // get time of day static void repairTimer( const timeval &time ) // repair broken timer { timeval diff = watchtime - time; - register TimerInfo *t = timerList->first(); + TimerInfo *t = timerList->first(); while ( t ) { // repair all timers t->timeout = t->timeout - diff; t = timerList->next(); @@ -308,7 +308,7 @@ int qStartTimer( int interval, QObject *obj ) bool qKillTimer( int id ) { - register TimerInfo *t; + TimerInfo *t; if ( !timerList || id <= 0 || id > (int)timerBitVec->size() || !timerBitVec->testBit( id-1 ) ) return FALSE; // not init'd or invalid timer @@ -325,7 +325,7 @@ bool qKillTimer( int id ) bool qKillTimer( QObject *obj ) { - register TimerInfo *t; + TimerInfo *t; if ( !timerList ) // not initialized return FALSE; t = timerList->first(); @@ -530,7 +530,7 @@ int QEventLoop::activateTimers() timeval currentTime; int n_act = 0, maxCount = timerList->count(); TimerInfo *begin = 0; - register TimerInfo *t; + TimerInfo *t; for ( ;; ) { if ( ! maxCount-- ) diff --git a/src/kernel/qeventloop_unix_glib.cpp b/src/kernel/qeventloop_unix_glib.cpp index c41acce..24f5783 100644 --- a/src/kernel/qeventloop_unix_glib.cpp +++ b/src/kernel/qeventloop_unix_glib.cpp @@ -239,7 +239,7 @@ static void repairTimer( const timeval &time ) // repair broken timer qt_timerListMutex->lock(); #endif timeval diff = watchtime - time; - register TimerInfo *t = timerList->first(); + TimerInfo *t = timerList->first(); while ( t ) { // repair all timers t->timeout = t->timeout - diff; t = timerList->next(); @@ -374,7 +374,7 @@ bool qKillTimer( int id ) #if defined(QT_THREAD_SUPPORT) if (qt_timerListMutex) qt_timerListMutex->lock(); #endif - register TimerInfo *t; + TimerInfo *t; if ( (!timerList) || (id <= 0) || (id > (int)timerBitVec->size()) || (!timerBitVec->testBit( id-1 )) ) { #if defined(QT_THREAD_SUPPORT) if (qt_timerListMutex) qt_timerListMutex->unlock(); @@ -407,7 +407,7 @@ bool qKillTimer( QObject *obj ) #if defined(QT_THREAD_SUPPORT) if (qt_timerListMutex) qt_timerListMutex->lock(); #endif - register TimerInfo *t; + TimerInfo *t; if ( !timerList ) { // not initialized #if defined(QT_THREAD_SUPPORT) if (qt_timerListMutex) qt_timerListMutex->unlock(); @@ -645,7 +645,7 @@ int QEventLoop::activateTimers() timeval currentTime; int n_act = 0, maxCount = timerList->count(); TimerInfo *begin = 0; - register TimerInfo *t; + TimerInfo *t; for ( ;; ) { if ( ! maxCount-- ) { diff --git a/src/kernel/qfont_x11.cpp b/src/kernel/qfont_x11.cpp index fea0b58..c45a265 100644 --- a/src/kernel/qfont_x11.cpp +++ b/src/kernel/qfont_x11.cpp @@ -75,7 +75,7 @@ Q_EXPORT bool qt_has_xft = FALSE; Qt::HANDLE qt_xft_handle(const QFont &font) { QFontEngine *engine = font.d->engineForScript( QFontPrivate::defaultScript ); - if (!engine->type() == QFontEngine::Xft) + if (engine->type() != QFontEngine::Xft) return 0; return (long)static_cast<QFontEngineXft *>(engine)->font(); } diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp index 60a9a5d..69b5350 100644 --- a/src/kernel/qimage.cpp +++ b/src/kernel/qimage.cpp @@ -1392,7 +1392,7 @@ struct QRgbMap { static bool convert_32_to_8( const QImage *src, QImage *dst, int conversion_flags, QRgb* palette=0, int palette_count=0 ) { - register QRgb *p; + QRgb *p; uchar *b; bool do_quant = FALSE; int y, x; @@ -1702,7 +1702,7 @@ static bool convert_8_to_32( const QImage *src, QImage *dst ) return FALSE; // create failed dst->setAlphaBuffer( src->hasAlphaBuffer() ); for ( int y=0; y<dst->height(); y++ ) { // for each scan line... - register uint *p = (uint *)dst->scanLine(y); + uint *p = (uint *)dst->scanLine(y); uchar *b = src->scanLine(y); uint *end = p + dst->width(); while ( p < end ) @@ -1718,7 +1718,7 @@ static bool convert_1_to_32( const QImage *src, QImage *dst ) return FALSE; // could not create dst->setAlphaBuffer( src->hasAlphaBuffer() ); for ( int y=0; y<dst->height(); y++ ) { // for each scan line... - register uint *p = (uint *)dst->scanLine(y); + uint *p = (uint *)dst->scanLine(y); uchar *b = src->scanLine(y); int x; if ( src->bitOrder() == QImage::BigEndian ) { @@ -1756,7 +1756,7 @@ static bool convert_1_to_8( const QImage *src, QImage *dst ) dst->setColor( 1, 0xff000000 ); } for ( int y=0; y<dst->height(); y++ ) { // for each scan line... - register uchar *p = dst->scanLine(y); + uchar *p = dst->scanLine(y); uchar *b = src->scanLine(y); int x; if ( src->bitOrder() == QImage::BigEndian ) { @@ -1833,7 +1833,7 @@ static bool dither_to_1( const QImage *src, QImage *dst, int bmwidth = (w+7)/8; if ( !(line1 && line2) ) return FALSE; - register uchar *p; + uchar *p; uchar *end; int *b1, *b2; int wbytes = w * (d/8); @@ -2083,7 +2083,7 @@ static bool convert_16_to_32( const QImage *src, QImage *dst ) return FALSE; // create failed dst->setAlphaBuffer( src->hasAlphaBuffer() ); for ( int y=0; y<dst->height(); y++ ) { // for each scan line... - register uint *p = (uint *)dst->scanLine(y); + uint *p = (uint *)dst->scanLine(y); ushort *s = (ushort*)src->scanLine(y); uint *end = p + dst->width(); while ( p < end ) @@ -2099,7 +2099,7 @@ static bool convert_32_to_16( const QImage *src, QImage *dst ) return FALSE; // create failed dst->setAlphaBuffer( src->hasAlphaBuffer() ); for ( int y=0; y<dst->height(); y++ ) { // for each scan line... - register ushort *p = (ushort *)dst->scanLine(y); + ushort *p = (ushort *)dst->scanLine(y); uint *s = (uint*)src->scanLine(y); ushort *end = p + dst->width(); while ( p < end ) @@ -2363,7 +2363,7 @@ QImage QImage::convertBitOrder( Endian bitOrder ) const int bpl = (width() + 7) / 8; for ( int y = 0; y < data->h; y++ ) { - register uchar *p = jumpTable()[y]; + uchar *p = jumpTable()[y]; uchar *end = p + bpl; uchar *b = image.jumpTable()[y]; while ( p < end ) @@ -2454,14 +2454,14 @@ void pnmscale(const QImage& src, QImage& dst) { QRgb* xelrow = 0; QRgb* tempxelrow = 0; - register QRgb* xP; - register QRgb* nxP; + QRgb* xP; + QRgb* nxP; int rows, cols, rowsread, newrows, newcols; - register int row, col, needtoreadrow; + int row, col, needtoreadrow; const uchar maxval = 255; double xscale, yscale; long sxscale, syscale; - register long fracrowtofill, fracrowleft; + long fracrowtofill, fracrowleft; long* as; long* rs; long* gs; @@ -2551,11 +2551,11 @@ void pnmscale(const QImage& src, QImage& dst) xelrow = (QRgb*)src.scanLine(rowsread++); needtoreadrow = 0; } - register long a=0; + long a=0; for ( col = 0, xP = xelrow, nxP = tempxelrow; col < cols; ++col, ++xP, ++nxP ) { - register long r, g, b; + long r, g, b; if ( as ) { r = rs[col] + fracrowtofill * qRed( *xP ) * qAlpha( *xP ) / 255; @@ -2601,9 +2601,9 @@ void pnmscale(const QImage& src, QImage& dst) /* shortcut X scaling if possible */ memcpy(dst.scanLine(rowswritten++), tempxelrow, newcols*4); } else { - register long a, r, g, b; - register long fraccoltofill, fraccolleft = 0; - register int needcol; + long a, r, g, b; + long fraccoltofill, fraccolleft = 0; + int needcol; nxP = (QRgb*)dst.scanLine(rowswritten++); fraccoltofill = SCALE; @@ -3692,7 +3692,7 @@ static void swapPixel01( QImage *image ) // 1-bpp: swap 0 and 1 pixels { int i; if ( image->depth() == 1 && image->numColors() == 2 ) { - register uint *p = (uint *)image->bits(); + uint *p = (uint *)image->bits(); int nbytes = image->numBytes(); for ( i=0; i<nbytes/4; i++ ) { *p = ~*p; @@ -3942,7 +3942,7 @@ static QImageHandler *get_image_handler( const char *format ) { // get pointer to handler qt_init_image_handlers(); qt_init_image_plugins(); - register QImageHandler *p = imageHandlers->first(); + QImageHandler *p = imageHandlers->first(); while ( p ) { // traverse list if ( p->format == format ) return p; @@ -4667,6 +4667,8 @@ bool read_dib( QDataStream& s, int offset, int startpos, QImage& image ) if ( !(comp == BMP_RGB || (nbits == 4 && comp == BMP_RLE4) || (nbits == 8 && comp == BMP_RLE8) || ((nbits == 16 || nbits == 32) && comp == BMP_BITFIELDS)) ) return FALSE; // weird compression type + if ((w < 0) || ((w * abs(h)) > (16384 * 16384))) + return FALSE; int ncols; int depth; @@ -4774,7 +4776,7 @@ bool read_dib( QDataStream& s, int offset, int startpos, QImage& image ) Q_CHECK_PTR( buf ); if ( comp == BMP_RLE4 ) { // run length compression int x=0, y=0, b, c, i; - register uchar *p = line[h-1]; + uchar *p = line[h-1]; uchar *endp = line[h-1]+w; while ( y < h ) { if ( (b=d->getch()) == EOF ) @@ -4839,7 +4841,7 @@ bool read_dib( QDataStream& s, int offset, int startpos, QImage& image ) while ( --h >= 0 ) { if ( d->readBlock((char*)buf,buflen) != buflen ) break; - register uchar *p = line[h]; + uchar *p = line[h]; uchar *b = buf; for ( int i=0; i<w/2; i++ ) { // convert nibbles to bytes *p++ = *b >> 4; @@ -4855,7 +4857,7 @@ bool read_dib( QDataStream& s, int offset, int startpos, QImage& image ) else if ( nbits == 8 ) { // 8 bit BMP image if ( comp == BMP_RLE8 ) { // run length compression int x=0, y=0, b; - register uchar *p = line[h-1]; + uchar *p = line[h-1]; const uchar *endp = line[h-1]+w; while ( y < h ) { if ( (b=d->getch()) == EOF ) @@ -4918,7 +4920,7 @@ bool read_dib( QDataStream& s, int offset, int startpos, QImage& image ) } else if ( nbits == 16 || nbits == 24 || nbits == 32 ) { // 16,24,32 bit BMP image - register QRgb *p; + QRgb *p; QRgb *end; uchar *buf24 = new uchar[bpl]; int bpl24 = ((w*nbits+31)/32)*4; @@ -5049,7 +5051,7 @@ bool qt_write_dib( QDataStream& s, QImage image ) uchar *buf = new uchar[bpl_bmp]; uchar *b, *end; - register uchar *p; + uchar *p; memset( buf, 0, bpl_bmp ); for ( y=image.height()-1; y>=0; y-- ) { // write the image bits @@ -5194,7 +5196,7 @@ static void read_pbm_image( QImageIO *iio ) // read PBM image data mcc = 1; // ignore max color component else mcc = read_pbm_int( d ); // get max color component - if ( w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 ) + if ( w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff ) return; // weird P.M image int maxc = mcc; @@ -5235,7 +5237,7 @@ static void read_pbm_image( QImageIO *iio ) // read PBM image data } } } else { // read ascii data - register uchar *p; + uchar *p; int n; for ( y=0; y<h; y++ ) { p = image.scanLine( y ); @@ -5501,7 +5503,7 @@ static void read_async_image( QImageIO *iio ) X bitmap image read/write functions *****************************************************************************/ -static inline int hex2byte( register char *p ) +static inline int hex2byte( char *p ) { return ( (isdigit((uchar) *p) ? *p - '0' : toupper((uchar) *p) - 'A' + 10) << 4 ) | ( isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10 ); @@ -5510,18 +5512,32 @@ static inline int hex2byte( register char *p ) static void read_xbm_image( QImageIO *iio ) { const int buflen = 300; + const int maxlen = 4096; char buf[buflen]; QRegExp r1, r2; QIODevice *d = iio->ioDevice(); int w=-1, h=-1; QImage image; + Q_INT64 readBytes = 0; + Q_INT64 totalReadBytes = 0; r1 = QString::fromLatin1("^#define[ \t]+[a-zA-Z0-9._]+[ \t]+"); r2 = QString::fromLatin1("[0-9]+"); - d->readLine( buf, buflen ); // "#define .._width <num>" - while (!d->atEnd() && buf[0] != '#') //skip leading comment, if any - d->readLine( buf, buflen ); + buf[0] = '\0'; + while (buf[0] != '#') { //skip leading comment, if any + readBytes = d->readLine(buf, buflen); + + // if readBytes >= buflen, it's very probably not a C file + if ((readBytes <= 0) || (readBytes >= (buflen-1))) + return; + + // limit xbm headers to the first 4k in the file to prevent + // excessive reads on non-xbm files + totalReadBytes += readBytes; + if (totalReadBytes >= maxlen) + return; + } QString sbuf; sbuf = QString::fromLatin1(buf); @@ -5530,7 +5546,10 @@ static void read_xbm_image( QImageIO *iio ) r2.search(sbuf, r1.matchedLength()) == r1.matchedLength() ) w = atoi( &buf[r1.matchedLength()] ); - d->readLine( buf, buflen ); // "#define .._height <num>" + readBytes = d->readLine(buf, buflen ); // "#define .._height <num>" + if (readBytes <= 0) { + return; + } sbuf = QString::fromLatin1(buf); if ( r1.search(sbuf) == 0 && @@ -5541,8 +5560,11 @@ static void read_xbm_image( QImageIO *iio ) return; // format error for ( ;; ) { // scan for data - if ( d->readLine(buf, buflen) <= 0 ) // end of file + readBytes = d->readLine(buf, buflen); + if (readBytes <= 0) { // end of file return; + } + buf[readBytes] = '\0'; if ( strstr(buf,"0x") != 0 ) // does line contain data? break; } @@ -5560,7 +5582,10 @@ static void read_xbm_image( QImageIO *iio ) w = (w+7)/8; // byte width while ( y < h ) { // for all encoded bytes... - if ( p ) { // p = "0x.." + if (p && (p < (buf + readBytes - 3))) { // p = "0x.." + if (!isxdigit(p[2]) || !isxdigit(p[3])) { + return; + } *b++ = hex2byte(p+2); p += 2; if ( ++x == w && ++y < h ) { @@ -5569,8 +5594,10 @@ static void read_xbm_image( QImageIO *iio ) } p = strstr( p, "0x" ); } else { // read another line - if ( d->readLine(buf,buflen) <= 0 ) // EOF ==> truncated image + readBytes = d->readLine(buf, buflen); + if (readBytes <= 0) // EOF ==> truncated image break; + buf[readBytes] = '\0'; p = strstr( buf, "0x" ); } } @@ -5619,7 +5646,7 @@ static void write_xbm_image( QImageIO *iio ) } } int bcnt = 0; - register char *p = buf; + char *p = buf; int bpl = (w+7)/8; for (int y = 0; y < h; ++y) { uchar *b = image.scanLine(y); diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index b48531e..6bd6224 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -736,7 +736,7 @@ QObject::~QObject() } if ( parentObj ) // remove it from parent object parentObj->removeChild( this ); - register QObject *obj; + QObject *obj; if ( senderObjects ) { // disconnect from senders QSenderObjectList *tmp = senderObjects; senderObjects = 0; @@ -753,7 +753,7 @@ QObject::~QObject() QConnectionList* clist = (*connections)[i]; // for each signal... if ( !clist ) continue; - register QConnection *c; + QConnection *c; QConnectionListIt cit(*clist); while( (c=cit.current()) ) { // for each connected slot... ++cit; @@ -879,7 +879,7 @@ void *qt_inheritedBy( QMetaObject *superClass, const QObject *object ) { if (!object) return 0; - register QMetaObject *mo = object->metaObject(); + QMetaObject *mo = object->metaObject(); while (mo) { if (mo == superClass) return (void*)object; @@ -1266,7 +1266,7 @@ bool QObject::activate_filters( QEvent *e ) if ( !eventFilters ) // no event filter return FALSE; QObjectListIt it( *eventFilters ); - register QObject *obj = it.current(); + QObject *obj = it.current(); while ( obj ) { // send to all filters ++it; // until one returns TRUE if ( obj->eventFilter(this,e) ) { @@ -2466,7 +2466,7 @@ bool QObject::disconnectInternal( const QObject *sender, int signal_index, bool success = FALSE; QConnectionList *clist; - register QConnection *c; + QConnection *c; if ( signal_index == -1 ) { for ( int i = 0; i < (int) s->connections->size(); i++ ) { clist = (*s->connections)[i]; // for all signals... @@ -3060,7 +3060,7 @@ void QObject::dumpObjectInfo() if ( ( clist = connections->at( i ) ) ) { qDebug( "\t%s", metaObject()->signal( i, TRUE )->name ); n++; - register QConnection *c; + QConnection *c; QConnectionListIt cit(*clist); while ( (c=cit.current()) ) { ++cit; diff --git a/src/kernel/qpainter_x11.cpp b/src/kernel/qpainter_x11.cpp index b939848..4c33e2d 100644 --- a/src/kernel/qpainter_x11.cpp +++ b/src/kernel/qpainter_x11.cpp @@ -303,7 +303,7 @@ static void init_gc_array() static void cleanup_gc_array( Display *dpy ) { - register QGC *p = gc_array; + QGC *p = gc_array; int i = gc_array_size; if ( gc_array_init ) { while ( i-- ) { @@ -328,7 +328,7 @@ static GC alloc_gc( Display *dpy, int scrn, Drawable hd, bool monochrome=FALSE, XSetGraphicsExposures( dpy, gc, False ); return gc; } - register QGC *p = gc_array; + QGC *p = gc_array; int i = gc_array_size; if ( !gc_array_init ) // not initialized init_gc_array(); @@ -364,7 +364,7 @@ static void free_gc( Display *dpy, GC gc, bool privateGC = FALSE ) XFreeGC( dpy, gc ); return; } - register QGC *p = gc_array; + QGC *p = gc_array; int i = gc_array_size; if ( gc_array_init ) { while ( i-- ) { diff --git a/src/kernel/qpixmap_x11.cpp b/src/kernel/qpixmap_x11.cpp index 28d2926..f471af8 100644 --- a/src/kernel/qpixmap_x11.cpp +++ b/src/kernel/qpixmap_x11.cpp @@ -290,7 +290,7 @@ extern const uchar *qt_get_bitflip_array(); // defined in qimage.cpp static uchar *flip_bits( const uchar *bits, int len ) { - register const uchar *p = bits; + const uchar *p = bits; const uchar *end = p + len; uchar *newdata = new uchar[len]; uchar *b = newdata; @@ -958,7 +958,7 @@ QImage QPixmap::convertToImage() const image.setColor( 0, qRgb(255,255,255) ); image.setColor( 1, qRgb(0,0,0) ); } else if ( !trucol ) { // pixmap with colormap - register uchar *p; + uchar *p; uchar *end; uchar use[256]; // pixel-in-use table uchar pix[256]; // pixel translation table @@ -1243,8 +1243,8 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags ) bool trucol = (visual->c_class == TrueColor || visual->c_class == DirectColor); int nbytes = image.numBytes(); uchar *newbits= 0; - int newbits_size = 0; #ifdef QT_MITSHM_CONVERSIONS + int newbits_size = 0; bool mitshm_ximage = false; XShmSegmentInfo shminfo; #endif @@ -1615,7 +1615,9 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags ) } newbits = (uchar *)malloc( nbytes ); // copy image into newbits +#ifdef QT_MITSHM_CONVERSIONS newbits_size = nbytes; +#endif Q_CHECK_PTR( newbits ); if ( !newbits ) // no memory return FALSE; @@ -1744,7 +1746,9 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags ) ushort *p2; int p2inc = xi->bytes_per_line/sizeof(ushort); ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h ); +#ifdef QT_MITSHM_CONVERSIONS newbits_size = xi->bytes_per_line * h; +#endif Q_CHECK_PTR( newerbits ); if ( !newerbits ) // no memory return FALSE; diff --git a/src/kernel/qpngio.cpp b/src/kernel/qpngio.cpp index 58e6e7e..814ceec 100644 --- a/src/kernel/qpngio.cpp +++ b/src/kernel/qpngio.cpp @@ -46,7 +46,7 @@ #include "qiodevice.h" #include <png.h> -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 #include <zlib.h> #endif /* LIBPNG 1.5 */ @@ -129,7 +129,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 png_colorp info_ptr_palette = NULL; int info_ptr_num_palette = 0; if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { @@ -147,7 +147,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr if ( color_type == PNG_COLOR_TYPE_GRAY ) { // Black & White or 8-bit grayscale -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if ( bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1 ) { #else /* LIBPNG 1.5 */ if ( bit_depth == 1 && info_ptr->channels == 1 ) { @@ -185,9 +185,9 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr image.setColor( i, qRgba(c,c,c,0xff) ); } if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 const int g = info_ptr_trans_color->gray; -#elif ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) +#elif PNG_LIBPNG_VER>=10400 const int g = info_ptr->trans_color.gray; #else const int g = info_ptr->trans_values.gray; @@ -200,7 +200,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr } } else if ( color_type == PNG_COLOR_TYPE_PALETTE && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 && info_ptr_num_palette <= 256 ) #else /* LIBPNG 1.5 */ && info_ptr->num_palette <= 256 ) @@ -212,7 +212,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr png_read_update_info( png_ptr, info_ptr ); png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if (!image.create(width, height, bit_depth, info_ptr_num_palette, #else /* LIBPNG 1.5 */ if (!image.create(width, height, bit_depth, info_ptr->num_palette, @@ -223,7 +223,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { image.setAlphaBuffer( TRUE ); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 while ( i < info_ptr_num_trans ) { image.setColor(i, qRgba( info_ptr_palette[i].red, @@ -236,9 +236,9 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr info_ptr->palette[i].green, info_ptr->palette[i].blue, #endif /* LIBPNG 1.5 */ -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 info_ptr_trans_alpha[i] -#elif ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) +#elif PNG_LIBPNG_VER>=10400 info_ptr->trans_alpha[i] #else info_ptr->trans[i] @@ -248,7 +248,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float scr i++; } } -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 while ( i < info_ptr_num_palette ) { image.setColor(i, qRgba( info_ptr_palette[i].red, @@ -347,7 +347,7 @@ void read_png_image(QImageIO* iio) return; } -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if (setjmp(png_jmpbuf(png_ptr))) { #else /* LIBPNG 1.5 */ if (setjmp(png_ptr->jmpbuf)) { @@ -388,7 +388,7 @@ void read_png_image(QImageIO* iio) png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) if (image.depth()==32 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { QRgb trans = 0xFF000000 | qRgb( -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) +#if PNG_LIBPNG_VER>=10400 (info_ptr->trans_color.red << 8 >> bit_depth)&0xff, (info_ptr->trans_color.green << 8 >> bit_depth)&0xff, (info_ptr->trans_color.blue << 8 >> bit_depth)&0xff); @@ -542,7 +542,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, int quality_in, int off_x_ return FALSE; } -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if (setjmp(png_jmpbuf(png_ptr))) { #else /* LIBPNG 1.5 */ if (setjmp(png_ptr->jmpbuf)) { @@ -568,19 +568,6 @@ bool QPNGImageWriter::writeImage(const QImage& image, int quality_in, int off_x_ png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) -#warning XXXtnn not too sure about this -/* -according to png.h, channels is only used on read, not writes, so we -should be able to comment this out. -*/ -#else /* LIBPNG 1.5 */ - info_ptr->channels = - (image.depth() == 32) - ? (image.hasAlphaBuffer() ? 4 : 3) - : 1; -#endif /* LIBPNG 1.5 */ - png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), image.depth() == 1 ? 1 : 8 /* per channel */, image.depth() == 32 @@ -589,7 +576,7 @@ should be able to comment this out. : PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 png_color_8 sig_bit; sig_bit.red = 8; sig_bit.green = 8; @@ -614,14 +601,14 @@ should be able to comment this out. png_set_PLTE(png_ptr, info_ptr, palette, num_palette); int* trans = new int[num_palette]; int num_trans = 0; -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 png_colorp info_ptr_palette = NULL; int tmp; png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &tmp); #endif /* LIBPNG 1.5 */ for (int i=0; i<num_palette; i++) { QRgb rgb=image.color(i); -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 info_ptr_palette[i].red = qRed(rgb); info_ptr_palette[i].green = qGreen(rgb); info_ptr_palette[i].blue = qBlue(rgb); @@ -637,7 +624,7 @@ should be able to comment this out. } } } -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 png_set_PLTE(png_ptr, info_ptr, info_ptr_palette, num_palette); #endif /* LIBPNG 1.5 */ if (num_trans) { @@ -650,7 +637,7 @@ should be able to comment this out. } if ( image.hasAlphaBuffer() ) { -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 png_color_8p sig_bit; png_get_sBIT(png_ptr, info_ptr, &sig_bit); sig_bit->alpha = 8; @@ -1143,7 +1130,7 @@ int QPNGFormat::decode(QImage& img, QImageConsumer* cons, return -1; } -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if (setjmp(png_jmpbuf(png_ptr))) { #else /* LIBPNG 1.5 */ if (setjmp((png_ptr)->jmpbuf)) { @@ -1174,7 +1161,7 @@ int QPNGFormat::decode(QImage& img, QImageConsumer* cons, if ( !png_ptr ) return 0; -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 if (setjmp(png_jmpbuf(png_ptr))) { #else /* LIBPNG 1.5 */ if (setjmp(png_ptr->jmpbuf)) { @@ -1238,7 +1225,7 @@ void QPNGFormat::end(png_structp png, png_infop info) consumer->frameDone(QPoint(offx,offy),r); consumer->end(); state = FrameStart; -#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=5 ) +#if PNG_LIBPNG_VER>=10500 unused_data = png_process_data_pause(png, 0); #else /* LIBPNG 1.5 */ unused_data = (int)png->buffer_size; // Since libpng doesn't tell us diff --git a/src/kernel/qpointarray.cpp b/src/kernel/qpointarray.cpp index d1c7569..b7f5b2c 100644 --- a/src/kernel/qpointarray.cpp +++ b/src/kernel/qpointarray.cpp @@ -190,8 +190,8 @@ QPointArray::QPointArray( int nPoints, const QCOORD *points ) void QPointArray::translate( int dx, int dy ) { - register QPoint *p = data(); - register int i = size(); + QPoint *p = data(); + int i = size(); QPoint pt( dx, dy ); while ( i-- ) { *p += pt; @@ -440,7 +440,7 @@ QRect QPointArray::boundingRect() const { if ( isEmpty() ) return QRect( 0, 0, 0, 0 ); // null rectangle - register QPoint *pd = data(); + QPoint *pd = data(); int minx, maxx, miny, maxy; minx = maxx = pd->x(); miny = maxy = pd->y(); @@ -937,7 +937,7 @@ QPointArray QPointArray::cubicBezier() const if ( m < 2 ) // at least two points m = 2; QPointArray p( m ); // p = Bezier point array - register QPointData *pd = p.data(); + QPointData *pd = p.data(); float x0 = xvec[0], y0 = yvec[0]; float dt = 1.0F/m; @@ -1018,7 +1018,7 @@ QPointArray QPointArray::cubicBezier() const QDataStream &operator<<( QDataStream &s, const QPointArray &a ) { - register uint i; + uint i; uint len = a.size(); s << len; // write size of array for ( i=0; i<len; i++ ) // write each point @@ -1037,7 +1037,7 @@ QDataStream &operator<<( QDataStream &s, const QPointArray &a ) QDataStream &operator>>( QDataStream &s, QPointArray &a ) { - register uint i; + uint i; uint len; s >> len; // read size of array if ( !a.resize( len ) ) // no memory diff --git a/src/kernel/qpolygonscanner.cpp b/src/kernel/qpolygonscanner.cpp index 86f9ca0..31766dd 100644 --- a/src/kernel/qpolygonscanner.cpp +++ b/src/kernel/qpolygonscanner.cpp @@ -407,8 +407,8 @@ static bool miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock) { - register EdgeTableEntry *start, *prev; - register ScanLineList *pSLL, *pPrevSLL; + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* @@ -505,7 +505,7 @@ typedef struct { static void miFreeStorage(ScanLineListBlock *pSLLBlock) { - register ScanLineListBlock *tmpSLLBlock; + ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { @@ -519,8 +519,8 @@ static bool miCreateETandAET(int count, DDXPointPtr pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { - register DDXPointPtr top, bottom; - register DDXPointPtr PrevPt, CurrPt; + DDXPointPtr top, bottom; + DDXPointPtr PrevPt, CurrPt; int iSLLBlock = 0; int dy; @@ -609,8 +609,8 @@ miCreateETandAET(int count, DDXPointPtr pts, EdgeTable *ET, static void miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { - register EdgeTableEntry *pPrevAET; - register EdgeTableEntry *tmp; + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; @@ -656,9 +656,9 @@ miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) static void micomputeWAET(EdgeTableEntry *AET) { - register EdgeTableEntry *pWETE; - register int inside = 1; - register int isInside = 0; + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; AET->nextWETE = 0; pWETE = AET; @@ -694,10 +694,10 @@ micomputeWAET(EdgeTableEntry *AET) static int miInsertionSort(EdgeTableEntry *AET) { - register EdgeTableEntry *pETEchase; - register EdgeTableEntry *pETEinsert; - register EdgeTableEntry *pETEchaseBackTMP; - register int changed = 0; + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; AET = AET->next; while (AET) @@ -769,12 +769,12 @@ void QPolygonScanner::scan( const QPointArray& pa, bool winding, int index, int DDXPointPtr ptsIn = (DDXPointPtr)pa.data(); ptsIn += index; - register EdgeTableEntry *pAET; /* the Active Edge Table */ - register int y; /* the current scanline */ - register int nPts = 0; /* number of pts in buffer */ - register EdgeTableEntry *pWETE; /* Winding Edge Table */ - register ScanLineList *pSLL; /* Current ScanLineList */ - register DDXPointPtr ptsOut; /* ptr to output buffers */ + EdgeTableEntry *pAET; /* the Active Edge Table */ + int y; /* the current scanline */ + int nPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table */ + ScanLineList *pSLL; /* Current ScanLineList */ + DDXPointPtr ptsOut; /* ptr to output buffers */ int *width; DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ int FirstWidth[NUMPTSTOBUFFER]; diff --git a/src/kernel/qregion_x11.cpp b/src/kernel/qregion_x11.cpp index 7b04a15..29e54de 100644 --- a/src/kernel/qregion_x11.cpp +++ b/src/kernel/qregion_x11.cpp @@ -89,8 +89,8 @@ struct QRegionPrivate { static void UnionRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, QRegionPrivate *newReg); -static void IntersectRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, register QRegionPrivate *newReg); -static void miRegionOp(register QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate *reg2, +static void IntersectRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, QRegionPrivate *newReg); +static void miRegionOp(QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate *reg2, void (*overlapFunc)(...), void (*nonOverlap1Func)(...), void (*nonOverlap2Func)(...)); @@ -300,7 +300,7 @@ typedef void (*voidProcp)(...); static -void UnionRectWithRegion(register const QRect *rect, QRegionPrivate *source, QRegionPrivate *dest) +void UnionRectWithRegion(const QRect *rect, QRegionPrivate *source, QRegionPrivate *dest) { QRegionPrivate region; @@ -333,7 +333,7 @@ void UnionRectWithRegion(register const QRect *rect, QRegionPrivate *source, QRe static void miSetExtents (QRegionPrivate *pReg) { - register QRect *pBox, + QRect *pBox, *pBoxEnd, *pExtents; @@ -383,10 +383,10 @@ miSetExtents (QRegionPrivate *pReg) static int -OffsetRegion(register QRegionPrivate *pRegion, register int x, register int y) +OffsetRegion(QRegionPrivate *pRegion, int x, int y) { - register int nbox; - register QRect *pbox; + int nbox; + QRect *pbox; pbox = pRegion->rects.data(); nbox = pRegion->numRects; @@ -419,12 +419,12 @@ OffsetRegion(register QRegionPrivate *pRegion, register int x, register int y) /* static void*/ static int -miIntersectO (register QRegionPrivate *pReg, register QRect *r1, QRect *r1End, - register QRect *r2, QRect *r2End, int y1, int y2) +miIntersectO (QRegionPrivate *pReg, QRect *r1, QRect *r1End, + QRect *r2, QRect *r2End, int y1, int y2) { - register int x1; - register int x2; - register QRect *pNextRect; + int x1; + int x2; + QRect *pNextRect; pNextRect = pReg->rects.data() + pReg->numRects; @@ -474,7 +474,7 @@ miIntersectO (register QRegionPrivate *pReg, register QRect *r1, QRect *r1End, static void -IntersectRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, register QRegionPrivate *newReg) +IntersectRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, QRegionPrivate *newReg) { /* check for trivial reject */ if ( (!(reg1->numRects)) || (!(reg2->numRects)) || @@ -519,14 +519,14 @@ IntersectRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, register QRegionPriv /* static int*/ static int -miCoalesce (register QRegionPrivate *pReg, int prevStart, int curStart) +miCoalesce (QRegionPrivate *pReg, int prevStart, int curStart) //Region pReg; /* Region to coalesce */ //prevStart; /* Index of start of previous band */ //curStart; /* Index of start of current band */ { - register QRect *pPrevBox; /* Current box in previous band */ - register QRect *pCurBox; /* Current box in current band */ - register QRect *pRegEnd; /* End of region */ + QRect *pPrevBox; /* Current box in previous band */ + QRect *pCurBox; /* Current box in current band */ + QRect *pRegEnd; /* End of region */ int curNumRects; /* Number of rectangles in current * band */ int prevNumRects; /* Number of rectangles in previous @@ -670,11 +670,11 @@ miCoalesce (register QRegionPrivate *pReg, int prevStart, int curStart) */ /* static void*/ static void -miRegionOp(register QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate *reg2, +miRegionOp(QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate *reg2, void (*overlapFunc)(...), void (*nonOverlap1Func)(...), void (*nonOverlap2Func)(...)) - //register Region newReg; /* Place to store result */ + //Region newReg; /* Place to store result */ //Region reg1; /* First region in operation */ //Region reg2; /* 2d region in operation */ //void (*overlapFunc)(); /* Function to call for over- @@ -686,18 +686,18 @@ miRegionOp(register QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate //* overlapping bands in region //* 2 */ { - register QRect *r1; /* Pointer into first region */ - register QRect *r2; /* Pointer into 2d region */ + QRect *r1; /* Pointer into first region */ + QRect *r2; /* Pointer into 2d region */ QRect *r1End; /* End of 1st region */ QRect *r2End; /* End of 2d region */ - register int ybot; /* Bottom of intersection */ - register int ytop; /* Top of intersection */ + int ybot; /* Bottom of intersection */ + int ytop; /* Top of intersection */ int prevBand; /* Index of start of * previous band in newReg */ int curBand; /* Index of start of current * band in newReg */ - register QRect *r1BandEnd; /* End of current band in r1 */ - register QRect *r2BandEnd; /* End of current band in r2 */ + QRect *r1BandEnd; /* End of current band in r1 */ + QRect *r2BandEnd; /* End of current band in r2 */ int top; /* Top of non-overlapping * band */ int bot; /* Bottom of non-overlapping @@ -951,10 +951,10 @@ miRegionOp(register QRegionPrivate *newReg, QRegionPrivate *reg1, QRegionPrivate /* static void*/ static int -miUnionNonO (register QRegionPrivate *pReg, register QRect * r, - QRect * rEnd, register int y1, register int y2) +miUnionNonO (QRegionPrivate *pReg, QRect * r, + QRect * rEnd, int y1, int y2) { - register QRect * pNextRect; + QRect * pNextRect; pNextRect = pReg->rects.data() + pReg->numRects; @@ -993,10 +993,10 @@ miUnionNonO (register QRegionPrivate *pReg, register QRect * r, /* static void*/ static int -miUnionO (register QRegionPrivate *pReg, register QRect *r1, QRect *r1End, - register QRect *r2, QRect *r2End, register int y1, register int y2) +miUnionO (QRegionPrivate *pReg, QRect *r1, QRect *r1End, + QRect *r2, QRect *r2End, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = pReg->rects.data() + pReg->numRects; @@ -1121,10 +1121,10 @@ static void UnionRegion(QRegionPrivate *reg1, QRegionPrivate *reg2, QRegionPriva /* static void*/ static int -miSubtractNonO1 (register QRegionPrivate *pReg, register QRect *r, - QRect *rEnd, register int y1, register int y2) +miSubtractNonO1 (QRegionPrivate *pReg, QRect *r, + QRect *rEnd, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = pReg->rects.data() + pReg->numRects; @@ -1160,11 +1160,11 @@ miSubtractNonO1 (register QRegionPrivate *pReg, register QRect *r, /* static void*/ static int -miSubtractO (register QRegionPrivate *pReg, register QRect *r1, QRect *r1End, - register QRect *r2, QRect *r2End, register int y1, register int y2) +miSubtractO (QRegionPrivate *pReg, QRect *r1, QRect *r1End, + QRect *r2, QRect *r2End, int y1, int y2) { - register QRect *pNextRect; - register int x1; + QRect *pNextRect; + int x1; x1 = r1->left(); @@ -1285,7 +1285,7 @@ miSubtractO (register QRegionPrivate *pReg, register QRect *r1, QRect *r1End, *----------------------------------------------------------------------- */ -static void SubtractRegion(QRegionPrivate *regM, QRegionPrivate *regS, register QRegionPrivate *regD) +static void SubtractRegion(QRegionPrivate *regM, QRegionPrivate *regS, QRegionPrivate *regD) { /* check for trivial reject */ if ( (!(regM->numRects)) || (!(regS->numRects)) || @@ -1361,13 +1361,13 @@ static bool PointInRegion( QRegionPrivate *pRegion, int x, int y ) return FALSE; } -static bool RectInRegion(register QRegionPrivate *region, +static bool RectInRegion(QRegionPrivate *region, int rx, int ry, unsigned int rwidth, unsigned int rheight) { - register QRect *pbox; - register QRect *pboxEnd; + QRect *pbox; + QRect *pboxEnd; QRect rect(rx, ry, rwidth, rheight); - register QRect *prect = ▭ + QRect *prect = ▭ int partIn, partOut; /* this is (just) a useful optimization */ @@ -1800,8 +1800,8 @@ static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock) { - register EdgeTableEntry *start, *prev; - register ScanLineList *pSLL, *pPrevSLL; + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* @@ -1881,12 +1881,12 @@ InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, */ static void -CreateETandAET(register int count, register QPoint *pts, - EdgeTable *ET, EdgeTableEntry *AET, register EdgeTableEntry *pETEs, +CreateETandAET(int count, QPoint *pts, + EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { - register QPoint *top, *bottom; - register QPoint *PrevPt, *CurrPt; + QPoint *top, *bottom; + QPoint *PrevPt, *CurrPt; int iSLLBlock = 0; int dy; @@ -1969,10 +1969,10 @@ CreateETandAET(register int count, register QPoint *pts, */ static void -loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) +loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { - register EdgeTableEntry *pPrevAET; - register EdgeTableEntry *tmp; + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; @@ -2016,11 +2016,11 @@ loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) * */ static void -computeWAET(register EdgeTableEntry *AET) +computeWAET(EdgeTableEntry *AET) { - register EdgeTableEntry *pWETE; - register int inside = 1; - register int isInside = 0; + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; AET->nextWETE = (EdgeTableEntry *)NULL; pWETE = AET; @@ -2054,12 +2054,12 @@ computeWAET(register EdgeTableEntry *AET) */ static int -InsertionSort(register EdgeTableEntry *AET) +InsertionSort(EdgeTableEntry *AET) { - register EdgeTableEntry *pETEchase; - register EdgeTableEntry *pETEinsert; - register EdgeTableEntry *pETEchaseBackTMP; - register int changed = 0; + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; AET = AET->next; while (AET) @@ -2090,9 +2090,9 @@ InsertionSort(register EdgeTableEntry *AET) * Clean up our act. */ static void -FreeStorage(register ScanLineListBlock *pSLLBlock) +FreeStorage(ScanLineListBlock *pSLLBlock) { - register ScanLineListBlock *tmpSLLBlock; + ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { @@ -2110,15 +2110,15 @@ FreeStorage(register ScanLineListBlock *pSLLBlock) * stack by the calling procedure. * */ -static int PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock, +static int PtsToRegion(int numFullPtBlocks, int iCurPtBlock, POINTBLOCK *FirstPtBlock, QRegionPrivate *reg) { - register QRect *rects; - register QPoint *pts; - register POINTBLOCK *CurPtBlock; - register int i; - register QRect *extents; - register int numRects; + QRect *rects; + QPoint *pts; + POINTBLOCK *CurPtBlock; + int i; + QRect *extents; + int numRects; extents = ®->extents; @@ -2182,12 +2182,12 @@ static QRegionPrivate *PolygonRegion(QPoint *Pts, int Count, int rule) //int rule; /* winding rule */ { QRegionPrivate *region; - register EdgeTableEntry *pAET; /* Active Edge Table */ - register int y; /* current scanline */ - register int iPts = 0; /* number of pts in buffer */ - register EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ - register ScanLineList *pSLL; /* current scanLineList */ - register QPoint *pts; /* output buffer */ + EdgeTableEntry *pAET; /* Active Edge Table */ + int y; /* current scanline */ + int iPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ + ScanLineList *pSLL; /* current scanLineList */ + QPoint *pts; /* output buffer */ EdgeTableEntry *pPrevAET; /* ptr to previous AET */ EdgeTable ET; /* header node for ET */ EdgeTableEntry AET; /* header node for AET */ diff --git a/src/kernel/qrichtext.cpp b/src/kernel/qrichtext.cpp index 71095a3..661f149 100644 --- a/src/kernel/qrichtext.cpp +++ b/src/kernel/qrichtext.cpp @@ -4093,7 +4093,7 @@ QTextParagraph::~QTextParagraph() { delete str; if ( hasdoc ) { - register QTextDocument *doc = document(); + QTextDocument *doc = document(); if ( this == doc->minwParag ) { doc->minwParag = 0; doc->minw = 0; diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp index 1358250..6b43b0b 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -331,7 +331,10 @@ void QThread::start(Priority priority) pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); -#if !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0) +#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0) +#if _POSIX_THREAD_PRIORITY_SCHEDULING == 0 && defined _SC_THREAD_PRIORITY_SCHEDULING + if (sysconf(_SC_THREAD_PRIORITY_SCHEDULING) > 0) +#endif switch (priority) { case InheritPriority: { diff --git a/src/kernel/qtkdeintegration_x11.cpp b/src/kernel/qtkdeintegration_x11.cpp index 5fcd00f..9aabb4f 100644 --- a/src/kernel/qtkdeintegration_x11.cpp +++ b/src/kernel/qtkdeintegration_x11.cpp @@ -26,11 +26,7 @@ static QCString findLibrary() if( getenv( "QT_NO_KDE_INTEGRATION" ) == NULL || getenv( "QT_NO_KDE_INTEGRATION" )[ 0 ] == '0' ) { -#ifdef USE_LIB64_PATHES - return "/opt/kde3/lib64/kde3/plugins/integration/libqtkde"; -#else - return "/opt/kde3/lib/kde3/plugins/integration/libqtkde"; -#endif + return QCString() + qInstallPathPlugins() + "/integration/libqtkde"; } return ""; } diff --git a/src/kernel/qucomextra.cpp b/src/kernel/qucomextra.cpp index 427c29a..0ea698a 100644 --- a/src/kernel/qucomextra.cpp +++ b/src/kernel/qucomextra.cpp @@ -85,7 +85,7 @@ bool QUType_QVariant::convertFrom( QUObject *o, QUType *t ) else if ( isEqual( o->type, &static_QUType_int ) ) var = new QVariant( static_QUType_int.get( o ) ); else if ( isEqual( o->type, &static_QUType_bool ) ) - var = new QVariant( static_QUType_bool.get( o ), 42 ); + var = new QVariant( static_QUType_bool.get( o ) ); else if ( isEqual( o->type, &static_QUType_double ) ) var = new QVariant( static_QUType_double.get( o ) ); else if ( isEqual( o->type, &static_QUType_charstar ) ) diff --git a/src/kernel/qvariant.cpp b/src/kernel/qvariant.cpp index c9ea5b1..99659df 100644 --- a/src/kernel/qvariant.cpp +++ b/src/kernel/qvariant.cpp @@ -877,12 +877,10 @@ QVariant::QVariant( Q_ULLONG val ) } /*! - Constructs a new variant with a boolean value, \a val. The integer - argument is a dummy, necessary for compatibility with some - compilers. + Constructs a new variant with a boolean value, \a val. */ -QVariant::QVariant( bool val, int ) -{ // this is the comment that does NOT name said compiler. +QVariant::QVariant( bool val ) +{ d = new Private; d->typ = Bool; d->value.b = val; diff --git a/src/kernel/qvariant.h b/src/kernel/qvariant.h index b2cab8d..3c60295 100644 --- a/src/kernel/qvariant.h +++ b/src/kernel/qvariant.h @@ -42,7 +42,10 @@ #define QVARIANT_H #ifndef QT_H +#include "qmap.h" #include "qstring.h" +#include "qstringlist.h" +#include "qvaluelist.h" #endif // QT_H #ifndef QT_NO_VARIANT @@ -80,6 +83,10 @@ template <class T> class QValueListConstIterator; template <class T> class QValueListNode; template <class Key, class T> class QMap; template <class Key, class T> class QMapConstIterator; + +typedef QMap<QString, QVariant> QStringVariantMap; +typedef QMapIterator<QString, QVariant> QStringVariantMapIterator; +typedef QMapConstIterator<QString, QVariant> QStringVariantMapConstIterator; #endif class Q_EXPORT QVariant @@ -167,8 +174,7 @@ public: QVariant( uint ); QVariant( Q_LLONG ); QVariant( Q_ULLONG ); - // ### Problems on some compilers ? - QVariant( bool, int ); + QVariant( bool ); QVariant( double ); QVariant( QSizePolicy ); @@ -317,13 +323,6 @@ public: void* rawAccess( void* ptr = 0, Type typ = Invalid, bool deepCopy = FALSE ); }; -// down here for GCC 2.7.* compatibility -#ifndef QT_H -#include "qvaluelist.h" -#include "qstringlist.h" -#include "qmap.h" -#endif // QT_H - inline QVariant::Type QVariant::type() const { return d->typ; diff --git a/src/kernel/qwidget.cpp b/src/kernel/qwidget.cpp index 461c7f3..e7d27a9 100644 --- a/src/kernel/qwidget.cpp +++ b/src/kernel/qwidget.cpp @@ -1044,7 +1044,7 @@ void QWidget::destroyMapper() QWidgetIntDictIt it( *((QWidgetIntDict*)mapper) ); QWidgetMapper * myMapper = mapper; mapper = 0; - register QWidget *w; + QWidget *w; while ( (w=it.current()) ) { // remove parents widgets ++it; if ( !w->parentObj ) // widget is a parent @@ -4172,7 +4172,7 @@ void QWidget::showChildren( bool spontaneous ) { if ( children() ) { QObjectListIt it(*children()); - register QObject *object; + QObject *object; QWidget *widget; while ( it ) { object = it.current(); @@ -4197,7 +4197,7 @@ void QWidget::hideChildren( bool spontaneous ) { if ( children() ) { QObjectListIt it(*children()); - register QObject *object; + QObject *object; QWidget *widget; while ( it ) { object = it.current(); diff --git a/src/kernel/qwidget_x11.cpp b/src/kernel/qwidget_x11.cpp index ddad9cd..54c37e6 100644 --- a/src/kernel/qwidget_x11.cpp +++ b/src/kernel/qwidget_x11.cpp @@ -794,7 +794,7 @@ void QWidget::destroy( bool destroyWindow, bool destroySubWindows ) clearWState( WState_Created ); if ( children() ) { QObjectListIt it(*children()); - register QObject *obj; + QObject *obj; while ( (obj=it.current()) ) { // destroy all widget children ++it; if ( obj->isWidgetType() ) @@ -1487,28 +1487,31 @@ void QWidget::grabMouse() void QWidget::grabMouse( const QCursor &cursor ) { if ( !qt_nograb() ) { - if ( mouseGrb ) - mouseGrb->releaseMouse(); + if ( mouseGrb != this ) { + if ( mouseGrb ) { + mouseGrb->releaseMouse(); + } #if defined(QT_CHECK_STATE) - int status = + int status = #endif - XGrabPointer( x11Display(), winId(), False, - (uint)(ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | EnterWindowMask | LeaveWindowMask), - GrabModeAsync, GrabModeAsync, - None, cursor.handle(), qt_x_time ); + XGrabPointer( x11Display(), winId(), False, + (uint)(ButtonPressMask | ButtonReleaseMask | + PointerMotionMask | EnterWindowMask | LeaveWindowMask), + GrabModeAsync, GrabModeAsync, + None, cursor.handle(), qt_x_time ); #if defined(QT_CHECK_STATE) - if ( status ) { - const char *s = - status == GrabNotViewable ? "\"GrabNotViewable\"" : - status == AlreadyGrabbed ? "\"AlreadyGrabbed\"" : - status == GrabFrozen ? "\"GrabFrozen\"" : - status == GrabInvalidTime ? "\"GrabInvalidTime\"" : - "<?>"; - qWarning( "Grabbing the mouse failed with %s", s ); - } + if ( status ) { + const char *s = + status == GrabNotViewable ? "\"GrabNotViewable\"" : + status == AlreadyGrabbed ? "\"AlreadyGrabbed\"" : + status == GrabFrozen ? "\"GrabFrozen\"" : + status == GrabInvalidTime ? "\"GrabInvalidTime\"" : + "<?>"; + qWarning( "Grabbing the mouse failed with %s", s ); + } #endif - mouseGrb = this; + mouseGrb = this; + } } } @@ -1548,11 +1551,13 @@ void QWidget::releaseMouse() void QWidget::grabKeyboard() { if ( !qt_nograb() ) { - if ( keyboardGrb ) - keyboardGrb->releaseKeyboard(); - XGrabKeyboard( x11Display(), winid, False, GrabModeAsync, GrabModeAsync, - qt_x_time ); - keyboardGrb = this; + if ( keyboardGrb != this ) { + if ( keyboardGrb ) { + keyboardGrb->releaseKeyboard(); + } + XGrabKeyboard( x11Display(), winid, False, GrabModeAsync, GrabModeAsync, qt_x_time ); + keyboardGrb = this; + } } } @@ -2476,7 +2481,7 @@ void QWidget::scroll( int dx, int dy, const QRect& r ) if ( !valid_rect && children() ) { // scroll children QPoint pd( dx, dy ); QObjectListIt it(*children()); - register QObject *object; + QObject *object; while ( it ) { // move all children object = it.current(); if ( object->isWidgetType() ) { diff --git a/src/kernel/qwmatrix.cpp b/src/kernel/qwmatrix.cpp index aaefddd..6b13811 100644 --- a/src/kernel/qwmatrix.cpp +++ b/src/kernel/qwmatrix.cpp @@ -724,8 +724,8 @@ QRegion QWMatrix::operator * (const QRegion &r ) const return r; QMemArray<QRect> rects = r.rects(); QRegion result; - register QRect *rect = rects.data(); - register int i = rects.size(); + QRect *rect = rects.data(); + int i = rects.size(); if ( _m12 == 0.0F && _m21 == 0.0F && _m11 > 1.0F && _m22 > 1.0F ) { // simple case, no rotation while ( i ) { |