summaryrefslogtreecommitdiffstats
path: root/src/tools/qstring.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-09-16 22:30:57 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-09-16 22:30:57 +0900
commit02964eb384e1b5a73a198d04262497607d81e38f (patch)
tree56b694b9d973c7906f9960a2029068dc44791c2b /src/tools/qstring.cpp
parent1fb89fa15488ff396623fc275242b8ed149f4c1e (diff)
downloadtqt3-02964eb384e1b5a73a198d04262497607d81e38f.tar.gz
tqt3-02964eb384e1b5a73a198d04262497607d81e38f.zip
Conversion QT_THREAD_SUPPORT -> TQT_THREAD_SUPPORT. This is part of the
qt->tqt conversion and is required to align to corresponding patch for common/admin module. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/tools/qstring.cpp')
-rw-r--r--src/tools/qstring.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp
index 10f0a6d26..755d26776 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -93,9 +93,9 @@
#define ULLONG_MAX TQ_UINT64_C(18446744073709551615)
#endif
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#include "ntqmutex.h"
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
extern TQMutex *tqt_sharedStringMutex;
@@ -1053,9 +1053,9 @@ TQStringData::TQStringData() : TQShared(),
maxl(0),
islatin1(FALSE),
security_unpaged(FALSE) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
ref();
}
@@ -1067,9 +1067,9 @@ TQStringData::TQStringData(TQChar *u, uint l, uint m) : TQShared(),
maxl(m),
islatin1(FALSE),
security_unpaged(FALSE) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
TQStringData::~TQStringData() {
@@ -1084,12 +1084,12 @@ TQStringData::~TQStringData() {
if ( ascii ) {
delete[] ascii;
}
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if ( mutex ) {
delete mutex;
mutex = NULL;
}
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
void TQStringData::setDirty() {
@@ -1457,14 +1457,14 @@ QT_STATIC_CONST_IMPL TQChar TQChar::nbsp((ushort)0x00a0);
TQStringData* TQString::makeSharedNull()
{
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if (TQString::shared_null) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@@ -1474,9 +1474,9 @@ TQStringData* TQString::makeSharedNull()
that->d = TQString::shared_null;
#endif
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@@ -1517,13 +1517,13 @@ TQString::TQString( const TQString &s ) :
d(s.d)
{
if ( d && (d != shared_null) ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->ref();
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
}
@@ -1676,20 +1676,20 @@ TQString::~TQString()
return;
}
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->deleteSelf();
d = NULL;
}
else {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
}
@@ -1711,22 +1711,22 @@ void TQString::real_detach()
void TQString::deref()
{
if ( d && (d != shared_null) ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d != shared_null ) {
delete d;
}
d = 0;
}
else {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
}
}
@@ -1769,13 +1769,13 @@ void TQStringData::deleteSelf()
TQString &TQString::operator=( const TQString &s )
{
if ( s.d && (s.d != shared_null) ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
s.d->ref();
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
deref();
d = s.d;
@@ -1883,9 +1883,9 @@ void TQString::truncate( uint newLen )
*/
void TQString::setLength( uint newLen )
{
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ||
( newLen * 4 < d->maxl && d->maxl > 4 ) ) {
@@ -1896,24 +1896,24 @@ void TQString::setLength( uint newLen )
uint len = TQMIN( d->len, newLen );
memcpy( nd, d->unicode, sizeof(TQChar) * len );
bool unpaged = d->security_unpaged;
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, newLen, newMax );
setSecurityUnPaged(unpaged);
}
else {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
}
else {
d->len = newLen;
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@@ -1999,21 +1999,21 @@ void TQString::squeeze()
*/
void TQString::grow( uint newLen )
{
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
setLength( newLen );
}
else {
d->len = newLen;
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@@ -6423,19 +6423,19 @@ TQString TQString::fromUcs2( const unsigned short *str )
*/
TQChar& TQString::ref(uint i) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( (d->count != 1) || (i >= d->len) ) {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
subat( i );
}
else {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
d->setDirty();
return d->unicode[i];
@@ -6523,9 +6523,9 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
}
}
else {
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) {
// detach, grown or shrink
uint newMax = computeNewMax( len );
@@ -6533,17 +6533,17 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
if ( unicode ) {
memcpy( nd, unicode, sizeof(TQChar)*len );
}
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, len, newMax );
}
else {
d->len = len;
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
if ( unicode ) {
memcpy( d->unicode, unicode, sizeof(TQChar)*len );
@@ -7254,9 +7254,9 @@ TQConstString::TQConstString( const TQChar* unicode, uint length ) :
*/
TQConstString::~TQConstString()
{
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count > 1 ) {
TQChar* cp = QT_ALLOC_QCHAR_VEC( d->len );
@@ -7268,9 +7268,9 @@ TQConstString::~TQConstString()
}
// The original d->unicode is now unlinked.
-#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
/*!