summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
Diffstat (limited to 'qtools')
-rw-r--r--qtools/qcstring.cpp32
-rw-r--r--qtools/qdatastream.cpp28
-rw-r--r--qtools/qgarray.cpp24
-rw-r--r--qtools/qgcache.cpp2
-rw-r--r--qtools/qgdict.cpp14
-rw-r--r--qtools/qglist.cpp24
-rw-r--r--qtools/qgvector.cpp4
-rw-r--r--qtools/qstring.cpp10
-rw-r--r--qtools/qtextstream.cpp4
9 files changed, 71 insertions, 71 deletions
diff --git a/qtools/qcstring.cpp b/qtools/qcstring.cpp
index 35b9bb8..77461b2 100644
--- a/qtools/qcstring.cpp
+++ b/qtools/qcstring.cpp
@@ -41,7 +41,7 @@ QCString &QCString::sprintf( const char *format, ... )
int QCString::find( char c, int index, bool cs ) const
{
if (index<0 || index>=(int)length()) return -1; // index outside string
- register const char *pos;
+ const char *pos;
if (cs)
{
pos = strchr(data()+index,c);
@@ -62,7 +62,7 @@ int QCString::find( const char *str, int index, bool cs ) const
if (index<0 || index>=l) return -1; // index outside string
if (!str) return -1; // no string to search for
if (!*str) return index; // empty string matching at index
- register const char *pos;
+ const char *pos;
if (cs) // case sensitive
{
pos = strstr(data()+index,str);
@@ -132,7 +132,7 @@ int QCString::findRev( const char *str, int index, bool cs) const
else if (index>len) return -1; // bad index
else if (index+slen>len) index=len-slen; // str would be too long
if (index<0) return -1; // no match possible
- register const char *pos = data()+index;
+ const char *pos = data()+index;
if (cs) // case sensitive
{
for (int i=index; i>=0; i--) if (qstrncmp(pos--,str,slen)==0) return i;
@@ -253,7 +253,7 @@ QCString QCString::mid( uint index, uint len) const
}
else
{
- register const char *p = data()+index;
+ const char *p = data()+index;
QCString s(len+1);
qstrncpy( s.rawData(), p, len+1 );
return s;
@@ -264,7 +264,7 @@ QCString QCString::lower() const
{
if (length()==0) return QCString();
QCString s(data());
- register char *pos = s.rawData();
+ char *pos = s.rawData();
if (pos)
{
while (*pos)
@@ -280,7 +280,7 @@ QCString QCString::upper() const
{
if (length()==0) return QCString();
QCString s(data());
- register char *pos = s.rawData();
+ char *pos = s.rawData();
if (pos)
{
while (*pos)
@@ -297,13 +297,13 @@ QCString QCString::stripWhiteSpace() const
if ( isEmpty() ) // nothing to do
return *this;
- register const char *cs = data();
+ const char *cs = data();
int reslen = length();
if ( !isspace((uchar)cs[0]) && !isspace((uchar)cs[reslen-1]) )
return *this; // returns a copy
QCString result(cs);
- register char *s = result.rawData();
+ char *s = result.rawData();
int start = 0;
int end = reslen - 1;
while ( isspace((uchar) s[start]) ) // skip white space from start
@@ -489,7 +489,7 @@ QCString &QCString::setNum(uint n)
QCString &QCString::setNum(long n)
{
char buf[20];
- register char *p = &buf[19];
+ char *p = &buf[19];
bool neg;
if ( n < 0 )
{
@@ -514,7 +514,7 @@ QCString &QCString::setNum(long n)
QCString &QCString::setNum( ulong n)
{
char buf[20];
- register char *p = &buf[19];
+ char *p = &buf[19];
*p = '\0';
do
{
@@ -529,8 +529,8 @@ QCString &QCString::setNum( ulong n)
void *qmemmove( void *dst, const void *src, uint len )
{
- register char *d;
- register char *s;
+ char *d;
+ char *s;
if ( dst > src ) {
d = (char *)dst + len - 1;
s = (char *)src + len - 1;
@@ -566,8 +566,8 @@ char *qstrncpy( char *dst, const char *src, uint len )
int qstricmp( const char *str1, const char *str2 )
{
- register const uchar *s1 = (const uchar *)str1;
- register const uchar *s2 = (const uchar *)str2;
+ const uchar *s1 = (const uchar *)str1;
+ const uchar *s2 = (const uchar *)str2;
int res;
uchar c;
if ( !s1 || !s2 )
@@ -580,8 +580,8 @@ int qstricmp( const char *str1, const char *str2 )
int qstrnicmp( const char *str1, const char *str2, uint len )
{
- register const uchar *s1 = (const uchar *)str1;
- register const uchar *s2 = (const uchar *)str2;
+ const uchar *s1 = (const uchar *)str1;
+ const uchar *s2 = (const uchar *)str2;
int res;
uchar c;
if ( !s1 || !s2 )
diff --git a/qtools/qdatastream.cpp b/qtools/qdatastream.cpp
index 70bcab1..5190b53 100644
--- a/qtools/qdatastream.cpp
+++ b/qtools/qdatastream.cpp
@@ -403,7 +403,7 @@ void QDataStream::setByteOrder( int bo )
static Q_INT32 read_int_ascii( QDataStream *s )
{
- register int n = 0;
+ int n = 0;
char buf[40];
while ( TRUE ) {
buf[n] = s->device()->getch();
@@ -462,7 +462,7 @@ QDataStream &QDataStream::operator>>( Q_INT16 &i )
} else if ( noswap ) { // no conversion needed
dev->readBlock( (char *)&i, sizeof(Q_INT16) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[2];
dev->readBlock( b, 2 );
*p++ = b[1];
@@ -491,7 +491,7 @@ QDataStream &QDataStream::operator>>( Q_INT32 &i )
} else if ( noswap ) { // no conversion needed
dev->readBlock( (char *)&i, sizeof(Q_INT32) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[4];
dev->readBlock( b, 4 );
*p++ = b[3];
@@ -521,7 +521,7 @@ QDataStream &QDataStream::operator>>( Q_INT64 &i )
} else if ( noswap ) { // no conversion needed
dev->readBlock( (char *)&i, sizeof(Q_INT64) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[sizeof(Q_INT64)];
dev->readBlock( b, sizeof(Q_INT64) );
if ( sizeof(Q_INT64) == 8 ) {
@@ -540,7 +540,7 @@ QDataStream &QDataStream::operator>>( Q_INT64 &i )
static double read_double_ascii( QDataStream *s )
{
- register int n = 0;
+ int n = 0;
char buf[80];
while ( TRUE ) {
buf[n] = s->device()->getch();
@@ -566,7 +566,7 @@ QDataStream &QDataStream::operator>>( float &f )
} else if ( noswap ) { // no conversion needed
dev->readBlock( (char *)&f, sizeof(float) );
} else { // swap bytes
- register uchar *p = (uchar *)(&f);
+ uchar *p = (uchar *)(&f);
char b[4];
dev->readBlock( b, 4 );
*p++ = b[3];
@@ -591,7 +591,7 @@ QDataStream &QDataStream::operator>>( double &f )
} else if ( noswap ) { // no conversion needed
dev->readBlock( (char *)&f, sizeof(double) );
} else { // swap bytes
- register uchar *p = (uchar *)(&f);
+ uchar *p = (uchar *)(&f);
char b[8];
dev->readBlock( b, 8 );
*p++ = b[7];
@@ -670,7 +670,7 @@ QDataStream &QDataStream::readRawBytes( char *s, uint len )
{
CHECK_STREAM_PRECOND
if ( printable ) { // printable data
- register Q_INT8 *p = (Q_INT8*)s;
+ Q_INT8 *p = (Q_INT8*)s;
while ( len-- )
*this >> *p++;
} else { // read data char array
@@ -734,7 +734,7 @@ QDataStream &QDataStream::operator<<( Q_INT16 i )
} else if ( noswap ) { // no conversion needed
dev->writeBlock( (char *)&i, sizeof(Q_INT16) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[2];
b[1] = *p++;
b[0] = *p;
@@ -765,7 +765,7 @@ QDataStream &QDataStream::operator<<( Q_INT32 i )
} else if ( noswap ) { // no conversion needed
dev->writeBlock( (char *)&i, sizeof(Q_INT32) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -797,7 +797,7 @@ QDataStream &QDataStream::operator<<( Q_INT64 i )
} else if ( noswap ) { // no conversion needed
dev->writeBlock( (char *)&i, sizeof(Q_INT64) );
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ uchar *p = (uchar *)(&i);
char b[sizeof(Q_INT64)];
if ( sizeof(Q_INT64) == 8 ) {
b[7] = *p++;
@@ -845,7 +845,7 @@ QDataStream &QDataStream::operator<<( float f )
if ( noswap ) { // no conversion needed
dev->writeBlock( (char *)&g, sizeof(float) );
} else { // swap bytes
- register uchar *p = (uchar *)(&g);
+ uchar *p = (uchar *)(&g);
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -873,7 +873,7 @@ QDataStream &QDataStream::operator<<( double f )
} else if ( noswap ) { // no conversion needed
dev->writeBlock( (char *)&f, sizeof(double) );
} else { // swap bytes
- register uchar *p = (uchar *)(&f);
+ uchar *p = (uchar *)(&f);
char b[8];
b[7] = *p++;
b[6] = *p++;
@@ -939,7 +939,7 @@ QDataStream &QDataStream::writeRawBytes( const char *s, uint len )
{
CHECK_STREAM_PRECOND
if ( printable ) { // write printable
- register char *p = (char *)s;
+ char *p = (char *)s;
while ( len-- )
*this << *p++;
} else { // write data char array
diff --git a/qtools/qgarray.cpp b/qtools/qgarray.cpp
index df31363..2607a26 100644
--- a/qtools/qgarray.cpp
+++ b/qtools/qgarray.cpp
@@ -255,17 +255,17 @@ bool QGArray::fill( const char *d, int len, uint sz )
if ( sz == 1 ) // 8 bit elements
memset( data(), *d, len );
else if ( sz == 4 ) { // 32 bit elements
- register Q_INT32 *x = (Q_INT32*)data();
+ Q_INT32 *x = (Q_INT32*)data();
Q_INT32 v = *((Q_INT32*)d);
while ( len-- )
*x++ = v;
} else if ( sz == 2 ) { // 16 bit elements
- register Q_INT16 *x = (Q_INT16*)data();
+ Q_INT16 *x = (Q_INT16*)data();
Q_INT16 v = *((Q_INT16*)d);
while ( len-- )
*x++ = v;
} else { // any other size elements
- register char *x = data();
+ char *x = data();
while ( len-- ) { // more complicated
memcpy( x, d, sz );
x += sz;
@@ -329,7 +329,7 @@ QGArray &QGArray::duplicate( const QGArray &a )
if ( a.shd == shd ) { // a.duplicate(a) !
if ( shd->count > 1 ) {
shd->count--;
- register array_data *n = newData();
+ array_data *n = newData();
CHECK_PTR( n );
if ( (n->len=shd->len) ) {
n->data = NEW(char,n->len);
@@ -528,11 +528,11 @@ int QGArray::find( const char *d, uint index, uint sz ) const
#endif
return -1;
}
- register uint i;
+ uint i;
uint ii;
switch ( sz ) {
case 1: { // 8 bit elements
- register char *x = data() + index;
+ char *x = data() + index;
char v = *d;
for ( i=index; i<shd->len; i++ ) {
if ( *x++ == v )
@@ -542,7 +542,7 @@ int QGArray::find( const char *d, uint index, uint sz ) const
}
break;
case 2: { // 16 bit elements
- register Q_INT16 *x = (Q_INT16*)(data() + index);
+ Q_INT16 *x = (Q_INT16*)(data() + index);
Q_INT16 v = *((Q_INT16*)d);
for ( i=index; i<shd->len; i+=2 ) {
if ( *x++ == v )
@@ -552,7 +552,7 @@ int QGArray::find( const char *d, uint index, uint sz ) const
}
break;
case 4: { // 32 bit elements
- register Q_INT32 *x = (Q_INT32*)(data() + index);
+ Q_INT32 *x = (Q_INT32*)(data() + index);
Q_INT32 v = *((Q_INT32*)d);
for ( i=index; i<shd->len; i+=4 ) {
if ( *x++ == v )
@@ -583,11 +583,11 @@ int QGArray::find( const char *d, uint index, uint sz ) const
int QGArray::contains( const char *d, uint sz ) const
{
- register uint i = shd->len;
+ uint i = shd->len;
int count = 0;
switch ( sz ) {
case 1: { // 8 bit elements
- register char *x = data();
+ char *x = data();
char v = *d;
while ( i-- ) {
if ( *x++ == v )
@@ -596,7 +596,7 @@ int QGArray::contains( const char *d, uint sz ) const
}
break;
case 2: { // 16 bit elements
- register Q_INT16 *x = (Q_INT16*)data();
+ Q_INT16 *x = (Q_INT16*)data();
Q_INT16 v = *((Q_INT16*)d);
i /= 2;
while ( i-- ) {
@@ -606,7 +606,7 @@ int QGArray::contains( const char *d, uint sz ) const
}
break;
case 4: { // 32 bit elements
- register Q_INT32 *x = (Q_INT32*)data();
+ Q_INT32 *x = (Q_INT32*)data();
Q_INT32 v = *((Q_INT32*)d);
i /= 4;
while ( i-- ) {
diff --git a/qtools/qgcache.cpp b/qtools/qgcache.cpp
index 683c2a7..03150fe 100644
--- a/qtools/qgcache.cpp
+++ b/qtools/qgcache.cpp
@@ -577,7 +577,7 @@ bool QGCache::makeRoomFor( int cost, int priority )
return FALSE; // than maximum cost
if ( priority == -1 )
priority = 32767;
- register QCacheItem *ci = lruList->last();
+ QCacheItem *ci = lruList->last();
int cntCost = 0;
int dumps = 0; // number of items to dump
while ( cntCost < cost && ci && ci->skipPriority <= priority ) {
diff --git a/qtools/qgdict.cpp b/qtools/qgdict.cpp
index c8d8fbd..ab3fea9 100644
--- a/qtools/qgdict.cpp
+++ b/qtools/qgdict.cpp
@@ -90,7 +90,7 @@ int QGDict::hashKeyString( const QString &key )
qWarning( "QGDict::hashStringKey: Invalid null key" );
#endif
int i;
- register uint h=0;
+ uint h=0;
uint g;
int len = key.length();
const QChar *p = key.unicode();
@@ -129,8 +129,8 @@ int QGDict::hashKeyAscii( const char *key )
return 0;
}
#endif
- register const char *k = key;
- register uint h=0;
+ const char *k = key;
+ uint h=0;
uint g;
if ( cases ) { // case sensitive
while ( *k ) {
@@ -1170,8 +1170,8 @@ QCollection::Item QGDictIterator::toFirst()
curNode = 0;
return 0;
}
- register uint i = 0;
- register QBaseBucket **v = dict->vec;
+ uint i = 0;
+ QBaseBucket **v = dict->vec;
while ( !(*v++) )
i++;
curNode = dict->vec[i];
@@ -1217,8 +1217,8 @@ QCollection::Item QGDictIterator::operator++()
return 0;
curNode = curNode->getNext();
if ( !curNode ) { // no next bucket
- register uint i = curIndex + 1; // look from next vec element
- register QBaseBucket **v = &dict->vec[i];
+ uint i = curIndex + 1; // look from next vec element
+ QBaseBucket **v = &dict->vec[i];
while ( i < dict->size() && !(*v++) )
i++;
if ( i == dict->size() ) { // nothing found
diff --git a/qtools/qglist.cpp b/qtools/qglist.cpp
index 731d9fd..8197db5 100644
--- a/qtools/qglist.cpp
+++ b/qtools/qglist.cpp
@@ -280,7 +280,7 @@ QLNode *QGList::locate( uint index )
curNode = firstNode;
curIndex = 0;
}
- register QLNode *node;
+ QLNode *node;
int distance = index - curIndex; // node distance to cur node
bool forward; // direction to traverse
@@ -327,7 +327,7 @@ QLNode *QGList::locate( uint index )
void QGList::inSort( QCollection::Item d )
{
int index = 0;
- register QLNode *n = firstNode;
+ QLNode *n = firstNode;
while ( n && compareItems(n->data,d) < 0 ){ // find position in list
n = n->next;
index++;
@@ -343,7 +343,7 @@ void QGList::inSort( QCollection::Item d )
void QGList::prepend( QCollection::Item d )
{
- register QLNode *n = new QLNode( newItem(d) );
+ QLNode *n = new QLNode( newItem(d) );
CHECK_PTR( n );
n->prev = 0;
if ( (n->next = firstNode) ) // list is not empty
@@ -363,7 +363,7 @@ void QGList::prepend( QCollection::Item d )
void QGList::append( QCollection::Item d )
{
- register QLNode *n = new QLNode( newItem(d) );
+ QLNode *n = new QLNode( newItem(d) );
CHECK_PTR( n );
n->next = 0;
if ( (n->prev = lastNode) ) // list is not empty
@@ -394,7 +394,7 @@ bool QGList::insertAt( uint index, QCollection::Item d )
if ( !nextNode ) // illegal position
return FALSE;
QLNode *prevNode = nextNode->prev;
- register QLNode *n = new QLNode( newItem(d) );
+ QLNode *n = new QLNode( newItem(d) );
CHECK_PTR( n );
nextNode->prev = n;
prevNode->next = n;
@@ -437,7 +437,7 @@ QLNode *QGList::unlink()
{
if ( curNode == 0 ) // null current node
return 0;
- register QLNode *n = curNode; // unlink this node
+ QLNode *n = curNode; // unlink this node
if ( n == firstNode ) { // removing first node ?
if ( (firstNode = n->next) ) {
firstNode->prev = 0;
@@ -651,7 +651,7 @@ QCollection::Item QGList::takeLast()
void QGList::clear()
{
- register QLNode *n = firstNode;
+ QLNode *n = firstNode;
firstNode = lastNode = curNode = 0; // initialize list
numNodes = 0;
@@ -682,7 +682,7 @@ void QGList::clear()
int QGList::findRef( QCollection::Item d, bool fromStart )
{
- register QLNode *n;
+ QLNode *n;
int index;
if ( fromStart ) { // start from first node
n = firstNode;
@@ -707,7 +707,7 @@ int QGList::findRef( QCollection::Item d, bool fromStart )
int QGList::find( QCollection::Item d, bool fromStart )
{
- register QLNode *n;
+ QLNode *n;
int index;
if ( fromStart ) { // start from first node
n = firstNode;
@@ -733,7 +733,7 @@ int QGList::find( QCollection::Item d, bool fromStart )
uint QGList::containsRef( QCollection::Item d ) const
{
- register QLNode *n = firstNode;
+ QLNode *n = firstNode;
uint count = 0;
while ( n ) { // for all nodes...
if ( n->data == d ) // count # exact matches
@@ -750,7 +750,7 @@ uint QGList::containsRef( QCollection::Item d ) const
uint QGList::contains( QCollection::Item d ) const
{
- register QLNode *n = firstNode;
+ QLNode *n = firstNode;
uint count = 0;
QGList *that = (QGList*)this; // mutable for compareItems()
while ( n ) { // for all nodes...
@@ -876,7 +876,7 @@ void QGList::toVector( QGVector *vector ) const
vector->clear();
if ( !vector->resize( count() ) )
return;
- register QLNode *n = firstNode;
+ QLNode *n = firstNode;
uint i = 0;
while ( n ) {
vector->insert( i, n->data );
diff --git a/qtools/qgvector.cpp b/qtools/qgvector.cpp
index 63cce64..2d08ede 100644
--- a/qtools/qgvector.cpp
+++ b/qtools/qgvector.cpp
@@ -411,8 +411,8 @@ void QGVector::sort() // sort vector
{
if ( count() == 0 ) // no elements
return;
- register Item *start = &vec[0];
- register Item *end = &vec[len-1];
+ Item *start = &vec[0];
+ Item *end = &vec[len-1];
Item tmp;
while ( TRUE ) { // put all zero elements behind
while ( start < end && *start != 0 )
diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp
index fe478bd..0e2b14a 100644
--- a/qtools/qstring.cpp
+++ b/qtools/qstring.cpp
@@ -12956,7 +12956,7 @@ int QString::find( QChar c, int index, bool cs ) const
index += length();
if ( (uint)index >= length() ) // index outside string
return -1;
- register const QChar *uc;
+ const QChar *uc;
uc = unicode()+index;
int n = length()-index;
if ( cs ) {
@@ -13325,7 +13325,7 @@ QString QString::mid( uint index, uint len ) const
len = slen - index;
if ( index == 0 && len == length() )
return *this;
- register const QChar *p = unicode()+index;
+ const QChar *p = unicode()+index;
QString s( len, TRUE );
memcpy( s.d->unicode, p, len*sizeof(QChar) );
s.d->len = len;
@@ -13429,7 +13429,7 @@ QString QString::lower() const
int l=length();
if ( l ) {
s.real_detach(); // could do this only when we find a change
- register QChar *p=s.d->unicode;
+ QChar *p=s.d->unicode;
if ( p ) {
while ( l-- ) {
*p = p->lower();
@@ -13458,7 +13458,7 @@ QString QString::upper() const
int l=length();
if ( l ) {
s.real_detach(); // could do this only when we find a change
- register QChar *p=s.d->unicode;
+ QChar *p=s.d->unicode;
if ( p ) {
while ( l-- ) {
*p = p->upper();
@@ -13493,7 +13493,7 @@ QString QString::stripWhiteSpace() const
if ( !at(0).isSpace() && !at(length()-1).isSpace() )
return *this;
- register const QChar *s = unicode();
+ const QChar *s = unicode();
QString result = fromLatin1("");
int start = 0;
diff --git a/qtools/qtextstream.cpp b/qtools/qtextstream.cpp
index 4ebf59e..ffbdeba 100644
--- a/qtools/qtextstream.cpp
+++ b/qtools/qtextstream.cpp
@@ -1596,7 +1596,7 @@ QTextStream &QTextStream::output_int( int format, ulong n, bool neg )
static char hexdigits_upper[] = "0123456789ABCDEF";
CHECK_STREAM_PRECOND
char buf[76];
- register char *p;
+ char *p;
int len;
char *hexdigits;
@@ -1784,7 +1784,7 @@ QTextStream &QTextStream::operator<<( double f )
f_char = (flags() & uppercase) ? 'E' : 'e';
else
f_char = (flags() & uppercase) ? 'G' : 'g';
- register char *fs = format; // generate format string
+ char *fs = format; // generate format string
*fs++ = '%'; // "%.<prec>l<f_char>"
*fs++ = '.';
int prec = precision();