kasumi-2.5-fix-build-gcc-11.patch (6783B)
1 https://bugs.gentoo.org/786738 2 3 From 84c34bc1b09ba85a66924ba50a6a33fa59d159f3 Mon Sep 17 00:00:00 2001 4 From: Sam James <sam@gentoo.org> 5 Date: Wed, 11 Aug 2021 20:32:40 +0100 6 Subject: [PATCH] Drop dynamic exceptions for C++17 7 8 --- 9 KasumiConfiguration.cxx | 17 ++++++----------- 10 KasumiConfiguration.hxx | 13 ++++++------- 11 KasumiDic.cxx | 7 ++----- 12 KasumiDic.hxx | 9 ++++----- 13 KasumiWord.cxx | 6 ++---- 14 KasumiWord.hxx | 6 ++---- 15 6 files changed, 22 insertions(+), 36 deletions(-) 16 17 diff --git a/KasumiConfiguration.cxx b/KasumiConfiguration.cxx 18 index 98a857b..543ea7c 100644 19 --- a/KasumiConfiguration.cxx 20 +++ b/KasumiConfiguration.cxx 21 @@ -57,8 +57,7 @@ using namespace std; 22 // 3. If the setting may be set by command line arguments, add some routines 23 // to loadConfigurationFromArgument method 24 25 -KasumiConfiguration::KasumiConfiguration(int argc, char *argv[]) 26 - throw(KasumiException){ 27 +KasumiConfiguration::KasumiConfiguration(int argc, char *argv[]){ 28 29 try{ 30 loadDefaultProperties(); 31 @@ -87,7 +86,7 @@ KasumiConfiguration::~KasumiConfiguration(){ 32 saveConfiguration(); 33 } 34 35 -void KasumiConfiguration::loadDefaultProperties() throw(KasumiException){ 36 +void KasumiConfiguration::loadDefaultProperties(){ 37 char *home = getenv("HOME"); 38 if(home == NULL){ 39 throw KasumiException(string("Cannot find $HOME environment variable."), 40 @@ -123,8 +122,7 @@ void KasumiConfiguration::loadDefaultProperties() throw(KasumiException){ 41 #endif // HAS_ANTHY_DICUTIL_SET_ENCODING 42 } 43 44 -void KasumiConfiguration::loadConfigurationFromArgument(int argc, char *argv[]) 45 - throw(KasumiException){ 46 +void KasumiConfiguration::loadConfigurationFromArgument(int argc, char *argv[]){ 47 int option_index = 0; 48 static struct option long_options[] = { 49 {"help", no_argument, NULL, 'h'}, 50 @@ -214,8 +212,7 @@ void KasumiConfiguration::loadConfigurationFromArgument(int argc, char *argv[]) 51 } 52 53 54 -void KasumiConfiguration::loadConfigurationFile() 55 - throw(KasumiException){ 56 +void KasumiConfiguration::loadConfigurationFile(){ 57 58 int line = 0; 59 string Contents = string(); 60 @@ -247,13 +244,11 @@ void KasumiConfiguration::loadConfigurationFile() 61 } 62 63 // ToDo: implement saveConfiguration method 64 -void KasumiConfiguration::saveConfiguration() 65 - throw(KasumiException){ 66 +void KasumiConfiguration::saveConfiguration(){ 67 68 } 69 70 -void KasumiConfiguration::checkValidity() 71 - throw(KasumiException){ 72 +void KasumiConfiguration::checkValidity(){ 73 74 if(config[string("StartupMode")] != string("MANAGE") && 75 config[string("StartupMode")] != string("ADD") && 76 diff --git a/KasumiConfiguration.hxx b/KasumiConfiguration.hxx 77 index b42c5f6..2dc7524 100644 78 --- a/KasumiConfiguration.hxx 79 +++ b/KasumiConfiguration.hxx 80 @@ -38,16 +38,15 @@ private: 81 map<string, string> config; 82 string ConfFileName; 83 84 - void loadDefaultProperties() throw(KasumiException); 85 - void loadConfigurationFile() throw (KasumiException); 86 - void loadConfigurationFromArgument(int argc, char *argv[]) 87 - throw(KasumiException); 88 - void saveConfiguration() throw (KasumiException); 89 + void loadDefaultProperties(); 90 + void loadConfigurationFile(); 91 + void loadConfigurationFromArgument(int argc, char *argv[]); 92 + void saveConfiguration(); 93 94 void setPropertyValue(const string &name, const string &value); 95 - void checkValidity() throw(KasumiException); 96 + void checkValidity(); 97 public: 98 - KasumiConfiguration(int argc, char *argv[]) throw (KasumiException); 99 + KasumiConfiguration(int argc, char *argv[]); 100 ~KasumiConfiguration(); 101 string getPropertyValue(const string &name); 102 int getPropertyValueByInt(const string &name); 103 diff --git a/KasumiDic.cxx b/KasumiDic.cxx 104 index 291123b..19e88b4 100644 105 --- a/KasumiDic.cxx 106 +++ b/KasumiDic.cxx 107 @@ -46,8 +46,7 @@ using namespace std; 108 #define OptionOutput( Word, OptionName ) (string(OptionName) + " = " + (Word->getOption(OptionName) ? "y" : "n")) 109 #define BUFFER_SIZE (255) 110 111 -KasumiDic::KasumiDic(KasumiConfiguration *conf) 112 - throw(KasumiException){ 113 +KasumiDic::KasumiDic(KasumiConfiguration *conf){ 114 115 try{ 116 load(conf); 117 @@ -68,8 +67,7 @@ KasumiDic::~KasumiDic() 118 } 119 } 120 121 -void KasumiDic::load(KasumiConfiguration *conf) 122 - throw(KasumiException){ 123 +void KasumiDic::load(KasumiConfiguration *conf){ 124 125 const int FREQ_LBOUND = conf->getPropertyValueByInt("MinFrequency"); 126 const int FREQ_UBOUND = conf->getPropertyValueByInt("MaxFrequency"); 127 @@ -176,7 +174,6 @@ void KasumiDic::removeWord(unsigned int id) 128 } 129 130 void KasumiDic::store() 131 - throw(KasumiException) 132 { 133 list<KasumiWord*>::iterator p = mWordList.begin(); 134 135 diff --git a/KasumiDic.hxx b/KasumiDic.hxx 136 index 20cc6b8..e487dca 100644 137 --- a/KasumiDic.hxx 138 +++ b/KasumiDic.hxx 139 @@ -49,12 +49,11 @@ private: 140 list<KasumiWord*> mWordList; 141 vector<KasumiDicEventListener*> EventListeners; 142 143 - void load(KasumiConfiguration *conf) throw (KasumiException); 144 + void load(KasumiConfiguration *conf); 145 public: 146 - KasumiDic(KasumiConfiguration *conf) 147 - throw(KasumiException); 148 + KasumiDic(KasumiConfiguration *conf); 149 ~KasumiDic(); 150 - void store() throw(KasumiException); 151 + void store(); 152 void appendWord(KasumiWord *word); // returns this word's ID 153 void removeWord(unsigned int id); 154 155 @@ -69,7 +68,7 @@ public: 156 void changedSound(KasumiWord *word); 157 void changedWordType(KasumiWord *word); 158 159 -// KasumiWord *getWordWithID(unsigned int id) throw(KasumiException); 160 +// KasumiWord *getWordWithID(unsigned int id); 161 // int getUpperBoundOfWordID(); 162 }; 163 164 diff --git a/KasumiWord.cxx b/KasumiWord.cxx 165 index 650f97d..18e53f2 100644 166 --- a/KasumiWord.cxx 167 +++ b/KasumiWord.cxx 168 @@ -177,8 +177,7 @@ KasumiWord* KasumiWord::createNewWord(KasumiConfiguration *conf) 169 return word; 170 } 171 172 -void KasumiWord::setSound(const string &aSound) 173 - throw(KasumiException){ 174 +void KasumiWord::setSound(const string &aSound){ 175 176 if(aSound == Sound) 177 return; 178 @@ -201,8 +200,7 @@ void KasumiWord::setSound(const string &aSound) 179 } 180 } 181 182 -void KasumiWord::setSoundByUTF8(const string &aSound) 183 - throw(KasumiException){ 184 +void KasumiWord::setSoundByUTF8(const string &aSound){ 185 186 if(aSound == Sound_UTF8) 187 return; 188 diff --git a/KasumiWord.hxx b/KasumiWord.hxx 189 index 25c6f8c..a54829d 100644 190 --- a/KasumiWord.hxx 191 +++ b/KasumiWord.hxx 192 @@ -69,10 +69,8 @@ public: 193 static KasumiWord* createNewWord(KasumiConfiguration *conf); 194 195 // property functions 196 - void setSound(const string &aSound) 197 - throw(KasumiException); 198 - void setSoundByUTF8(const string &aSound) 199 - throw(KasumiException); 200 + void setSound(const string &aSound); 201 + void setSoundByUTF8(const string &aSound); 202 string getSound(){ return Sound; }; 203 string getSoundByUTF8(){ return Sound_UTF8; }; 204 205 -- 206 2.32.0 207