From 1312ede370956c8312f97a11b2155941ad920d8b Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Jun 2011 18:43:58 +0200 Subject: [PATCH] Changed: Exceptions catched by reference --- code/ryzom/client/src/net_manager.cpp | 6 +++--- code/ryzom/server/src/ai_service/commands.cpp | 2 +- .../src/entities_game_service/player_manager/character.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 85196bb2e..a450424fb 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -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()); } diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index 49b5af2a8..851de164f 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -1825,7 +1825,7 @@ bool execLoadScript(CStringWriter& stringWriter, vector const& args) FOREACHC(itGrp, vector, 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; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 586c21d82..53034f686 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -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(" 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(" 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(" Exception : %s",e.what( var ) ); return false;