Changed: Exceptions catched by reference

This commit is contained in:
kervala 2011-06-02 18:43:58 +02:00
parent 540bc1f62f
commit e896f53b6b
3 changed files with 7 additions and 7 deletions

View file

@ -286,7 +286,7 @@ static void readPrivileges(NLMISC::CBitMemStream &impulse)
{
impulse.serial(UserPrivileges);
}
catch(EStreamOverflow &)
catch(const EStreamOverflow &)
{
nlwarning("User privileges not serialised, assuming none");
UserPrivileges = "";
@ -345,7 +345,7 @@ void copyKeySet(const std::string &srcPath, const std::string &destPath)
COFile ofile(destPath);
ofile.serialBuffer((uint8 *) &srcStr[0], (uint)srcStr.size());
}
catch(EStream &)
catch(const EStream &)
{
nlwarning("Couldn't copy %s to %s to create new character keyset", srcPath.c_str(), destPath.c_str());
}
@ -2821,7 +2821,7 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory
CInventoryManager::getInstance()->sortBag();
}
catch ( Exception &e )
catch (const Exception &e)
{
nlwarning ("Problem while decoding a DB_UPD_INV msg, skipped: %s", e.what());
}

View file

@ -1825,7 +1825,7 @@ bool execLoadScript(CStringWriter& stringWriter, vector<string> const& args)
FOREACHC(itGrp, vector<CGroup*>, grps)
(*itGrp)->getPersistentStateInstance()->interpretCode(NULL, codePtr);
}
catch (EPathNotFound e)
catch (const EPathNotFound &e)
{
nlwarning("Path not found while loading AIS script %s", args[2].c_str());
return false;

View file

@ -930,7 +930,7 @@ bool CCharacter::setValue( string var, string value )
sint32 &temp = lookupStat(var);
NLMISC::fromString(value, temp);
}
catch( CCharacter::EInvalidStat &e)
catch(const CCharacter::EInvalidStat &e)
{
nlwarning("<CCharacter::setValue> Exception : %s",e.what( var ) );
return false;
@ -955,7 +955,7 @@ bool CCharacter::modifyValue( string var, string value )
NLMISC::fromString(value, valueInt);
temp = temp + valueInt;
}
catch( CCharacter::EInvalidStat &e)
catch(const CCharacter::EInvalidStat &e)
{
nlwarning("<CCharacter::modifyValue> Exception : %s",e.what( var ) );
return false;
@ -974,7 +974,7 @@ bool CCharacter::getValue( string var, string& value )
{
CEntityBase::getValue( var, value );
}
catch( CCharacter::EInvalidStat &e)
catch(const CCharacter::EInvalidStat &e)
{
nlwarning("<CCharacter::getValue> Exception : %s",e.what( var ) );
return false;