summaryrefslogtreecommitdiff
path: root/qmake/tools/qgdict.cpp
Unidiff
Diffstat (limited to 'qmake/tools/qgdict.cpp') (more/less context) (show whitespace changes)
-rw-r--r--qmake/tools/qgdict.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qmake/tools/qgdict.cpp b/qmake/tools/qgdict.cpp
index c431ff8..3d49fc7 100644
--- a/qmake/tools/qgdict.cpp
+++ b/qmake/tools/qgdict.cpp
@@ -195,25 +195,28 @@ QDataStream& QGDict::write( QDataStream &s, QPtrCollection::Item ) const
195 \c IntKey or \c PtrKey. The case-sensitivity of lookups is set with 195 \c IntKey or \c PtrKey. The case-sensitivity of lookups is set with
196 \a caseSensitive. Keys are copied if \a copyKeys is TRUE. 196 \a caseSensitive. Keys are copied if \a copyKeys is TRUE.
197*/ 197*/
198 198
199QGDict::QGDict( uint len, KeyType kt, bool caseSensitive, bool copyKeys ) 199QGDict::QGDict( uint len, KeyType kt, bool caseSensitive, bool copyKeys )
200{ 200{
201 init( len, kt, caseSensitive, copyKeys ); 201 init( len, kt, caseSensitive, copyKeys );
202} 202}
203 203
204 204
205void QGDict::init( uint len, KeyType kt, bool caseSensitive, bool copyKeys ) 205void QGDict::init( uint len, KeyType kt, bool caseSensitive, bool copyKeys )
206{ 206{
207 vec = new QBaseBucket *[vlen = len]; // allocate hash table 207 vlen = len;
208 if ( vlen == 0 )
209 vlen = 17;
210 vec = new QBaseBucket *[vlen];
208 Q_CHECK_PTR( vec ); 211 Q_CHECK_PTR( vec );
209 memset( (char*)vec, 0, vlen*sizeof(QBaseBucket*) ); 212 memset( (char*)vec, 0, vlen*sizeof(QBaseBucket*) );
210 numItems = 0; 213 numItems = 0;
211 iterators = 0; 214 iterators = 0;
212 // The caseSensitive and copyKey options don't make sense for 215 // The caseSensitive and copyKey options don't make sense for
213 // all dict types. 216 // all dict types.
214 switch ( (keytype = (uint)kt) ) { 217 switch ( (keytype = (uint)kt) ) {
215 case StringKey: 218 case StringKey:
216 cases = caseSensitive; 219 cases = caseSensitive;
217 copyk = FALSE; 220 copyk = FALSE;
218 break; 221 break;
219 case AsciiKey: 222 case AsciiKey: