From c7d33f4eb9c5dd5585d815d68b3eb18be1197617 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Sun, 9 Jan 2022 16:35:07 +0800 Subject: [PATCH] clean code: remove old cpp feature --- aard.cc | 6 +++--- aard.hh | 2 +- belarusiantranslit.cc | 2 +- belarusiantranslit.hh | 2 +- bgl.cc | 14 +++++++------- bgl.hh | 2 +- btreeidx.cc | 4 ++-- btreeidx.hh | 4 ++-- chinese.cc | 2 +- chinese.hh | 2 +- config.cc | 20 ++++++++++---------- config.hh | 20 ++++++++++---------- cpp_features.hh | 6 +----- dictdfiles.cc | 6 +++--- dictdfiles.hh | 2 +- dictionary.cc | 14 +++++++------- dictionary.hh | 18 +++++++++--------- dictserver.cc | 10 +++++----- dictserver.hh | 2 +- dsl.cc | 10 +++++----- dsl.hh | 2 +- dsl_details.cc | 9 ++++----- dsl_details.hh | 8 ++++---- epwing.cc | 18 +++++++++--------- epwing.hh | 2 +- externalviewer.cc | 4 ++-- externalviewer.hh | 4 ++-- file.cc | 38 ++++++++++++++++++------------------- file.hh | 44 +++++++++++++++++++++---------------------- forvo.cc | 8 ++++---- forvo.hh | 2 +- german.cc | 2 +- german.hh | 2 +- gls.cc | 23 +++++++++++----------- gls.hh | 2 +- greektranslit.cc | 2 +- greektranslit.hh | 2 +- hunspell.cc | 14 +++++++------- hunspell.hh | 2 +- iconv.cc | 10 +++++----- iconv.hh | 11 +++++------ lsa.cc | 10 +++++----- lsa.hh | 2 +- mdx.cc | 10 +++++----- mdx.hh | 2 +- mediawiki.cc | 10 +++++----- mediawiki.hh | 2 +- programs.cc | 10 +++++----- programs.hh | 2 +- romaji.cc | 2 +- romaji.hh | 2 +- russiantranslit.cc | 2 +- russiantranslit.hh | 2 +- sdict.cc | 6 +++--- sdict.hh | 2 +- slob.cc | 10 +++++----- slob.hh | 2 +- sounddir.cc | 10 +++++----- sounddir.hh | 2 +- stardict.cc | 14 +++++++------- stardict.hh | 2 +- transliteration.cc | 6 +++--- transliteration.hh | 6 +++--- utf8.cc | 2 +- utf8.hh | 2 +- voiceengines.cc | 10 +++++----- voiceengines.hh | 2 +- website.cc | 14 +++++++------- website.hh | 2 +- xdxf.cc | 14 +++++++------- xdxf.hh | 2 +- zim.cc | 10 +++++----- zim.hh | 2 +- zipsounds.cc | 10 +++++----- zipsounds.hh | 2 +- 75 files changed, 269 insertions(+), 276 deletions(-) diff --git a/aard.cc b/aard.cc index f4ac6be1..7f4ba637 100644 --- a/aard.cc +++ b/aard.cc @@ -261,7 +261,7 @@ class AardDictionary: public BtreeIndexing::BtreeDictionary vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -827,7 +827,7 @@ sptr< Dictionary::DataRequest > AardDictionary::getArticle( wstring const & word vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new AardArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -839,7 +839,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing & initializing, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/aard.hh b/aard.hh index 686dfa14..6b7305a9 100644 --- a/aard.hh +++ b/aard.hh @@ -17,7 +17,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing &, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ); + ; } diff --git a/belarusiantranslit.cc b/belarusiantranslit.cc index 1138d0af..dbfb35b7 100644 --- a/belarusiantranslit.cc +++ b/belarusiantranslit.cc @@ -406,7 +406,7 @@ public: } }; -std::vector< sptr< Dictionary::Class > > makeDictionaries() THROW_SPEC( std::exception ) +std::vector< sptr< Dictionary::Class > > makeDictionaries() { static BelarusianLatinToClassicTable t0; static BelarusianLatinToSchoolTable t1; diff --git a/belarusiantranslit.hh b/belarusiantranslit.hh index 5c622071..c09de673 100644 --- a/belarusiantranslit.hh +++ b/belarusiantranslit.hh @@ -10,7 +10,7 @@ // Support for Belarusian transliteration namespace BelarusianTranslit { -std::vector< sptr< Dictionary::Class > > makeDictionaries() THROW_SPEC( std::exception ); +std::vector< sptr< Dictionary::Class > > makeDictionaries() ; } diff --git a/bgl.cc b/bgl.cc index 62125bb3..6e84b7a5 100644 --- a/bgl.cc +++ b/bgl.cc @@ -226,16 +226,16 @@ namespace { return idxHeader.langTo; } virtual sptr< Dictionary::WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getSearchResults( QString const & searchString, int searchMode, bool matchCase, @@ -608,7 +608,7 @@ void BglHeadwordsRequest::run() sptr< Dictionary::WordSearchRequest > BglDictionary::findHeadwordsForSynonym( wstring const & word ) - THROW_SPEC( std::exception ) + { return synonymSearchEnabled ? new BglHeadwordsRequest( word, *this ) : Class::findHeadwordsForSynonym( word ); @@ -932,7 +932,7 @@ sptr< Dictionary::DataRequest > BglDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new BglArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1076,7 +1076,7 @@ void BglResourceRequest::run() } sptr< Dictionary::DataRequest > BglDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new BglResourceRequest( idxMutex, idx, idxHeader.resourceListOffset, idxHeader.resourcesCount, name ); @@ -1177,7 +1177,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/bgl.hh b/bgl.hh index 05ea64d9..0fb3e659 100644 --- a/bgl.hh +++ b/bgl.hh @@ -23,7 +23,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/btreeidx.cc b/btreeidx.cc index d4ef84f3..e3ef1516 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -462,7 +462,7 @@ BtreeWordSearchRequest::~BtreeWordSearchRequest() sptr< Dictionary::WordSearchRequest > BtreeDictionary::prefixMatch( wstring const & str, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { return new BtreeWordSearchRequest( *this, str, 0, -1, true, maxResults ); } @@ -470,7 +470,7 @@ sptr< Dictionary::WordSearchRequest > BtreeDictionary::prefixMatch( sptr< Dictionary::WordSearchRequest > BtreeDictionary::stemmedMatch( wstring const & str, unsigned minLength, unsigned maxSuffixVariation, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { return new BtreeWordSearchRequest( *this, str, minLength, (int)maxSuffixVariation, false, maxResults ); diff --git a/btreeidx.hh b/btreeidx.hh index 8be0bc3c..6e4a33f6 100644 --- a/btreeidx.hh +++ b/btreeidx.hh @@ -167,13 +167,13 @@ public: /// need not to implement this function. virtual sptr< Dictionary::WordSearchRequest > prefixMatch( wstring const &, unsigned long ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::WordSearchRequest > stemmedMatch( wstring const &, unsigned minLength, unsigned maxSuffixVariation, unsigned long maxResults ) - THROW_SPEC( std::exception ); + ; virtual bool isLocalDictionary() { return true; } diff --git a/chinese.cc b/chinese.cc index c7242008..f0ef0810 100644 --- a/chinese.cc +++ b/chinese.cc @@ -109,7 +109,7 @@ std::vector< gd::wstring > CharacterConversionDictionary::getAlternateWritings( } std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const & cfg ) - THROW_SPEC( std::exception ) + { std::vector< sptr< Dictionary::Class > > result; diff --git a/chinese.hh b/chinese.hh index 162e0571..e42d27c5 100644 --- a/chinese.hh +++ b/chinese.hh @@ -12,7 +12,7 @@ namespace Chinese { std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const & ) - THROW_SPEC( std::exception ); + ; } diff --git a/config.cc b/config.cc index 852014e8..92632f30 100644 --- a/config.cc +++ b/config.cc @@ -451,7 +451,7 @@ void saveMutedDictionaries( QDomDocument & dd, QDomElement & muted, } -Class load() THROW_SPEC( exError ) +Class load() { QString configName = getConfigFileName(); @@ -1286,7 +1286,7 @@ void saveGroup( Group const & data, QDomElement & group ) } -void save( Class const & c ) THROW_SPEC( exError ) +void save( Class const & c ) { QFile configFile( getConfigFileName() + ".tmp" ); @@ -2222,12 +2222,12 @@ QString getConfigFileName() return getHomeDir().absoluteFilePath( "config" ); } -QString getConfigDir() THROW_SPEC( exError ) +QString getConfigDir() { return getHomeDir().path() + QDir::separator(); } -QString getIndexDir() THROW_SPEC( exError ) +QString getIndexDir() { QDir result = getHomeDir(); @@ -2248,12 +2248,12 @@ QString getIndexDir() THROW_SPEC( exError ) return result.path() + QDir::separator(); } -QString getPidFileName() THROW_SPEC( exError ) +QString getPidFileName() { return getHomeDir().filePath( "pid" ); } -QString getHistoryFileName() THROW_SPEC( exError ) +QString getHistoryFileName() { QString homeHistoryPath = getHomeDir().filePath( "history" ); @@ -2269,22 +2269,22 @@ QString getHistoryFileName() THROW_SPEC( exError ) return homeHistoryPath; } -QString getFavoritiesFileName() THROW_SPEC( exError ) +QString getFavoritiesFileName() { return getHomeDir().filePath( "favorites" ); } -QString getUserCssFileName() THROW_SPEC( exError ) +QString getUserCssFileName() { return getHomeDir().filePath( "article-style.css" ); } -QString getUserCssPrintFileName() THROW_SPEC( exError ) +QString getUserCssPrintFileName() { return getHomeDir().filePath( "article-style-print.css" ); } -QString getUserQtCssFileName() THROW_SPEC( exError ) +QString getUserQtCssFileName() { return getHomeDir().filePath( "qt-style.css" ); } diff --git a/config.hh b/config.hh index bdcd9452..f24a9162 100644 --- a/config.hh +++ b/config.hh @@ -766,38 +766,38 @@ DEF_EX( exCantWriteConfigFile, "Can't write the configuration file", exError ) DEF_EX( exMalformedConfigFile, "The configuration file is malformed", exError ) /// Loads the configuration, or creates the default one if none is present -Class load() THROW_SPEC( exError ); +Class load() ; /// Saves the configuration -void save( Class const & ) THROW_SPEC( exError ); +void save( Class const & ) ; /// Returns the configuration file name. QString getConfigFileName(); /// Returns the main configuration directory. -QString getConfigDir() THROW_SPEC( exError ); +QString getConfigDir() ; /// Returns the index directory, where the indices are to be stored. -QString getIndexDir() THROW_SPEC( exError ); +QString getIndexDir() ; /// Returns the filename of a .pid file which should store current pid of /// the process. -QString getPidFileName() THROW_SPEC( exError ); +QString getPidFileName() ; /// Returns the filename of a history file which stores search history. -QString getHistoryFileName() THROW_SPEC( exError ); +QString getHistoryFileName() ; /// Returns the filename of a favorities file. -QString getFavoritiesFileName() THROW_SPEC( exError ); +QString getFavoritiesFileName() ; /// Returns the user .css file name. -QString getUserCssFileName() THROW_SPEC( exError ); +QString getUserCssFileName() ; /// Returns the user .css file name used for printing only. -QString getUserCssPrintFileName() THROW_SPEC( exError ); +QString getUserCssPrintFileName() ; /// Returns the user .css file name for the Qt interface customization. -QString getUserQtCssFileName() THROW_SPEC( exError ); +QString getUserQtCssFileName() ; /// Returns the program's data dir. Under Linux that would be something like /// /usr/share/apps/goldendict, under Windows C:/Program Files/GoldenDict. diff --git a/cpp_features.hh b/cpp_features.hh index e15544b3..fe71f005 100644 --- a/cpp_features.hh +++ b/cpp_features.hh @@ -1,10 +1,6 @@ #ifndef __CPP_HH_INCLUDED__ #define __CPP_HH_INCLUDED__ -#if __cplusplus > 199711L -#define THROW_SPEC(...) -#else -#define THROW_SPEC(...) throw(__VA_ARGS__) -#endif + #endif // CPP_HH diff --git a/dictdfiles.cc b/dictdfiles.cc index c33797b7..f1e7868d 100644 --- a/dictdfiles.cc +++ b/dictdfiles.cc @@ -124,7 +124,7 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -258,7 +258,7 @@ sptr< Dictionary::DataRequest > DictdDictionary::getArticle( wstring const & wor vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { try { @@ -583,7 +583,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/dictdfiles.hh b/dictdfiles.hh index a71a1e6c..d4c6584d 100644 --- a/dictdfiles.hh +++ b/dictdfiles.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/dictionary.cc b/dictionary.cc index 53f61698..03234926 100644 --- a/dictionary.cc +++ b/dictionary.cc @@ -73,7 +73,7 @@ size_t WordSearchRequest::matchesCount() return matches.size(); } -WordMatch WordSearchRequest::operator [] ( size_t index ) THROW_SPEC( exIndexOutOfRange ) +WordMatch WordSearchRequest::operator [] ( size_t index ) { Mutex::Lock _( dataMutex ); @@ -83,7 +83,7 @@ WordMatch WordSearchRequest::operator [] ( size_t index ) THROW_SPEC( exIndexOut return matches[ index ]; } -vector< WordMatch > & WordSearchRequest::getAllMatches() THROW_SPEC( exRequestUnfinished ) +vector< WordMatch > & WordSearchRequest::getAllMatches() { if ( !isFinished() ) throw exRequestUnfinished(); @@ -112,7 +112,7 @@ long DataRequest::dataSize() } void DataRequest::getDataSlice( size_t offset, size_t size, void * buffer ) - THROW_SPEC( exSliceOutOfRange ) + { if ( size == 0 ) return; @@ -125,7 +125,7 @@ void DataRequest::getDataSlice( size_t offset, size_t size, void * buffer ) memcpy( buffer, &data[ offset ], size ); } -vector< char > & DataRequest::getFullData() THROW_SPEC( exRequestUnfinished ) +vector< char > & DataRequest::getFullData() { if ( !isFinished() ) throw exRequestUnfinished(); @@ -147,13 +147,13 @@ sptr< WordSearchRequest > Class::stemmedMatch( wstring const & /*str*/, unsigned /*minLength*/, unsigned /*maxSuffixVariation*/, unsigned long /*maxResults*/ ) - THROW_SPEC( std::exception ) + { return new WordSearchRequestInstant(); } sptr< WordSearchRequest > Class::findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ) + { return new WordSearchRequestInstant(); } @@ -165,7 +165,7 @@ vector< wstring > Class::getAlternateWritings( wstring const & ) } sptr< DataRequest > Class::getResource( string const & /*name*/ ) - THROW_SPEC( std::exception ) + { return new DataRequestInstant( false ); } diff --git a/dictionary.hh b/dictionary.hh index 148793a5..b1877791 100644 --- a/dictionary.hh +++ b/dictionary.hh @@ -144,11 +144,11 @@ public: /// Returns the match with the given zero-based index, which should be less /// than matchesCount(). - WordMatch operator [] ( size_t index ) THROW_SPEC( exIndexOutOfRange ); + WordMatch operator [] ( size_t index ) ; /// Returns all the matches found. Since no further locking can or would be /// done, this can only be called after the request has finished. - vector< WordMatch > & getAllMatches() THROW_SPEC( exRequestUnfinished ); + vector< WordMatch > & getAllMatches() ; /// Returns true if the match was uncertain -- that is, there may be more /// results in the dictionary itself, the dictionary index isn't good enough @@ -188,11 +188,11 @@ public: /// Writes "size" bytes starting from "offset" of the data read to the given /// buffer. "size + offset" must be <= than dataSize(). void getDataSlice( size_t offset, size_t size, void * buffer ) - THROW_SPEC( exSliceOutOfRange ); + ; /// Returns all the data read. Since no further locking can or would be /// done, this can only be called after the request has finished. - vector< char > & getFullData() THROW_SPEC( exRequestUnfinished ); + vector< char > & getFullData() ; DataRequest(): hasAnyData( false ) {} @@ -344,7 +344,7 @@ public: /// be stored. The whole operation is supposed to be fast, though some /// dictionaries, the network ones particularly, may of course be slow. virtual sptr< WordSearchRequest > prefixMatch( wstring const &, - unsigned long maxResults ) THROW_SPEC( std::exception )=0; + unsigned long maxResults ) =0; /// Looks up a given word in the dictionary, aiming to find different forms /// of the given word by allowing suffix variations. This means allowing words @@ -357,14 +357,14 @@ public: virtual sptr< WordSearchRequest > stemmedMatch( wstring const &, unsigned minLength, unsigned maxSuffixVariation, - unsigned long maxResults ) THROW_SPEC( std::exception ); + unsigned long maxResults ) ; /// Finds known headwords for the given word, that is, the words for which /// the given word is a synonym. If a dictionary can't perform this operation, /// it should leave the default implementation which always returns an empty /// result. virtual sptr< WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; /// For a given word, provides alternate writings of it which are to be looked /// up alongside with it. Transliteration dictionaries implement this. The @@ -385,14 +385,14 @@ public: vector< wstring > const & alts, wstring const & context = wstring(), bool ignoreDiacritics = false ) - THROW_SPEC( std::exception )=0; + =0; /// Loads contents of a resource named 'name' into the 'data' vector. This is /// usually a picture file referenced in the article or something like that. /// The default implementation always returns the non-existing resource /// response. virtual sptr< DataRequest > getResource( string const & /*name*/ ) - THROW_SPEC( std::exception ); + ; /// Returns a results of full-text search of given string similar getArticle(). virtual sptr< DataRequest > getSearchResults( QString const & searchString, diff --git a/dictserver.cc b/dictserver.cc index 151c32df..1a24360c 100644 --- a/dictserver.cc +++ b/dictserver.cc @@ -222,11 +222,11 @@ public: { return 0; } virtual sptr< WordSearchRequest > prefixMatch( wstring const &, - unsigned long maxResults ) THROW_SPEC( std::exception ); + unsigned long maxResults ) ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; virtual quint32 getLangFrom() const { return langId; } @@ -918,7 +918,7 @@ void DictServerArticleRequest::cancel() sptr< WordSearchRequest > DictServerDictionary::prefixMatch( wstring const & word, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { (void) maxResults; if ( word.size() > 80 ) @@ -934,7 +934,7 @@ sptr< WordSearchRequest > DictServerDictionary::prefixMatch( wstring const & wor sptr< DataRequest > DictServerDictionary::getArticle( wstring const & word, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ) + { if ( word.size() > 80 ) { @@ -949,7 +949,7 @@ sptr< DataRequest > DictServerDictionary::getArticle( wstring const & word, } // Anonimuos namespace vector< sptr< Dictionary::Class > > makeDictionaries( Config::DictServers const & servers ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/dictserver.hh b/dictserver.hh index 39d093e5..fa387d8a 100644 --- a/dictserver.hh +++ b/dictserver.hh @@ -12,7 +12,7 @@ using std::string; vector< sptr< Dictionary::Class > > makeDictionaries( Config::DictServers const & servers ) - THROW_SPEC( std::exception ); + ; } diff --git a/dsl.cc b/dsl.cc index 740f1fb8..a5d8c85d 100644 --- a/dsl.cc +++ b/dsl.cc @@ -217,10 +217,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getSearchResults( QString const & searchString, int searchMode, bool matchCase, @@ -1799,7 +1799,7 @@ sptr< Dictionary::DataRequest > DslDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new DslArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1985,7 +1985,7 @@ void DslResourceRequest::run() } sptr< Dictionary::DataRequest > DslDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new DslResourceRequest( *this, name ); } @@ -2010,7 +2010,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing & initializing, int maxPictureWidth, unsigned int maxHeadwordSize ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/dsl.hh b/dsl.hh index 958cbed0..8641723f 100644 --- a/dsl.hh +++ b/dsl.hh @@ -17,7 +17,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing &, int maxPictureWidth, unsigned int maxHeadwordSize ) - THROW_SPEC( std::exception ); + ; } diff --git a/dsl_details.cc b/dsl_details.cc index 843224f4..ec960258 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -780,7 +780,7 @@ void ArticleDom::closeTag( wstring const & name, } } -void ArticleDom::nextChar() THROW_SPEC( eot ) +void ArticleDom::nextChar() { if ( !*stringPos ) throw eot(); @@ -825,7 +825,7 @@ bool ArticleDom::atSignFirstInLine() /////////////// DslScanner -DslScanner::DslScanner( string const & fileName ) THROW_SPEC( Ex, Iconv::Ex ): +DslScanner::DslScanner( string const & fileName ) : encoding( Utf8::Windows1252 ), readBufferPtr( readBuffer ), readBufferLeft( 0 ), linesRead( 0 ) { @@ -995,8 +995,7 @@ DslScanner::~DslScanner() throw() gzclose( f ); } -bool DslScanner::readNextLine( wstring & out, size_t & offset, bool only_head_word ) THROW_SPEC( Ex, - Iconv::Ex ) +bool DslScanner::readNextLine( wstring & out, size_t & offset, bool only_head_word ) { offset = (size_t)( gztell( f ) - readBufferLeft/*+pos*/ ); @@ -1050,7 +1049,7 @@ bool DslScanner::readNextLine( wstring & out, size_t & offset, bool only_head_wo } bool DslScanner::readNextLineWithoutComments( wstring & out, size_t & offset , bool only_headword) - THROW_SPEC( Ex, Iconv::Ex ) + { wstring str; bool commentToNextLine = false; diff --git a/dsl_details.hh b/dsl_details.hh index 0b22335d..c1be6918 100644 --- a/dsl_details.hh +++ b/dsl_details.hh @@ -91,7 +91,7 @@ private: unsigned transcriptionCount; // >0 = inside a [t] tag unsigned mediaCount; // >0 = inside a [s] tag - void nextChar() THROW_SPEC( eot ); + void nextChar() ; /// Information for diagnostic purposes string dictionaryName; @@ -125,7 +125,7 @@ public: DEF_EX( exUnknownCodePage, "The .dsl file specified an unknown code page", Ex ) DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really - DslScanner( string const & fileName ) THROW_SPEC( Ex, Iconv::Ex ); + DslScanner( string const & fileName ) ; ~DslScanner() throw(); /// Returns the detected encoding of this file. @@ -154,10 +154,10 @@ public: /// If end of file is reached, false is returned. /// Reading begins from the first line after the headers (ones which start /// with #). - bool readNextLine( wstring &, size_t & offset, bool only_head_word = false ) THROW_SPEC( Ex, Iconv::Ex ); + bool readNextLine( wstring &, size_t & offset, bool only_head_word = false ) ; /// Similar readNextLine but strip all DSL comments {{...}} - bool readNextLineWithoutComments( wstring &, size_t & offset, bool only_headword = false ) THROW_SPEC( Ex, Iconv::Ex ); + bool readNextLineWithoutComments( wstring &, size_t & offset, bool only_headword = false ) ; /// Returns the number of lines read so far from the file. unsigned getLinesRead() const diff --git a/epwing.cc b/epwing.cc index fa61ed53..2f50575b 100644 --- a/epwing.cc +++ b/epwing.cc @@ -120,10 +120,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getSearchResults( QString const & searchString, int searchMode, bool matchCase, @@ -153,13 +153,13 @@ public: virtual sptr< Dictionary::WordSearchRequest > prefixMatch( wstring const &, unsigned long ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::WordSearchRequest > stemmedMatch( wstring const &, unsigned minLength, unsigned maxSuffixVariation, unsigned long maxResults ) - THROW_SPEC( std::exception ); + ; protected: @@ -657,7 +657,7 @@ sptr< Dictionary::DataRequest > EpwingDictionary::getArticle( wstring const & wo vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new EpwingArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -785,7 +785,7 @@ void EpwingResourceRequest::run() } sptr< Dictionary::DataRequest > EpwingDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new EpwingResourceRequest( *this, name ); } @@ -932,7 +932,7 @@ void EpwingWordSearchRequest::findMatches() sptr< Dictionary::WordSearchRequest > EpwingDictionary::prefixMatch( wstring const & str, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { return new EpwingWordSearchRequest( *this, str, 0, -1, true, maxResults ); } @@ -940,7 +940,7 @@ sptr< Dictionary::WordSearchRequest > EpwingDictionary::prefixMatch( sptr< Dictionary::WordSearchRequest > EpwingDictionary::stemmedMatch( wstring const & str, unsigned minLength, unsigned maxSuffixVariation, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { return new EpwingWordSearchRequest( *this, str, minLength, (int)maxSuffixVariation, false, maxResults ); @@ -952,7 +952,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/epwing.hh b/epwing.hh index 9b94e3d0..8ce85e26 100644 --- a/epwing.hh +++ b/epwing.hh @@ -13,7 +13,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } #endif // __EPWING_HH__INCLUDED__ diff --git a/externalviewer.cc b/externalviewer.cc index 71683fc3..ac76003c 100644 --- a/externalviewer.cc +++ b/externalviewer.cc @@ -10,7 +10,7 @@ ExternalViewer::ExternalViewer( const char * data, int size, QString const & extension, QString const & viewerCmdLine_, QObject * parent) - THROW_SPEC( exCantCreateTempFile ): + : QObject( parent ), tempFile( QDir::temp().filePath( QString( "gd-XXXXXXXX." ) + extension ) ), viewer( this ), @@ -31,7 +31,7 @@ ExternalViewer::ExternalViewer( const char * data, int size, GD_DPRINTF( "%s\n", tempFile.fileName().toLocal8Bit().data() ); } -void ExternalViewer::start() THROW_SPEC( exCantRunViewer ) +void ExternalViewer::start() { connect( &viewer, SIGNAL( finished( int, QProcess::ExitStatus ) ), this, SLOT( deleteLater() ) ); diff --git a/externalviewer.hh b/externalviewer.hh index a17f967c..46db5d6f 100644 --- a/externalviewer.hh +++ b/externalviewer.hh @@ -29,11 +29,11 @@ public: ExternalViewer( const char * data, int size, QString const & extension, QString const & viewerCmdLine, QObject * parent = 0 ) - THROW_SPEC( exCantCreateTempFile ); + ; // Once this is called, the object will be deleted when it's done, even if // the function throws. - void start() THROW_SPEC( exCantRunViewer ); + void start() ; /// If the external process is running, requests its termination and returns /// false - expect the QObject::destroyed() signal to be emitted soon. diff --git a/file.cc b/file.cc index 12ddbdbb..bee19fdc 100644 --- a/file.cc +++ b/file.cc @@ -80,7 +80,7 @@ bool exists( char const * filename ) throw() #endif } -void Class::open( char const * filename, char const * mode ) THROW_SPEC( exCantOpen ) +void Class::open( char const * filename, char const * mode ) { QFile::OpenMode openMode = QIODevice::Text; const char * pch = mode; @@ -110,19 +110,19 @@ void Class::open( char const * filename, char const * mode ) THROW_SPEC( exCantO throw exCantOpen( std::string( filename ) + ": " + f.errorString().toUtf8().data() ); } -Class::Class( char const * filename, char const * mode ) THROW_SPEC( exCantOpen ): +Class::Class( char const * filename, char const * mode ) : writeBuffer( 0 ) { open( filename, mode ); } Class::Class( std::string const & filename, char const * mode ) - THROW_SPEC( exCantOpen ): writeBuffer( 0 ) + : writeBuffer( 0 ) { open( filename.c_str(), mode ); } -void Class::read( void * buf, qint64 size ) THROW_SPEC( exReadError, exWriteError ) +void Class::read( void * buf, qint64 size ) { if ( !size ) return; @@ -136,7 +136,7 @@ void Class::read( void * buf, qint64 size ) THROW_SPEC( exReadError, exWriteErro throw exReadError(); } -size_t Class::readRecords( void * buf, qint64 size, size_t count ) THROW_SPEC( exWriteError ) +size_t Class::readRecords( void * buf, qint64 size, size_t count ) { if ( writeBuffer ) flushWriteBuffer(); @@ -145,7 +145,7 @@ size_t Class::readRecords( void * buf, qint64 size, size_t count ) THROW_SPEC( e return result < 0 ? result : result / size; } -void Class::write( void const * buf, qint64 size ) THROW_SPEC( exWriteError, exAllocation ) +void Class::write( void const * buf, qint64 size ) { if ( !size ) return; @@ -193,7 +193,7 @@ void Class::write( void const * buf, qint64 size ) THROW_SPEC( exWriteError, exA } size_t Class::writeRecords( void const * buf, qint64 size, size_t count ) - THROW_SPEC( exWriteError ) + { flushWriteBuffer(); @@ -202,7 +202,7 @@ size_t Class::writeRecords( void const * buf, qint64 size, size_t count ) } char * Class::gets( char * s, int size, bool stripNl ) - THROW_SPEC( exWriteError ) + { if ( writeBuffer ) flushWriteBuffer(); @@ -229,7 +229,7 @@ char * Class::gets( char * s, int size, bool stripNl ) return result; } -std::string Class::gets( bool stripNl ) THROW_SPEC( exReadError, exWriteError ) +std::string Class::gets( bool stripNl ) { char buf[ 1024 ]; @@ -239,7 +239,7 @@ std::string Class::gets( bool stripNl ) THROW_SPEC( exReadError, exWriteError ) return std::string( buf ); } -void Class::seek( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) +void Class::seek( qint64 offset ) { if ( writeBuffer ) flushWriteBuffer(); @@ -248,7 +248,7 @@ void Class::seek( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) throw exSeekError(); } -void Class::seekCur( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) +void Class::seekCur( qint64 offset ) { if ( writeBuffer ) flushWriteBuffer(); @@ -257,7 +257,7 @@ void Class::seekCur( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) throw exSeekError(); } -void Class::seekEnd( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) +void Class::seekEnd( qint64 offset ) { if ( writeBuffer ) flushWriteBuffer(); @@ -266,12 +266,12 @@ void Class::seekEnd( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ) throw exSeekError(); } -void Class::rewind() THROW_SPEC( exSeekError, exWriteError ) +void Class::rewind() { seek( 0 ); } -qint64 Class::tell() THROW_SPEC( exSeekError ) +qint64 Class::tell() { qint64 result = f.pos(); @@ -284,7 +284,7 @@ qint64 Class::tell() THROW_SPEC( exSeekError ) return result; } -bool Class::eof() THROW_SPEC( exWriteError ) +bool Class::eof() { if ( writeBuffer ) flushWriteBuffer(); @@ -292,14 +292,14 @@ bool Class::eof() THROW_SPEC( exWriteError ) return f.atEnd(); } -QFile & Class::file() THROW_SPEC( exWriteError ) +QFile & Class::file() { flushWriteBuffer(); return f; } -void Class::close() THROW_SPEC( exWriteError ) +void Class::close() { releaseWriteBuffer(); f.close(); @@ -320,7 +320,7 @@ Class::~Class() throw() } } -void Class::flushWriteBuffer() THROW_SPEC( exWriteError ) +void Class::flushWriteBuffer() { if ( writeBuffer && writeBufferLeft != WriteBufferSize ) { @@ -333,7 +333,7 @@ void Class::flushWriteBuffer() THROW_SPEC( exWriteError ) } } -void Class::releaseWriteBuffer() THROW_SPEC( exWriteError ) +void Class::releaseWriteBuffer() { flushWriteBuffer(); diff --git a/file.hh b/file.hh index 5bcd2ec1..f4b5f216 100644 --- a/file.hh +++ b/file.hh @@ -42,29 +42,29 @@ class Class char * writeBuffer; qint64 writeBufferLeft; - void open( char const * filename, char const * mode ) THROW_SPEC( exCantOpen ); + void open( char const * filename, char const * mode ) ; public: - Class( char const * filename, char const * mode ) THROW_SPEC( exCantOpen ); + Class( char const * filename, char const * mode ) ; - Class( std::string const & filename, char const * mode ) THROW_SPEC( exCantOpen ); + Class( std::string const & filename, char const * mode ) ; /// Reads the number of bytes to the buffer, throws an error if it /// failed to fill the whole buffer (short read, i/o error etc). - void read( void * buf, qint64 size ) THROW_SPEC( exReadError, exWriteError ); + void read( void * buf, qint64 size ) ; template< typename T > - void read( T & value ) THROW_SPEC( exReadError, exWriteError ) + void read( T & value ) { read( &value, sizeof( value ) ); } template< typename T > - T read() THROW_SPEC( exReadError, exWriteError ) + T read() { T value; read( value ); return value; } /// Attempts reading at most 'count' records sized 'size'. Returns /// the number of records it managed to read, up to 'count'. - size_t readRecords( void * buf, qint64 size, size_t count ) THROW_SPEC( exWriteError ); + size_t readRecords( void * buf, qint64 size, size_t count ) ; /// Writes the number of bytes from the buffer, throws an error if it /// failed to write the whole buffer (short write, i/o error etc). @@ -72,10 +72,10 @@ public: /// end up on disk immediately, or a short write may occur later /// than it really did. If you don't want write buffering, use /// writeRecords() function instead. - void write( void const * buf, qint64 size ) THROW_SPEC( exWriteError, exAllocation ); + void write( void const * buf, qint64 size ) ; template< typename T > - void write( T const & value ) THROW_SPEC( exWriteError ) + void write( T const & value ) { write( &value, sizeof( value ) ); } /// Attempts writing at most 'count' records sized 'size'. Returns @@ -83,46 +83,46 @@ public: /// This function does not employ buffering, but flushes the buffer if it /// was used before. size_t writeRecords( void const * buf, qint64 size, size_t count ) - THROW_SPEC( exWriteError ); + ; /// Reads a string from the file. Unlike the normal fgets(), this one /// can strip the trailing newline character, if this was requested. /// Returns either s or 0 if no characters were read. - char * gets( char * s, int size, bool stripNl = false ) THROW_SPEC( exWriteError ); + char * gets( char * s, int size, bool stripNl = false ) ; /// Like the above, but uses its own local internal buffer (1024 bytes /// currently), and strips newlines by default. - std::string gets( bool stripNl = true ) THROW_SPEC( exReadError, exWriteError ); + std::string gets( bool stripNl = true ) ; /// Seeks in the file, relative to its beginning. - void seek( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ); + void seek( qint64 offset ) ; /// Seeks in the file, relative to the current position. - void seekCur( qint64 offset ) THROW_SPEC( exSeekError, exWriteError ); + void seekCur( qint64 offset ) ; /// Seeks in the file, relative to the end of file. - void seekEnd( qint64 offset = 0 ) THROW_SPEC( exSeekError, exWriteError ); + void seekEnd( qint64 offset = 0 ) ; /// Seeks to the beginning of file - void rewind() THROW_SPEC( exSeekError, exWriteError ); + void rewind() ; /// Tells the current position within the file, relative to its beginning. - qint64 tell() THROW_SPEC( exSeekError ); + qint64 tell() ; /// Returns true if end-of-file condition is set. - bool eof() THROW_SPEC( exWriteError ); + bool eof() ; /// Returns the underlying FILE * record, so other operations can be /// performed on it. - QFile & file() THROW_SPEC( exWriteError ); + QFile & file() ; /// Closes the file. No further operations are valid. - void close() THROW_SPEC( exWriteError ); + void close() ; ~Class() throw(); private: - void flushWriteBuffer() THROW_SPEC( exWriteError ); - void releaseWriteBuffer() THROW_SPEC( exWriteError ); + void flushWriteBuffer() ; + void releaseWriteBuffer() ; }; } diff --git a/forvo.cc b/forvo.cc index c225990d..c9bcd245 100644 --- a/forvo.cc +++ b/forvo.cc @@ -55,7 +55,7 @@ public: { return 0; } virtual sptr< WordSearchRequest > prefixMatch( wstring const & /*word*/, - unsigned long /*maxResults*/ ) THROW_SPEC( std::exception ) + unsigned long /*maxResults*/ ) { sptr< WordSearchRequestInstant > sr = new WordSearchRequestInstant; @@ -66,7 +66,7 @@ public: virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; protected: @@ -77,7 +77,7 @@ protected: sptr< DataRequest > ForvoDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ) + { if ( word.size() > 80 ) { @@ -347,7 +347,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Dictionary::Initializing &, Config::Forvo const & forvo, QNetworkAccessManager & mgr ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/forvo.hh b/forvo.hh index c9588ed6..0607ba79 100644 --- a/forvo.hh +++ b/forvo.hh @@ -21,7 +21,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Dictionary::Initializing &, Config::Forvo const &, QNetworkAccessManager & ) - THROW_SPEC( std::exception ); + ; /// Exposed here for moc class ForvoArticleRequest: public Dictionary::DataRequest diff --git a/german.cc b/german.cc index 402896c3..7caaadaf 100644 --- a/german.cc +++ b/german.cc @@ -40,7 +40,7 @@ GermanTable::GermanTable() } -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ) +sptr< Dictionary::Class > makeDictionary() { static GermanTable t; diff --git a/german.hh b/german.hh index d4c82d32..38afbe71 100644 --- a/german.hh +++ b/german.hh @@ -9,7 +9,7 @@ // Support for German transliteration namespace GermanTranslit { -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ); +sptr< Dictionary::Class > makeDictionary() ; } diff --git a/gls.cc b/gls.cc index d1fc2c13..c2546dff 100644 --- a/gls.cc +++ b/gls.cc @@ -83,7 +83,7 @@ public: DEF_EX_STR( exMalformedGlsFile, "The .gls file is malformed:", Ex ) DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really - GlsScanner( string const & fileName ) THROW_SPEC( Ex, Iconv::Ex ); + GlsScanner( string const & fileName ) ; ~GlsScanner() throw(); /// Returns the detected encoding of this file. @@ -116,13 +116,13 @@ public: /// If end of file is reached, false is returned. /// Reading begins from the first line after the headers (ones which end /// by the "### Glossary section:" line). - bool readNextLine( wstring &, size_t & offset ) THROW_SPEC( Ex, Iconv::Ex ); + bool readNextLine( wstring &, size_t & offset ) ; /// Returns the number of lines read so far from the file. unsigned getLinesRead() const { return linesRead; } }; -GlsScanner::GlsScanner( string const & fileName ) THROW_SPEC( Ex, Iconv::Ex ): +GlsScanner::GlsScanner( string const & fileName ) : encoding( Utf8::Utf8 ), readBufferPtr( readBuffer ), readBufferLeft( 0 ), linesRead( 0 ) { @@ -242,8 +242,7 @@ GlsScanner::GlsScanner( string const & fileName ) THROW_SPEC( Ex, Iconv::Ex ): } } -bool GlsScanner::readNextLine( wstring & out, size_t & offset ) THROW_SPEC( Ex, - Iconv::Ex ) +bool GlsScanner::readNextLine( wstring & out, size_t & offset ) { offset = (size_t)(gztell(f) - readBufferLeft); @@ -393,16 +392,16 @@ public: { return idxHeader.langTo; } virtual sptr< Dictionary::WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -979,7 +978,7 @@ void GlsHeadwordsRequest::run() sptr< Dictionary::WordSearchRequest > GlsDictionary::findHeadwordsForSynonym( wstring const & word ) - THROW_SPEC( std::exception ) + { return synonymSearchEnabled ? new GlsHeadwordsRequest( word, *this ) : Class::findHeadwordsForSynonym( word ); @@ -1161,7 +1160,7 @@ sptr< Dictionary::DataRequest > GlsDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new GlsArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1380,7 +1379,7 @@ void GlsResourceRequest::run() } sptr< Dictionary::DataRequest > GlsDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new GlsResourceRequest( *this, name ); } @@ -1403,7 +1402,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/gls.hh b/gls.hh index 6b96e9be..b022d094 100644 --- a/gls.hh +++ b/gls.hh @@ -13,7 +13,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/greektranslit.cc b/greektranslit.cc index 1d43324f..7d88c2be 100644 --- a/greektranslit.cc +++ b/greektranslit.cc @@ -831,7 +831,7 @@ GreekTable::GreekTable() } -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ) +sptr< Dictionary::Class > makeDictionary() { static GreekTable t; diff --git a/greektranslit.hh b/greektranslit.hh index 9f0d125b..184f4220 100644 --- a/greektranslit.hh +++ b/greektranslit.hh @@ -9,7 +9,7 @@ // Support for Greek transliteration namespace GreekTranslit { -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ); +sptr< Dictionary::Class > makeDictionary() ; } diff --git a/hunspell.cc b/hunspell.cc index ef5c9d3c..c1badab8 100644 --- a/hunspell.cc +++ b/hunspell.cc @@ -73,16 +73,16 @@ public: virtual sptr< WordSearchRequest > prefixMatch( wstring const &, unsigned long maxResults ) - THROW_SPEC( std::exception ); + ; virtual sptr< WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; virtual bool isLocalDictionary() { return true; } @@ -366,7 +366,7 @@ void HunspellArticleRequest::run() sptr< DataRequest > HunspellDictionary::getArticle( wstring const & word, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ) + { return new HunspellArticleRequest( word, getHunspellMutex(), hunspell ); } @@ -566,7 +566,7 @@ QVector< wstring > suggest( wstring & word, Mutex & hunspellMutex, Hunspell & hu sptr< WordSearchRequest > HunspellDictionary::findHeadwordsForSynonym( wstring const & word ) - THROW_SPEC( std::exception ) + { return new HunspellHeadwordsRequest( word, getHunspellMutex(), hunspell ); } @@ -685,7 +685,7 @@ void HunspellPrefixMatchRequest::run() sptr< WordSearchRequest > HunspellDictionary::prefixMatch( wstring const & word, unsigned long /*maxResults*/ ) - THROW_SPEC( std::exception ) + { return new HunspellPrefixMatchRequest( word, getHunspellMutex(), hunspell ); } @@ -828,7 +828,7 @@ wstring decodeFromHunspell( Hunspell & hunspell, char const * str ) } vector< sptr< Dictionary::Class > > makeDictionaries( Config::Hunspell const & cfg ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/hunspell.hh b/hunspell.hh index bdeb99c2..ee52b81d 100644 --- a/hunspell.hh +++ b/hunspell.hh @@ -34,7 +34,7 @@ struct DataFiles vector< DataFiles > findDataFiles( QString const & path ); vector< sptr< Dictionary::Class > > makeDictionaries( Config::Hunspell const & ) - THROW_SPEC( std::exception ); + ; } diff --git a/iconv.cc b/iconv.cc index b7ddb40a..0a6e2113 100644 --- a/iconv.cc +++ b/iconv.cc @@ -18,14 +18,14 @@ char const * const Iconv::Utf8 = "UTF-8"; using gd::wchar; -Iconv::Iconv( char const * to, char const * from ) THROW_SPEC( exCantInit ): +Iconv::Iconv( char const * to, char const * from ) : state( iconv_open( to, from ) ) { if ( state == (iconv_t) -1 ) throw exCantInit( strerror( errno ) ); } -void Iconv::reinit( char const * to, char const * from ) THROW_SPEC( exCantInit ) +void Iconv::reinit( char const * to, char const * from ) { iconv_close( state ); @@ -42,7 +42,7 @@ Iconv::~Iconv() throw() Iconv::Result Iconv::convert( void const * & inBuf, size_t & inBytesLeft, void * & outBuf, size_t & outBytesLeft ) - THROW_SPEC( exIncorrectSeq, exOther ) + { size_t result = iconv( state, // #ifdef __WIN32 @@ -73,7 +73,7 @@ Iconv::Result Iconv::convert( void const * & inBuf, size_t & inBytesLeft, gd::wstring Iconv::toWstring( char const * fromEncoding, void const * fromData, size_t dataSize ) - THROW_SPEC( exCantInit, exIncorrectSeq, exPrematureEnd, exOther ) + { /// Special-case the dataSize == 0 to avoid any kind of iconv-specific /// behaviour in that regard. @@ -114,7 +114,7 @@ gd::wstring Iconv::toWstring( char const * fromEncoding, void const * fromData, std::string Iconv::toUtf8( char const * fromEncoding, void const * fromData, size_t dataSize ) - THROW_SPEC( exCantInit, exIncorrectSeq, exPrematureEnd, exOther ) + { // Similar to toWstring diff --git a/iconv.hh b/iconv.hh index 4edad0fd..ab99cb8f 100644 --- a/iconv.hh +++ b/iconv.hh @@ -28,10 +28,10 @@ public: static char const * const Utf16Le; static char const * const Utf8; - Iconv( char const * to, char const * from ) THROW_SPEC( exCantInit ); + Iconv( char const * to, char const * from ) ; // Changes to another pair of encodings. All the internal state is reset. - void reinit( char const * to, char const * from ) THROW_SPEC( exCantInit ); + void reinit( char const * to, char const * from ) ; ~Iconv() throw(); @@ -43,19 +43,18 @@ public: }; Result convert( void const * & inBuf, size_t & inBytesLeft, - void * & outBuf, size_t & outBytesLeft ) THROW_SPEC( exIncorrectSeq, - exOther ); + void * & outBuf, size_t & outBytesLeft ); // Converts a given block of data from the given encoding to a wide string. static gd::wstring toWstring( char const * fromEncoding, void const * fromData, size_t dataSize ) - THROW_SPEC( exCantInit, exIncorrectSeq, exPrematureEnd, exOther ); + ; // Converts a given block of data from the given encoding to an utf8-encoded // string. static std::string toUtf8( char const * fromEncoding, void const * fromData, size_t dataSize ) - THROW_SPEC( exCantInit, exIncorrectSeq, exPrematureEnd, exOther ); + ; private: diff --git a/lsa.cc b/lsa.cc index 9e8c4f20..09e55ad9 100644 --- a/lsa.cc +++ b/lsa.cc @@ -179,10 +179,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; protected: @@ -217,7 +217,7 @@ sptr< Dictionary::DataRequest > LsaDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { vector< WordArticleLink > chain = findArticles( word, ignoreDiacritics ); @@ -399,7 +399,7 @@ __attribute__((packed)) ; sptr< Dictionary::DataRequest > LsaDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { // See if the name ends in .wav. Remove that extension then @@ -524,7 +524,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/lsa.hh b/lsa.hh index 6bb2456d..96751f71 100644 --- a/lsa.hh +++ b/lsa.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/mdx.cc b/mdx.cc index 47047196..7772be81 100644 --- a/mdx.cc +++ b/mdx.cc @@ -246,8 +246,8 @@ public: virtual sptr< Dictionary::DataRequest > getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, - bool ignoreDiacritics ) THROW_SPEC( std::exception ); - virtual sptr< Dictionary::DataRequest > getResource( string const & name ) THROW_SPEC( std::exception ); + bool ignoreDiacritics ) ; + virtual sptr< Dictionary::DataRequest > getResource( string const & name ) ; virtual QString const & getDescription(); virtual sptr< Dictionary::DataRequest > getSearchResults( QString const & searchString, @@ -720,7 +720,7 @@ void MdxArticleRequest::run() } sptr MdxDictionary::getArticle( const wstring & word, const vector & alts, - const wstring &, bool ignoreDiacritics ) THROW_SPEC( std::exception ) + const wstring &, bool ignoreDiacritics ) { return new MdxArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -923,7 +923,7 @@ void MddResourceRequest::run() finish(); } -sptr MdxDictionary::getResource( const string & name ) THROW_SPEC( std::exception ) +sptr MdxDictionary::getResource( const string & name ) { return new MddResourceRequest( *this, name ); } @@ -1435,7 +1435,7 @@ static void findResourceFiles( string const & mdx, vector< string > & dictFiles vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, - Dictionary::Initializing & initializing ) THROW_SPEC( std::exception ) + Dictionary::Initializing & initializing ) { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/mdx.hh b/mdx.hh index 2b304390..e8f56ce2 100644 --- a/mdx.hh +++ b/mdx.hh @@ -14,7 +14,7 @@ using std::string; vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, - Dictionary::Initializing & ) THROW_SPEC( std::exception ); + Dictionary::Initializing & ) ; } diff --git a/mediawiki.cc b/mediawiki.cc index 3ce5e981..b8630556 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -60,11 +60,11 @@ public: { return 0; } virtual sptr< WordSearchRequest > prefixMatch( wstring const &, - unsigned long maxResults ) THROW_SPEC( std::exception ); + unsigned long maxResults ) ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; virtual quint32 getLangFrom() const { return langId; } @@ -541,7 +541,7 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) sptr< WordSearchRequest > MediaWikiDictionary::prefixMatch( wstring const & word, unsigned long maxResults ) - THROW_SPEC( std::exception ) + { (void) maxResults; if ( word.size() > 80 ) @@ -557,7 +557,7 @@ sptr< WordSearchRequest > MediaWikiDictionary::prefixMatch( wstring const & word sptr< DataRequest > MediaWikiDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ) + { if ( word.size() > 80 ) { @@ -575,7 +575,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Dictionary::Initializing &, Config::MediaWikis const & wikis, QNetworkAccessManager & mgr ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/mediawiki.hh b/mediawiki.hh index e8ba98a6..54164a4a 100644 --- a/mediawiki.hh +++ b/mediawiki.hh @@ -18,7 +18,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Dictionary::Initializing &, Config::MediaWikis const & wikis, QNetworkAccessManager & ) - THROW_SPEC( std::exception ); + ; /// Exposed here for moc class MediaWikiWordSearchRequestSlots: public Dictionary::WordSearchRequest diff --git a/programs.cc b/programs.cc index 3b8c7aef..6191877e 100644 --- a/programs.cc +++ b/programs.cc @@ -44,12 +44,12 @@ public: virtual sptr< WordSearchRequest > prefixMatch( wstring const & word, unsigned long maxResults ) - THROW_SPEC( std::exception ); + ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; protected: @@ -58,7 +58,7 @@ protected: sptr< WordSearchRequest > ProgramsDictionary::prefixMatch( wstring const & word, unsigned long /*maxResults*/ ) - THROW_SPEC( std::exception ) + { if ( prg.type == Config::Program::PrefixMatch ) return new ProgramWordSearchRequest( gd::toQString( word ), prg ); @@ -74,7 +74,7 @@ sptr< WordSearchRequest > ProgramsDictionary::prefixMatch( wstring const & word, sptr< Dictionary::DataRequest > ProgramsDictionary::getArticle( wstring const & word, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ) + { switch( prg.type ) { @@ -372,7 +372,7 @@ void ProgramWordSearchRequest::cancel() vector< sptr< Dictionary::Class > > makeDictionaries( Config::Programs const & programs ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/programs.hh b/programs.hh index 6c11a665..2e53a186 100644 --- a/programs.hh +++ b/programs.hh @@ -17,7 +17,7 @@ using std::string; using gd::wstring; vector< sptr< Dictionary::Class > > makeDictionaries( Config::Programs const & ) - THROW_SPEC( std::exception ); + ; class RunInstance: public QObject { diff --git a/romaji.cc b/romaji.cc index f8aa7654..319fb4f1 100644 --- a/romaji.cc +++ b/romaji.cc @@ -92,7 +92,7 @@ HepburnKatakana::HepburnKatakana() } vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & r ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/romaji.hh b/romaji.hh index 581435db..58d08669 100644 --- a/romaji.hh +++ b/romaji.hh @@ -13,7 +13,7 @@ namespace Romaji { using std::vector; vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & ) - THROW_SPEC( std::exception ); + ; } diff --git a/russiantranslit.cc b/russiantranslit.cc index 29787b15..56f44d95 100644 --- a/russiantranslit.cc +++ b/russiantranslit.cc @@ -99,7 +99,7 @@ RussianTable::RussianTable() ins( "Ya", "Я" ); } -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ) +sptr< Dictionary::Class > makeDictionary() { static RussianTable t; diff --git a/russiantranslit.hh b/russiantranslit.hh index e5b889f6..63dffdf1 100644 --- a/russiantranslit.hh +++ b/russiantranslit.hh @@ -9,7 +9,7 @@ // Support for Russian transliteration namespace RussianTranslit { -sptr< Dictionary::Class > makeDictionary() THROW_SPEC( std::exception ); +sptr< Dictionary::Class > makeDictionary() ; } diff --git a/sdict.cc b/sdict.cc index 0df51de1..3ee0e690 100644 --- a/sdict.cc +++ b/sdict.cc @@ -163,7 +163,7 @@ class SdictDictionary: public BtreeIndexing::BtreeDictionary vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual QString const & getDescription(); @@ -663,7 +663,7 @@ sptr< Dictionary::DataRequest > SdictDictionary::getArticle( wstring const & wor vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new SdictArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -742,7 +742,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/sdict.hh b/sdict.hh index ef979c02..81de56c0 100644 --- a/sdict.hh +++ b/sdict.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/slob.cc b/slob.cc index a0e9c410..5dab738c 100644 --- a/slob.cc +++ b/slob.cc @@ -606,10 +606,10 @@ class SlobDictionary: public BtreeIndexing::BtreeDictionary vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -1486,7 +1486,7 @@ sptr< Dictionary::DataRequest > SlobDictionary::getArticle( wstring const & word vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new SlobArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1635,7 +1635,7 @@ void SlobResourceRequest::run() } sptr< Dictionary::DataRequest > SlobDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new SlobResourceRequest( *this, name ); } @@ -1646,7 +1646,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing & initializing, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/slob.hh b/slob.hh index 3be13df2..a095e3d6 100644 --- a/slob.hh +++ b/slob.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing &, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ); + ; } diff --git a/sounddir.cc b/sounddir.cc index 0bde1741..40383e6e 100644 --- a/sounddir.cc +++ b/sounddir.cc @@ -95,10 +95,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; protected: @@ -128,7 +128,7 @@ sptr< Dictionary::DataRequest > SoundDirDictionary::getArticle( wstring const & vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { vector< WordArticleLink > chain = findArticles( word, ignoreDiacritics ); @@ -306,7 +306,7 @@ void SoundDirDictionary::loadIcon() throw() } sptr< Dictionary::DataRequest > SoundDirDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { bool isNumber = false; @@ -408,7 +408,7 @@ void addDir( QDir const & baseDir, QDir const & dir, IndexedWords & indexedWords vector< sptr< Dictionary::Class > > makeDictionaries( Config::SoundDirs const & soundDirs, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/sounddir.hh b/sounddir.hh index 1b11cd17..1c3f2eb0 100644 --- a/sounddir.hh +++ b/sounddir.hh @@ -16,7 +16,7 @@ using std::string; vector< sptr< Dictionary::Class > > makeDictionaries( Config::SoundDirs const &, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/stardict.cc b/stardict.cc index eeb62d9f..fe5a4daa 100644 --- a/stardict.cc +++ b/stardict.cc @@ -170,16 +170,16 @@ public: { return idxHeader.langTo; } virtual sptr< Dictionary::WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -1310,7 +1310,7 @@ void StardictHeadwordsRequest::run() sptr< Dictionary::WordSearchRequest > StardictDictionary::findHeadwordsForSynonym( wstring const & word ) - THROW_SPEC( std::exception ) + { return synonymSearchEnabled ? new StardictHeadwordsRequest( word, *this ) : Class::findHeadwordsForSynonym( word ); @@ -1515,7 +1515,7 @@ sptr< Dictionary::DataRequest > StardictDictionary::getArticle( wstring const & vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new StardictArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1822,7 +1822,7 @@ void StardictResourceRequest::run() } sptr< Dictionary::DataRequest > StardictDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new StardictResourceRequest( *this, name ); } @@ -2005,7 +2005,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing & initializing, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/stardict.hh b/stardict.hh index 7cc53055..bfe82a23 100644 --- a/stardict.hh +++ b/stardict.hh @@ -17,7 +17,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing &, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ); + ; } diff --git a/transliteration.cc b/transliteration.cc index cee4a230..aefc13fd 100644 --- a/transliteration.cc +++ b/transliteration.cc @@ -35,17 +35,17 @@ unsigned long BaseTransliterationDictionary::getWordCount() throw() { return 0; } sptr< Dictionary::WordSearchRequest > BaseTransliterationDictionary::prefixMatch( wstring const &, - unsigned long ) THROW_SPEC( std::exception ) + unsigned long ) { return new Dictionary::WordSearchRequestInstant(); } sptr< Dictionary::DataRequest > BaseTransliterationDictionary::getArticle( wstring const &, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ) + { return new Dictionary::DataRequestInstant( false ); } sptr< Dictionary::WordSearchRequest > BaseTransliterationDictionary::findHeadwordsForSynonym( wstring const & str ) - THROW_SPEC( std::exception ) + { sptr< Dictionary::WordSearchRequestInstant > result = new Dictionary::WordSearchRequestInstant(); diff --git a/transliteration.hh b/transliteration.hh index e2ff40cf..d6d96198 100644 --- a/transliteration.hh +++ b/transliteration.hh @@ -40,15 +40,15 @@ public: throw() = 0; virtual sptr< Dictionary::WordSearchRequest > findHeadwordsForSynonym( wstring const & ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::WordSearchRequest > prefixMatch( wstring const &, - unsigned long ) THROW_SPEC( std::exception ); + unsigned long ) ; virtual sptr< Dictionary::DataRequest > getArticle( wstring const &, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; }; diff --git a/utf8.cc b/utf8.cc index ee5dd1f6..91618f92 100644 --- a/utf8.cc +++ b/utf8.cc @@ -143,7 +143,7 @@ string encode( wstring const & in ) throw() encode( in.data(), in.size(), &buffer.front() ) ); } -wstring decode( string const & in ) THROW_SPEC( exCantDecode ) +wstring decode( string const & in ) { if ( in.size() == 0 ) diff --git a/utf8.hh b/utf8.hh index ef1bc08f..81039d7d 100644 --- a/utf8.hh +++ b/utf8.hh @@ -46,7 +46,7 @@ long decode( char const * in, size_t inSize, wchar * out ); /// Versions for non time-critical code. string encode( wstring const & ) throw(); -wstring decode( string const & ) THROW_SPEC( exCantDecode ); +wstring decode( string const & ) ; /// Since the standard isspace() is locale-specific, we need something /// that would never mess up our utf8 input. The stock one worked fine under diff --git a/voiceengines.cc b/voiceengines.cc index f4353fc4..3e795b6c 100644 --- a/voiceengines.cc +++ b/voiceengines.cc @@ -58,12 +58,12 @@ public: virtual sptr< WordSearchRequest > prefixMatch( wstring const & word, unsigned long maxResults ) - THROW_SPEC( std::exception ); + ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const &, bool ) - THROW_SPEC( std::exception ); + ; protected: @@ -72,7 +72,7 @@ protected: sptr< WordSearchRequest > VoiceEnginesDictionary::prefixMatch( wstring const & /*word*/, unsigned long /*maxResults*/ ) - THROW_SPEC( std::exception ) + { WordSearchRequestInstant * sr = new WordSearchRequestInstant(); sr->setUncertain( true ); @@ -81,7 +81,7 @@ sptr< WordSearchRequest > VoiceEnginesDictionary::prefixMatch( wstring const & / sptr< Dictionary::DataRequest > VoiceEnginesDictionary::getArticle( wstring const & word, vector< wstring > const &, wstring const &, bool ) - THROW_SPEC( std::exception ) + { string result; string wordUtf8( Utf8::encode( word ) ); @@ -128,7 +128,7 @@ void VoiceEnginesDictionary::loadIcon() throw() vector< sptr< Dictionary::Class > > makeDictionaries( Config::VoiceEngines const & voiceEngines ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/voiceengines.hh b/voiceengines.hh index 85dadb37..e3d94acb 100644 --- a/voiceengines.hh +++ b/voiceengines.hh @@ -18,7 +18,7 @@ using std::string; using gd::wstring; vector< sptr< Dictionary::Class > > makeDictionaries(Config::VoiceEngines const & voiceEngines) - THROW_SPEC( std::exception ); + ; } diff --git a/website.cc b/website.cc index a2bda352..ab6dbf9c 100644 --- a/website.cc +++ b/website.cc @@ -56,14 +56,14 @@ public: { return 0; } virtual sptr< WordSearchRequest > prefixMatch( wstring const & word, - unsigned long ) THROW_SPEC( std::exception ); + unsigned long ) ; virtual sptr< DataRequest > getArticle( wstring const &, vector< wstring > const & alts, wstring const & context, bool ) - THROW_SPEC( std::exception ); + ; - virtual sptr< Dictionary::DataRequest > getResource( string const & name ) THROW_SPEC( std::exception ); + virtual sptr< Dictionary::DataRequest > getResource( string const & name ) ; void isolateWebCSS( QString & css ); @@ -73,7 +73,7 @@ protected: }; sptr< WordSearchRequest > WebSiteDictionary::prefixMatch( wstring const & /*word*/, - unsigned long ) THROW_SPEC( std::exception ) + unsigned long ) { sptr< WordSearchRequestInstant > sr = new WordSearchRequestInstant; @@ -330,7 +330,7 @@ void WebSiteArticleRequest::requestFinished( QNetworkReply * r ) sptr< DataRequest > WebSiteDictionary::getArticle( wstring const & str, vector< wstring > const &, wstring const & context, bool ) - THROW_SPEC( std::exception ) + { QByteArray urlString; @@ -509,7 +509,7 @@ void WebSiteResourceRequest::requestFinished( QNetworkReply * r ) finish(); } -sptr< Dictionary::DataRequest > WebSiteDictionary::getResource( string const & name ) THROW_SPEC( std::exception ) +sptr< Dictionary::DataRequest > WebSiteDictionary::getResource( string const & name ) { QString link = QString::fromUtf8( name.c_str() ); int pos = link.indexOf( '/' ); @@ -538,7 +538,7 @@ void WebSiteDictionary::loadIcon() throw() vector< sptr< Dictionary::Class > > makeDictionaries( Config::WebSites const & ws, QNetworkAccessManager & mgr ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > result; diff --git a/website.hh b/website.hh index 43bf7885..9fb570e0 100644 --- a/website.hh +++ b/website.hh @@ -17,7 +17,7 @@ using std::string; vector< sptr< Dictionary::Class > > makeDictionaries( Config::WebSites const &, QNetworkAccessManager & ) - THROW_SPEC( std::exception ); + ; /// Exposed here for moc class WebSiteDataRequestSlots: public Dictionary::DataRequest diff --git a/xdxf.cc b/xdxf.cc index e32caef2..536f1c95 100644 --- a/xdxf.cc +++ b/xdxf.cc @@ -167,10 +167,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -622,7 +622,7 @@ sptr< Dictionary::DataRequest > XdxfDictionary::getArticle( wstring const & word vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new XdxfArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -686,7 +686,7 @@ class GzippedFile: public QIODevice public: - GzippedFile( char const * fileName ) THROW_SPEC( exCantReadFile ); + GzippedFile( char const * fileName ) ; ~GzippedFile(); @@ -717,7 +717,7 @@ protected: { return -1; } }; -GzippedFile::GzippedFile( char const * fileName ) THROW_SPEC( exCantReadFile ) +GzippedFile::GzippedFile( char const * fileName ) { gz = gd_gzopen( fileName ); if ( !gz ) @@ -1134,7 +1134,7 @@ void XdxfResourceRequest::run() } sptr< Dictionary::DataRequest > XdxfDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new XdxfResourceRequest( *this, name ); } @@ -1146,7 +1146,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/xdxf.hh b/xdxf.hh index 880b2b50..c562a56a 100644 --- a/xdxf.hh +++ b/xdxf.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; } diff --git a/zim.cc b/zim.cc index a75097d5..8857ca02 100644 --- a/zim.cc +++ b/zim.cc @@ -584,10 +584,10 @@ class ZimDictionary: public BtreeIndexing::BtreeDictionary vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; virtual QString const& getDescription(); @@ -1330,7 +1330,7 @@ sptr< Dictionary::DataRequest > ZimDictionary::getArticle( wstring const & word, vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { return new ZimArticleRequest( word, alts, *this, ignoreDiacritics ); } @@ -1476,7 +1476,7 @@ void ZimResourceRequest::run() } sptr< Dictionary::DataRequest > ZimDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { return new ZimResourceRequest( *this, name ); } @@ -1488,7 +1488,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing & initializing, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ) + { vector< sptr< Dictionary::Class > > dictionaries; diff --git a/zim.hh b/zim.hh index 4f3b0d6c..93848f6c 100644 --- a/zim.hh +++ b/zim.hh @@ -16,7 +16,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( string const & indicesDir, Dictionary::Initializing &, unsigned maxHeadwordsToExpand ) - THROW_SPEC( std::exception ); + ; } diff --git a/zipsounds.cc b/zipsounds.cc index 839e69c0..7209923a 100644 --- a/zipsounds.cc +++ b/zipsounds.cc @@ -129,10 +129,10 @@ public: vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ); + ; virtual sptr< Dictionary::DataRequest > getResource( string const & name ) - THROW_SPEC( std::exception ); + ; protected: @@ -178,7 +178,7 @@ sptr< Dictionary::DataRequest > ZipSoundsDictionary::getArticle( wstring const & vector< wstring > const & alts, wstring const &, bool ignoreDiacritics ) - THROW_SPEC( std::exception ) + { vector< WordArticleLink > chain = findArticles( word, ignoreDiacritics ); @@ -343,7 +343,7 @@ sptr< Dictionary::DataRequest > ZipSoundsDictionary::getArticle( wstring const & } sptr< Dictionary::DataRequest > ZipSoundsDictionary::getResource( string const & name ) - THROW_SPEC( std::exception ) + { // Remove extension for sound files (like in sound dirs) @@ -410,7 +410,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) - THROW_SPEC( std::exception ) + { (void) initializing; vector< sptr< Dictionary::Class > > dictionaries; diff --git a/zipsounds.hh b/zipsounds.hh index bb392a66..d24555f6 100644 --- a/zipsounds.hh +++ b/zipsounds.hh @@ -15,7 +15,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) - THROW_SPEC( std::exception ); + ; }