Changed: Exceptions catched by reference

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

View file

@ -286,7 +286,7 @@ static void readPrivileges(NLMISC::CBitMemStream &impulse)
{ {
impulse.serial(UserPrivileges); impulse.serial(UserPrivileges);
} }
catch(EStreamOverflow &) catch(const EStreamOverflow &)
{ {
nlwarning("User privileges not serialised, assuming none"); nlwarning("User privileges not serialised, assuming none");
UserPrivileges = ""; UserPrivileges = "";
@ -345,7 +345,7 @@ void copyKeySet(const std::string &srcPath, const std::string &destPath)
COFile ofile(destPath); COFile ofile(destPath);
ofile.serialBuffer((uint8 *) &srcStr[0], (uint)srcStr.size()); 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()); 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(); CInventoryManager::getInstance()->sortBag();
} }
catch ( Exception &e ) catch (const Exception &e)
{ {
nlwarning ("Problem while decoding a DB_UPD_INV msg, skipped: %s", e.what()); 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) FOREACHC(itGrp, vector<CGroup*>, grps)
(*itGrp)->getPersistentStateInstance()->interpretCode(NULL, codePtr); (*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()); nlwarning("Path not found while loading AIS script %s", args[2].c_str());
return false; return false;

View file

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