diff options
author | Timothy Pearson <[email protected]> | 2012-06-17 17:28:28 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-06-17 17:28:28 -0500 |
commit | 6dec101d43dcbd4195c47d54bd388db1a8d7230e (patch) | |
tree | 7c336cbed3a93807a34cd4df39b2f92a7d48a141 /src/kernel/qtranslator.cpp | |
parent | f27c2533f735d53c6b555f387c6390c0690cc246 (diff) | |
download | tqt3-6dec101d43dcbd4195c47d54bd388db1a8d7230e.tar.gz tqt3-6dec101d43dcbd4195c47d54bd388db1a8d7230e.zip |
Automated update from Qt3
Diffstat (limited to 'src/kernel/qtranslator.cpp')
-rw-r--r-- | src/kernel/qtranslator.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/kernel/qtranslator.cpp b/src/kernel/qtranslator.cpp index 6a66947b3..5f3eec77e 100644 --- a/src/kernel/qtranslator.cpp +++ b/src/kernel/qtranslator.cpp @@ -563,11 +563,11 @@ bool TQTranslator::do_load( const uchar *data, int len ) s.device()->at( MagicLength ); - Q_UINT8 tag = 0; - Q_UINT32 blockLen = 0; + TQ_UINT8 tag = 0; + TQ_UINT32 blockLen = 0; s >> tag >> blockLen; while ( tag && blockLen ) { - if ( (Q_UINT32) s.device()->at() + blockLen > (Q_UINT32) len ) { + if ( (TQ_UINT32) s.device()->at() + blockLen > (TQ_UINT32) len ) { ok = FALSE; break; } @@ -622,23 +622,23 @@ bool TQTranslator::save( const TQString & filename, SaveMode mode ) TQDataStream s( &f ); s.writeRawBytes( (const char *)magic, MagicLength ); - Q_UINT8 tag; + TQ_UINT8 tag; if ( d->offsetArray != 0 ) { - tag = (Q_UINT8) TQTranslatorPrivate::Hashes; - Q_UINT32 oas = (Q_UINT32) d->offsetArray->size(); + tag = (TQ_UINT8) TQTranslatorPrivate::Hashes; + TQ_UINT32 oas = (TQ_UINT32) d->offsetArray->size(); s << tag << oas; s.writeRawBytes( d->offsetArray->data(), oas ); } if ( d->messageArray != 0 ) { - tag = (Q_UINT8) TQTranslatorPrivate::Messages; - Q_UINT32 mas = (Q_UINT32) d->messageArray->size(); + tag = (TQ_UINT8) TQTranslatorPrivate::Messages; + TQ_UINT32 mas = (TQ_UINT32) d->messageArray->size(); s << tag << mas; s.writeRawBytes( d->messageArray->data(), mas ); } if ( d->contextArray != 0 ) { - tag = (Q_UINT8) TQTranslatorPrivate::Contexts; - Q_UINT32 cas = (Q_UINT32) d->contextArray->size(); + tag = (TQ_UINT8) TQTranslatorPrivate::Contexts; + TQ_UINT32 cas = (TQ_UINT32) d->contextArray->size(); s << tag << cas; s.writeRawBytes( d->contextArray->data(), cas ); } @@ -760,7 +760,7 @@ void TQTranslator::squeeze( SaveMode mode ) while ( offset != offsets.end() ) { TQTranslatorPrivate::Offset k = offset.key(); ++offset; - ds << (Q_UINT32)k.h << (Q_UINT32)k.o; + ds << (TQ_UINT32)k.h << (TQ_UINT32)k.o; } if ( mode == Stripped ) { @@ -770,7 +770,7 @@ void TQTranslator::squeeze( SaveMode mode ) for ( it = messages->begin(); it != messages->end(); ++it ) contextSet.replace( it.key().context(), &baudelaire ); - Q_UINT16 hTableSize; + TQ_UINT16 hTableSize; if ( contextSet.count() < 200 ) hTableSize = ( contextSet.count() < 60 ) ? 151 : 503; else if ( contextSet.count() < 2500 ) @@ -791,14 +791,14 @@ void TQTranslator::squeeze( SaveMode mode ) table to provide fast lookup. The context array has the following format: - Q_UINT16 hTableSize; - Q_UINT16 hTable[hTableSize]; - Q_UINT8 contextPool[...]; + TQ_UINT16 hTableSize; + TQ_UINT16 hTable[hTableSize]; + TQ_UINT8 contextPool[...]; The context pool stores the contexts as Pascal strings: - Q_UINT8 len; - Q_UINT8 data[len]; + TQ_UINT8 len; + TQ_UINT8 data[len]; Let's consider the look-up of context "FunnyDialog". A hash value between 0 and hTableSize - 1 is computed, say h. @@ -811,12 +811,12 @@ void TQTranslator::squeeze( SaveMode mode ) d->contextArray = new TQByteArray; d->contextArray->resize( 2 + (hTableSize << 1) ); TQDataStream t( *d->contextArray, IO_WriteOnly ); - Q_UINT16 *hTable = new Q_UINT16[hTableSize]; - memset( hTable, 0, hTableSize * sizeof(Q_UINT16) ); + TQ_UINT16 *hTable = new TQ_UINT16[hTableSize]; + memset( hTable, 0, hTableSize * sizeof(TQ_UINT16) ); t << hTableSize; t.device()->at( 2 + (hTableSize << 1) ); - t << (Q_UINT16) 0; // the entry at offset 0 cannot be used + t << (TQ_UINT16) 0; // the entry at offset 0 cannot be used uint upto = 2; for ( int i = 0; i < hTableSize; i++ ) { @@ -824,17 +824,17 @@ void TQTranslator::squeeze( SaveMode mode ) if ( con == 0 ) { hTable[i] = 0; } else { - hTable[i] = (Q_UINT16) ( upto >> 1 ); + hTable[i] = (TQ_UINT16) ( upto >> 1 ); do { uint len = (uint) tqstrlen( con ); len = TQMIN( len, 255 ); - t << (Q_UINT8) len; + t << (TQ_UINT8) len; t.writeRawBytes( con, len ); upto += 1 + len; hDict.remove( i ); } while ( (con = hDict.find(i)) != 0 ); do { - t << (Q_UINT8) 0; // empty string (at least one) + t << (TQ_UINT8) 0; // empty string (at least one) upto++; } while ( (upto & 0x1) != 0 ); // offsets have to be even } @@ -1000,18 +1000,18 @@ TQTranslatorMessage TQTranslator::findMessage( const char* context, installed, this step is necessary. */ if ( d->contextArray ) { - Q_UINT16 hTableSize = 0; + TQ_UINT16 hTableSize = 0; TQDataStream t( *d->contextArray, IO_ReadOnly ); t >> hTableSize; uint g = elfHash( context ) % hTableSize; t.device()->at( 2 + (g << 1) ); - Q_UINT16 off; + TQ_UINT16 off; t >> off; if ( off == 0 ) return TQTranslatorMessage(); t.device()->at( 2 + (hTableSize << 1) + (off << 1) ); - Q_UINT8 len; + TQ_UINT8 len; char con[256]; for ( ;; ) { t >> len; @@ -1024,7 +1024,7 @@ TQTranslatorMessage TQTranslator::findMessage( const char* context, } } - size_t numItems = d->offsetArray->size() / ( 2 * sizeof(Q_UINT32) ); + size_t numItems = d->offsetArray->size() / ( 2 * sizeof(TQ_UINT32) ); if ( !numItems ) return TQTranslatorMessage(); @@ -1032,10 +1032,10 @@ TQTranslatorMessage TQTranslator::findMessage( const char* context, tqSysInfo( &systemWordSize, &systemBigEndian ); for ( ;; ) { - Q_UINT32 h = elfHash( TQCString(sourceText) + comment ); + TQ_UINT32 h = elfHash( TQCString(sourceText) + comment ); char *r = (char *) bsearch( &h, d->offsetArray->data(), numItems, - 2 * sizeof(Q_UINT32), + 2 * sizeof(TQ_UINT32), systemBigEndian ? cmp_uint32_big : cmp_uint32_little ); if ( r != 0 ) { @@ -1047,7 +1047,7 @@ TQTranslatorMessage TQTranslator::findMessage( const char* context, TQDataStream s( *d->offsetArray, IO_ReadOnly ); s.device()->at( r - d->offsetArray->data() ); - Q_UINT32 rh, ro; + TQ_UINT32 rh, ro; s >> rh >> ro; TQDataStream ms( *d->messageArray, IO_ReadOnly ); @@ -1191,7 +1191,7 @@ TQTranslatorMessage::TQTranslatorMessage( TQDataStream & stream ) { TQString str16; char tag; - Q_UINT8 obs1; + TQ_UINT8 obs1; for ( ;; ) { tag = 0; |