From e90b15c55dd5cfa5b40e078722c8145264ee7237 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 12 Feb 2012 17:34:58 -0600 Subject: Clean up a few build warnings --- src/tools/qdir_unix.cpp | 5 ++++- src/tools/qgcache.cpp | 4 ++-- src/tools/qgdict.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdir_unix.cpp b/src/tools/qdir_unix.cpp index 0b297ca..5c0c393 100644 --- a/src/tools/qdir_unix.cpp +++ b/src/tools/qdir_unix.cpp @@ -98,7 +98,10 @@ QString QDir::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; diff --git a/src/tools/qgcache.cpp b/src/tools/qgcache.cpp index a9f970d..3c70d9f 100644 --- a/src/tools/qgcache.cpp +++ b/src/tools/qgcache.cpp @@ -641,7 +641,7 @@ void QGCache::statistics() const #if defined(QT_DEBUG) QString 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 QGCache::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 7f6a314..b9c1810 100644 --- a/src/tools/qgdict.cpp +++ b/src/tools/qgdict.cpp @@ -846,11 +846,11 @@ void QGDict::statistics() const QString 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 QGDict::statistics() const while ( b-- ) *pbuf++ = '*'; *pbuf = '\0'; - qDebug( buf ); + qDebug( "%s", buf ); i++; } qDebug( "Array size = %d", size() ); @@ -879,7 +879,7 @@ void QGDict::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 } -- cgit v1.2.3