From 4120213ee84be581c2764c2022b2d495ea2643bf Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sun, 11 May 2014 01:02:31 +0400 Subject: [PATCH] Rename "DPRINTF" and "FDPRINTF" debug macro --- article_maker.cc | 12 ++++++------ article_netmgr.cc | 10 +++++----- bgl.cc | 2 +- bgl_babylon.cc | 14 +++++++------- btreeidx.cc | 2 +- config.cc | 4 ++-- dictdfiles.cc | 8 ++++---- dsl.cc | 8 ++++---- dsl_details.cc | 8 ++++---- externalviewer.cc | 2 +- forvo.cc | 4 ++-- fulltextsearch.cc | 6 +++--- gddebug.hh | 8 ++++---- hunspell.cc | 2 +- indexedzip.cc | 8 ++++---- loaddictionaries.cc | 2 +- lsa.cc | 6 +++--- mainwindow.cc | 10 +++++----- mdx.cc | 2 +- mediawiki.cc | 12 ++++++------ scanpopup.cc | 4 ++-- stardict.cc | 20 ++++++++++---------- transliteration.cc | 2 +- wordbyauto.cc | 4 ++-- xdxf.cc | 8 ++++---- 25 files changed, 84 insertions(+), 84 deletions(-) diff --git a/article_maker.cc b/article_maker.cc index 30709d6b..29e34b62 100644 --- a/article_maker.cc +++ b/article_maker.cc @@ -536,7 +536,7 @@ void ArticleRequest::bodyFinished() if ( bodyDone ) return; - DPRINTF( "some body finished\n" ); + GD_DPRINTF( "some body finished\n" ); bool wasUpdated = false; @@ -547,7 +547,7 @@ void ArticleRequest::bodyFinished() { // Good - DPRINTF( "one finished.\n" ); + GD_DPRINTF( "one finished.\n" ); Dictionary::DataRequest & req = *bodyRequests.front(); @@ -683,14 +683,14 @@ void ArticleRequest::bodyFinished() foundAnyDefinitions = true; } - DPRINTF( "erasing..\n" ); + GD_DPRINTF( "erasing..\n" ); bodyRequests.pop_front(); - DPRINTF( "erase done..\n" ); + GD_DPRINTF( "erase done..\n" ); } else { - DPRINTF( "one not finished.\n" ); - break; + GD_DPRINTF( "one not finished.\n" ); + break; } } diff --git a/article_netmgr.cc b/article_netmgr.cc index 20636801..4b78d32c 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -126,9 +126,9 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op, sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource( QUrl const & url, QString & contentType ) { - DPRINTF( "getResource: %ls\n", url.toString().toStdWString().c_str() ); - DPRINTF( "scheme: %ls\n", url.scheme().toStdWString().c_str() ); - DPRINTF( "host: %ls\n", url.host().toStdWString().c_str() ); + GD_DPRINTF( "getResource: %ls\n", url.toString().toStdWString().c_str() ); + GD_DPRINTF( "scheme: %ls\n", url.scheme().toStdWString().c_str() ); + GD_DPRINTF( "host: %ls\n", url.host().toStdWString().c_str() ); if ( url.scheme() == "gdlookup" ) { @@ -286,7 +286,7 @@ ArticleResourceReply::ArticleResourceReply( QObject * parent, if ( req->isFinished() ) { emit finishedSignal(); - DPRINTF( "In-place finish.\n" ); + GD_DPRINTF( "In-place finish.\n" ); } } } @@ -324,7 +324,7 @@ qint64 ArticleResourceReply::readData( char * out, qint64 maxSize ) if ( maxSize == 0 ) return 0; - DPRINTF( "====reading %d bytes\n", (int)maxSize ); + GD_DPRINTF( "====reading %d bytes\n", (int)maxSize ); bool finished = req->isFinished(); diff --git a/bgl.cc b/bgl.cc index 6855335d..61729c3b 100644 --- a/bgl.cc +++ b/bgl.cc @@ -1291,7 +1291,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( idxHeader.chunksOffset = chunks.finish(); - DPRINTF( "Writing index...\n" ); + GD_DPRINTF( "Writing index...\n" ); // Good. Now build the index diff --git a/bgl_babylon.cc b/bgl_babylon.cc index 9463b93b..64d0847b 100644 --- a/bgl_babylon.cc +++ b/bgl_babylon.cc @@ -324,7 +324,7 @@ bool Babylon::read(std::string &source_charset, std::string &target_charset) convertToUtf8( m_email, TARGET_CHARSET ); convertToUtf8( m_copyright, TARGET_CHARSET ); convertToUtf8( m_description, TARGET_CHARSET ); - DPRINTF("Default charset: %s\nSource Charset: %s\nTargetCharset: %s\n", m_defaultCharset.c_str(), m_sourceCharset.c_str(), m_targetCharset.c_str()); + GD_DPRINTF("Default charset: %s\nSource Charset: %s\nTargetCharset: %s\n", m_defaultCharset.c_str(), m_sourceCharset.c_str(), m_targetCharset.c_str()); return true; } @@ -504,7 +504,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 2 ) { - FDPRINTF( stderr, "Hidden displayed headword is too large %s\n", headword.c_str() ); + GD_FDPRINTF( stderr, "Hidden displayed headword is too large %s\n", headword.c_str() ); pos += len - a; break; } @@ -519,7 +519,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 2 ) { - FDPRINTF( stderr, "Displayed headword's length is too large for headword %s\n", headword.c_str() ); + GD_FDPRINTF( stderr, "Displayed headword's length is too large for headword %s\n", headword.c_str() ); pos += len - a; break; } @@ -539,7 +539,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 3 ) { - FDPRINTF( stderr, "2-byte sized displayed headword for %s is too large\n", headword.c_str() ); + GD_FDPRINTF( stderr, "2-byte sized displayed headword for %s is too large\n", headword.c_str() ); pos += len - a; break; } @@ -557,7 +557,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 3 ) { - FDPRINTF( stderr, "1-byte-sized transcription's length is too large for headword %s\n", headword.c_str() ); + GD_FDPRINTF( stderr, "1-byte-sized transcription's length is too large for headword %s\n", headword.c_str() ); pos += len - a; break; } @@ -590,7 +590,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 4) { - FDPRINTF( stderr, "2-byte-sized transcription's length is too large for headword %s\n", headword.c_str() ); + GD_FDPRINTF( stderr, "2-byte-sized transcription's length is too large for headword %s\n", headword.c_str() ); pos += len - a; break; } @@ -623,7 +623,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler ) if ( length > len - a - 2 ) { - FDPRINTF( stderr, "Hidden transcription is too large %s\n", headword.c_str() ); + GD_FDPRINTF( stderr, "Hidden transcription is too large %s\n", headword.c_str() ); pos += len - a; break; } diff --git a/btreeidx.cc b/btreeidx.cc index 6861a56c..b7cd8cc5 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -1158,7 +1158,7 @@ IndexInfo buildIndex( IndexedWords const & indexedWords, File::Class & file ) if ( btreeMaxElements > BtreeMaxElements ) btreeMaxElements = BtreeMaxElements; - DPRINTF( "Building a tree of %u elements\n", (unsigned) btreeMaxElements ); + GD_DPRINTF( "Building a tree of %u elements\n", (unsigned) btreeMaxElements ); uint32_t lastLeafOffset = 0; diff --git a/config.cc b/config.cc index f23b80f6..1164ef02 100644 --- a/config.cc +++ b/config.cc @@ -409,7 +409,7 @@ Class load() throw( exError ) // Load the config as usual if ( !dd.setContent( &configFile, false, &errorStr, &errorLine, &errorColumn ) ) { - DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn ); + GD_DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn ); throw exMalformedConfigFile(); } } @@ -424,7 +424,7 @@ Class load() throw( exError ) if ( !dd.setContent( &bufferedData, false, &errorStr, &errorLine, &errorColumn ) ) { - DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn ); + GD_DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn ); throw exMalformedConfigFile(); } } diff --git a/dictdfiles.cc b/dictdfiles.cc index 1835f795..8670a642 100644 --- a/dictdfiles.cc +++ b/dictdfiles.cc @@ -610,7 +610,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( char * tab4 = strchr( tab3 + 1, '\t'); if ( tab4 ) { - DPRINTF( "Warning: too many tabs present, skipping: %s\n", buf ); + GD_DPRINTF( "Warning: too many tabs present, skipping: %s\n", buf ); continue; } @@ -649,7 +649,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( if ( endEol ) *endEol = 0; - DPRINTF( "DICT NAME: '%s'\n", eol ); + GD_DPRINTF( "DICT NAME: '%s'\n", eol ); dictionaryName = eol; } } @@ -662,13 +662,13 @@ vector< sptr< Dictionary::Class > > makeDictionaries( } else { - DPRINTF( "Warning: only a single tab present, skipping: %s\n", buf ); + GD_DPRINTF( "Warning: only a single tab present, skipping: %s\n", buf ); continue; } } else { - DPRINTF( "Warning: no tabs present, skipping: %s\n", buf ); + GD_DPRINTF( "Warning: no tabs present, skipping: %s\n", buf ); continue; } diff --git a/dsl.cc b/dsl.cc index 4fd2bfdf..272a504b 100644 --- a/dsl.cc +++ b/dsl.cc @@ -403,7 +403,7 @@ void DslDictionary::doDeferredInit() memcpy( &total, abrvBlock, sizeof( uint32_t ) ); abrvBlock += sizeof( uint32_t ); - DPRINTF( "Loading %u abbrv\n", total ); + GD_DPRINTF( "Loading %u abbrv\n", total ); while( total-- ) { @@ -532,7 +532,7 @@ void DslDictionary::loadArticle( uint32_t address, memcpy( &articleSize, articleProps + sizeof( articleOffset ), sizeof( articleSize ) ); - DPRINTF( "offset = %x\n", articleOffset ); + GD_DPRINTF( "offset = %x\n", articleOffset ); char * articleBody; @@ -1717,7 +1717,7 @@ void DslResourceRequest::run() FsEncoding::separator() + FsEncoding::encode( resourceName ); - DPRINTF( "n is %s\n", n.c_str() ); + GD_DPRINTF( "n is %s\n", n.c_str() ); try { @@ -2264,7 +2264,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( if ( zipFileName.size() ) { - DPRINTF( "Indexing zip file\n" ); + GD_DPRINTF( "Indexing zip file\n" ); idxHeader.hasZipFile = 1; diff --git a/dsl_details.cc b/dsl_details.cc index 0f8f7619..401acdd3 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -463,7 +463,7 @@ ArticleDom::ArticleDom( wstring const & str, string const & dictName, if ( stack.size() ) { - FDPRINTF( stderr, "Warning: %u tags were unclosed.\n", (unsigned) stack.size() ); + GD_FDPRINTF( stderr, "Warning: %u tags were unclosed.\n", (unsigned) stack.size() ); } } @@ -776,7 +776,7 @@ DslScanner::DslScanner( string const & fileName ) throw( Ex, Iconv::Ex ): if ( !needExactEncoding ) { // We don't need that! - FDPRINTF( stderr, "Warning: encoding was specified in a Unicode file, ignoring.\n" ); + GD_FDPRINTF( stderr, "Warning: encoding was specified in a Unicode file, ignoring.\n" ); } else if ( !wcscasecmp( arg.c_str(), GD_NATIVE_TO_WS( L"Latin" ) ) ) @@ -1023,7 +1023,7 @@ void processUnsortedParts( wstring & str, bool strip ) if ( refCount < 0 ) { - FDPRINTF( stderr, "Warning: an unmatched closing brace was encountered.\n" ); + GD_FDPRINTF( stderr, "Warning: an unmatched closing brace was encountered.\n" ); refCount = 0; // But we remove that thing either way str.erase( x, 1 ); @@ -1052,7 +1052,7 @@ void processUnsortedParts( wstring & str, bool strip ) if ( strip && refCount ) { - FDPRINTF( stderr, "Warning: unclosed brace(s) encountered.\n" ); + GD_FDPRINTF( stderr, "Warning: unclosed brace(s) encountered.\n" ); str.erase( startPos ); } } diff --git a/externalviewer.cc b/externalviewer.cc index a599a5be..5a56f0a7 100644 --- a/externalviewer.cc +++ b/externalviewer.cc @@ -29,7 +29,7 @@ ExternalViewer::ExternalViewer( QObject * parent, vector< char > const & data, tempFile.close(); - DPRINTF( "%s\n", tempFile.fileName().toLocal8Bit().data() ); + GD_DPRINTF( "%s\n", tempFile.fileName().toLocal8Bit().data() ); } void ExternalViewer::start() throw( exCantRunViewer ) diff --git a/forvo.cc b/forvo.cc index fa0ffd7f..56985f43 100644 --- a/forvo.cc +++ b/forvo.cc @@ -181,7 +181,7 @@ void ForvoArticleRequest::addQuery( QNetworkAccessManager & mgr, void ForvoArticleRequest::requestFinished( QNetworkReply * r ) { - DPRINTF( "Finished.\n" ); + GD_DPRINTF( "Finished.\n" ); if ( isFinished() ) // Was cancelled return; @@ -350,7 +350,7 @@ void ForvoArticleRequest::requestFinished( QNetworkReply * r ) setErrorString( text ); } } - DPRINTF( "done.\n" ); + GD_DPRINTF( "done.\n" ); } else setErrorString( netReply->errorString() ); diff --git a/fulltextsearch.cc b/fulltextsearch.cc index cb3a1e67..641d4209 100644 --- a/fulltextsearch.cc +++ b/fulltextsearch.cc @@ -355,7 +355,7 @@ void FullTextSearchDialog::searchReqFinished() { if ( (*it)->isFinished() ) { - DPRINTF( "one finished.\n" ); + GD_DPRINTF( "one finished.\n" ); QString errorString = (*it)->getErrorString(); @@ -384,9 +384,9 @@ void FullTextSearchDialog::searchReqFinished() } if( it != searchReqs.end() ) { - DPRINTF( "erasing..\n" ); + GD_DPRINTF( "erasing..\n" ); searchReqs.erase( it ); - DPRINTF( "erase done..\n" ); + GD_DPRINTF( "erase done..\n" ); continue; } else diff --git a/gddebug.hh b/gddebug.hh index 2aa21a97..305863c3 100644 --- a/gddebug.hh +++ b/gddebug.hh @@ -4,11 +4,11 @@ #include #ifdef NO_CONSOLE -#define DPRINTF(...) -#define FDPRINTF(...) +#define GD_DPRINTF(...) +#define GD_FDPRINTF(...) #else -#define DPRINTF(...) printf(__VA_ARGS__) -#define FDPRINTF(...) fprintf(__VA_ARGS__) +#define GD_DPRINTF(...) printf(__VA_ARGS__) +#define GD_FDPRINTF(...) fprintf(__VA_ARGS__) #endif void gdWarning(const char *, ...) /* print warning message */ diff --git a/hunspell.cc b/hunspell.cc index bab0d6c2..d376af8e 100644 --- a/hunspell.cc +++ b/hunspell.cc @@ -502,7 +502,7 @@ QVector< wstring > HunspellHeadwordsRequest::suggest( wstring & word ) { QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ] ) ); - DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() ); + GD_DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() ); if ( cutStem.indexIn( suggestion ) != -1 ) { diff --git a/indexedzip.cc b/indexedzip.cc index 7333fcd7..153473ec 100644 --- a/indexedzip.cc +++ b/indexedzip.cc @@ -59,7 +59,7 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) if ( !ZipFile::readLocalHeader( zip, header ) ) { - DPRINTF( "Failed to load header\n" ); + GD_DPRINTF( "Failed to load header\n" ); return false; } @@ -68,13 +68,13 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) switch( header.compressionMethod ) { case ZipFile::Uncompressed: - DPRINTF( "Uncompressed\n" ); + GD_DPRINTF( "Uncompressed\n" ); data.resize( header.uncompressedSize ); return (size_t) zip.read( &data.front(), data.size() ) == data.size(); case ZipFile::Deflated: { - DPRINTF( "Deflated\n" ); + GD_DPRINTF( "Deflated\n" ); // Now do the deflation @@ -102,7 +102,7 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) if ( inflate( &stream, Z_FINISH ) != Z_STREAM_END ) { - DPRINTF( "Not zstream end!" ); + GD_DPRINTF( "Not zstream end!" ); data.clear(); diff --git a/loaddictionaries.cc b/loaddictionaries.cc index 40d94a0f..db98de02 100644 --- a/loaddictionaries.cc +++ b/loaddictionaries.cc @@ -326,7 +326,7 @@ void loadDictionaries( QWidget * parent, bool showInitially, dictionaries.insert( dictionaries.end(), dicts.begin(), dicts.end() ); } - DPRINTF( "Load done\n" ); + GD_DPRINTF( "Load done\n" ); // Remove any stale index files diff --git a/lsa.cc b/lsa.cc index 78d0f662..7c807ac1 100644 --- a/lsa.cc +++ b/lsa.cc @@ -477,7 +477,7 @@ sptr< Dictionary::DataRequest > LsaDictionary::getResource( string const & name if ( result > left ) { - FDPRINTF( stderr, "Warning: Vorbis decode returned more data than requested.\n" ); + GD_FDPRINTF( stderr, "Warning: Vorbis decode returned more data than requested.\n" ); result = left; } @@ -575,7 +575,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( /// XXX handle big-endian machines here! uint32_t entriesCount = f.read< uint32_t >(); - DPRINTF( "%s: %u entries\n", i->c_str(), entriesCount ); + GD_DPRINTF( "%s: %u entries\n", i->c_str(), entriesCount ); idxHeader.soundsCount = entriesCount; @@ -591,7 +591,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( // Remove the extension, no need for that in the index e.name = stripExtension( e.name ); - DPRINTF( "Read filename %s (%u at %u)<\n", e.name.c_str(), e.samplesLength, e.samplesOffset ); + GD_DPRINTF( "Read filename %s (%u at %u)<\n", e.name.c_str(), e.samplesLength, e.samplesOffset ); // Insert new entry into an index diff --git a/mainwindow.cc b/mainwindow.cc index ba1eff0a..523db35b 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1612,7 +1612,7 @@ void MainWindow::ctrlReleased() void MainWindow::backClicked() { - DPRINTF( "Back\n" ); + GD_DPRINTF( "Back\n" ); ArticleView *view = getCurrentArticleView(); @@ -1621,7 +1621,7 @@ void MainWindow::backClicked() void MainWindow::forwardClicked() { - DPRINTF( "Forward\n" ); + GD_DPRINTF( "Forward\n" ); ArticleView *view = getCurrentArticleView(); @@ -2877,7 +2877,7 @@ void MainWindow::latestReleaseReplyReady() // Failed -- reschedule to check in two hours newReleaseCheckTimer.start( 2 * 60 * 60 * 1000 ); - DPRINTF( "Failed to check program version, retry in two hours\n" ); + GD_DPRINTF( "Failed to check program version, retry in two hours\n" ); } else { @@ -2888,8 +2888,8 @@ void MainWindow::latestReleaseReplyReady() Config::save( cfg ); - DPRINTF( "Program version's check successful, current version is %ls\n", - latestVersion.toStdWString().c_str() ); + GD_DPRINTF( "Program version's check successful, current version is %ls\n", + latestVersion.toStdWString().c_str() ); } if ( success && latestVersion > PROGRAM_VERSION && latestVersion != cfg.skippedRelease ) diff --git a/mdx.cc b/mdx.cc index cea74e65..90ebf5ab 100644 --- a/mdx.cc +++ b/mdx.cc @@ -1191,7 +1191,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f // Finish with the chunks idxHeader.chunksOffset = chunks.finish(); - DPRINTF( "Writing index...\n" ); + GD_DPRINTF( "Writing index...\n" ); // Good. Now build the index IndexInfo idxInfo = BtreeIndexing::buildIndex( indexedWords, idx ); diff --git a/mediawiki.cc b/mediawiki.cc index 9e6e94a7..dd0299ab 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -121,7 +121,7 @@ MediaWikiWordSearchRequest::MediaWikiWordSearchRequest( wstring const & str, QNetworkAccessManager & mgr ): livedLongEnough( false ), isCancelling( false ) { - DPRINTF( "request begin\n" ); + GD_DPRINTF( "request begin\n" ); QUrl reqUrl( url + "/api.php?action=query&list=allpages&aplimit=40&format=xml" ); reqUrl.addQueryItem( "apfrom", gd::toQString( str ) ); @@ -147,7 +147,7 @@ void MediaWikiWordSearchRequest::timerEvent( QTimerEvent * ev ) MediaWikiWordSearchRequest::~MediaWikiWordSearchRequest() { - DPRINTF( "request end\n" ); + GD_DPRINTF( "request end\n" ); } void MediaWikiWordSearchRequest::cancel() @@ -164,7 +164,7 @@ void MediaWikiWordSearchRequest::cancel() } else { - DPRINTF("not long enough\n" ); + GD_DPRINTF("not long enough\n" ); } } @@ -199,7 +199,7 @@ void MediaWikiWordSearchRequest::downloadFinished() matches.push_back( gd::toWString( nl.item( x ).toElement().attribute( "title" ) ) ); } } - DPRINTF( "done.\n" ); + GD_DPRINTF( "done.\n" ); } else setErrorString( netReply->errorString() ); @@ -267,7 +267,7 @@ void MediaWikiArticleRequest::addQuery( QNetworkAccessManager & mgr, void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) { - DPRINTF( "Finished.\n" ); + GD_DPRINTF( "Finished.\n" ); if ( isFinished() ) // Was cancelled return; @@ -379,7 +379,7 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) } } } - DPRINTF( "done.\n" ); + GD_DPRINTF( "done.\n" ); } else setErrorString( netReply->errorString() ); diff --git a/scanpopup.cc b/scanpopup.cc index 119b52fd..5113c593 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -328,7 +328,7 @@ void ScanPopup::editGroupRequested() void ScanPopup::translateWordFromClipboard(QClipboard::Mode m) { - DPRINTF( "translating from clipboard or selection\n" ); + GD_DPRINTF( "translating from clipboard or selection\n" ); QString subtype = "plain"; @@ -364,7 +364,7 @@ void ScanPopup::clipboardChanged( QClipboard::Mode m ) if ( !isScanningEnabled ) return; - DPRINTF( "clipboard changed\n" ); + GD_DPRINTF( "clipboard changed\n" ); QString subtype = "plain"; diff --git a/stardict.cc b/stardict.cc index 3fbdf3ea..19b582bb 100644 --- a/stardict.cc +++ b/stardict.cc @@ -1136,7 +1136,7 @@ void StardictResourceRequest::run() FsEncoding::separator() + FsEncoding::encode( resourceName ); - DPRINTF( "n is %s\n", n.c_str() ); + GD_DPRINTF( "n is %s\n", n.c_str() ); try { @@ -1310,7 +1310,7 @@ static void handleIdxSynFile( string const & fileName, sizeof( uint32_t ) * 2 ) > &image.back() ) { - FDPRINTF( stderr, "Warning: sudden end of file %s\n", fileName.c_str() ); + GD_FDPRINTF( stderr, "Warning: sudden end of file %s\n", fileName.c_str() ); break; } @@ -1392,7 +1392,7 @@ static void handleIdxSynFile( string const & fileName, indexedWords.addWord( Utf8::decode( word ), offset ); } - DPRINTF( "%u entires made\n", (unsigned) indexedWords.size() ); + GD_DPRINTF( "%u entires made\n", (unsigned) indexedWords.size() ); } @@ -1460,21 +1460,21 @@ vector< sptr< Dictionary::Class > > makeDictionaries( { if ( ifo.synwordcount ) { - DPRINTF( "Warning: dictionary has synwordcount specified, but no " - "corresponding .syn file was found\n" ); + GD_DPRINTF( "Warning: dictionary has synwordcount specified, but no " + "corresponding .syn file was found\n" ); ifo.synwordcount = 0; // Pretend it wasn't there } } else if ( !ifo.synwordcount ) { - DPRINTF( "Warning: ignoring .syn file %s, since there's no synwordcount in .ifo specified\n", - synFileName.c_str() ); + GD_DPRINTF( "Warning: ignoring .syn file %s, since there's no synwordcount in .ifo specified\n", + synFileName.c_str() ); } - DPRINTF( "bookname = %s\n", ifo.bookname.c_str() ); - DPRINTF( "wordcount = %u\n", ifo.wordcount ); + GD_DPRINTF( "bookname = %s\n", ifo.bookname.c_str() ); + GD_DPRINTF( "wordcount = %u\n", ifo.wordcount ); initializing.indexingDictionary( ifo.bookname ); @@ -1551,7 +1551,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( if ( zipFileName.size() ) { - DPRINTF( "Indexing zip file\n" ); + GD_DPRINTF( "Indexing zip file\n" ); idxHeader.hasZipFile = 1; diff --git a/transliteration.cc b/transliteration.cc index 967cf3d3..ac79ba93 100644 --- a/transliteration.cc +++ b/transliteration.cc @@ -122,7 +122,7 @@ sptr< Dictionary::WordSearchRequest > TransliterationDictionary::findHeadwordsFo vector< wstring > alts = getAlternateWritings( str ); - DPRINTF( "alts = %u\n", (unsigned) alts.size() ); + GD_DPRINTF( "alts = %u\n", (unsigned) alts.size() ); for( unsigned x = 0; x < alts.size(); ++x ) result->getMatches().push_back( alts[ x ] ); diff --git a/wordbyauto.cc b/wordbyauto.cc index 2627f4df..a3a20372 100644 --- a/wordbyauto.cc +++ b/wordbyauto.cc @@ -49,14 +49,14 @@ BSTR bstr; RECT r = { 0, 0, 0, 0 }; bool bGoUp; - DPRINTF("\nEntering getWordAtPoint\n"); + GD_DPRINTF("\nEntering getWordAtPoint\n"); if( pGDAutomation == NULL ) return false; buffer[0] = 0; pElement = NULL; hr = pGDAutomation->ElementFromPoint( pt, &pElement ); - DPRINTF("ElementFromPoint return hr=%08lX, ptr=%p\n", hr, pElement); + GD_DPRINTF("ElementFromPoint return hr=%08lX, ptr=%p\n", hr, pElement); if( hr != S_OK || pElement == NULL ) return false; diff --git a/xdxf.cc b/xdxf.cc index aaeb93ea..23a7678b 100644 --- a/xdxf.cc +++ b/xdxf.cc @@ -1008,7 +1008,7 @@ void XdxfResourceRequest::run() FsEncoding::separator() + FsEncoding::encode( resourceName ); - DPRINTF( "n is %s\n", n.c_str() ); + GD_DPRINTF( "n is %s\n", n.c_str() ); try { @@ -1243,7 +1243,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( } else { - DPRINTF( "Warning: duplicate full_name in %s\n", dictFiles[ 0 ].c_str() ); + GD_DPRINTF( "Warning: duplicate full_name in %s\n", dictFiles[ 0 ].c_str() ); } } else @@ -1265,7 +1265,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( } else { - DPRINTF( "Warning: duplicate description in %s\n", dictFiles[ 0 ].c_str() ); + GD_DPRINTF( "Warning: duplicate description in %s\n", dictFiles[ 0 ].c_str() ); } } else @@ -1376,7 +1376,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( if ( zipFileName.size() ) { - DPRINTF( "Indexing zip file\n" ); + GD_DPRINTF( "Indexing zip file\n" ); idxHeader.hasZipFile = 1;