mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
catch exceptions by ref
This commit is contained in:
parent
e8b0565164
commit
442624912e
@ -36,7 +36,7 @@ unsigned int RunContext::addFunction(const string &name, DoubleFunction *init)
|
||||
|
||||
return getFunctionAddress(name);
|
||||
}
|
||||
catch (Exceptions::Definition)
|
||||
catch (Exceptions::Definition &)
|
||||
{
|
||||
unsigned int address = fTable_.size();
|
||||
|
||||
@ -55,7 +55,7 @@ unsigned int RunContext::addVariable(const string &name, double init)
|
||||
|
||||
return getVariableAddress(name);
|
||||
}
|
||||
catch (Exceptions::Definition)
|
||||
catch (Exceptions::Definition &)
|
||||
{
|
||||
unsigned int address = vTable_.size();
|
||||
|
||||
@ -92,7 +92,7 @@ unsigned int RunContext::getFunctionAddress(const string &name) const
|
||||
{
|
||||
return fTable_.at(name);
|
||||
}
|
||||
catch (out_of_range)
|
||||
catch (out_of_range &)
|
||||
{
|
||||
LATAN_ERROR(Definition, "undefined function '" + name + "'");
|
||||
}
|
||||
@ -139,7 +139,7 @@ unsigned int RunContext::getVariableAddress(const string &name) const
|
||||
{
|
||||
return vTable_.at(name);
|
||||
}
|
||||
catch (out_of_range)
|
||||
catch (out_of_range &)
|
||||
{
|
||||
LATAN_ERROR(Definition, "undefined variable '" + name + "'");
|
||||
}
|
||||
@ -449,7 +449,7 @@ try\
|
||||
{\
|
||||
address = (table).at(name);\
|
||||
}\
|
||||
catch (out_of_range)\
|
||||
catch (out_of_range &)\
|
||||
{\
|
||||
address = (table).size();\
|
||||
(table)[(name)] = address;\
|
||||
|
@ -105,12 +105,12 @@ const IoT& File::getData(const std::string &name) const
|
||||
{
|
||||
return dynamic_cast<const IoT &>(*(data_.at(name)));
|
||||
}
|
||||
catch(std::out_of_range)
|
||||
catch (std::out_of_range &)
|
||||
{
|
||||
LATAN_ERROR(Definition, "no data with name '" + name + "' in file "
|
||||
+ name_);
|
||||
}
|
||||
catch(std::bad_cast)
|
||||
catch (std::bad_cast &)
|
||||
{
|
||||
LATAN_ERROR(Definition, "data with name '" + name + "' in file "
|
||||
+ name_ + " does not have type '" + typeid(IoT).name()
|
||||
|
@ -75,7 +75,7 @@ void loadAndCheck(vector<DMatSample> &sample, const vector<string> &fileName)
|
||||
gotSize = true;
|
||||
}
|
||||
}
|
||||
catch (Exceptions::Definition)
|
||||
catch (Exceptions::Definition &)
|
||||
{
|
||||
failed.insert(i);
|
||||
}
|
||||
@ -233,7 +233,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
process<DSample>(outFileName, fileName, code);
|
||||
}
|
||||
catch (Exceptions::Definition)
|
||||
catch (Exceptions::Definition &)
|
||||
{
|
||||
process<DMatSample>(outFileName, fileName, code);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user