diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-13 17:43:39 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-13 17:43:39 -0600 |
commit | 359640943bcf155faa9a067dde9e00a123276290 (patch) | |
tree | fb3d55ea5e18949042fb0064123fb73d2b1eb932 /src/tools | |
parent | a829bcdc533e154000803d517200d32fe762e85c (diff) | |
download | tqt3-359640943bcf155faa9a067dde9e00a123276290.tar.gz tqt3-359640943bcf155faa9a067dde9e00a123276290.zip |
Automated update from Qt3
Diffstat (limited to 'src/tools')
39 files changed, 221 insertions, 218 deletions
diff --git a/src/tools/ntqbuffer.h b/src/tools/ntqbuffer.h index ba5aea33b..7ab320392 100644 --- a/src/tools/ntqbuffer.h +++ b/src/tools/ntqbuffer.h @@ -83,7 +83,7 @@ private: uint a_inc; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQBuffer( const TQBuffer & ); TQBuffer &operator=( const TQBuffer & ); #endif diff --git a/src/tools/ntqcstring.h b/src/tools/ntqcstring.h index f3893f63e..18837ad34 100644 --- a/src/tools/ntqcstring.h +++ b/src/tools/ntqcstring.h @@ -57,7 +57,7 @@ Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); Q_EXPORT char *qstrdup( const char * ); -Q_EXPORT inline uint qstrlen( const char *str ) +Q_EXPORT inline uint tqstrlen( const char *str ) { return str ? (uint)strlen(str) : 0u; } Q_EXPORT inline char *qstrcpy( char *dst, const char *src ) @@ -71,7 +71,7 @@ Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 ) : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); } -Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len ) +Q_EXPORT inline int tqstrncmp( const char *str1, const char *str2, uint len ) { return ( str1 && str2 ) ? strncmp( str1, str2, len ) : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); @@ -121,11 +121,11 @@ typedef TQMemArray<char> TQByteArray; #ifndef QT_NO_COMPRESS Q_EXPORT TQByteArray qCompress( const uchar* data, int nbytes ); -Q_EXPORT TQByteArray qUncompress( const uchar* data, int nbytes ); +Q_EXPORT TQByteArray tqUncompress( const uchar* data, int nbytes ); Q_EXPORT inline TQByteArray qCompress( const TQByteArray& data) { return qCompress( (const uchar*)data.data(), data.size() ); } -Q_EXPORT inline TQByteArray qUncompress( const TQByteArray& data ) -{ return qUncompress( (const uchar*)data.data(), data.size() ); } +Q_EXPORT inline TQByteArray tqUncompress( const TQByteArray& data ) +{ return tqUncompress( (const uchar*)data.data(), data.size() ); } #endif /***************************************************************************** @@ -256,7 +256,7 @@ inline TQCString &TQCString::operator=( const TQCString &s ) { return (TQCString&)assign( s ); } inline TQCString &TQCString::operator=( const char *str ) -{ return (TQCString&)duplicate( str, qstrlen(str)+1 ); } +{ return (TQCString&)duplicate( str, tqstrlen(str)+1 ); } inline bool TQCString::isNull() const { return data() == 0; } @@ -265,7 +265,7 @@ inline bool TQCString::isEmpty() const { return data() == 0 || *data() == '\0'; } inline uint TQCString::length() const -{ return qstrlen( data() ); } +{ return tqstrlen( data() ); } inline bool TQCString::truncate( uint pos ) { return resize(pos+1); } diff --git a/src/tools/ntqdatastream.h b/src/tools/ntqdatastream.h index 73fa584cf..1031f3bf5 100644 --- a/src/tools/ntqdatastream.h +++ b/src/tools/ntqdatastream.h @@ -120,7 +120,7 @@ private: int ver; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQDataStream( const TQDataStream & ); TQDataStream &operator=( const TQDataStream & ); #endif diff --git a/src/tools/ntqfile.h b/src/tools/ntqfile.h index 40ad46856..829ae91d2 100644 --- a/src/tools/ntqfile.h +++ b/src/tools/ntqfile.h @@ -114,7 +114,7 @@ private: TQCString ungetchBuffer; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQFile( const TQFile & ); TQFile &operator=( const TQFile & ); #endif diff --git a/src/tools/ntqfileinfo.h b/src/tools/ntqfileinfo.h index 36cf4d7a2..28f2aea98 100644 --- a/src/tools/ntqfileinfo.h +++ b/src/tools/ntqfileinfo.h @@ -119,7 +119,7 @@ public: bool permission( int permissionSpec ) const; -#if (QT_VERSION-0 >= 0x040000) +#if (TQT_VERSION-0 >= 0x040000) #error "TQFileInfo::size() should return TQIODevice::Offset instead of uint" #elif defined(QT_ABI_QT4) TQIODevice::Offset size() const; diff --git a/src/tools/ntqglobal.h b/src/tools/ntqglobal.h index 34d9acea2..385156f0b 100644 --- a/src/tools/ntqglobal.h +++ b/src/tools/ntqglobal.h @@ -43,11 +43,11 @@ #define TQT_REAL_TQT 1 -#define QT_VERSION_STR "3.4.0" +#define TQT_VERSION_STR "3.4.0" /* - QT_VERSION is (major << 16) + (minor << 8) + patch. + TQT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x030400 +#define TQT_VERSION 0x030400 /* The operating system, must be one of: (Q_OS_x) @@ -321,7 +321,7 @@ members of a packed struct. (Pointers are OK, because then you supposedly know what you are doing.) */ # if (defined(__arm__) || defined(__ARMEL__)) && !defined(__ARM_EABI__) && !defined(QT_MOC_CPP) -# define Q_PACKED __attribute__ ((packed)) +# define TQ_PACKED __attribute__ ((packed)) # if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 # define Q_NO_PACKED_REFERENCE # endif @@ -548,8 +548,8 @@ # error "TQt has not been tested with this compiler - talk to qt-bugs@trolltech.com" #endif -#ifndef Q_PACKED -# define Q_PACKED +#ifndef TQ_PACKED +# define TQ_PACKED #endif @@ -607,10 +607,10 @@ Some classes do not permit copies to be made of an object. These classes contains a private copy constructor and operator= to disable copying (the compiler gives an error message). - Undefine Q_DISABLE_COPY to turn off this checking. + Undefine TQ_DISABLE_COPY to turn off this checking. */ -#define Q_DISABLE_COPY +#define TQ_DISABLE_COPY #if defined(__cplusplus) @@ -692,7 +692,7 @@ const bool true = TRUE; #define TQMIN(a, b) ((a) < (b) ? (a) : (b)) #define TQABS(a) ((a) >= 0 ? (a) : -(a)) -inline int qRound( double d ) +inline int tqRound( double d ) { return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1); } @@ -726,13 +726,13 @@ typedef long Q_LONG; // word up to 64 bit signed typedef unsigned long Q_ULONG; // word up to 64 bit unsigned #endif #if defined(Q_OS_WIN) && !defined(Q_CC_GNU) -# define Q_INT64_C(c) c ## i64 // signed 64 bit constant -# define Q_UINT64_C(c) c ## ui64 // unsigned 64 bit constant +# define TQ_INT64_C(c) c ## i64 // signed 64 bit constant +# define TQ_UINT64_C(c) c ## ui64 // unsigned 64 bit constant typedef __int64 Q_INT64; // 64 bit signed typedef unsigned __int64 Q_UINT64; // 64 bit unsigned #else -# define Q_INT64_C(c) c ## LL // signed 64 bit constant -# define Q_UINT64_C(c) c ## ULL // unsigned 64 bit constant +# define TQ_INT64_C(c) c ## LL // signed 64 bit constant +# define TQ_UINT64_C(c) c ## ULL // unsigned 64 bit constant typedef long long Q_INT64; // 64 bit signed typedef unsigned long long Q_UINT64; // 64 bit unsigned #endif @@ -782,37 +782,37 @@ class TQDataStream; #endif -#ifndef QT_BUILD_KEY -#define QT_BUILD_KEY "unspecified" +#ifndef TQT_BUILD_KEY +#define TQT_BUILD_KEY "unspecified" #endif // prune to local config #include "ntqmodules.h" -#ifndef QT_MODULE_DIALOGS +#ifndef TQT_MODULE_DIALOGS # define QT_NO_DIALOG #endif -#ifndef QT_MODULE_ICONVIEW +#ifndef TQT_MODULE_ICONVIEW # define QT_NO_ICONVIEW #endif -#ifndef QT_MODULE_WORKSPACE +#ifndef TQT_MODULE_WORKSPACE # define QT_NO_WORKSPACE #endif -#ifndef QT_MODULE_NETWORK +#ifndef TQT_MODULE_NETWORK #define QT_NO_NETWORK #endif -#ifndef QT_MODULE_CANVAS +#ifndef TQT_MODULE_CANVAS # define QT_NO_CANVAS #endif -#ifndef QT_MODULE_TABLE +#ifndef TQT_MODULE_TABLE #define QT_NO_TABLE #endif -#ifndef QT_MODULE_XML +#ifndef TQT_MODULE_XML # define QT_NO_XML #endif -#ifndef QT_MODULE_OPENGL +#ifndef TQT_MODULE_OPENGL # define QT_NO_OPENGL #endif -#if !defined(QT_MODULE_SQL) +#if !defined(TQT_MODULE_SQL) # define QT_NO_SQL #endif @@ -863,7 +863,7 @@ class TQDataStream; # define Q_EXPORT __declspec(dllexport) # define Q_TEMPLATEDLL # define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# undef TQ_DISABLE_COPY /* avoid unresolved externals */ # elif defined(QT_DLL) /* use a TQt DLL library */ # define Q_EXPORT __declspec(dllimport) # define Q_TEMPLATEDLL @@ -874,18 +874,18 @@ class TQDataStream; # define Q_TEMPLATE_EXTERN # endif # endif -# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# undef TQ_DISABLE_COPY /* avoid unresolved externals */ # endif #elif defined(Q_OS_LINUX) && defined(Q_CC_BOR) # if defined(QT_SHARED) /* create a TQt shared library */ # define Q_EXPORT __declspec(dllexport) # define Q_TEMPLATEDLL # define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# undef TQ_DISABLE_COPY /* avoid unresolved externals */ # else # define Q_TEMPLATEDLL # define Q_TEMPLATE_EXTERN -# undef Q_DISABLE_COPY /* avoid unresolved externals */ +# undef TQ_DISABLE_COPY /* avoid unresolved externals */ # endif #elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 # define Q_EXPORT __attribute__((visibility("default"))) @@ -1042,14 +1042,14 @@ Q_EXPORT void fatal( const char *, ... ) // print fatal message and exit Q_EXPORT bool qt_check_pointer( bool c, const char *, int ); #if defined(QT_CHECK_NULL) -# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__)) +# define TQ_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__)) #else -# define Q_CHECK_PTR(p) +# define TQ_CHECK_PTR(p) #endif #if !defined(QT_NO_COMPAT) // compatibility with TQt 2 # if !defined(CHECK_PTR) -# define CHECK_PTR(x) Q_CHECK_PTR(x) +# define CHECK_PTR(x) TQ_CHECK_PTR(x) # endif #endif // QT_NO_COMPAT diff --git a/src/tools/ntqiodevice.h b/src/tools/ntqiodevice.h index 65c4c59df..33516d076 100644 --- a/src/tools/ntqiodevice.h +++ b/src/tools/ntqiodevice.h @@ -154,7 +154,7 @@ private: int ioSt; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQIODevice( const TQIODevice & ); TQIODevice &operator=( const TQIODevice & ); #endif diff --git a/src/tools/ntqlibrary.h b/src/tools/ntqlibrary.h index 385726b8e..c6c92fd5c 100644 --- a/src/tools/ntqlibrary.h +++ b/src/tools/ntqlibrary.h @@ -74,7 +74,7 @@ private: uint aunload : 1; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQLibrary( const TQLibrary & ); TQLibrary &operator=( const TQLibrary & ); #endif diff --git a/src/tools/ntqmutex.h b/src/tools/ntqmutex.h index 90c5150c3..2a9afb1d2 100644 --- a/src/tools/ntqmutex.h +++ b/src/tools/ntqmutex.h @@ -70,7 +70,7 @@ public: private: TQMutexPrivate * d; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQMutex( const TQMutex & ); TQMutex &operator=( const TQMutex & ); #endif @@ -87,7 +87,7 @@ public: private: TQMutex *mtx; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQMutexLocker( const TQMutexLocker & ); TQMutexLocker &operator=( const TQMutexLocker & ); #endif diff --git a/src/tools/ntqsemaphore.h b/src/tools/ntqsemaphore.h index 8b246054c..dc6309d58 100644 --- a/src/tools/ntqsemaphore.h +++ b/src/tools/ntqsemaphore.h @@ -70,7 +70,7 @@ public: private: TQSemaphorePrivate *d; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQSemaphore(const TQSemaphore &); TQSemaphore &operator=(const TQSemaphore &); #endif diff --git a/src/tools/ntqsettings.h b/src/tools/ntqsettings.h index 5c4b24cac..f6a30dacc 100644 --- a/src/tools/ntqsettings.h +++ b/src/tools/ntqsettings.h @@ -145,7 +145,7 @@ public: private: TQSettingsPrivate *d; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQSettings(const TQSettings &); TQSettings &operator=(const TQSettings &); #endif diff --git a/src/tools/ntqstring.h b/src/tools/ntqstring.h index 85dacc8c2..04b319aeb 100644 --- a/src/tools/ntqstring.h +++ b/src/tools/ntqstring.h @@ -244,7 +244,7 @@ private: #if defined(QT_QSTRING_UCS_4) ushort grp; #endif -} Q_PACKED; +} TQ_PACKED; inline TQChar::TQChar() : ucs( 0 ) #ifdef QT_QSTRING_UCS_4 @@ -390,7 +390,7 @@ struct Q_EXPORT TQStringData : public TQShared { uint islatin1 : 1; private: -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQStringData( const TQStringData& ); TQStringData& operator=( const TQStringData& ); #endif diff --git a/src/tools/ntqtextstream.h b/src/tools/ntqtextstream.h index a99c8e26c..e0520a5c4 100644 --- a/src/tools/ntqtextstream.h +++ b/src/tools/ntqtextstream.h @@ -190,7 +190,7 @@ private: TQTextStream &writeBlock( const TQChar* p, uint len ); private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQTextStream( const TQTextStream & ); TQTextStream &operator=( const TQTextStream & ); #endif @@ -208,7 +208,7 @@ public: TQTextStream(f,IO_ReadOnly) { } private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQTextIStream( const TQTextIStream & ); TQTextIStream &operator=( const TQTextIStream & ); #endif @@ -224,7 +224,7 @@ public: TQTextStream(f,IO_WriteOnly) { } private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQTextOStream( const TQTextOStream & ); TQTextOStream &operator=( const TQTextOStream & ); #endif diff --git a/src/tools/ntqthreadstorage.h b/src/tools/ntqthreadstorage.h index acce6dbaa..06edbec3e 100644 --- a/src/tools/ntqthreadstorage.h +++ b/src/tools/ntqthreadstorage.h @@ -65,11 +65,11 @@ class TQThreadStorage private: TQThreadStorageData d; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) // disable copy constructor and operator= TQThreadStorage( const TQThreadStorage & ); TQThreadStorage &operator=( const TQThreadStorage & ); -#endif // Q_DISABLE_COPY +#endif // TQ_DISABLE_COPY static void deleteData( void *x ) { delete (T)x; } diff --git a/src/tools/ntqtl.h b/src/tools/ntqtl.h index ae8c5af87..ee601c157 100644 --- a/src/tools/ntqtl.h +++ b/src/tools/ntqtl.h @@ -72,7 +72,7 @@ public: #endif //QT_NO_TEXTSTREAM template <class InputIterator, class OutputIterator> -inline OutputIterator qCopy( InputIterator _begin, InputIterator _end, +inline OutputIterator tqCopy( InputIterator _begin, InputIterator _end, OutputIterator _dest ) { while( _begin != _end ) @@ -81,7 +81,7 @@ inline OutputIterator qCopy( InputIterator _begin, InputIterator _end, } template <class BiIterator, class BiOutputIterator> -inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end, +inline BiOutputIterator tqCopyBackward( BiIterator _begin, BiIterator _end, BiOutputIterator _dest ) { while ( _begin != _end ) @@ -90,7 +90,7 @@ inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end, } template <class InputIterator1, class InputIterator2> -inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) +inline bool tqEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) { // ### compare using !(*first1 == *first2) in TQt 4.0 for ( ; first1 != last1; ++first1, ++first2 ) @@ -100,7 +100,7 @@ inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 } template <class ForwardIterator, class T> -inline void qFill( ForwardIterator first, ForwardIterator last, const T& val ) +inline void tqFill( ForwardIterator first, ForwardIterator last, const T& val ) { for ( ; first != last; ++first ) *first = val; @@ -122,7 +122,7 @@ inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end, template <class InputIterator, class T> -inline InputIterator qFind( InputIterator first, InputIterator last, +inline InputIterator tqFind( InputIterator first, InputIterator last, const T& val ) { while ( first != last && *first != val ) @@ -131,7 +131,7 @@ inline InputIterator qFind( InputIterator first, InputIterator last, } template <class InputIterator, class T, class Size> -inline void qCount( InputIterator first, InputIterator last, const T& value, +inline void tqCount( InputIterator first, InputIterator last, const T& value, Size& n ) { for ( ; first != last; ++first ) @@ -140,7 +140,7 @@ inline void qCount( InputIterator first, InputIterator last, const T& value, } template <class T> -inline void qSwap( T& _value1, T& _value2 ) +inline void tqSwap( T& _value1, T& _value2 ) { T tmp = _value1; _value1 = _value2; @@ -170,7 +170,7 @@ Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e ) --y; if ( *x < *y ) { swapped = TRUE; - qSwap( *x, *y ); + tqSwap( *x, *y ); swap_pos = y; } } while( y != b ); @@ -197,18 +197,18 @@ Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last ) if ( last == 2 * r ) { // node r has only one child if ( heap[2 * r] < heap[r] ) - qSwap( heap[r], heap[2 * r] ); + tqSwap( heap[r], heap[2 * r] ); r = last; } else { // node r has two children if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) { // swap with left child - qSwap( heap[r], heap[2 * r] ); + tqSwap( heap[r], heap[2 * r] ); r *= 2; } else if ( heap[2 * r + 1] < heap[r] && heap[2 * r + 1] < heap[2 * r] ) { // swap with right child - qSwap( heap[r], heap[2 * r + 1] ); + tqSwap( heap[r], heap[2 * r + 1] ); r = 2 * r + 1; } else { r = last; @@ -231,7 +231,7 @@ Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value heap[++size] = *insert; int i = size; while( i > 1 && heap[i] < heap[i / 2] ) { - qSwap( heap[i], heap[i / 2] ); + tqSwap( heap[i], heap[i / 2] ); i /= 2; } } diff --git a/src/tools/ntqvaluelist.h b/src/tools/ntqvaluelist.h index c217a7892..411c2dd75 100644 --- a/src/tools/ntqvaluelist.h +++ b/src/tools/ntqvaluelist.h @@ -439,7 +439,7 @@ public: TQValueList( const std::list<T>& l ) { sh = new TQValueListPrivate<T>; - qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); + tqCopy( l.begin(), l.end(), std::back_inserter( *this ) ); } #endif ~TQValueList() { sh->derefAndDelete(); } @@ -455,7 +455,7 @@ public: TQValueList<T>& operator= ( const std::list<T>& l ) { detach(); - qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); + tqCopy( l.begin(), l.end(), std::back_inserter( *this ) ); return *this; } bool operator== ( const std::list<T>& l ) const diff --git a/src/tools/ntqvaluevector.h b/src/tools/ntqvaluevector.h index bef40f54b..02a151110 100644 --- a/src/tools/ntqvaluevector.h +++ b/src/tools/ntqvaluevector.h @@ -130,9 +130,9 @@ Q_INLINE_TEMPLATES TQValueVectorPrivate<T>::TQValueVectorPrivate( const TQValueV finish = start + i; end = start + i; #if defined(__xlC__) && __xlC__ < 0x400 // xlC 3.6 confused by const - qCopy( (pointer)x.start, (pointer)x.finish, start ); + tqCopy( (pointer)x.start, (pointer)x.finish, start ); #else - qCopy( x.start, x.finish, start ); + tqCopy( x.start, x.finish, start ); #endif } else { start = 0; @@ -163,9 +163,9 @@ Q_INLINE_TEMPLATES void TQValueVectorPrivate<T>::insert( pointer pos, const T& x const size_t offset = pos - start; pointer newStart = new T[n]; pointer newFinish = newStart + offset; - qCopy( start, pos, newStart ); + tqCopy( start, pos, newStart ); *newFinish = x; - qCopy( pos, finish, ++newFinish ); + tqCopy( pos, finish, ++newFinish ); delete[] start; start = newStart; finish = newStart + lastSize + 1; @@ -180,31 +180,31 @@ Q_INLINE_TEMPLATES void TQValueVectorPrivate<T>::insert( pointer pos, size_t n, const size_t elems_after = finish - pos; pointer old_finish = finish; if ( elems_after > n ) { - qCopy( finish - n, finish, finish ); + tqCopy( finish - n, finish, finish ); finish += n; - qCopyBackward( pos, old_finish - n, old_finish ); - qFill( pos, pos + n, x ); + tqCopyBackward( pos, old_finish - n, old_finish ); + tqFill( pos, pos + n, x ); } else { pointer filler = finish; size_t i = n - elems_after; for ( ; i > 0; --i, ++filler ) *filler = x; finish += n - elems_after; - qCopy( pos, old_finish, finish ); + tqCopy( pos, old_finish, finish ); finish += elems_after; - qFill( pos, old_finish, x ); + tqFill( pos, old_finish, x ); } } else { // not enough room const size_t lastSize = size(); const size_t len = lastSize + TQMAX( lastSize, n ); pointer newStart = new T[len]; - pointer newFinish = qCopy( start, pos, newStart ); + pointer newFinish = tqCopy( start, pos, newStart ); // fill up inserted space size_t i = n; for ( ; i > 0; --i, ++newFinish ) *newFinish = x; - newFinish = qCopy( pos, finish, newFinish ); + newFinish = tqCopy( pos, finish, newFinish ); delete[] start; start = newStart; finish = newFinish; @@ -226,7 +226,7 @@ template <class T> Q_INLINE_TEMPLATES Q_TYPENAME TQValueVectorPrivate<T>::pointer TQValueVectorPrivate<T>::growAndCopy( size_t n, pointer s, pointer f ) { pointer newStart = new T[n]; - qCopy( s, f, newStart ); + tqCopy( s, f, newStart ); delete[] start; return newStart; } @@ -268,13 +268,13 @@ public: TQValueVector( std::vector<T>& v ) // ### remove in 4.0 { sh = new TQValueVectorPrivate<T>( v.size() ); - qCopy( v.begin(), v.end(), begin() ); + tqCopy( v.begin(), v.end(), begin() ); } TQValueVector( const std::vector<T>& v ) { sh = new TQValueVectorPrivate<T>( v.size() ); - qCopy( v.begin(), v.end(), begin() ); + tqCopy( v.begin(), v.end(), begin() ); } #endif @@ -296,7 +296,7 @@ public: { clear(); resize( v.size() ); - qCopy( v.begin(), v.end(), begin() ); + tqCopy( v.begin(), v.end(), begin() ); return *this; } #endif @@ -441,7 +441,7 @@ public: { detach(); if ( pos + 1 != end() ) - qCopy( pos + 1, sh->finish, pos ); + tqCopy( pos + 1, sh->finish, pos ); --sh->finish; return pos; } @@ -449,7 +449,7 @@ public: iterator erase( iterator first, iterator last ) { detach(); - qCopy( last, sh->finish, first ); + tqCopy( last, sh->finish, first ); sh->finish = sh->finish - ( last - first ); return first; } @@ -457,12 +457,12 @@ public: // ### remove in TQt 4.0 bool operator==( const TQValueVector<T>& x ) { - return size()==x.size() ? qEqual( constBegin(), constEnd(), x.begin()) : FALSE; + return size()==x.size() ? tqEqual( constBegin(), constEnd(), x.begin()) : FALSE; } bool operator==( const TQValueVector<T>& x ) const { - return size()==x.size() ? qEqual( begin(), end(), x.begin() ) : FALSE; + return size()==x.size() ? tqEqual( begin(), end(), x.begin() ) : FALSE; } typedef T ValueType; @@ -494,7 +494,7 @@ template <class T> Q_INLINE_TEMPLATES TQValueVector<T>::TQValueVector( size_type n, const T& val ) { sh = new TQValueVectorPrivate<T>( n ); - qFill( begin(), end(), val ); + tqFill( begin(), end(), val ); } template <class T> @@ -522,7 +522,7 @@ Q_INLINE_TEMPLATES Q_TYPENAME TQValueVector<T>::iterator TQValueVector<T>::inser } else { *sh->finish = *(sh->finish - 1); ++sh->finish; - qCopyBackward( pos, sh->finish - 2, sh->finish - 1 ); + tqCopyBackward( pos, sh->finish - 2, sh->finish - 1 ); *pos = x; } } diff --git a/src/tools/ntqwaitcondition.h b/src/tools/ntqwaitcondition.h index 6e6038801..7b8475f23 100644 --- a/src/tools/ntqwaitcondition.h +++ b/src/tools/ntqwaitcondition.h @@ -68,7 +68,7 @@ public: private: TQWaitConditionPrivate * d; -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) TQWaitCondition( const TQWaitCondition & ); TQWaitCondition &operator=( const TQWaitCondition & ); #endif diff --git a/src/tools/qbitarray.cpp b/src/tools/qbitarray.cpp index c1433887a..a374cc6ca 100644 --- a/src/tools/qbitarray.cpp +++ b/src/tools/qbitarray.cpp @@ -145,7 +145,7 @@ TQBitArray::TQBitArray() : TQByteArray( 0, 0 ) { bitarr_data *x = new bitarr_data; - Q_CHECK_PTR( x ); + TQ_CHECK_PTR( x ); x->nbits = 0; setSharedBlock( x ); } @@ -159,7 +159,7 @@ TQBitArray::TQBitArray() : TQByteArray( 0, 0 ) TQBitArray::TQBitArray( uint size ) : TQByteArray( 0, 0 ) { bitarr_data *x = new bitarr_data; - Q_CHECK_PTR( x ); + TQ_CHECK_PTR( x ); x->nbits = 0; setSharedBlock( x ); resize( size ); diff --git a/src/tools/qcom_p.h b/src/tools/qcom_p.h index 0bf1f4aea..a53c79c80 100644 --- a/src/tools/qcom_p.h +++ b/src/tools/qcom_p.h @@ -297,9 +297,9 @@ public: \ # define Q_UCM_VERIFICATION_DATA \ static const char *qt_ucm_verification_data = \ "pattern=""QT_UCM_VERIFICATION_DATA""\n" \ - "version="QT_VERSION_STR"\n" \ + "version="TQT_VERSION_STR"\n" \ "flags="Q_UCM_FLAGS_STRING"\n" \ - "buildkey="QT_BUILD_KEY"\0"; + "buildkey="TQT_BUILD_KEY"\0"; #endif // Q_UCM_VERIFICATION_DATA // This macro expands to the default implementation of ucm_instantiate. diff --git a/src/tools/qcomlibrary.cpp b/src/tools/qcomlibrary.cpp index c6d22e2e8..5869d3e37 100644 --- a/src/tools/qcomlibrary.cpp +++ b/src/tools/qcomlibrary.cpp @@ -103,8 +103,8 @@ static bool qt_verify( const TQString& library, uint version, uint flags, qWarning( "Conflict in %s:\n" " Plugin cannot be queried successfully!", (const char*) TQFile::encodeName(library) ); - } else if ( ( version > QT_VERSION ) || - ( ( QT_VERSION & 0xff0000 ) > ( version & 0xff0000 ) ) ) { + } else if ( ( version > TQT_VERSION ) || + ( ( TQT_VERSION & 0xff0000 ) > ( version & 0xff0000 ) ) ) { if ( warn ) qWarning( "Conflict in %s:\n" " Plugin uses incompatible TQt library (%d.%d.%d)!", @@ -116,13 +116,13 @@ static bool qt_verify( const TQString& library, uint version, uint flags, " Plugin uses %s TQt library!", (const char*) TQFile::encodeName(library), (flags & 2) ? "multi threaded" : "single threaded" ); - } else if ( key != QT_BUILD_KEY ) { + } else if ( key != TQT_BUILD_KEY ) { if ( warn ) qWarning( "Conflict in %s:\n" " Plugin uses incompatible TQt library!\n" " expected build key \"%s\", got \"%s\".", (const char*) TQFile::encodeName(library), - QT_BUILD_KEY, + TQT_BUILD_KEY, key.isEmpty() ? "<null>" : (const char *) key ); } else { return TRUE; @@ -214,7 +214,7 @@ static bool qt_parse_pattern( const char *s, uint *version, uint *flags, qt_token_info pinfo("=\n", 2); int parse; - ulong at = 0, advance, parselen = qstrlen( s ); + ulong at = 0, advance, parselen = tqstrlen( s ); do { parse = qt_tokenize( s + at, parselen, &advance, pinfo ); if ( parse == -1 ) { @@ -225,7 +225,7 @@ static bool qt_parse_pattern( const char *s, uint *version, uint *flags, at += advance; parselen -= advance; - if ( qstrncmp( "version", pinfo.results[ 0 ], pinfo.lengths[ 0 ] ) == 0 ) { + if ( tqstrncmp( "version", pinfo.results[ 0 ], pinfo.lengths[ 0 ] ) == 0 ) { // parse version string qt_token_info pinfo2("..-", 3); if ( qt_tokenize( pinfo.results[ 1 ], pinfo.lengths[ 1 ], @@ -238,7 +238,7 @@ static bool qt_parse_pattern( const char *s, uint *version, uint *flags, ret = FALSE; break; } - } else if ( qstrncmp( "flags", pinfo.results[ 0 ], pinfo.lengths[ 0 ] ) == 0 ) { + } else if ( tqstrncmp( "flags", pinfo.results[ 0 ], pinfo.lengths[ 0 ] ) == 0 ) { // parse flags string char ch; *flags = 0; @@ -255,7 +255,7 @@ static bool qt_parse_pattern( const char *s, uint *version, uint *flags, } ++p; } - } else if ( qstrncmp( "buildkey", pinfo.results[ 0 ], + } else if ( tqstrncmp( "buildkey", pinfo.results[ 0 ], pinfo.lengths[ 0 ] ) == 0 ){ // save buildkey *key = TQCString( pinfo.results[ 1 ], pinfo.lengths[ 1 ] + 1 ); @@ -299,7 +299,7 @@ static long qt_find_pattern( const char *s, ulong s_len, } i = delta; for (;;) { - if ( hs == hp && qstrncmp( s + i, pattern, p_len ) == 0 ) + if ( hs == hp && tqstrncmp( s + i, pattern, p_len ) == 0 ) return i; if ( i == 0 ) break; @@ -357,7 +357,7 @@ static bool qt_unix_query( const TQString &library, uint *version, uint *flags, // verify that the pattern is present in the plugin const char *pattern = "pattern=QT_UCM_VERIFICATION_DATA"; - const ulong plen = qstrlen( pattern ); + const ulong plen = tqstrlen( pattern ); long pos = qt_find_pattern( filedata, fdlen, pattern, plen ); bool ret = FALSE; @@ -389,8 +389,8 @@ void TQComLibrary::createInstanceInternal() TQFileInfo fileinfo( library() ); TQString lastModified = fileinfo.lastModified().toString(TQt::ISODate); TQString regkey = TQString("/TQt Plugins %1.%2/%3") - .arg( ( QT_VERSION & 0xff0000 ) >> 16 ) - .arg( ( QT_VERSION & 0xff00 ) >> 8 ) + .arg( ( TQT_VERSION & 0xff0000 ) >> 16 ) + .arg( ( TQT_VERSION & 0xff00 ) >> 8 ) .arg( library() ); TQStringList reg; uint flags = 0; diff --git a/src/tools/qcstring.cpp b/src/tools/qcstring.cpp index 60e698f34..8e7a1d14d 100644 --- a/src/tools/qcstring.cpp +++ b/src/tools/qcstring.cpp @@ -105,7 +105,7 @@ char *qstrdup( const char *src ) if ( !src ) return 0; char *dst = new char[strlen(src)+1]; - Q_CHECK_PTR( dst ); + TQ_CHECK_PTR( dst ); return strcpy( dst, src ); } @@ -144,7 +144,7 @@ char *qstrncpy( char *dst, const char *src, uint len ) } /*! - \fn uint qstrlen( const char *str ); + \fn uint tqstrlen( const char *str ); \relates TQCString @@ -170,12 +170,12 @@ char *qstrncpy( char *dst, const char *src, uint len ) Special case II: Returns a random nonzero value if \a str1 is 0 or \a str2 is 0 (but not both). - \sa qstrncmp() qstricmp() qstrnicmp() + \sa tqstrncmp() qstricmp() qstrnicmp() \link #asciinotion Note on character comparisons \endlink */ /*! - \fn int qstrncmp( const char *str1, const char *str2, uint len ); + \fn int tqstrncmp( const char *str1, const char *str2, uint len ); \relates TQCString @@ -212,7 +212,7 @@ char *qstrncpy( char *dst, const char *src, uint len ) Special case II: Returns a random nonzero value if \a str1 is 0 or \a str2 is 0 (but not both). - \sa qstrcmp(), qstrncmp(), qstrnicmp() + \sa qstrcmp(), tqstrncmp(), qstrnicmp() \link #asciinotion Note on character comparisons \endlink */ @@ -246,7 +246,7 @@ int qstricmp( const char *str1, const char *str2 ) Special case II: Returns a random nonzero value if \a str1 is 0 or \a str2 is 0 (but not both). - \sa qstrcmp(), qstrncmp() qstricmp() + \sa qstrcmp(), tqstrncmp() qstricmp() \link #asciinotion Note on character comparisons \endlink */ @@ -342,7 +342,7 @@ Q_UINT16 qChecksum( const char *data, uint len ) Compresses the array \a data and returns the compressed byte array using zlib. - \sa qUncompress() + \sa tqUncompress() */ /*! @@ -401,7 +401,7 @@ TQByteArray qCompress( const uchar* data, int nbytes ) #endif /*! - \fn TQByteArray qUncompress( const TQByteArray& data ) + \fn TQByteArray tqUncompress( const TQByteArray& data ) \relates TQByteArray @@ -429,7 +429,7 @@ TQByteArray qCompress( const uchar* data, int nbytes ) */ #ifndef QT_NO_COMPRESS -TQByteArray qUncompress( const uchar* data, int nbytes ) +TQByteArray tqUncompress( const uchar* data, int nbytes ) { if ( !data ) { #if defined(QT_CHECK_RANGE) @@ -699,7 +699,7 @@ TQCString::TQCString( int size ) TQCString::TQCString( const char *str ) { - duplicate( str, qstrlen(str) + 1 ); + duplicate( str, tqstrlen(str) + 1 ); } @@ -887,7 +887,7 @@ TQCString &TQCString::sprintf( const char *format, ... ) #else vsprintf( data(), format, ap ); #endif - resize( qstrlen(data()) + 1 ); // truncate + resize( tqstrlen(data()) + 1 ); // truncate va_end( ap ); return *this; } @@ -987,7 +987,7 @@ int TQCString::find( const char *str, int index, bool cs, uint l ) const return -1; if ( !*str ) return index; - const uint sl = qstrlen( str ); + const uint sl = tqstrlen( str ); if ( sl + index > l ) return -1; @@ -1013,7 +1013,7 @@ int TQCString::find( const char *str, int index, bool cs, uint l ) const while ( haystack <= end ) { hashHaystack += *(haystack+sl_minus_1); if ( hashHaystack == hashNeedle && *needle == *haystack - && qstrncmp( needle, haystack, sl ) == 0 ) + && tqstrncmp( needle, haystack, sl ) == 0 ) return haystack - data(); REHASH( *haystack ); @@ -1094,7 +1094,7 @@ int TQCString::findRev( const char *str, int index, bool cs ) const /* See TQString::find() for explanations. */ - const uint sl = qstrlen( str ); + const uint sl = tqstrlen( str ); const uint l = length(); int delta = l-sl; if ( index < 0 ) @@ -1123,7 +1123,7 @@ int TQCString::findRev( const char *str, int index, bool cs ) const hashHaystack -= *haystack; while ( haystack >= end ) { hashHaystack += *haystack; - if ( hashHaystack == hashNeedle && qstrncmp( needle, haystack, sl ) == 0 ) + if ( hashHaystack == hashNeedle && tqstrncmp( needle, haystack, sl ) == 0 ) return haystack-data(); --haystack; REHASH( *(haystack+sl) ); @@ -1283,7 +1283,7 @@ TQCString TQCString::right( uint len ) const TQCString TQCString::mid( uint index, uint len ) const { - uint slen = qstrlen( data() ); + uint slen = tqstrlen( data() ); if ( isEmpty() || index >= slen ) { TQCString empty; return empty; @@ -1319,7 +1319,7 @@ TQCString TQCString::mid( uint index, uint len ) const TQCString TQCString::leftJustify( uint width, char fill, bool truncate ) const { TQCString result; - int len = qstrlen(data()); + int len = tqstrlen(data()); int padlen = width - len; if ( padlen > 0 ) { result.TQByteArray::resize( len+padlen+1 ); @@ -1357,7 +1357,7 @@ TQCString TQCString::leftJustify( uint width, char fill, bool truncate ) const TQCString TQCString::rightJustify( uint width, char fill, bool truncate ) const { TQCString result; - int len = qstrlen(data()); + int len = tqstrlen(data()); int padlen = width - len; if ( padlen > 0 ) { result.TQByteArray::resize( len+padlen+1 ); @@ -1534,7 +1534,7 @@ TQCString TQCString::simplifyWhiteSpace() const TQCString &TQCString::insert( uint index, const char *s ) { - int len = qstrlen(s); + int len = tqstrlen(s); if ( len == 0 ) return *this; uint olen = length(); @@ -2090,7 +2090,7 @@ TQCString &TQCString::setStr( const char *str ) { detach(); if ( str ) // valid string - store( str, qstrlen(str)+1 ); + store( str, tqstrlen(str)+1 ); else // empty resize( 0 ); return *this; @@ -2122,7 +2122,7 @@ TQCString &TQCString::setNum( long n ) } while ( n ); if ( neg ) *--p = '-'; - store( p, qstrlen(p)+1 ); + store( p, tqstrlen(p)+1 ); return *this; } @@ -2143,7 +2143,7 @@ TQCString &TQCString::setNum( ulong n ) *--p = ((int)(n%10)) + '0'; n /= 10; } while ( n ); - store( p, qstrlen(p)+1 ); + store( p, tqstrlen(p)+1 ); return *this; } @@ -2263,7 +2263,7 @@ TQCString& TQCString::operator+=( const char *str ) return *this; // nothing to append detach(); uint len1 = length(); - uint len2 = qstrlen(str); + uint len2 = tqstrlen(str); if ( !TQByteArray::resize( len1 + len2 + 1, TQByteArray::SpeedOptim ) ) return *this; // no memory memcpy( data() + len1, str, len2 + 1 ); diff --git a/src/tools/qdatastream.cpp b/src/tools/qdatastream.cpp index 3359d68bc..deab90bb6 100644 --- a/src/tools/qdatastream.cpp +++ b/src/tools/qdatastream.cpp @@ -810,7 +810,7 @@ TQDataStream &TQDataStream::readBytes( char *&s, uint &l ) return *this; } else { s = new char[len]; // create char array - Q_CHECK_PTR( s ); + TQ_CHECK_PTR( s ); if ( !s ) // no memory return *this; return readRawBytes( s, (uint)len ); @@ -1115,7 +1115,7 @@ TQDataStream &TQDataStream::operator<<( const char *s ) *this << (Q_UINT32)0; return *this; } - uint len = qstrlen( s ) + 1; // also write null terminator + uint len = tqstrlen( s ) + 1; // also write null terminator *this << (Q_UINT32)len; // write length specifier return writeRawBytes( s, len ); } diff --git a/src/tools/qdir_unix.cpp b/src/tools/qdir_unix.cpp index c5d7173e7..54ca9df56 100644 --- a/src/tools/qdir_unix.cpp +++ b/src/tools/qdir_unix.cpp @@ -98,7 +98,10 @@ TQString TQDir::canonicalPath() const slashify( r ); // always make sure we go back to the current dir - ::chdir( cur ); + if (::chdir( cur ) < 0) { + // Error! + // FIXME + } } #endif /* __GLIBC__ && !PATH_MAX */ return r; @@ -206,9 +209,9 @@ bool TQDir::readDirEntries( const TQString &nameFilter, int i; if ( !fList ) { fList = new TQStringList; - Q_CHECK_PTR( fList ); + TQ_CHECK_PTR( fList ); fiList = new TQFileInfoList; - Q_CHECK_PTR( fiList ); + TQ_CHECK_PTR( fiList ); fiList->setAutoDelete( TRUE ); } else { fList->clear(); diff --git a/src/tools/qfile.cpp b/src/tools/qfile.cpp index ab5248fe9..dc0a2427e 100644 --- a/src/tools/qfile.cpp +++ b/src/tools/qfile.cpp @@ -371,7 +371,7 @@ Q_LONG TQFile::readLine( char *p, Q_ULONG maxlen ) if ( maxlen == 0 ) // application bug? return 0; #if defined(QT_CHECK_STATE) - Q_CHECK_PTR( p ); + TQ_CHECK_PTR( p ); if ( !isOpen() ) { // file not open qWarning( "TQFile::readLine: File not open" ); return -1; @@ -387,7 +387,7 @@ Q_LONG TQFile::readLine( char *p, Q_ULONG maxlen ) } else { // buffered file p = fgets( p, maxlen, fh ); if ( p ) { - nread = qstrlen( p ); + nread = tqstrlen( p ); if ( !isSequentialAccess() ) ioIndex += nread; } else { diff --git a/src/tools/qfile_unix.cpp b/src/tools/qfile_unix.cpp index 85d0fd4fa..c65bf9228 100644 --- a/src/tools/qfile_unix.cpp +++ b/src/tools/qfile_unix.cpp @@ -321,7 +321,7 @@ bool TQFile::open( int m ) { TQFile f; f.open( IO_WriteOnly, stderr ); - f.writeBlock( msg, qstrlen(msg) ); // write to stderr + f.writeBlock( msg, tqstrlen(msg) ); // write to stderr f.close(); } \endcode diff --git a/src/tools/qfileinfo.cpp b/src/tools/qfileinfo.cpp index 014e037c8..288df5b67 100644 --- a/src/tools/qfileinfo.cpp +++ b/src/tools/qfileinfo.cpp @@ -253,7 +253,7 @@ TQFileInfo &TQFileInfo::operator=( const TQFileInfo &fi ) } else { if ( !fic ) { fic = new TQFileInfoCache; - Q_CHECK_PTR( fic ); + TQ_CHECK_PTR( fic ); } *fic = *fi.fic; } diff --git a/src/tools/qgarray.cpp b/src/tools/qgarray.cpp index 4d7fd38e4..8eba534ca 100644 --- a/src/tools/qgarray.cpp +++ b/src/tools/qgarray.cpp @@ -116,7 +116,7 @@ TQGArray::TQGArray() { shd = newData(); - Q_CHECK_PTR( shd ); + TQ_CHECK_PTR( shd ); } /*! @@ -143,11 +143,11 @@ TQGArray::TQGArray( int size ) size = 0; } shd = newData(); - Q_CHECK_PTR( shd ); + TQ_CHECK_PTR( shd ); if ( size == 0 ) // zero length return; shd->data = NEW(char,size); - Q_CHECK_PTR( shd->data ); + TQ_CHECK_PTR( shd->data ); shd->len = #ifdef QT_QGARRAY_SPEED_OPTIM shd->maxl = @@ -375,7 +375,7 @@ TQGArray &TQGArray::assign( const char *d, uint len ) if ( shd->count > 1 ) { // disconnect this shd->count--; shd = newData(); - Q_CHECK_PTR( shd ); + TQ_CHECK_PTR( shd ); } else { if ( shd->data ) DELETE(shd->data); @@ -401,10 +401,10 @@ TQGArray &TQGArray::duplicate( const TQGArray &a ) if ( shd->count > 1 ) { shd->count--; register array_data *n = newData(); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); if ( (n->len=shd->len) ) { n->data = NEW(char,n->len); - Q_CHECK_PTR( n->data ); + TQ_CHECK_PTR( n->data ); if ( n->data ) memcpy( n->data, shd->data, n->len ); } else { @@ -418,13 +418,13 @@ TQGArray &TQGArray::duplicate( const TQGArray &a ) if ( shd->count > 1 ) { // disconnect this shd->count--; shd = newData(); - Q_CHECK_PTR( shd ); + TQ_CHECK_PTR( shd ); } else { // delete after copy was made oldptr = shd->data; } if ( a.shd->len ) { // duplicate data shd->data = NEW(char,a.shd->len); - Q_CHECK_PTR( shd->data ); + TQ_CHECK_PTR( shd->data ); if ( shd->data ) memcpy( shd->data, a.shd->data, a.shd->len ); } else { @@ -461,13 +461,13 @@ TQGArray &TQGArray::duplicate( const char *d, uint len ) return *this; } data = NEW(char,len); - Q_CHECK_PTR( data ); + TQ_CHECK_PTR( data ); memcpy( data, d, len ); } if ( shd->count > 1 ) { // detach shd->count--; shd = newData(); - Q_CHECK_PTR( shd ); + TQ_CHECK_PTR( shd ); } else { // just a single reference if ( shd->data ) DELETE(shd->data); diff --git a/src/tools/qgcache.cpp b/src/tools/qgcache.cpp index 190e3c9e9..a67112f9c 100644 --- a/src/tools/qgcache.cpp +++ b/src/tools/qgcache.cpp @@ -256,11 +256,11 @@ TQGCache::TQGCache( int maxCost, uint size, KeyType kt, bool caseSensitive, { keytype = kt; lruList = new TQCList; - Q_CHECK_PTR( lruList ); + TQ_CHECK_PTR( lruList ); lruList->setAutoDelete( TRUE ); copyk = ((keytype == AsciiKey) && copyKeys); dict = new TQCDict( size, kt, caseSensitive, FALSE ); - Q_CHECK_PTR( dict ); + TQ_CHECK_PTR( dict ); mCost = maxCost; tCost = 0; #if defined(QT_DEBUG) @@ -389,7 +389,7 @@ bool TQGCache::insert_string( const TQString &key, TQPtrCollection::Item data, priority = 32677; TQCacheItem *ci = new TQCacheItem( new TQString(key), newItem(data), cost, (short)priority ); - Q_CHECK_PTR( ci ); + TQ_CHECK_PTR( ci ); lruList->insert( 0, ci ); dict->insert_string( key, ci ); tCost += cost; @@ -420,7 +420,7 @@ bool TQGCache::insert_other( const char *key, TQPtrCollection::Item data, priority = 32677; TQCacheItem *ci = new TQCacheItem( (void*)key, newItem(data), cost, (short)priority ); - Q_CHECK_PTR( ci ); + TQ_CHECK_PTR( ci ); lruList->insert( 0, ci ); if ( keytype == AsciiKey ) dict->insert_ascii( key, ci ); @@ -641,7 +641,7 @@ void TQGCache::statistics() const #if defined(QT_DEBUG) TQString line; line.fill( '*', 80 ); - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); qDebug( "CACHE STATISTICS:" ); qDebug( "cache contains %d item%s, with a total cost of %d", count(), count() != 1 ? "s" : "", tCost ); @@ -662,7 +662,7 @@ void TQGCache::statistics() const lruList->dumps != 1 ? "have" : "has", lruList->dumpCosts ); qDebug( "Statistics from internal dictionary class:" ); dict->statistics(); - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); #endif } diff --git a/src/tools/qgdict.cpp b/src/tools/qgdict.cpp index 99c0cbc29..ac54098fc 100644 --- a/src/tools/qgdict.cpp +++ b/src/tools/qgdict.cpp @@ -210,7 +210,7 @@ void TQGDict::init( uint len, KeyType kt, bool caseSensitive, bool copyKeys ) vlen = len ? len : 17; vec = new TQBaseBucket *[ vlen ]; - Q_CHECK_PTR( vec ); + TQ_CHECK_PTR( vec ); memset( (char*)vec, 0, vlen*sizeof(TQBaseBucket*) ); numItems = 0; iterators = 0; @@ -358,7 +358,7 @@ TQPtrCollection::Item TQGDict::look_string( const TQString &key, TQPtrCollection } // op_insert or op_replace n = new TQStringBucket(key,newItem(d),vec[index]); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); #if defined(QT_CHECK_NULL) if ( n->getData() == 0 ) qWarning( "TQDict: Cannot insert null item" ); @@ -394,7 +394,7 @@ TQPtrCollection::Item TQGDict::look_ascii( const char *key, TQPtrCollection::Ite } // op_insert or op_replace n = new TQAsciiBucket(copyk ? qstrdup(key) : key,newItem(d),vec[index]); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); #if defined(QT_CHECK_NULL) if ( n->getData() == 0 ) qWarning( "TQAsciiDict: Cannot insert null item" ); @@ -422,7 +422,7 @@ TQPtrCollection::Item TQGDict::look_int( long key, TQPtrCollection::Item d, int } // op_insert or op_replace n = new TQIntBucket(key,newItem(d),vec[index]); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); #if defined(QT_CHECK_NULL) if ( n->getData() == 0 ) qWarning( "TQIntDict: Cannot insert null item" ); @@ -450,7 +450,7 @@ TQPtrCollection::Item TQGDict::look_ptr( void *key, TQPtrCollection::Item d, int } // op_insert or op_replace n = new TQPtrBucket(key,newItem(d),vec[index]); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); #if defined(QT_CHECK_NULL) if ( n->getData() == 0 ) qWarning( "TQPtrDict: Cannot insert null item" ); @@ -474,7 +474,7 @@ void TQGDict::resize( uint newsize ) bool old_copyk = copyk; vec = new TQBaseBucket *[vlen = newsize]; - Q_CHECK_PTR( vec ); + TQ_CHECK_PTR( vec ); memset( (char*)vec, 0, vlen*sizeof(TQBaseBucket*) ); numItems = 0; copyk = FALSE; @@ -846,11 +846,11 @@ void TQGDict::statistics() const TQString line; line.fill( '-', 60 ); double real, ideal; - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); qDebug( "DICTIONARY STATISTICS:" ); if ( count() == 0 ) { qDebug( "Empty!" ); - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); return; } real = 0.0; @@ -871,7 +871,7 @@ void TQGDict::statistics() const while ( b-- ) *pbuf++ = '*'; *pbuf = '\0'; - qDebug( buf ); + qDebug( "%s", buf ); i++; } qDebug( "Array size = %d", size() ); @@ -879,7 +879,7 @@ void TQGDict::statistics() const qDebug( "Real dist = %g", real ); qDebug( "Rand dist = %g", ideal ); qDebug( "Real/Rand = %g", real/ideal ); - qDebug( line.ascii() ); + qDebug( "%s", line.ascii() ); #endif // QT_DEBUG } @@ -1018,7 +1018,7 @@ TQGDictIterator::TQGDictIterator( const TQGDict &d ) toFirst(); // set to first noe if ( !dict->iterators ) { dict->iterators = new TQGDItList; // create iterator list - Q_CHECK_PTR( dict->iterators ); + TQ_CHECK_PTR( dict->iterators ); } dict->iterators->append( this ); // attach iterator to dict } diff --git a/src/tools/qglist.cpp b/src/tools/qglist.cpp index c9f14102b..b67b11540 100644 --- a/src/tools/qglist.cpp +++ b/src/tools/qglist.cpp @@ -386,7 +386,7 @@ void TQGList::inSort( TQPtrCollection::Item d ) void TQGList::prepend( TQPtrCollection::Item d ) { register TQLNode *n = new TQLNode( newItem(d) ); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); n->prev = 0; if ( (n->next = firstNode) ) // list is not empty firstNode->prev = n; @@ -405,7 +405,7 @@ void TQGList::prepend( TQPtrCollection::Item d ) void TQGList::append( TQPtrCollection::Item d ) { register TQLNode *n = new TQLNode( newItem(d) ); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); n->next = 0; if ( (n->prev = lastNode) ) // list is not empty lastNode->next = n; @@ -435,7 +435,7 @@ bool TQGList::insertAt( uint index, TQPtrCollection::Item d ) return FALSE; TQLNode *prevNode = nextNode->prev; register TQLNode *n = new TQLNode( newItem(d) ); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); nextNode->prev = n; prevNode->next = n; n->prev = prevNode; // link new node into list @@ -1025,11 +1025,11 @@ TQDataStream &TQGList::read( TQDataStream &s ) while ( num-- ) { // read all items Item d; read( s, d ); - Q_CHECK_PTR( d ); + TQ_CHECK_PTR( d ); if ( !d ) // no memory break; TQLNode *n = new TQLNode( d ); - Q_CHECK_PTR( n ); + TQ_CHECK_PTR( n ); if ( !n ) // no memory break; n->next = 0; @@ -1102,7 +1102,7 @@ TQGListIterator::TQGListIterator( const TQGList &l ) curNode = list->firstNode; // set to first node if ( !list->iterators ) { list->iterators = new TQGListIteratorList; // create iterator list - Q_CHECK_PTR( list->iterators ); + TQ_CHECK_PTR( list->iterators ); } list->iterators->add( this ); // attach iterator to list } diff --git a/src/tools/qglobal.cpp b/src/tools/qglobal.cpp index 2336fb0b1..baf6e6f69 100644 --- a/src/tools/qglobal.cpp +++ b/src/tools/qglobal.cpp @@ -58,14 +58,14 @@ Returns the TQt version number as a string, for example, "2.3.0" or "3.0.5". - The \c QT_VERSION define has the numeric value in the form: + The \c TQT_VERSION define has the numeric value in the form: 0xmmiibb (m = major, i = minor, b = bugfix). For example, TQt - 3.0.5's \c QT_VERSION is 0x030005. + 3.0.5's \c TQT_VERSION is 0x030005. */ const char *qVersion() { - return QT_VERSION_STR; + return TQT_VERSION_STR; } bool qSharedBuild() @@ -591,10 +591,10 @@ void qFatal( const char *msg, ... ) abort(); // trap; generates core dump #elif defined(Q_OS_TEMP) && defined(QT_DEBUG) TQString fstr; - fstr.sprintf( "%s:%s %s %s\n", __FILE__, __LINE__, QT_VERSION_STR, buf ); + fstr.sprintf( "%s:%s %s %s\n", __FILE__, __LINE__, TQT_VERSION_STR, buf ); OutputDebugString( fstr.ucs2() ); #elif defined(_CRT_ERROR) && defined(_DEBUG) - _CrtDbgReport( _CRT_ERROR, __FILE__, __LINE__, QT_VERSION_STR, buf ); + _CrtDbgReport( _CRT_ERROR, __FILE__, __LINE__, TQT_VERSION_STR, buf ); #else exit( 1 ); // goodbye cruel world #endif @@ -625,10 +625,10 @@ void fatal( const char *msg, ... ) abort(); // trap; generates core dump #elif defined(Q_OS_TEMP) && defined(QT_DEBUG) TQString fstr; - fstr.sprintf( "%s:%s %s %s\n", __FILE__, __LINE__, QT_VERSION_STR, buf ); + fstr.sprintf( "%s:%s %s %s\n", __FILE__, __LINE__, TQT_VERSION_STR, buf ); OutputDebugString( fstr.ucs2() ); #elif defined(_CRT_ERROR) && defined(_DEBUG) - _CrtDbgReport( _CRT_ERROR, __FILE__, __LINE__, QT_VERSION_STR, buf ); + _CrtDbgReport( _CRT_ERROR, __FILE__, __LINE__, TQT_VERSION_STR, buf ); #else exit( 1 ); // goodbye cruel world #endif @@ -729,7 +729,7 @@ void qSystemWarning( const char* msg, int code ) /*! - \fn void Q_CHECK_PTR( void *p ) + \fn void TQ_CHECK_PTR( void *p ) \relates TQApplication @@ -742,10 +742,10 @@ void qSystemWarning( const char* msg, int code ) \code int *a; - Q_CHECK_PTR( a = new int[80] ); // WRONG! + TQ_CHECK_PTR( a = new int[80] ); // WRONG! a = new (nothrow) int[80]; // Right - Q_CHECK_PTR( a ); + TQ_CHECK_PTR( a ); \endcode \sa qWarning(), \link debug.html Debugging\endlink @@ -753,11 +753,11 @@ void qSystemWarning( const char* msg, int code ) // -// The Q_CHECK_PTR macro calls this function to check if an allocation went ok. +// The TQ_CHECK_PTR macro calls this function to check if an allocation went ok. // -#if (QT_VERSION-0 >= 0x040000) +#if (TQT_VERSION-0 >= 0x040000) #if defined(Q_CC_GNU) -#warning "Change Q_CHECK_PTR to '{if ((p)==0) qt_check_pointer(__FILE__,__LINE__);}'" +#warning "Change TQ_CHECK_PTR to '{if ((p)==0) qt_check_pointer(__FILE__,__LINE__);}'" #warning "No need for qt_check_pointer() to return a value - make it void!" #endif #endif diff --git a/src/tools/qgpluginmanager.cpp b/src/tools/qgpluginmanager.cpp index 5afd8bc41..5c428f924 100644 --- a/src/tools/qgpluginmanager.cpp +++ b/src/tools/qgpluginmanager.cpp @@ -398,7 +398,7 @@ const TQLibrary* TQGPluginManager::library( const TQString& feature ) const same.append( new TQComLibrary( *bit ) ); TQComLibrary* bestMatch = 0; for ( TQComLibrary* candidate = same.first(); candidate; candidate = same.next() ) - if ( candidate->qtVersion() && candidate->qtVersion() <= QT_VERSION + if ( candidate->qtVersion() && candidate->qtVersion() <= TQT_VERSION && ( !bestMatch || candidate->qtVersion() > bestMatch->qtVersion() ) ) bestMatch = candidate; if ( bestMatch ) { @@ -435,7 +435,7 @@ TQStringList TQGPluginManager::featureList() const if ( (*it).isEmpty() || libDict[*it] ) continue; TQComLibrary* library = new TQComLibrary( *it ); - if ( library->qtVersion() == QT_VERSION ) { + if ( library->qtVersion() == TQT_VERSION ) { that->addLibrary( library ); phase2Deny << TQFileInfo( *it ).baseName(); } else { @@ -491,11 +491,11 @@ bool TQGPluginManager::addLibrary( TQLibrary* lib ) TQComLibrary* first = (TQComLibrary*)old; TQComLibrary* second = (TQComLibrary*)plugin; bool takeFirst = TRUE; - if ( first->qtVersion() != QT_VERSION ) { - if ( second->qtVersion() == QT_VERSION ) + if ( first->qtVersion() != TQT_VERSION ) { + if ( second->qtVersion() == TQT_VERSION ) takeFirst = FALSE; - else if ( second->qtVersion() < QT_VERSION && - first->qtVersion() > QT_VERSION ) + else if ( second->qtVersion() < TQT_VERSION && + first->qtVersion() > TQT_VERSION ) takeFirst = FALSE; } if ( !takeFirst ) { diff --git a/src/tools/qgvector.cpp b/src/tools/qgvector.cpp index b53e41721..90bb88e07 100644 --- a/src/tools/qgvector.cpp +++ b/src/tools/qgvector.cpp @@ -176,7 +176,7 @@ TQGVector::TQGVector( uint size ) // create vectors with nullptrs return; } vec = NEW(Item,len); - Q_CHECK_PTR( vec ); + TQ_CHECK_PTR( vec ); memset( (void*)vec, 0, len*sizeof(Item) ); // fill with nulls } @@ -190,11 +190,11 @@ TQGVector::TQGVector( const TQGVector &a ) // make copy of other vector return; } vec = NEW( Item, len ); - Q_CHECK_PTR( vec ); + TQ_CHECK_PTR( vec ); for ( uint i = 0; i < len; i++ ) { if ( a.vec[i] ) { vec[i] = newItem( a.vec[i] ); - Q_CHECK_PTR( vec[i] ); + TQ_CHECK_PTR( vec[i] ); } else { vec[i] = 0; } @@ -219,11 +219,11 @@ TQGVector& TQGVector::operator=( const TQGVector &v ) return *this; } vec = NEW( Item, len ); - Q_CHECK_PTR( vec ); + TQ_CHECK_PTR( vec ); for ( uint i = 0; i < len; i++ ) { if ( v.vec[i] ) { vec[i] = newItem( v.vec[i] ); - Q_CHECK_PTR( vec[i] ); + TQ_CHECK_PTR( vec[i] ); } else { vec[i] = 0; } @@ -246,7 +246,7 @@ bool TQGVector::insert( uint index, Item d ) // insert item at index } if ( d ) { vec[index] = newItem( d ); - Q_CHECK_PTR( vec[index] ); + TQ_CHECK_PTR( vec[index] ); numItems++; return vec[index] != 0; } else { @@ -560,7 +560,7 @@ TQDataStream &TQGVector::read( TQDataStream &s ) // read vector from stream for (uint i=0; i<num; i++) { // read all items Item d; read( s, d ); - Q_CHECK_PTR( d ); + TQ_CHECK_PTR( d ); if ( !d ) // no memory break; vec[i] = d; diff --git a/src/tools/qlocale.cpp b/src/tools/qlocale.cpp index dd1769216..ce2e1647b 100644 --- a/src/tools/qlocale.cpp +++ b/src/tools/qlocale.cpp @@ -147,13 +147,13 @@ static inline double negNan() // Sizes as defined by the ISO C99 standard - fallback #ifndef LLONG_MAX -# define LLONG_MAX Q_INT64_C(9223372036854775807) +# define LLONG_MAX TQ_INT64_C(9223372036854775807) #endif #ifndef LLONG_MIN -# define LLONG_MIN (-LLONG_MAX - Q_INT64_C(1)) +# define LLONG_MIN (-LLONG_MAX - TQ_INT64_C(1)) #endif #ifndef ULLONG_MAX -# define ULLONG_MAX Q_UINT64_C(0xffffffffffffffff) +# define ULLONG_MAX TQ_UINT64_C(0xffffffffffffffff) #endif #ifndef QT_QLOCALE_USES_FCVT diff --git a/src/tools/qregexp.cpp b/src/tools/qregexp.cpp index 81e160136..5338e6dbb 100644 --- a/src/tools/qregexp.cpp +++ b/src/tools/qregexp.cpp @@ -1443,7 +1443,7 @@ int TQRegExpEngine::anchorConcatenation( int a, int b ) if ( ((a | b) & Anchor_Alternation) == 0 ) return a | b; if ( (b & Anchor_Alternation) != 0 ) - qSwap( a, b ); + tqSwap( a, b ); int aprime = anchorConcatenation( aa[a ^ Anchor_Alternation].a, b ); int bprime = anchorConcatenation( aa[a ^ Anchor_Alternation].b, b ); @@ -2171,10 +2171,10 @@ bool TQRegExpEngine::matchHere() ) stop = TRUE; - qSwap( mmCurStack, mmNextStack ); + tqSwap( mmCurStack, mmNextStack ); #ifndef QT_NO_REGEXP_CAPTURE - qSwap( mmCurCapBegin, mmNextCapBegin ); - qSwap( mmCurCapEnd, mmNextCapEnd ); + tqSwap( mmCurCapBegin, mmNextCapBegin ); + tqSwap( mmCurCapEnd, mmNextCapEnd ); #endif ncur = nnext; nnext = 0; @@ -2244,7 +2244,7 @@ void TQRegExpEngine::CharClass::addCategories( int cats ) void TQRegExpEngine::CharClass::addRange( ushort from, ushort to ) { if ( from > to ) - qSwap( from, to ); + tqSwap( from, to ); int m = r.size(); r.resize( m + 1 ); r[m].from = from; @@ -2901,7 +2901,7 @@ int TQRegExpEngine::getToken() yyMaxRep = getRep( InftyRep ); } if ( yyMaxRep < yyMinRep ) - qSwap( yyMinRep, yyMaxRep ); + tqSwap( yyMinRep, yyMaxRep ); if ( yyCh != '}' ) error( RXERR_REPETITION ); yyCh = getChar(); diff --git a/src/tools/qsettings.cpp b/src/tools/qsettings.cpp index 9d582d7e1..640d5643c 100644 --- a/src/tools/qsettings.cpp +++ b/src/tools/qsettings.cpp @@ -882,7 +882,7 @@ void TQSettings::removeSearchPath( System s, const TQString &path) TQSettings::TQSettings() { d = new TQSettingsPrivate( Native ); - Q_CHECK_PTR(d); + TQ_CHECK_PTR(d); #if !defined(TQWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC)) d->sysd = 0; @@ -902,7 +902,7 @@ TQSettings::TQSettings() TQSettings::TQSettings( Format format ) { d = new TQSettingsPrivate( format ); - Q_CHECK_PTR(d); + TQ_CHECK_PTR(d); #if !defined(TQWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC)) d->sysd = 0; diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index f4946a01a..756f12477 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -70,13 +70,13 @@ #endif #ifndef LLONG_MAX -#define LLONG_MAX Q_INT64_C(9223372036854775807) +#define LLONG_MAX TQ_INT64_C(9223372036854775807) #endif #ifndef LLONG_MIN -#define LLONG_MIN (-LLONG_MAX - Q_INT64_C(1)) +#define LLONG_MIN (-LLONG_MAX - TQ_INT64_C(1)) #endif #ifndef ULLONG_MAX -#define ULLONG_MAX Q_UINT64_C(18446744073709551615) +#define ULLONG_MAX TQ_UINT64_C(18446744073709551615) #endif static int ucstrcmp( const TQString &as, const TQString &bs ) @@ -1855,7 +1855,7 @@ static ArgEscapeData findArgEscapes(const TQString &s) d.locale_occurrences = 0; } -#if QT_VERSION < 0x040000 +#if TQT_VERSION < 0x040000 // ### remove preprocessor in TQt 4.0 /* Since in TQt < 4.0 only the first instance is replaced, escape_len should hold the length of only the first escape diff --git a/src/tools/qtextstream.cpp b/src/tools/qtextstream.cpp index 9c2d0dfb8..e3633600f 100644 --- a/src/tools/qtextstream.cpp +++ b/src/tools/qtextstream.cpp @@ -399,7 +399,7 @@ bool TQStringBuffer::at( Offset pos ) Q_LONG TQStringBuffer::readBlock( char *p, Q_ULONG len ) { #if defined(QT_CHECK_STATE) - Q_CHECK_PTR( p ); + TQ_CHECK_PTR( p ); if ( !isOpen() ) { qWarning( "TQStringBuffer::readBlock: Buffer not open" ); return -1; @@ -1943,7 +1943,7 @@ TQTextStream &TQTextStream::output_int( int format, ulong n, bool neg ) } if ( fwidth ) { // adjustment required if ( !(flags() & left) ) { // but NOT left adjustment - len = qstrlen(p); + len = tqstrlen(p); int padlen = fwidth - len; if ( padlen <= 0 ) { // no padding required writeBlock( p, len ); @@ -1959,7 +1959,7 @@ TQTextStream &TQTextStream::output_int( int format, ulong n, bool neg ) fwidth = 0; // reset field width } else - writeBlock( p, qstrlen(p) ); + writeBlock( p, tqstrlen(p) ); return *this; } @@ -2111,7 +2111,7 @@ TQTextStream &TQTextStream::operator<<( const char* s ) { CHECK_STREAM_PRECOND char padbuf[48]; - uint len = qstrlen( s ); // don't write null terminator + uint len = tqstrlen( s ); // don't write null terminator if ( fwidth ) { // field width set int padlen = fwidth - len; fwidth = 0; // reset width @@ -2119,7 +2119,7 @@ TQTextStream &TQTextStream::operator<<( const char* s ) char *ppad; if ( padlen > 46 ) { // create extra big fill buffer ppad = new char[padlen]; - Q_CHECK_PTR( ppad ); + TQ_CHECK_PTR( ppad ); } else { ppad = padbuf; } |