From f9cc842b824f631a5702a86c8ba15d0fa4c30fd6 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Jun 2011 18:31:40 +0200 Subject: [PATCH] Changed: Exceptions catched by reference --- code/nel/include/nel/georges/load_form.h | 12 ++-- code/nel/include/nel/ligo/primitive_utils.h | 4 +- code/nel/include/nel/net/module.h | 2 +- code/nel/samples/misc/debug/main.cpp | 2 +- code/nel/samples/net/chat/client.cpp | 2 +- .../net/login_system/frontend_service.cpp | 4 +- code/nel/samples/net/udp/client.cpp | 4 +- code/nel/samples/net/udp/receive_task.cpp | 2 +- code/nel/samples/sound_sources/main.cpp | 2 +- code/nel/src/3d/animation_set.cpp | 2 +- code/nel/src/3d/async_file_manager_3d.cpp | 6 +- .../3d/driver/direct3d/driver_direct3d.cpp | 2 +- .../3d/driver/opengl/driver_opengl_window.cpp | 2 +- code/nel/src/3d/driver_user.cpp | 2 +- code/nel/src/3d/ps_mesh.cpp | 2 +- code/nel/src/3d/texture_grouped.cpp | 4 +- code/nel/src/3d/tile_bank.cpp | 2 +- code/nel/src/3d/zone_lighter.cpp | 4 +- code/nel/src/ligo/zone_bank.cpp | 2 +- code/nel/src/misc/command.cpp | 2 +- code/nel/src/misc/diff_tool.cpp | 2 +- code/nel/src/misc/inter_window_msg_queue.cpp | 2 +- code/nel/src/misc/words_dictionary.cpp | 2 +- code/nel/src/net/buf_client.cpp | 2 +- code/nel/src/net/buf_server.cpp | 6 +- code/nel/src/net/callback_client.cpp | 2 +- code/nel/src/net/login_server.cpp | 6 +- code/nel/src/net/module.cpp | 2 +- code/nel/src/net/module_gateway.cpp | 2 +- code/nel/src/net/module_gateway_transport.cpp | 2 +- code/nel/src/net/net_displayer.cpp | 4 +- code/nel/src/net/service.cpp | 2 +- code/nel/src/net/transport_class.cpp | 2 +- code/nel/src/pacs/retriever_bank.h | 2 +- code/nel/src/sound/audio_mixer_user.cpp | 4 +- code/nel/src/sound/sample_bank.cpp | 2 +- .../tools/3d/anim_builder/anim_builder.cpp | 6 +- .../animation_set_builder.cpp | 2 +- .../3d/build_clod_bank/build_clod_bank.cpp | 6 +- code/nel/tools/3d/build_clodtex/main.cpp | 4 +- .../build_coarse_mesh/build_coarse_mesh.cpp | 4 +- code/nel/tools/3d/build_interface/main.cpp | 2 +- .../3d/hls_bank_maker/hls_bank_maker.cpp | 4 +- code/nel/tools/3d/ig_info/ig_info.cpp | 2 +- code/nel/tools/3d/lightmap_optimizer/main.cpp | 12 ++-- .../tools/3d/panoply_maker/panoply_maker.cpp | 46 ++++++------ .../3d/shapes_exporter/shapes_exporter.cpp | 28 ++++---- code/nel/tools/3d/tga_2_dds/tga2dds.cpp | 4 +- code/nel/tools/3d/tga_cut/tga_cut.cpp | 2 +- .../3d/zone_check_bind/zone_check_bind.cpp | 2 +- .../zone_dependencies/zone_dependencies.cpp | 8 +-- .../3d/zone_ig_lighter/zone_ig_lighter.cpp | 2 +- .../tools/3d/zone_lighter/zone_lighter.cpp | 6 +- code/nel/tools/3d/zone_welder/zone_welder.cpp | 2 +- code/nel/tools/3d/zviewer/zviewer.cpp | 8 +-- .../tools/georges/georges2csv/georges2csv.cpp | 2 +- .../tools/pacs/build_rbank/build_rbank.cpp | 6 +- .../ryzom/client/src/bg_downloader_access.cpp | 8 +-- code/ryzom/client/src/camera_recorder.cpp | 4 +- code/ryzom/client/src/client.cpp | 4 +- code/ryzom/client/src/color_slot_manager.cpp | 6 +- code/ryzom/client/src/commands.cpp | 6 +- code/ryzom/client/src/connection.cpp | 2 +- code/ryzom/client/src/continent.cpp | 4 +- code/ryzom/client/src/far_tp.cpp | 4 +- code/ryzom/client/src/fog_map.cpp | 2 +- code/ryzom/client/src/http_client.cpp | 2 +- code/ryzom/client/src/init.cpp | 2 +- code/ryzom/client/src/init_main_loop.cpp | 2 +- .../client/src/interface_v3/group_map.cpp | 2 +- .../src/interface_v3/interface_element.cpp | 2 +- .../src/interface_v3/interface_manager.cpp | 6 +- .../src/interface_v3/interface_parser.cpp | 2 +- .../client/src/interface_v3/lua_object.cpp | 2 +- .../src/interface_v3/people_interraction.cpp | 8 +-- .../client/src/interface_v3/yubo_chat.cpp | 6 +- .../client/src/lod_character_user_manager.cpp | 2 +- code/ryzom/client/src/login.cpp | 6 +- code/ryzom/client/src/login_patch.cpp | 16 ++--- .../client/src/login_progress_post_thread.cpp | 2 +- code/ryzom/client/src/main_loop.cpp | 2 +- code/ryzom/client/src/network_connection.cpp | 8 +-- code/ryzom/client/src/pacs_client.cpp | 2 +- code/ryzom/client/src/permanent_ban.cpp | 2 +- .../client/src/r2/dmc/com_lua_module.cpp | 2 +- code/ryzom/client/src/r2/editor.cpp | 6 +- code/ryzom/client/src/r2/island_collision.cpp | 4 +- code/ryzom/client/src/r2/tool_select_move.cpp | 2 +- .../ryzom/client/src/session_browser_impl.cpp | 12 ++-- code/ryzom/client/src/sky.cpp | 2 +- code/ryzom/client/src/sound_manager.cpp | 2 +- .../client/src/string_manager_client.cpp | 12 ++-- code/ryzom/common/src/game_share/mirror.cpp | 26 +++---- .../time_weather_season/weather_predict.cpp | 2 +- .../src/ai_service/ai_script_data_manager.cpp | 4 +- .../src/ai_service/nf_state_instance.cpp | 2 +- .../src/ai_service/npc_description_msg.cpp | 2 +- code/ryzom/server/src/ai_share/ai_event.cpp | 14 ++-- .../src/backup_service/backup_file_access.cpp | 4 +- .../src/backup_service/backup_service.cpp | 4 +- .../cdb_struct_banks.cpp | 2 +- .../entities_game_service/client_messages.cpp | 6 +- .../entities_game_service.cpp | 10 +-- .../entity_manager/entity_base.cpp | 6 +- .../entity_manager/entity_callbacks.cpp | 10 +-- .../game_item_manager/game_item.cpp | 2 +- .../game_item_manager/game_item_manager.cpp | 4 +- .../guild_manager/guild_charge.cpp | 2 +- .../guild_manager/guild_manager.cpp | 2 +- .../mission_manager/mission_queue_manager.cpp | 2 +- .../outpost_manager/outpost_manager.cpp | 2 +- .../character_inventory_manipulation.cpp | 2 +- .../player_manager/player.cpp | 8 +-- .../player_manager/player_manager.cpp | 8 +-- .../primitives_parser.cpp | 2 +- .../shop_type/shop_type_manager.cpp | 2 +- .../team_manager/reward_sharing.cpp | 2 +- .../src/frontend_service/fe_receive_sub.cpp | 10 +-- .../src/frontend_service/fe_receive_task.cpp | 4 +- .../src/frontend_service/fe_send_sub.cpp | 2 +- .../src/frontend_service/frontend_service.cpp | 2 +- .../src/frontend_service/id_impulsions.cpp | 16 ++--- .../src/frontend_service/uid_impulsions.cpp | 4 +- .../server/src/gpm_service/gpm_service.cpp | 4 +- .../gpm_service/world_position_manager.cpp | 2 +- .../src/input_output_service/commands.cpp | 2 +- .../input_output_service.cpp | 4 +- .../src/input_output_service/messages.cpp | 72 +++++++++---------- .../input_output_service/string_manager.cpp | 6 +- .../string_manager_parser.cpp | 6 +- .../mail_forum_service/mail_forum_service.cpp | 10 +-- .../src/mirror_service/mirror_service.cpp | 16 ++--- .../src/mirror_service/mirror_service.h | 2 +- .../src/monitor_service/service_main.cpp | 2 +- code/ryzom/server/src/pd_lib/pd_messages.cpp | 4 +- .../ryzom_naming_service.cpp | 4 +- .../ryzom_welcome_service.cpp | 2 +- .../src/server_share/continent_container.cpp | 4 +- .../shard_unifier_service/name_manager.cpp | 2 +- .../src/tick_service/range_mirror_manager.cpp | 4 +- .../server/src/tick_service/tick_service.cpp | 14 ++-- .../ryzom/tools/leveldesign/export/export.cpp | 2 +- .../leveldesign/mission_compiler_lib/main.cpp | 4 +- .../mission_compiler_lib/mission_compiler.cpp | 2 +- .../tools/leveldesign/mp_generator/main.cpp | 2 +- .../tools/leveldesign/prim_export/main.cpp | 4 +- .../tools/make_alias_file/make_alias_file.cpp | 6 +- .../build_world_packed_col.cpp | 12 ++-- .../packed_world_builder.cpp | 6 +- .../build_world_packed_col/test_col_world.cpp | 12 ++-- .../server/build_world_packed_col/village.cpp | 2 +- .../tools/sheets_packer/sheets_packer.cpp | 12 ++-- .../tools/sheets_packer/sheets_packer_cfg.cpp | 8 +-- .../tools/skill_extractor/skill_extractor.cpp | 2 +- 154 files changed, 412 insertions(+), 412 deletions(-) diff --git a/code/nel/include/nel/georges/load_form.h b/code/nel/include/nel/georges/load_form.h index 1a9a759f9..3a2e6d839 100644 --- a/code/nel/include/nel/georges/load_form.h +++ b/code/nel/include/nel/georges/load_form.h @@ -201,7 +201,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ifile.serialCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -456,7 +456,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } @@ -564,7 +564,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ifile.serialPtrCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -819,7 +819,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } @@ -925,7 +925,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ifile.serialCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -1183,7 +1183,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } diff --git a/code/nel/include/nel/ligo/primitive_utils.h b/code/nel/include/nel/ligo/primitive_utils.h index cc71e2d50..c5049b06b 100644 --- a/code/nel/include/nel/ligo/primitive_utils.h +++ b/code/nel/include/nel/ligo/primitive_utils.h @@ -261,7 +261,7 @@ inline bool loadXmlPrimitiveFile(CPrimitives &primDoc, const std::string &fileNa // Read it return primDoc.read (xmlIn.getRootNode (), NLMISC::CFile::getFilename(fileName).c_str(), ligoConfig); } - catch(NLMISC::Exception e) + catch(const NLMISC::Exception &e) { nlwarning("Error reading input file '%s': '%s'", fileName.c_str(), e.what()); return false; @@ -294,7 +294,7 @@ inline bool saveXmlPrimitiveFile(CPrimitives &primDoc, const std::string &fileNa // return xmlSaveFile(fileName.c_str(), xmlDoc) != -1; } - catch(NLMISC::Exception e) + catch(const NLMISC::Exception &e) { nlwarning("Error writing output file '%s': '%s'", fileName.c_str(), e.what()); return false; diff --git a/code/nel/include/nel/net/module.h b/code/nel/include/nel/net/module.h index 70f11f1bc..62d2a0baf 100644 --- a/code/nel/include/nel/net/module.h +++ b/code/nel/include/nel/net/module.h @@ -524,7 +524,7 @@ namespace NLNET // run the module task command control to module task method (_Module->*_TaskMethod)(); } - catch (NLMISC::Exception e) + catch (const NLMISC::Exception &e) { nlwarning("In module task '%s', exception '%e' thrown", typeid(this).name(), e.what()); } diff --git a/code/nel/samples/misc/debug/main.cpp b/code/nel/samples/misc/debug/main.cpp index 9d17d158c..84f712c6a 100644 --- a/code/nel/samples/misc/debug/main.cpp +++ b/code/nel/samples/misc/debug/main.cpp @@ -63,7 +63,7 @@ int main (int /* argc */, char ** /* argv */) { nlerror ("nlerror() %d", 4); } - catch(EFatalError &) + catch(const EFatalError &) { // just continue... nlinfo ("nlerror() generated an EFatalError exception, just ignore it"); diff --git a/code/nel/samples/net/chat/client.cpp b/code/nel/samples/net/chat/client.cpp index a22843c0c..c2aee8c86 100644 --- a/code/nel/samples/net/chat/client.cpp +++ b/code/nel/samples/net/chat/client.cpp @@ -109,7 +109,7 @@ int main (int argc, char **argv) CInetAddress addr(LSHost+":3333"); Client->connect(addr); } - catch(ESocket &e) + catch(const ESocket &e) { printf("%s\n", e.what()); return 0; diff --git a/code/nel/samples/net/login_system/frontend_service.cpp b/code/nel/samples/net/login_system/frontend_service.cpp index 189bbaf67..e71e935bf 100644 --- a/code/nel/samples/net/login_system/frontend_service.cpp +++ b/code/nel/samples/net/login_system/frontend_service.cpp @@ -101,7 +101,7 @@ public: { fsPort = IService::ConfigFile.getVar("FSPort").asInt(); } - catch ( EUnknownVar& ) + catch (const EUnknownVar&) { } _FServer.init(fsPort); @@ -148,7 +148,7 @@ public: { fesPort = IService5::ConfigFile.getVar("FESPort").asInt(); } - catch ( EUnknownVar& ) + catch (const EUnknownVar&) { } diff --git a/code/nel/samples/net/udp/client.cpp b/code/nel/samples/net/udp/client.cpp index 749797368..dbf15c11d 100644 --- a/code/nel/samples/net/udp/client.cpp +++ b/code/nel/samples/net/udp/client.cpp @@ -232,7 +232,7 @@ void cbInit (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) { UdpSock->connect( CInetAddress (ServerAddr, UDPPort) ); } - catch ( Exception& e ) + catch (const Exception &e) { InfoLog->displayRawNL ("Cannot connect to remote UDP host '%s': %s", ServerAddr.c_str(), e.what() ); exit (""); @@ -291,7 +291,7 @@ int main( int argc, char **argv ) InfoLog->displayRawNL ("Waiting the server answer..."); } - catch(Exception &e) + catch(const Exception &e) { InfoLog->displayRawNL ("Can't connect to %s:%d (%s)\n", ServerAddr.c_str(), TCPPort, e.what()); exit (""); diff --git a/code/nel/samples/net/udp/receive_task.cpp b/code/nel/samples/net/udp/receive_task.cpp index 70276180c..bdfabbe29 100644 --- a/code/nel/samples/net/udp/receive_task.cpp +++ b/code/nel/samples/net/udp/receive_task.cpp @@ -108,7 +108,7 @@ void CReceiveTask::run() DataSock->receivedFrom( _ReceivedMessage.userDataW(), _DatagramLength, _ReceivedMessage.AddrFrom ); d = CTime::getLocalTime (); } - catch ( ESocket& ) + catch (const ESocket&) { // Remove the client corresponding to the address _ReceivedMessage.setTypeEvent( TReceivedMessage::RemoveClient ); diff --git a/code/nel/samples/sound_sources/main.cpp b/code/nel/samples/sound_sources/main.cpp index 50d28de6a..fb6753f63 100644 --- a/code/nel/samples/sound_sources/main.cpp +++ b/code/nel/samples/sound_sources/main.cpp @@ -85,7 +85,7 @@ void Init() AudioMixer->getListener()->setOrientation( frontvec, upvec ); } - catch( Exception& e ) + catch(const Exception &e) { nlerror( "Error: %s", e.what() ); } diff --git a/code/nel/src/3d/animation_set.cpp b/code/nel/src/3d/animation_set.cpp index 940592396..ec034e300 100644 --- a/code/nel/src/3d/animation_set.cpp +++ b/code/nel/src/3d/animation_set.cpp @@ -227,7 +227,7 @@ bool CAnimationSet::loadFromFiles(const std::string &path, bool recurse /* = tru iFile.close(); } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { if (wantWarningMessage) { diff --git a/code/nel/src/3d/async_file_manager_3d.cpp b/code/nel/src/3d/async_file_manager_3d.cpp index 7fbb170d1..382dc0039 100644 --- a/code/nel/src/3d/async_file_manager_3d.cpp +++ b/code/nel/src/3d/async_file_manager_3d.cpp @@ -338,7 +338,7 @@ void CAsyncFileManager3D::CMeshLoad::run() // Finally affect the pointer (Trans-Thread operation -> this operation must be atomic) *_ppShp = mesh.getShapePointer(); } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", MeshName.c_str()); *_ppShp = (IShape*)-1; @@ -382,7 +382,7 @@ void CAsyncFileManager3D::CIGLoad::run (void) *_ppIG = pIG; } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", _IGName.c_str()); *_ppIG = (CInstanceGroup*)-1; @@ -429,7 +429,7 @@ void CAsyncFileManager3D::CIGLoadUser::run (void) return; } } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", _IGName.c_str()); delete pIG; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index e05e52e7c..5ac1d2906 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1600,7 +1600,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r _EventEmitter.addEmitter(diee, true); } } - catch(EDirectInput &e) + catch(const EDirectInput &e) { nlinfo(e.what()); } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index eb3083729..74d905265 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -929,7 +929,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _EventEmitter.addEmitter(diee, true); } } - catch(EDirectInput &e) + catch(const EDirectInput &e) { nlinfo(e.what()); } diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 220536c4a..118e02141 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -1746,7 +1746,7 @@ void CDriverUser::loadHLSBank(const std::string &fileName) throw EPathNotFound(path); fIn.serial(*hlsBank); } - catch(Exception &) + catch(const Exception &) { delete hlsBank; throw; diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index 1ab6d723f..5cd61aa90 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -1291,7 +1291,7 @@ bool CPSConstraintMesh::update(std::vector *numVertsVect /*= NULL*/) { _ModelBank->load(_MeshShapeFileName[k]); } - catch (NLMISC::EPathNotFound &) + catch (const NLMISC::EPathNotFound &) { nlwarning("mesh not found : %s; used as a constraint mesh particle", _MeshShapeFileName[k].c_str()); // shape not found, so not present in the shape bank -> we create a dummy shape diff --git a/code/nel/src/3d/texture_grouped.cpp b/code/nel/src/3d/texture_grouped.cpp index fbe593d9d..c7dbe0033 100644 --- a/code/nel/src/3d/texture_grouped.cpp +++ b/code/nel/src/3d/texture_grouped.cpp @@ -50,12 +50,12 @@ static inline void GetTextureSize(ITexture *tex, uint &width, uint &height) width = srcWidth; height = srcHeight; } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { nlinfo("%s", e.what()); width = height = 0; } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlinfo("unable to load size from a bitmap ! name = %s", tf->getFileName().c_str()); nlinfo("reason = %s", e.what()); diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 361b3ea83..1f50fa7b5 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -1573,7 +1573,7 @@ void CTileSet::loadTileVegetableDesc() // load the TileVegetableDesc f.serial(_TileVegetableDesc); } - catch(Exception &e) + catch(const Exception &e) { nlinfo("Error loading TileVegetableDesc: %s", e.what()); } diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 4f1e53385..80026db12 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -3080,13 +3080,13 @@ void CZoneLighter::lightWater(CWaterShape &ws, const CMatrix &MT, const CLightDe diffuseTex->writeTGA(of, 24); of.close(); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("Zone lighter : while lighting a water shape, writing %s failed! ", texFileName.c_str()); } } } - catch(NLMISC::Exception &e) + catch(const NLMISC::Exception &e) { nlwarning("Water shape lighting failed !"); nlwarning(e.what()); diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index 5f03c4bb5..52b07ab71 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -541,7 +541,7 @@ bool CZoneBank::addElement (const std::string &elementName, std::string &error) error = "Can't open file " + elementName; } } - catch (Exception& e) + catch (const Exception& e) { error = "Error while loading ligozone "+elementName+" : "+e.what(); } diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index 313f36dcd..80d074386 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -188,7 +188,7 @@ bool ICommand::execute (const std::string &commandWithArgs, CLog &log, bool quie { return CCommandRegistry::getInstance().execute(commandWithArgs, log, quiet, human); } - catch(exception e) + catch(const exception &e) { log.displayNL("Command '%s' thrown an exception :", commandWithArgs.c_str()); log.displayNL(e.what()); diff --git a/code/nel/src/misc/diff_tool.cpp b/code/nel/src/misc/diff_tool.cpp index 27621748f..24d7bcc47 100644 --- a/code/nel/src/misc/diff_tool.cpp +++ b/code/nel/src/misc/diff_tool.cpp @@ -84,7 +84,7 @@ bool loadStringFile(const std::string filename, vector &stringInfos buffer = new uint8[size]; fp.serialBuffer(buffer, size); } - catch(Exception &e) + catch(const Exception &e) { nlinfo("Can't open file [%s] (%s)\n", filename.c_str(), e.what()); return true; diff --git a/code/nel/src/misc/inter_window_msg_queue.cpp b/code/nel/src/misc/inter_window_msg_queue.cpp index abdb84338..4cda83a04 100644 --- a/code/nel/src/misc/inter_window_msg_queue.cpp +++ b/code/nel/src/misc/inter_window_msg_queue.cpp @@ -419,7 +419,7 @@ namespace NLMISC } } } - catch(EStream &) + catch(const EStream &) { nlwarning("CInterWindowMsgQueue : Bad message format in inter window communication"); } diff --git a/code/nel/src/misc/words_dictionary.cpp b/code/nel/src/misc/words_dictionary.cpp index 687f9ea79..d3b32546d 100644 --- a/code/nel/src/misc/words_dictionary.cpp +++ b/code/nel/src/misc/words_dictionary.cpp @@ -55,7 +55,7 @@ bool CWordsDictionary::init( const string& configFileName ) cf.load( configFileName ); cfFound = true; } - catch ( EConfigFile& e ) + catch (const EConfigFile &e) { nlwarning( "WD: %s", e.what() ); } diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 7866f81cc..7bf9a7b08 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -451,7 +451,7 @@ void CClientReceiveTask::run() NbLoop++; } - catch ( ESocket& ) + catch (const ESocket&) { LNETL1_DEBUG( "LNETL1: Client connection %s broken", sockId()->asString().c_str() ); sockId()->Sock->disconnect(); diff --git a/code/nel/src/net/buf_server.cpp b/code/nel/src/net/buf_server.cpp index 57df165c8..67fe4b84b 100644 --- a/code/nel/src/net/buf_server.cpp +++ b/code/nel/src/net/buf_server.cpp @@ -829,7 +829,7 @@ void CListenTask::run() NbLoop++; } - catch ( ESocket& e ) + catch (const ESocket &e) { LNETL1_INFO( "LNETL1: Exception in listen thread: %s", e.what() ); // It can occur when too many sockets are open (e.g. 885 connections) @@ -1131,12 +1131,12 @@ void CServerReceiveTask::run() */ } } -// catch ( ESocketConnectionClosed& ) +// catch (const ESocketConnectionClosed&) // { // LNETL1_DEBUG( "LNETL1: Connection %s closed", serverbufsock->asString().c_str() ); // // The socket went to _Connected=false when throwing the exception // } - catch ( ESocket& ) + catch (const ESocket&) { LNETL1_DEBUG( "LNETL1: Connection %s broken", serverbufsock->asString().c_str() ); (*ic)->Sock->disconnect(); diff --git a/code/nel/src/net/callback_client.cpp b/code/nel/src/net/callback_client.cpp index 6f6011f38..181f48c89 100644 --- a/code/nel/src/net/callback_client.cpp +++ b/code/nel/src/net/callback_client.cpp @@ -280,7 +280,7 @@ void CCallbackClient::connect( const CInetAddress& addr ) _MR_Recorder.recordNext( _MR_UpdateCounter, Connecting, _BufSock, addrmsg ); } } - catch ( ESocketConnectionFailed& ) + catch (const ESocketConnectionFailed&) { if ( _MR_RecordingState == Record ) { diff --git a/code/nel/src/net/login_server.cpp b/code/nel/src/net/login_server.cpp index 2ff2e3b88..38c3ec321 100644 --- a/code/nel/src/net/login_server.cpp +++ b/code/nel/src/net/login_server.cpp @@ -349,17 +349,17 @@ void CLoginServer::init (const string &listenAddress) try { cfcbDefaultUserPriv(IService::getInstance()->ConfigFile.getVar("DefaultUserPriv")); IService::getInstance()->ConfigFile.setCallback("DefaultUserPriv", cfcbDefaultUserPriv); - } catch(Exception &) { } + } catch(const Exception &) { } try { cfcbAcceptInvalidCookie (IService::getInstance()->ConfigFile.getVar("AcceptInvalidCookie")); IService::getInstance()->ConfigFile.setCallback("AcceptInvalidCookie", cfcbAcceptInvalidCookie); - } catch(Exception &) { } + } catch(const Exception &) { } try { cfcbTimeBeforeEraseCookie (IService::getInstance()->ConfigFile.getVar("TimeBeforeEraseCookie")); IService::getInstance()->ConfigFile.setCallback("TimeBeforeEraseCookie", cfcbTimeBeforeEraseCookie); - } catch(Exception &) { } + } catch(const Exception &) { } // setup the listen address diff --git a/code/nel/src/net/module.cpp b/code/nel/src/net/module.cpp index d09ed3084..41489abfb 100644 --- a/code/nel/src/net/module.cpp +++ b/code/nel/src/net/module.cpp @@ -330,7 +330,7 @@ namespace NLNET _onProcessModuleMessage(currentSender, currentMessage); _CurrentMessageFailed = false; } - catch (NLMISC::Exception e) + catch (const NLMISC::Exception &e) { nlwarning("In module task '%s' (cotask message receiver), exception '%e' thrown", typeid(this).name(), e.what()); // an exception have been thrown diff --git a/code/nel/src/net/module_gateway.cpp b/code/nel/src/net/module_gateway.cpp index 9f838afd1..efe29ae1b 100644 --- a/code/nel/src/net/module_gateway.cpp +++ b/code/nel/src/net/module_gateway.cpp @@ -109,7 +109,7 @@ namespace NLNET sd->serial(s); } } - catch(EStreamOverflow e) + catch(const EStreamOverflow &) { // FAILED to read the security block, rewind to old pos and serial as unknow nlwarning("Error while reading stream for security data type %u", dataTag); diff --git a/code/nel/src/net/module_gateway_transport.cpp b/code/nel/src/net/module_gateway_transport.cpp index 6088ab3e8..b839584d1 100644 --- a/code/nel/src/net/module_gateway_transport.cpp +++ b/code/nel/src/net/module_gateway_transport.cpp @@ -684,7 +684,7 @@ namespace NLNET route->CallbackClient.connect(addr); nldebug("CGatewayL3ClientTransport : Connected to %s with connId %u", addr.asString().c_str(), connId); } - catch (ESocketConnectionFailed e) + catch (const ESocketConnectionFailed &) { nlinfo("CGatewayL3ClientTransport : Failed to connect to server %s, retrying in %u seconds", addr.asString().c_str(), _RetryInterval); } diff --git a/code/nel/src/net/net_displayer.cpp b/code/nel/src/net/net_displayer.cpp index d9aff2a49..d2a354786 100644 --- a/code/nel/src/net/net_displayer.cpp +++ b/code/nel/src/net/net_displayer.cpp @@ -79,7 +79,7 @@ void CNetDisplayer::setLogServer (const CInetAddress& logServerAddr) { _Server->connect (_ServerAddr); } - catch( ESocket& ) + catch(const ESocket&) { // Silence } @@ -153,7 +153,7 @@ void CNetDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess msg.serial( s ); _Server->send (msg, 0, false); } - catch( NLMISC::Exception& ) + catch(const NLMISC::Exception& ) { // Silence } diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index d59dbe5a8..64a2fdf1c 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -914,7 +914,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, // Get the localhost name localhost = CInetAddress::localHost().hostName(); } - catch (NLNET::ESocket &) + catch (const NLNET::ESocket &) { localhost = ""; } diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 1d9796dd2..a5f826728 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -419,7 +419,7 @@ void getNameOfMessageOrTransportClass( NLNET::CMessage& msgin, std::string& msgN msgin.seek( msgin.getHeaderSize(), NLMISC::IStream::begin ); msgin.serial( msgName ); } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { msgName = ""; } diff --git a/code/nel/src/pacs/retriever_bank.h b/code/nel/src/pacs/retriever_bank.h index bce8b11e6..d98a5db57 100644 --- a/code/nel/src/pacs/retriever_bank.h +++ b/code/nel/src/pacs/retriever_bank.h @@ -150,7 +150,7 @@ public: { f.serial(_Retrievers[i]); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlwarning("Couldn't load retriever file '%s', %s", fname.c_str(), e.what()); _Retrievers[i].clear(); diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index a80592727..45372dde2 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -883,7 +883,7 @@ void CAudioMixerUser::buildSampleBankList() } } } - catch(Exception e) + catch(const Exception &) { upToDate = false; } @@ -2489,7 +2489,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack) _FreeTracks.insert(_FreeTracks.begin(), _Tracks[i]); } } - catch ( ESoundDriver & ) + catch (const ESoundDriver &) { delete _Tracks[i]; // If the source generation failed, keep only the generated number of sources diff --git a/code/nel/src/sound/sample_bank.cpp b/code/nel/src/sound/sample_bank.cpp index a83166879..a9f3c8e9e 100644 --- a/code/nel/src/sound/sample_bank.cpp +++ b/code/nel/src/sound/sample_bank.cpp @@ -213,7 +213,7 @@ void CSampleBank::load(bool async) _SampleBankManager->m_LoadedSize += _ByteSize; } - catch(Exception &e) + catch(const Exception &e) { // loading failed ! nlwarning("Exception %s during loading of sample bank %s", e.what(), filename.c_str()); diff --git a/code/nel/tools/3d/anim_builder/anim_builder.cpp b/code/nel/tools/3d/anim_builder/anim_builder.cpp index f210e49a9..e8ec3001e 100644 --- a/code/nel/tools/3d/anim_builder/anim_builder.cpp +++ b/code/nel/tools/3d/anim_builder/anim_builder.cpp @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) animationOptimizer.addLowPrecisionTrack(anim_low_precision_tracks.asString(lpt)); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("\"anim_low_precision_tracks\" not found in the parameter file. Add \"Finger\" and \"Ponytail\" by default"); animationOptimizer.addLowPrecisionTrack("Finger"); @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) animationOptimizer.setSampleFrameRate(sr); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("\"anim_sample_rate\" not found in the parameter file. Use Default of 30 fps."); animationOptimizer.setSampleFrameRate(30); @@ -198,7 +198,7 @@ int main(int argc, char* argv[]) nlinfo("Anim skipped: %4d", numSkipped); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR %s\n", except.what()); diff --git a/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp b/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp index b5e35a9e3..a423d7ff8 100644 --- a/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp +++ b/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) return -1; } } - catch (Exception& e) + catch (const Exception& e) { // Error message fprintf (stderr, "Error: %s\n", e.what()); diff --git a/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp b/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp index 332e7ebad..2caf5c235 100644 --- a/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp +++ b/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) // NB: the key name here is the entire file, with the .anim, for easier georges editing. lodBuilder.addAnim(animFileName.c_str(), anim, bakeFrameRate); } - catch(EPathNotFound &) + catch(const EPathNotFound &) { printf("ERROR anim not found %s\n", animFileName.c_str()); delete anim; @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) uint32 shapeId= lodShapeBank.addShape(); *lodShapeBank.getShapeFullAcces(shapeId)= lodBuilder.getLodShape(); } - catch(EUnknownVar &evar) + catch(const EUnknownVar &evar) { nlwarning(evar.what()); // Any other exception will make the program quit. @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) oFile.serial(lodShapeBank); oFile.close(); } - catch (Exception& except) + catch (const Exception& except) { // Error message printf ("ERROR %s.\n Aborting.\n", except.what()); diff --git a/code/nel/tools/3d/build_clodtex/main.cpp b/code/nel/tools/3d/build_clodtex/main.cpp index d92a8f7d2..0d43479dc 100644 --- a/code/nel/tools/3d/build_clodtex/main.cpp +++ b/code/nel/tools/3d/build_clodtex/main.cpp @@ -100,7 +100,7 @@ bool computeOneShape(const char *lodFile, const char *shapeIn, const char *shape COFile dbgF("testDBG.tga"); dbg.writeTGA(dbgF, 32);*/ } - catch(Exception &e) + catch(const Exception &e) { nlwarning("ERROR: %s", e.what()); return false; @@ -179,7 +179,7 @@ int main(int argc, char *argv[]) LodFilters[i]= var.asString(i*2+1); } } - catch(Exception &e) + catch(const Exception &e) { // It is not an error to have a bad config file: files will be copied nlwarning(e.what()); diff --git a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp index 236c2727e..854e7bc18 100644 --- a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp +++ b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp @@ -255,12 +255,12 @@ int main(int argc, char* argv[]) nlwarning ("WARNING no coarse mesh to compute, abort.\n"); } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { // Something goes wrong... catch that nlwarning ("ERROR %s\n", e.what ()); } - catch (Exception &e) + catch (const Exception &e) { // Something goes wrong... catch that nlwarning ("ERROR %s\n", e.what ()); diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index b9e9b44f3..40627bab8 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -267,7 +267,7 @@ int main(int nNbArg, char **ppArgs) pBtmp->load(inFile); AllMaps[i] = pBtmp; } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; diff --git a/code/nel/tools/3d/hls_bank_maker/hls_bank_maker.cpp b/code/nel/tools/3d/hls_bank_maker/hls_bank_maker.cpp index 5e85b329a..e4730c459 100644 --- a/code/nel/tools/3d/hls_bank_maker/hls_bank_maker.cpp +++ b/code/nel/tools/3d/hls_bank_maker/hls_bank_maker.cpp @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) f.serial(textInfo); addTextToBank(textInfo, textBank); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("ERROR: Unable to process %s. Reason: %s. Processing next", hlsInfofiles[k].c_str(), e.what()); } @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) fOut.serial(textBank); fOut.close(); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("ERROR: Unable to write HLS Bank %s: %s", argv[2], e.what()); exit(-1); diff --git a/code/nel/tools/3d/ig_info/ig_info.cpp b/code/nel/tools/3d/ig_info/ig_info.cpp index 8de0bcf19..7a765a89c 100644 --- a/code/nel/tools/3d/ig_info/ig_info.cpp +++ b/code/nel/tools/3d/ig_info/ig_info.cpp @@ -83,7 +83,7 @@ int main(int argc, char **argv) printf("TotalCells: %d\n", totalCells); } - catch (std::exception &e) + catch (const std::exception &e) { printf("%s\n", e.what()); } diff --git a/code/nel/tools/3d/lightmap_optimizer/main.cpp b/code/nel/tools/3d/lightmap_optimizer/main.cpp index 528d85014..7cae0b5f9 100644 --- a/code/nel/tools/3d/lightmap_optimizer/main.cpp +++ b/code/nel/tools/3d/lightmap_optimizer/main.cpp @@ -365,7 +365,7 @@ int main(int nNbArg, char **ppArgs) CMeshBase *pMB = dynamic_cast(mesh.getShapePointer()); AllShapes.push_back (pMB); } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { outString(string("ERROR: shape not found ")+AllShapeNames[nShp]+" - "+e.what()); return -1; @@ -529,7 +529,7 @@ int main(int nNbArg, char **ppArgs) inFile.open(sTmp2); CBitmap::loadSize(inFile, wRef, hRef); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -546,7 +546,7 @@ int main(int nNbArg, char **ppArgs) inFile.open(sTmp3); CBitmap::loadSize(inFile, wCur, hCur); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { } @@ -595,7 +595,7 @@ int main(int nNbArg, char **ppArgs) pBtmp->load(inFile); AllLightmaps[i] = pBtmp; } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -671,7 +671,7 @@ int main(int nNbArg, char **ppArgs) BitmapJ.load (inFile); inFile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -883,7 +883,7 @@ int main(int nNbArg, char **ppArgs) meshfile.close (); } } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { outString(string("ERROR: cannot save shape ")+AllShapeNames[k]+" - "+e.what()); return -1; diff --git a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp index 9f51d86f7..6be9590c2 100644 --- a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp +++ b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp @@ -140,7 +140,7 @@ int main(int argc, char* argv[]) NLMISC::CPath::addSearchPath(NLMISC::CPath::standardizePath(additionnal_paths.asString(k)),true, false); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -149,7 +149,7 @@ int main(int argc, char* argv[]) { _Path_Input_TexBases = NLMISC::CPath::standardizePath(cf.getVar ("input_path_texbase").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) { _Path_Input_Masks = NLMISC::CPath::standardizePath(cf.getVar ("input_path_mask").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) { _Path_Output_MaksOptimized = NLMISC::CPath::standardizePath(cf.getVar ("output_path_mask_optimized").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) { _Path_Output_Cgi = NLMISC::CPath::standardizePath(cf.getVar ("output_path_cgi").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -185,12 +185,12 @@ int main(int argc, char* argv[]) { _Path_Output_Gtm = NLMISC::CPath::standardizePath(cf.getVar ("output_path_gtm").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Panoply building failed."); nlwarning(e.what()); @@ -256,7 +256,7 @@ int main(int argc, char* argv[]) NLMISC::CPath::addSearchPath(NLMISC::CPath::standardizePath(additionnal_paths.asString(k))); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -265,7 +265,7 @@ int main(int argc, char* argv[]) { bi.InputPath = NLMISC::CPath::standardizePath(cf.getVar ("input_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -274,7 +274,7 @@ int main(int argc, char* argv[]) { bi.OutputPath = NLMISC::CPath::standardizePath(cf.getVar ("output_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -283,7 +283,7 @@ int main(int argc, char* argv[]) { bi.HlsInfoPath = NLMISC::CPath::standardizePath(cf.getVar("hls_info_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.HlsInfoPath = "hlsInfo/"; } @@ -293,7 +293,7 @@ int main(int argc, char* argv[]) { bi.CachePath = NLMISC::CPath::standardizePath(cf.getVar ("cache_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -302,7 +302,7 @@ int main(int argc, char* argv[]) { bi.OutputFormat = "." + cf.getVar ("output_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.OutputFormat = ".tga"; } @@ -312,7 +312,7 @@ int main(int argc, char* argv[]) { bi.DefaultSeparator = cf.getVar ("default_separator").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.DefaultSeparator = '_'; } @@ -330,7 +330,7 @@ int main(int argc, char* argv[]) } } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.BitmapExtensions[0].resize(1); bi.BitmapExtensions[0] = bi.OutputFormat; @@ -340,14 +340,14 @@ int main(int argc, char* argv[]) { bi.LowDefShift = cf.getVar ("low_def_shift").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { // tranform 512*512 to 64*64 by default bi.LowDefShift= 3; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Panoply building failed."); nlwarning(e.what()); @@ -361,7 +361,7 @@ int main(int argc, char* argv[]) { BuildColoredVersions(bi); } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Something went wrong while building bitmap : %s", e.what()); return -1; @@ -389,7 +389,7 @@ static void validateCgiInfo() f.serialCont(temp); } - catch(std::exception &e) + catch(const std::exception &e) { nlwarning("Panoply building failed."); } @@ -491,7 +491,7 @@ static void BuildColoredVersions(const CBuildInfo &bi) //nlwarning(("No need to rebuild " + NLMISC::CFile::getFilename(files[k])).c_str()); } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Processing of %s failed : %s \n", files[k].c_str(), e.what()); } @@ -662,7 +662,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str return; } } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("File or format error with : %s. Processing next...", fileNameWithExtension.c_str()); return; @@ -743,7 +743,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str return; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Error with : %s : %s. Aborting this bitmap processing", maskFileName.c_str(), e.what()); return; @@ -827,7 +827,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str nlwarning(("Couldn't open " + bi.OutputPath + outputFileName + bi.OutputFormat + " for writing").c_str()); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning(("Couldn't write " + bi.OutputPath + outputFileName + bi.OutputFormat + " : " + e.what()).c_str()); } diff --git a/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp b/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp index a9cff1fc1..c61bc42a0 100644 --- a/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp +++ b/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp @@ -99,7 +99,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) // load the config file cf.load(filename); } - catch(exception &e) + catch(const exception &e) { nlwarning("can't parse config file : %s", filename.c_str()); nlwarning(e.what()); @@ -129,7 +129,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_format = cf.getVar("output_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_format = "jpg"; } @@ -141,7 +141,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) for (uint i=0; i < (uint)search_pathes.size(); ++i) CPath::addSearchPath(CPath::standardizePath(search_pathes.asString(i))); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { } @@ -152,7 +152,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) for (uint i=0; i< (uint)recursive_search_pathes.size(); ++i) CPath::addSearchPath(CPath::standardizePath(recursive_search_pathes.asString(i)), true, false); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { } @@ -180,7 +180,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_format = cf.getVar("preview_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_format = "jpg"; } @@ -190,7 +190,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_width = cf.getVar("preview_width").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_width = 256; } @@ -200,7 +200,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_height = cf.getVar("preview_height").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_height = 256; } @@ -210,7 +210,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_quality = (uint8)cf.getVar("preview_quality").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_quality = 90; } @@ -283,7 +283,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_steps_z = cf.getVar("output_steps_z").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_steps_z = 10; } @@ -293,7 +293,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_steps_x = cf.getVar("output_steps_x").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_steps_x = 10; } @@ -303,7 +303,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_width = cf.getVar("output_width").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_width = 256; } @@ -313,7 +313,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_height = cf.getVar("output_height").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_height = 256; } @@ -323,7 +323,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_antialiasing = (uint8)cf.getVar("output_antialiasing").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_antialiasing = 2; } @@ -333,7 +333,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_quality = (uint8)cf.getVar("output_quality").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_quality = 90; } diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index 4328c48fb..27e7b1603 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -629,7 +629,7 @@ int main(int argc, char **argv) picSrc.writePNG (output, 8); } } - catch(NLMISC::EWriteError &e) + catch(const NLMISC::EWriteError &e) { cerr<Name.c_str(), e.what()); } @@ -734,7 +734,7 @@ static void computeZoneIGBBox(const char *zoneName, CLightingBBox &result, TShap { ig.serial(igFile); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlwarning("Error while reading an instance group file : %s \n reason : %s", pathName.c_str(), e.what()); return; @@ -803,7 +803,7 @@ static void computeBBoxFromVillage(const NLGEORGES::UFormElm *villageItem, computeIGBBox(group, currBBox, shapeMap); result.makeUnion(currBBox); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { nlwarning ("Error while loading instance group %s\n", igName.c_str()); continue; @@ -909,7 +909,7 @@ static void computeIGBBoxFromContinent(NLMISC::CConfigFile ¶meter, nlwarning("Can't load continent form : %s", continentName.c_str()); } } - catch (NLMISC::EUnknownVar &e) + catch (const NLMISC::EUnknownVar &e) { nlinfo(e.what()); } diff --git a/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp b/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp index bdf564a66..f366a1aec 100644 --- a/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp +++ b/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp @@ -305,7 +305,7 @@ int main(int argc, char* argv[]) } } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { nlinfo("No additionnal ig's to load"); } diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index 8608958e0..465f72155 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -158,7 +158,7 @@ static void loadIGFromVillage(const NLGEORGES::UFormElm *villageItem, const std: { group->serial (inputFile); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { nlwarning ("Error while loading instance group %s\n", igName.c_str()); continue; @@ -266,7 +266,7 @@ static void loadIGFromContinent(NLMISC::CConfigFile ¶meter, std::listLandscape.TileBank.serial(bankFile); } - catch(Exception) + catch(const Exception &) { string tmp = string("Cant load bankfile ")+ViewerCfg.BanksPath + "/" + ViewerCfg.Bank; nlerror (tmp.c_str()); @@ -390,7 +390,7 @@ void displayZones() CIFile farbankFile(ViewerCfg.BanksPath + "/" + farBank); Landscape->Landscape.TileFarBank.serial(farbankFile); } - catch(Exception) + catch(const Exception &) { string tmp = string("Cant load bankfile ")+ViewerCfg.BanksPath + "/" + farBank; nlerror (tmp.c_str()); @@ -450,7 +450,7 @@ void displayZones() // Add it to collision manager. CollisionManager.addZone(zone.getZoneId()); } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } @@ -472,7 +472,7 @@ void displayZones() // Add it to the scene. group->addToScene (*CNELU::Scene); } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index b5785159a..e10d06bf5 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -838,7 +838,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType ForceInsertParents = (fiparents->asInt() == 1); nlinfo( "Force insert parents mode: %s", ForceInsertParents ? "ON" : "OFF" ); } - catch ( EConfigFile& e ) + catch (const EConfigFile &e) { nlwarning( "Problem in directory mapping: %s", e.what() ); } diff --git a/code/nel/tools/pacs/build_rbank/build_rbank.cpp b/code/nel/tools/pacs/build_rbank/build_rbank.cpp index 0a8091a5f..caca058e9 100644 --- a/code/nel/tools/pacs/build_rbank/build_rbank.cpp +++ b/code/nel/tools/pacs/build_rbank/build_rbank.cpp @@ -215,7 +215,7 @@ void processAllPasses(string &zoneName) retriever.serial(outputRetriever); } } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } @@ -392,7 +392,7 @@ void tessellateAndMoulineZone(string &zoneName) outputChains.serialCont(fullChains); } } - catch(Exception &e) + catch(const Exception &e) { printf(e.what ()); } @@ -452,7 +452,7 @@ void processRetriever(string &zoneName) retriever.serial(outputRetriever); } } - catch(Exception &e) + catch(const Exception &e) { printf(e.what ()); } diff --git a/code/ryzom/client/src/bg_downloader_access.cpp b/code/ryzom/client/src/bg_downloader_access.cpp index df95c6454..5ec3a3512 100644 --- a/code/ryzom/client/src/bg_downloader_access.cpp +++ b/code/ryzom/client/src/bg_downloader_access.cpp @@ -336,21 +336,21 @@ void CBGDownloaderAccess::CDownloadCoTask::run() } } } - catch(EDownloadException &e) + catch(const EDownloadException &e) { //shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; Parent->_ErrorMsg.fromUtf8(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch(EDownloadTerminationRequested &e) + catch(const EDownloadTerminationRequested &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; Parent->_ErrorMsg = ucstring(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; @@ -358,7 +358,7 @@ void CBGDownloaderAccess::CDownloadCoTask::run() Parent->_ErrorMsg = CI18N::get("uiBGD_ProtocolError") + ucstring(" : ") + ucstring(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch (EWaitMessageTimeoutException &e) + catch (const EWaitMessageTimeoutException &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; diff --git a/code/ryzom/client/src/camera_recorder.cpp b/code/ryzom/client/src/camera_recorder.cpp index 9ef556b06..309eee039 100644 --- a/code/ryzom/client/src/camera_recorder.cpp +++ b/code/ryzom/client/src/camera_recorder.cpp @@ -239,7 +239,7 @@ class CAHSaveCameraRecord : public IActionHandler nlwarning("Couldn't compute camera recorder next filename"); } } - catch(EStream &e) + catch(const EStream &e) { nlwarning(e.what()); } @@ -283,7 +283,7 @@ NLMISC_COMMAND(loadCamRec, "Load a camera path record file (.cr)", "") f.serialCont(Track); State = Idle; } - catch(EStream &e) + catch(const EStream &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 8eea73241..72fe1c0b1 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -85,7 +85,7 @@ using namespace NLNET; // We don't catch(...) because these exception are already trapped with the se_translation that generate the NeL message box #define RYZOM_TRY(_block) try { nlinfo(_block" of Ryzom..."); -#define RYZOM_CATCH(_block) nlinfo(_block" of Ryzom success"); } catch(EFatalError &) { return EXIT_FAILURE; } +#define RYZOM_CATCH(_block) nlinfo(_block" of Ryzom success"); } catch(const EFatalError &) { return EXIT_FAILURE; } ///////////// // GLOBALS // @@ -168,7 +168,7 @@ static bool connect() goto end; } } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't connect to web server '%s': %s", server.c_str(), e.what()); goto end; diff --git a/code/ryzom/client/src/color_slot_manager.cpp b/code/ryzom/client/src/color_slot_manager.cpp index 996d256a5..f7c059171 100644 --- a/code/ryzom/client/src/color_slot_manager.cpp +++ b/code/ryzom/client/src/color_slot_manager.cpp @@ -323,7 +323,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st { mask_extensions = &cf.getVar("mask_extensions"); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { return false; } @@ -343,7 +343,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st _Slots[k + startSlot][l] = extensions.asString(l); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { _Slots.resize(startSlot); nlwarning(("CColorSlotManager::addSlotsFromConfigFile : invalid config file, variable not found :" + mask_extensions->asString(k) + "_color_id").c_str()); @@ -355,7 +355,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st { _Separator = cf.getVar("default_separator").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { _Separator = "_"; } diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index fbea6da96..305a87389 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5137,7 +5137,7 @@ NLMISC_COMMAND(luaObject, "Dump the content of a lua object", " [max // make a reference to the table to be inspected (is this this a primitive type, just make a copy) luaState->executeScript(std::string(inspectedTable) + " = " + args[0]); } - catch(ELuaError &e) + catch(const ELuaError &e) { CLuaIHM::debugInfo(e.what()); return false; @@ -5407,7 +5407,7 @@ NLMISC_COMMAND(dumpPosAsPrim, "ld helper : add current position to pos.primitive stream.open(path); stream.serialBuffer((uint8 *) &srcFile[0], fileSize); } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlinfo(e.what()); srcFile.clear(); @@ -5455,7 +5455,7 @@ NLMISC_COMMAND(dumpPosAsPrim, "ld helper : add current position to pos.primitive stream.open(path); stream.serialBuffer((uint8 *) &srcFile[0], (uint)srcFile.size()); } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlinfo(e.what()); } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 4fafcdd07..bafee0086 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -1011,7 +1011,7 @@ TInterfaceState globalMenu() if ( ! firewallTimeout ) NetMngr.update(); } - catch ( EBlockedByFirewall& ) + catch (const EBlockedByFirewall&) { if ( NetMngr.getConnectionState() == CNetManager::Disconnect ) { diff --git a/code/ryzom/client/src/continent.cpp b/code/ryzom/client/src/continent.cpp index dc1d0fdaf..3759c5da7 100644 --- a/code/ryzom/client/src/continent.cpp +++ b/code/ryzom/client/src/continent.cpp @@ -1266,7 +1266,7 @@ void CContinent::dumpVillagesLoadingZones(const std::string &filename) { outBitmap.writeTGA(outFile, 24, true); } - catch(EStream &) + catch(const EStream &) { } } @@ -1327,7 +1327,7 @@ void CContinent::dumpFogMap(CFogMapBuild::TMapType mapType, const std::string &f { outBitmap.writeTGA(outFile, 24); } - catch(EStream &) + catch(const EStream &) { } } diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index b6fceac51..fb23b5810 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -174,7 +174,7 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event outputF.close(); \ } \ } \ - catch ( Exception & ) \ + catch (const Exception &) \ {} \ _CurrentState = stateId; \ break; \ @@ -912,7 +912,7 @@ retryJoinEdit: outputF.close(); } } - catch ( Exception & ) + catch (const Exception &) {} // If the session is not a permanent session and has vanished, pop the position diff --git a/code/ryzom/client/src/fog_map.cpp b/code/ryzom/client/src/fog_map.cpp index bd1e47978..78cd7ecda 100644 --- a/code/ryzom/client/src/fog_map.cpp +++ b/code/ryzom/client/src/fog_map.cpp @@ -224,7 +224,7 @@ void CFogMap::load(NLMISC::CBitmap &bm, const std::string &filename) inputFile.close(); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning(e.what()); inputFile.close(); diff --git a/code/ryzom/client/src/http_client.cpp b/code/ryzom/client/src/http_client.cpp index 6a10034cd..4c5f03d6d 100644 --- a/code/ryzom/client/src/http_client.cpp +++ b/code/ryzom/client/src/http_client.cpp @@ -57,7 +57,7 @@ bool CHttpClient::connect(std::string server) nldebug("Connected to web server '%s'", server.c_str()); } } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't connect to web server '%s': %s", server.c_str(), e.what()); goto end; diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index f94fa8321..37dd66e6e 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1264,7 +1264,7 @@ void postlogInit() { SoundMngr->init(&ProgressBar); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); // leak the alocated sound manager... diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index e8c888030..2610b5882 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -865,7 +865,7 @@ void initMainLoop() // load hlsBank Driver->loadHLSBank("characters.hlsbank"); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't load HLSBank: %s", e.what()); } diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 43021767c..51d07bb88 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -775,7 +775,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) _Islands.push_back(island); } } - catch(NLMISC::EFile &e) + catch(const NLMISC::EFile &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/interface_v3/interface_element.cpp b/code/ryzom/client/src/interface_v3/interface_element.cpp index f937a34e9..6db901b10 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.cpp +++ b/code/ryzom/client/src/interface_v3/interface_element.cpp @@ -1235,7 +1235,7 @@ CInterfaceElement *CInterfaceElement::clone() dupStream.fill(&datas[0], (uint32)datas.size()); dupStream.serialPolyPtr(begunThisCloneWarHas); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { // no-op -> caller has to handle the failure because NULL will be returned } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 478da960b..3e846d545 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1659,7 +1659,7 @@ bool CInterfaceManager::loadConfig (const string &filename) } } } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { f.close(); string sFileNameBackup = sFileName+"backup"; @@ -1846,7 +1846,7 @@ bool CInterfaceManager::saveConfig (const string &filename) return false; } } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { f.close(); nlwarning("Config saving failed."); @@ -5754,7 +5754,7 @@ bool CInterfaceManager::executeLuaScript(const std::string &luaScript, bool smal else _LuaState->executeScript(luaScript); } - catch(ELuaError &e) + catch(const ELuaError &e) { std::string msg = e.luaWhat(); char filename[MAX_PATH]; diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 90f307316..694638ab4 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -4721,7 +4721,7 @@ bool CInterfaceParser::loadLUA(const std::string &fileName, std::string &error) { _LuaState->executeFile(pathName); } - catch(ELuaError &e) + catch(const ELuaError &e) { nlwarning(e.luaWhat().c_str()); error= e.luaWhat(); diff --git a/code/ryzom/client/src/interface_v3/lua_object.cpp b/code/ryzom/client/src/interface_v3/lua_object.cpp index 86b91af73..eb5f76c4f 100644 --- a/code/ryzom/client/src/interface_v3/lua_object.cpp +++ b/code/ryzom/client/src/interface_v3/lua_object.cpp @@ -613,7 +613,7 @@ void CLuaObject::dump(uint maxDepth /*= 20*/, std::set *alreadySee NLMISC::InfoLog->forceDisplayRaw((res[k] + "\n") .c_str()); } } - catch(std::exception &e) + catch(const std::exception &e) { CLuaIHM::dumpCallStack(); nlwarning(e.what()); diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 218b1fd96..e98013f9a 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -1670,7 +1670,7 @@ bool CPeopleInterraction::saveUserChatsInfos(NLMISC::IStream &f) pCGW->saveFreeTeller(f); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while saving user chat infos : %s", e.what()); return false; @@ -1691,7 +1691,7 @@ bool CPeopleInterraction::saveUserDynChatsInfos(NLMISC::IStream &f) saveFilteredDynChat(f, TheUserChat); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while saving user dyn chat infos : %s", e.what()); return false; @@ -1756,7 +1756,7 @@ bool CPeopleInterraction::loadUserChatsInfos(NLMISC::IStream &f) if (pCGW) pCGW->loadFreeTeller(f); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading user chat infos : %s", e.what()); return false; @@ -1786,7 +1786,7 @@ bool CPeopleInterraction::loadUserDynChatsInfos(NLMISC::IStream &f) setupUserDynChatFromSummary(fcs, TheUserChat); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading user dyn chat infos : %s", e.what()); return false; diff --git a/code/ryzom/client/src/interface_v3/yubo_chat.cpp b/code/ryzom/client/src/interface_v3/yubo_chat.cpp index d24ae8bea..55bc17922 100644 --- a/code/ryzom/client/src/interface_v3/yubo_chat.cpp +++ b/code/ryzom/client/src/interface_v3/yubo_chat.cpp @@ -59,7 +59,7 @@ void CYuboChat::connect(const string &url, const std::string &login, const std:: return; } } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } @@ -78,7 +78,7 @@ void CYuboChat::disconnect() { _Sock.disconnect(); } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } @@ -265,7 +265,7 @@ void CYuboChat::sendInternal(const ucstring &msg) size= (uint32)toSend.size()-off; } } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } diff --git a/code/ryzom/client/src/lod_character_user_manager.cpp b/code/ryzom/client/src/lod_character_user_manager.cpp index 871f6fc30..5ba9d4a46 100644 --- a/code/ryzom/client/src/lod_character_user_manager.cpp +++ b/code/ryzom/client/src/lod_character_user_manager.cpp @@ -69,7 +69,7 @@ bool CLodCharacterUserManager::addLodShapeBank(const std::string &filename) // load and add the file to the main scene Scene->loadCLodShapeBank(filename); } - catch(Exception &e) + catch(const Exception &e) { nlwarning(e.what()); return false; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 6f06d1b5f..d1dee738d 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1721,15 +1721,15 @@ class CAHReboot : public IActionHandler } LoginSM.pushEvent(CLoginStateMachine::ev_reboot); } - catch (NLMISC::EDiskFullError &) + catch (const NLMISC::EDiskFullError &) { im->messageBoxWithHelp(CI18N::get("uiPatchDiskFull"), "ui:login"); } - catch (NLMISC::EWriteError &) + catch (const NLMISC::EWriteError &) { im->messageBoxWithHelp(CI18N::get("uiPatchWriteError"), "ui:login"); } - catch (std::exception &e) + catch (const std::exception &e) { im->messageBoxWithHelp(ucstring(e.what()), "ui:login", "login_quit"); } diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index fa0ef7f57..ec641c7ef 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -386,7 +386,7 @@ void CPatchManager::readClientVersionAndDescFile() DescFilename = "unknown"; ValidDescFile = true; } - catch(Exception &) + catch(const Exception &) { nlwarning("EXCEPTION CATCH: readClientVersionAndDescFile() failed - not important"); // Not important that there is no desc file @@ -2492,7 +2492,7 @@ void CCheckThread::run () CheckOk = true; Ended = true; } - catch (NLMISC::EDiskFullError) + catch (const NLMISC::EDiskFullError &) { // more explicit message for this common error case nlwarning("EXCEPTION CATCH: disk full"); @@ -2622,7 +2622,7 @@ void CPatchThread::run() } } - catch (NLMISC::EDiskFullError) + catch (const NLMISC::EDiskFullError &) { // more explicit message for this common error case nlwarning("EXCEPTION CATCH: CPatchThread::run() Disk Full"); @@ -2630,7 +2630,7 @@ void CPatchThread::run() sTranslate = CI18N::get("uiPatchDiskFull"); bErr = true; } - catch(Exception &e) + catch(const Exception &e) { nlwarning("EXCEPTION CATCH: CPatchThread::run() failed"); pPM->setState(true, ucstring(e.what())); @@ -2803,7 +2803,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // else -> file comes from a previous download (with .tmp extension, and is up to date) // the remaining code will just rename it with good name and exit } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { // this is a local error, rethrow ... throw; @@ -2814,7 +2814,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) pPM->getServerFile(lzmaFile, false, "", &progress); } } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { // this is a local error, rethrow ... throw; @@ -2837,7 +2837,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) break; } } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError&) { throw; } @@ -2880,7 +2880,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // remove the subfolder name PatchName = NLMISC::CFile::getFilename(PatchName); } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { throw; } diff --git a/code/ryzom/client/src/login_progress_post_thread.cpp b/code/ryzom/client/src/login_progress_post_thread.cpp index 1c38fdd88..ad39de60d 100644 --- a/code/ryzom/client/src/login_progress_post_thread.cpp +++ b/code/ryzom/client/src/login_progress_post_thread.cpp @@ -220,7 +220,7 @@ public: if (StopWanted) break; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 2a513244a..d1c54c6c0 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -850,7 +850,7 @@ void updateFromClientCfg() { SoundMngr->init(NULL); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); SoundMngr = 0; diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index fe1216b64..2a1de9a9e 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -141,7 +141,7 @@ void initReceiveLog() ReceiveLogger.displayNL( "LogReceive is on" ); // only when enabled } } - catch ( EConfigFile& ) + catch (const EConfigFile&) {} } @@ -968,7 +968,7 @@ void CNetworkConnection::sendSystemLogin() //sendUDP (&(_Connection), message.buffer(), length); _Connection.send( message.buffer(), length ); } - catch ( ESocket& e ) + catch (const ESocket &e) { #ifdef NL_OS_WINDOWS // An exception (10004: Blocking operation interrupted) may occur if a firewall such as Kerio is @@ -1123,7 +1123,7 @@ void CNetworkConnection::receiveSystemSync(CBitMemStream &msgin) if(xmlInvalid) xmlInvalid = (checkMsgXml != _AltMsgXmlMD5 || checkDatabaseXml != _AltDatabaseXmlMD5); } - catch (NLMISC::Exception&) + catch (const NLMISC::Exception&) { } @@ -1720,7 +1720,7 @@ void CNetworkConnection::decodeVisualProperties( CBitMemStream& msgin ) } } } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { // End of stream (saves useless bits) } diff --git a/code/ryzom/client/src/pacs_client.cpp b/code/ryzom/client/src/pacs_client.cpp index 16147f0f9..4dc7d7535 100644 --- a/code/ryzom/client/src/pacs_client.cpp +++ b/code/ryzom/client/src/pacs_client.cpp @@ -243,7 +243,7 @@ void initPrimitiveBlocks() { addPacsPrim(primFile); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("Error while loading %s", primFile.c_str()); } diff --git a/code/ryzom/client/src/permanent_ban.cpp b/code/ryzom/client/src/permanent_ban.cpp index 032a5ffaa..ba1ce4188 100644 --- a/code/ryzom/client/src/permanent_ban.cpp +++ b/code/ryzom/client/src/permanent_ban.cpp @@ -87,7 +87,7 @@ static void setPermanentBanFileMarker(const std::string &path, bool on) SetFileAttributes(path.c_str(), FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); #endif } - catch(EStream &e) + catch(const EStream &e) { nlinfo(e.what()); } diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index b4f6de3a4..69223a2ae 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -1359,7 +1359,7 @@ CObject* CComLuaModule::loadFromBuffer(const std::string& data, const std::strin } } } - catch(ELuaError &e) + catch(const ELuaError &e) { nlwarning("%s", e.what()); } diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index a068af182..fd6d99132 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -1706,7 +1706,7 @@ void CEditor::waitScenarioScreen() if ( ! firewallTimeout ) NetMngr.update(); } - catch ( EBlockedByFirewall& ) + catch (const EBlockedByFirewall&) { if ( NetMngr.getConnectionState() == CNetManager::Disconnect ) { @@ -4414,11 +4414,11 @@ bool CEditor::doLuaScript(const char *filename, const char *fileDescText) CLuaStackChecker ls(&getLua()); return true; } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading R2 %s (file = %s) : %s", fileDescText, filename, e.what()); } - catch(ELuaError &e) + catch(const ELuaError &e) { //char filename[MAX_PATH]; std::string msg = e.what(); diff --git a/code/ryzom/client/src/r2/island_collision.cpp b/code/ryzom/client/src/r2/island_collision.cpp index eecddb642..5d6558d8d 100644 --- a/code/ryzom/client/src/r2/island_collision.cpp +++ b/code/ryzom/client/src/r2/island_collision.cpp @@ -432,7 +432,7 @@ CPackedWorld *CIslandCollision::reloadPackedIsland(const CScenarioEntryPoints::C f.serialCheck((uint32) 'MHSI'); f.serial(_HeightMap); } - catch(Exception &e) + catch(const Exception &e) { nlwarning(e.what()); _HeightMap.clear(); @@ -572,7 +572,7 @@ void CIslandCollision::loadEntryPoints() { sep.loadCompleteIslands(); } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { _EntryPointsLoadingFailure = true; nlwarning(e.what()); diff --git a/code/ryzom/client/src/r2/tool_select_move.cpp b/code/ryzom/client/src/r2/tool_select_move.cpp index 1ad9fd797..6bbbe75ee 100644 --- a/code/ryzom/client/src/r2/tool_select_move.cpp +++ b/code/ryzom/client/src/r2/tool_select_move.cpp @@ -369,7 +369,7 @@ void CToolSelectMove::commitAction(CInstance &instance) pos.setValue("y", _FinalPos.y); pos.setValue("z", _FinalPos.z); } - catch(ELuaNotATable &) + catch(const ELuaNotATable &) { nlwarning("Error while setting position of copied object"); } diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index 4f39db901..c5ddb8f47 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -427,7 +427,7 @@ void CSessionBrowserImpl::fill(const std::vector &session // call into lua callRingAccessPointMethod("onSessionListReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -454,7 +454,7 @@ void CSessionBrowserImpl::playerRatingFill(bool scenarioRated, uint32 rateFun, u // call into lua callScenarioScoresMethod("onScenarioScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -482,7 +482,7 @@ void CSessionBrowserImpl::averageScoresFill(bool scenarioRated, uint32 rateFun, // call into lua callScenarioScoresMethod("onAverageScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -573,7 +573,7 @@ void CSessionBrowserImpl::on_scenarioAverageScores(NLNET::TSockId /* from */, bo // call into lua callScenarioScoresMethod("onScenarioAverageScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -647,7 +647,7 @@ void CSessionBrowserImpl::charsFill(const std::vector &chars // call into lua callRingCharTrackingMethod("onCharsListReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -706,7 +706,7 @@ void CSessionBrowserImpl::ringStatsFill() pSM->tryToUnblockTitleFromRingRatings( _LastAuthorRating, _LastAMRating, _LastMasterlessRating ); } } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index 560cf7313..aedee24ce 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -305,7 +305,7 @@ CBitmap *buildSharedBitmap(const std::string &filename, // dump bitmap fisrt line return builtBitmaps.back(); } - catch(EStream &) + catch(const EStream &) { return NULL; } diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index 762eeb298..65ae0a30a 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -512,7 +512,7 @@ void CSoundManager::init(IProgressCallback *progressCallBack) _AudioMixer->enableBackgroundMusicTimeConstraint(ClientCfg.EnableBackgroundMusicTimeConstraint); /* } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "Error: %s", e.what() ); } diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index 8963e9726..1e7fd23be 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -175,7 +175,7 @@ namespace STRING_MANAGER _CacheLoaded = true; } - catch(NLMISC::Exception &e) + catch(const NLMISC::Exception &e) { nlinfo("SM : loadCache failed, exception : %s", e.what()); nlinfo("SM : cache deactivated"); @@ -620,7 +620,7 @@ restartLoop: { dynInfo.Message.serial(param.StringId); } - catch(Exception &) + catch(const Exception &) { param.StringId = EmptyStringId; } @@ -631,7 +631,7 @@ restartLoop: { dynInfo.Message.serial(param.Integer); } - catch(Exception &) + catch(const Exception &) { param.Integer= 0; } @@ -642,7 +642,7 @@ restartLoop: { dynInfo.Message.serial(param.Time); } - catch(Exception &) + catch(const Exception &) { param.Time= 0; } @@ -653,7 +653,7 @@ restartLoop: { dynInfo.Message.serial(param.Money); } - catch(Exception &) + catch(const Exception &) { param.Money= 0; } @@ -664,7 +664,7 @@ restartLoop: { dynInfo.Message.serial(param.DynStringId); } - catch(Exception &) + catch(const Exception &) { param.DynStringId= EmptyDynStringId; } diff --git a/code/ryzom/common/src/game_share/mirror.cpp b/code/ryzom/common/src/game_share/mirror.cpp index 31304614b..1e025a30d 100644 --- a/code/ryzom/common/src/game_share/mirror.cpp +++ b/code/ryzom/common/src/game_share/mirror.cpp @@ -634,7 +634,7 @@ void CMirror::receiveTracker( bool entitiesOrProp, NLNET::CMessage& msgin ) ++nbSent; } } - catch( EMirror& ) + catch(const EMirror& ) { nlwarning( "MIRROR:ROWMGT:ATE> Invalid dataset name %s for adding tracker", name.c_str() ); } @@ -752,7 +752,7 @@ void CMirror::receiveAcknowledgeAddEntityTracker( NLNET::CMessage& msgin, TSe } } - catch( EMirror& ) + catch(const EMirror& ) { nlwarning( "MIRROR: Invalid dataset name %s for receiving ack of addEntityTracker", datasetname.c_str() ); } @@ -1043,7 +1043,7 @@ void cbAllMirrorsOnline( NLNET::CMessage& msgin, const std::string &/* serviceNa msgin.serial( versionStr ); hasVersion = true; } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) {} if ( (! hasVersion) || (MirrorVersion != versionStr) ) nlerror( "Mirror version mismatch! This service: %s; Local MS: %s", MirrorVersion.c_str(), versionStr.c_str() ); @@ -1174,7 +1174,7 @@ void CMirror::receiveServiceHasMirrorReady( const std::string& serviceName, TSer } } } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { nlwarning( "Received SMIRU from old version service %s-%hu", serviceName.c_str(), serviceId.get() ); } @@ -2484,7 +2484,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorRow, "Display the contents of th return true; } } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); return true; @@ -2682,7 +2682,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorEntities, "Display all of part o } } } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2727,7 +2727,7 @@ NLMISC_COMMAND( lookForMirrorValue, "Look for values with criteria (Value can be } MirrorInstance->getDataSet( args[0] ).lookForValue( log, propName, anyValue, valueSearchedStr, onlyEntityType, onlyCreatorId, onlyDynamicId, false, true, false, true ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2747,7 +2747,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorTrackers, "Display the trackers { MirrorInstance->getDataSet( args[0] ).displayTrackers( log ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2794,7 +2794,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, rescanExistingEntities, "Scan the entities to CMirroredDataSet& dataset = MirrorInstance->getDataSet( args[0] ); MirrorInstance->rescanExistingEntities( dataset, log, true ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2815,7 +2815,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayUnknownOnlineEntities, "Scan the entit CMirroredDataSet& dataset = MirrorInstance->getDataSet( args[0] ); MirrorInstance->rescanExistingEntities( dataset, log, false ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2844,7 +2844,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, monitorMirrorEntity, "Set/unset an entity for else log.displayNL( "Invalid entity index provided" ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2867,7 +2867,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, MainNbEntities, "Number of online { *pointer = MirrorInstance->getDataSet( "fe_temp" ).getNbOnlineEntities(); } - catch ( EMirror& ) + catch (const EMirror&) { *pointer = -2; // silent } @@ -2888,7 +2888,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, LocalEntities, "Number of online { *pointer = MirrorInstance->getDataSet( "fe_temp" ).getNbOwnedEntities(); } - catch ( EMirror& ) + catch (const EMirror&) { *pointer = -2; // silent } diff --git a/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp b/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp index 144b06036..6570e2600 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp +++ b/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp @@ -580,7 +580,7 @@ void CPredictWeather::generateWeatherStats(const std::string &fileName, const CW outputFile.serial(output[n]); } } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning(e.what()); } diff --git a/code/ryzom/server/src/ai_service/ai_script_data_manager.cpp b/code/ryzom/server/src/ai_service/ai_script_data_manager.cpp index f9c8a1854..97ad3dd06 100644 --- a/code/ryzom/server/src/ai_service/ai_script_data_manager.cpp +++ b/code/ryzom/server/src/ai_service/ai_script_data_manager.cpp @@ -195,11 +195,11 @@ std::string CAIScriptDataManager::dirname() // { // file->load(fullfilename); // } -// catch (EFileNotFound e) +// catch (const EFileNotFound &e) // { // nlwarning("File not found while trying to load an AI script data file %s", fullfilename.c_str()); // } -// catch (NLMISC::Exception e) +// catch (const NLMISC::Exception &e) // { // nlwarning("Error while loading AI script data file %s", fullfilename.c_str()); // } diff --git a/code/ryzom/server/src/ai_service/nf_state_instance.cpp b/code/ryzom/server/src/ai_service/nf_state_instance.cpp index dfc29a367..e19e6c890 100644 --- a/code/ryzom/server/src/ai_service/nf_state_instance.cpp +++ b/code/ryzom/server/src/ai_service/nf_state_instance.cpp @@ -772,7 +772,7 @@ void loadFile_s_(CStateInstance* entity, CScriptStack& stack) // Interpret the code for the group entity->interpretCode(NULL, codePtr); } - catch (EPathNotFound e) + catch (const EPathNotFound &e) { nlwarning("Path not found while loading AIS script %s", fileName.c_str()); } diff --git a/code/ryzom/server/src/ai_service/npc_description_msg.cpp b/code/ryzom/server/src/ai_service/npc_description_msg.cpp index b390be4da..70989be8d 100644 --- a/code/ryzom/server/src/ai_service/npc_description_msg.cpp +++ b/code/ryzom/server/src/ai_service/npc_description_msg.cpp @@ -159,7 +159,7 @@ static bool LookupShopType(std::string name,std::vector &shopList) } } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning(" shop_category.cfg or ShopCategory not found, no shop base type intialized..."); } diff --git a/code/ryzom/server/src/ai_share/ai_event.cpp b/code/ryzom/server/src/ai_share/ai_event.cpp index 763b54132..fd2d3e44c 100644 --- a/code/ryzom/server/src/ai_share/ai_event.cpp +++ b/code/ryzom/server/src/ai_share/ai_event.cpp @@ -53,7 +53,7 @@ void CAIStunEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -100,7 +100,7 @@ void CAIAggroEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -150,7 +150,7 @@ void CAIStunEndEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -198,7 +198,7 @@ void CAISurvivalInstinctEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -249,7 +249,7 @@ void CAIFearEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -296,7 +296,7 @@ void CAIFearEndEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) @@ -344,7 +344,7 @@ void CAIHungerEvent::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // seek takes a param in bytes (8 bits) f.seek( size, NLMISC::IStream::current); } - catch(ESeekNotSupported &) + catch(const ESeekNotSupported &) { uint8 tmp; for (uint i = 0 ; i < size ; ++i) diff --git a/code/ryzom/server/src/backup_service/backup_file_access.cpp b/code/ryzom/server/src/backup_service/backup_file_access.cpp index ac33c014e..653d18699 100644 --- a/code/ryzom/server/src/backup_service/backup_file_access.cpp +++ b/code/ryzom/server/src/backup_service/backup_file_access.cpp @@ -220,7 +220,7 @@ IFileAccess::TReturnCode CLoadFile::execute(CFileAccessManager& manager) fileRead = true; f.close(); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { } } @@ -389,7 +389,7 @@ IFileAccess::TReturnCode CWriteFile::execute(CFileAccessManager& manager) if (VerboseLog) nlinfo("%s %u octets to file '%s'", Append ? "Append" : "Save", Data.size(), Filename.c_str()); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { } diff --git a/code/ryzom/server/src/backup_service/backup_service.cpp b/code/ryzom/server/src/backup_service/backup_service.cpp index 5e14bbade..fa752cffa 100644 --- a/code/ryzom/server/src/backup_service/backup_service.cpp +++ b/code/ryzom/server/src/backup_service/backup_service.cpp @@ -384,7 +384,7 @@ static void cbSaveCheckFile( CMessage& msgin, const std::string &serviceName, NL { NLMISC::CFile::copyFile( msg.FileName + string(".backup"), msg.FileName ); } - catch( Exception &e ) + catch(const Exception &e) { nlwarning("Can't write file '%s' size %u : '%s', shard stalled until problem are resolved !!!", ( msg.FileName + string(".backup") ).c_str(), msg.Data.length(), e.what() ); // stall shard @@ -411,7 +411,7 @@ static void cbSaveCheckFile( CMessage& msgin, const std::string &serviceName, NL DirStats.writeFile(msg.FileName, msg.Data.length()); } - catch( Exception &e ) + catch(const Exception &e) { nlwarning("Can't write file '%s' size %u : '%s', shard stalled until problem are resolved !!!", msg.FileName.c_str(), msg.Data.length(), e.what()); // stall shard diff --git a/code/ryzom/server/src/entities_game_service/cdb_struct_banks.cpp b/code/ryzom/server/src/entities_game_service/cdb_struct_banks.cpp index 1ce423791..a9c8542e5 100644 --- a/code/ryzom/server/src/entities_game_service/cdb_struct_banks.cpp +++ b/code/ryzom/server/src/entities_game_service/cdb_struct_banks.cpp @@ -107,7 +107,7 @@ void CCDBStructBanks::doInit( const std::string& filename ) nlerror( "CDB: Cannot open file %s", filename.c_str() ); } } - catch ( Exception &e ) + catch (const Exception &e) { // Output error nlerror ("CDB: Error while loading the form %s: %s", filename.c_str(), e.what()); diff --git a/code/ryzom/server/src/entities_game_service/client_messages.cpp b/code/ryzom/server/src/entities_game_service/client_messages.cpp index bce76de53..f654b4a2a 100644 --- a/code/ryzom/server/src/entities_game_service/client_messages.cpp +++ b/code/ryzom/server/src/entities_game_service/client_messages.cpp @@ -1870,7 +1870,7 @@ void cbClientSendEmote( NLNET::CMessage& msgin, const std::string &serviceName, msgin.serial( emoteTextId ); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Bad emote serialisation '%s'", e.what()); return; @@ -1915,7 +1915,7 @@ void cbClientSendCustomEmote( NLNET::CMessage& msgin, const std::string &service msgin.serial( emoteCustomText ); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Bad custom emote serialisation '%s'", e.what()); return; @@ -2966,7 +2966,7 @@ void cbClientQuitGameRequest( NLNET::CMessage& msgin, const std::string & servic } } } - catch ( Exception& e ) // will catch any serialization/security exception + catch (const Exception &e) // will catch any serialization/security exception { GIVEUP_IF(charId.isUnknownId(), "cbClientQuitGameRequest: unknown char", return); nldebug("BypassDisconnectionTimer denied for %s: %s", charId.toString().c_str(), e.what()); diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index 04d86ad70..3d43a6012 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -1129,7 +1129,7 @@ void CPlayerService::initConfigFileVars() // CConfigFile::CVar& cvDecay = ConfigFile.getVar("DecayDelay"); // GameItemManager.DecayDelay = cvDecay.asInt() * 60 * 10; // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // //nlwarning(" var DecayDelay not found"); // } @@ -1139,7 +1139,7 @@ void CPlayerService::initConfigFileVars() // CConfigFile::CVar& cvCorpseToCarrion = ConfigFile.getVar("CorpseToCarrionDelay"); // GameItemManager.CorpseToCarrionDelay = cvCorpseToCarrion.asInt() * 60 * 10; // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // //nlwarning(" var CorpseToCarrionDelay not found"); // } @@ -1149,7 +1149,7 @@ void CPlayerService::initConfigFileVars() // CConfigFile::CVar& cvCarrionDecay = ConfigFile.getVar("CarrionDecayDelay"); // GameItemManager.CarrionDecayDelay = cvCarrionDecay.asInt() * 60 * 10; // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // //nlwarning(" var CarrionDecayDelay not found"); // } @@ -1159,7 +1159,7 @@ void CPlayerService::initConfigFileVars() // CConfigFile::CVar& cvCorpse = ConfigFile.getVar("CorpseMaxCount"); // GameItemManager.CorpseMaxCount = cvCorpse.asInt(); // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // //nlwarning(" var CorpseMaxCount not found"); // } @@ -1273,7 +1273,7 @@ void CPlayerService::initConfigFileVars() nlwarning(" bad size for var Mainlands : %d",mlsz); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning(" var Mainlands not found"); } diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp index e3f23690b..f8db0859c 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp @@ -859,7 +859,7 @@ bool CEntityBase::setValue( const string& var, const string& value ) } temp = v; } - catch( CEntityBase::EInvalidStat &e) + catch(const CEntityBase::EInvalidStat &e) { nlwarning(" Exception : %s",e.what( var ) ); return false; @@ -888,7 +888,7 @@ bool CEntityBase::modifyValue( const string& var, const string& value ) temp = temp + v; //nlinfo(" Modify value %s of %s for entity %s, old value %d, new value %d", var.c_str(), value.c_str(), _Id.toString().c_str(), oldValue, temp.getValue() ); } - catch( CEntityBase::EInvalidStat &e) + catch(const CEntityBase::EInvalidStat &e) { nlwarning(" Exception : %s",e.what( var ) ); return false; @@ -913,7 +913,7 @@ bool CEntityBase::getValue( const string& var, string& value ) sint32 val = lookupStat(var); value = toString(val); } - catch( CEntityBase::EInvalidStat &e) + catch(const CEntityBase::EInvalidStat &e) { if( var == string("Behaviour") ) { diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp index 7c6a85b0c..1ea9e4a1f 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp @@ -887,7 +887,7 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ } } } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "(PS) Error: %s", e.what() ); } @@ -993,7 +993,7 @@ void cbCreateChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ { CUnifiedNetwork::getInstance()->send(serviceId, msgout); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "(PS) Error: %s", e.what() ); } @@ -1087,7 +1087,7 @@ void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool ICharacter * cItf = ICharacter::getInterface( ch, false ); cItf->sendUserChar( userId, 0 /*auto*/, R2::TUserRole::ur_player ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "(PS) Error: %s", e.what() ); } @@ -1140,7 +1140,7 @@ void sendIfNameIsValide( uint32 userId, bool nameValide ) { CUnifiedNetwork::getInstance()->send( PlayerManager.getPlayerFrontEndId( userId ), msgoutName ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "(PS) Error: %s", e.what() ); } @@ -1320,7 +1320,7 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO { CUnifiedNetwork::getInstance()->send( frontEndId, msgout); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( " Error: %s", e.what() ); } diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp index e7b18c32b..eb30c4e76 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp @@ -2457,7 +2457,7 @@ void CGameItem::deleteItem(CGameItem *item) // //NLMEMORY::CheckHeap (true); // } //// } -//// catch( Exception& e ) +//// catch(const Exception &e) //// { //// nlwarning(" %s",e.what()); //// } diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp index 7b4e1a4f9..56ef17388 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp @@ -587,7 +587,7 @@ void CGameItemManager::destroyItem( CGameItemPtr &ptr ) // } // } // } -// catch( Exception& e ) +// catch(const Exception &e) // { // nlwarning(" %s",e.what()); // return; @@ -627,7 +627,7 @@ void CGameItemManager::destroyItem( CGameItemPtr &ptr ) // }*/ // } // } -// catch( Exception& e ) +// catch(const Exception &e) // { // nlwarning(" %s",e.what()); // return; diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_charge.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild_charge.cpp index eb3974d82..89f216681 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_charge.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_charge.cpp @@ -228,7 +228,7 @@ void CGuildCharge::save() } } } - catch( Exception& ) + catch(const Exception &) { //f.close(); nlwarning("(EGS) : Can't write file %s (disk full ?)",_FileName.c_str()); diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_manager.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild_manager.cpp index 6ee4ea4cd..9615c5ea1 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_manager.cpp @@ -351,7 +351,7 @@ void CGuildManager::saveGuild( CGuild* guild ) msg.DataMsg.serialBuffer((uint8*)&buffer.front(), (uint)buffer.size()); Bsi.sendFile( msg ); } - catch( Exception& ) + catch(const Exception &) { nlwarning(" : Can't serial file %s",fileName.c_str()); return; diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp index 83186f292..0b51cb178 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp @@ -158,7 +158,7 @@ void CMissionQueueManager::saveToFile() } Bsi.sendFile( msg ); } - catch( Exception& ) + catch(const Exception &) { nlwarning("(EGS) : Can't serial file %s (connection with BS service down ?)",sFilename.c_str()); return; diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp index 5415e253b..03674feca 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp @@ -799,7 +799,7 @@ void COutpostManager::saveOutpost(NLMISC::CSmartPtr outpost) } Bsi.sendFile( msg ); } - catch( Exception& ) + catch(const Exception &) { OUTPOST_WRN("Can't serial file %s",fileName.c_str()); return; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp index 54118e30f..6818a8b73 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp @@ -2484,7 +2484,7 @@ void CCharacter::sendItemInfos( uint16 slotId ) pInv->onItemChanged(slot, INVENTORIES::itc_info_version); } } - catch ( NLMISC::Exception & e ) + catch (const NLMISC::Exception &e) { nlwarning(" exception : '%s'",e.what() ); } diff --git a/code/ryzom/server/src/entities_game_service/player_manager/player.cpp b/code/ryzom/server/src/entities_game_service/player_manager/player.cpp index 977598a23..48d7606a4 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/player.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/player.cpp @@ -807,7 +807,7 @@ void CPlayer::loadAllCharacters() characterFound = true; egs_plinfo("LOADED Character '%s' from file: %s",pCh->getName().toUtf8().c_str(),serialBinFileName.c_str()); } - catch( Exception& e) + catch(const Exception &e) { nlwarning("Failed to load '%s': %s", serialBinFileName.c_str(), e.what()); string newfn = serialBinFileName+".wiped"; @@ -906,7 +906,7 @@ void CPlayer::loadAllCharacters() } } } - catch( Exception& e) + catch(const Exception &e) { nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what()); string newfn = fileName+".wiped"; @@ -933,7 +933,7 @@ void CPlayer::loadAllCharacters() PlayerManager.savePlayerChar( _UserId, i ); } } - catch( Exception& e) + catch(const Exception &e) { nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what()); string newfn = fileName+".wiped"; @@ -979,7 +979,7 @@ void CPlayer::loadAllCharactersPdr() if (!isOK) continue; } - catch( Exception& e) + catch(const Exception &e) { nlwarning("Failed to load '%s': %s", fileName.c_str(), e.what()); string newfn = fileName+".wiped"; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp index 78d83c0ed..99b1d63a7 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp @@ -745,7 +745,7 @@ void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set : Can't serial file %s (connection with BS service down ?)",serialFileName.c_str()); return; @@ -789,7 +789,7 @@ void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set : Can't serial file %s (connection with BS service down ?)",pdrFileName.c_str()); return; @@ -824,7 +824,7 @@ void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set : Can't write file %s : %s", serialPathFileName.c_str(), e.what()); @@ -849,7 +849,7 @@ void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set : Can't serial file %s (connection with BS service down ?)", pdrPathFileName.c_str()); return; diff --git a/code/ryzom/server/src/entities_game_service/primitives_parser.cpp b/code/ryzom/server/src/entities_game_service/primitives_parser.cpp index dfd92d25c..da99cc456 100644 --- a/code/ryzom/server/src/entities_game_service/primitives_parser.cpp +++ b/code/ryzom/server/src/entities_game_service/primitives_parser.cpp @@ -112,7 +112,7 @@ void CPrimitivesParser::init() _Primitives.back().FileName = fullName; // _PrimitiveFiles.push_back(fullName); } - catch( Exception & e ) + catch(const Exception &e) { nlwarning(" exception launched : %s",e.what() ); _Primitives.pop_back(); diff --git a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp index 18fdc67f7..e328ebf9e 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/shop_type_manager.cpp @@ -271,7 +271,7 @@ void CShopTypeManager::initShopBase() } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning(" shop_category.cfg or ShopCategory not found, no shop base type initialized..."); } diff --git a/code/ryzom/server/src/entities_game_service/team_manager/reward_sharing.cpp b/code/ryzom/server/src/entities_game_service/team_manager/reward_sharing.cpp index 10cc0df44..4fec526ae 100644 --- a/code/ryzom/server/src/entities_game_service/team_manager/reward_sharing.cpp +++ b/code/ryzom/server/src/entities_game_service/team_manager/reward_sharing.cpp @@ -433,7 +433,7 @@ void CRewardSharing::setUsersDb() shareItem.setPREREQUISIT_VALID(user->_PropertyDatabase, 0); } } - catch( NLMISC::Exception & e) + catch(const NLMISC::Exception &e) { nlwarning("exception in :'%s'",e.what()); } diff --git a/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp b/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp index 5a61c9868..5e9583b81 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp +++ b/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp @@ -854,7 +854,7 @@ void CFeReceiveSub::handleReceivedMsg( CClientHost *clienthost ) sint v = file.serialVersion( 0 ); file.serialCont( _AutoUidMap ); } - catch ( Exception& ) + catch (const Exception&) { nlinfo( "No AutoAllocUserid data found yet" ); } @@ -898,7 +898,7 @@ void CFeReceiveSub::handleReceivedMsg( CClientHost *clienthost ) file.serialVersion( 0 ); file.serialCont( _AutoUidMap ); } - catch ( Exception& e ) + catch (const Exception &e) { nlwarning( "Could not save AutoAllocUserid data: %s", e.what() ); } @@ -1394,17 +1394,17 @@ void CFeReceiveSub::handleReceivedMsg( CClientHost *clienthost ) } } } - catch( EStreamOverflow& ) + catch(const EStreamOverflow& ) { TUid userId = clienthost ? clienthost->Uid : 0; rejectReceivedMessage( InsufficientSize, userId ); } - catch( EInvalidDataStream& ) + catch(const EInvalidDataStream& ) { TUid userId = clienthost ? clienthost->Uid : 0; rejectReceivedMessage( HackedSizeInBuffer, userId ); } - catch ( Exception& ) + catch (const Exception& ) { TUid userId = clienthost ? clienthost->Uid : 0; rejectReceivedMessage( UnknownExceptionType, userId ); diff --git a/code/ryzom/server/src/frontend_service/fe_receive_task.cpp b/code/ryzom/server/src/frontend_service/fe_receive_task.cpp index 6b87b214d..cca6f9f8f 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_task.cpp +++ b/code/ryzom/server/src/frontend_service/fe_receive_task.cpp @@ -102,7 +102,7 @@ CFEReceiveTask::CFEReceiveTask( uint16 firstAcceptablePort, uint16 lastAcceptabl DataSock->bind( actualPort ); break; } - catch ( ESocket& e ) + catch (const ESocket &e) { nlinfo( "Port %u not available: %s", actualPort, e.what() ); } @@ -157,7 +157,7 @@ void CFEReceiveTask::run() _ReceivedMessage.setTypeEvent( TReceivedMessage::User ); DataSock->receivedFrom( _ReceivedMessage.userDataW(), _DatagramLength, _ReceivedMessage.AddrFrom ); } - catch ( ESocket& ) + catch (const ESocket&) { // Remove the client corresponding to the address _ReceivedMessage.setTypeEvent( TReceivedMessage::RemoveClient ); diff --git a/code/ryzom/server/src/frontend_service/fe_send_sub.cpp b/code/ryzom/server/src/frontend_service/fe_send_sub.cpp index 8b80a2985..6c3611d5a 100644 --- a/code/ryzom/server/src/frontend_service/fe_send_sub.cpp +++ b/code/ryzom/server/src/frontend_service/fe_send_sub.cpp @@ -375,7 +375,7 @@ void CFeSendSub::flushMessages() ++_SendCounter; //nldebug( "%u: SENDING NOW %u bytes to %s", CTickEventHandler::getGameCycle(), (*isb).OutBox.length(), (*isb).DestAddress.asString().c_str() ); } - catch ( ESocket& ) + catch (const ESocket&) { nlwarning( "Could not send data to client %u", isb-_CurrentFlushingBuffers->begin() ); } diff --git a/code/ryzom/server/src/frontend_service/frontend_service.cpp b/code/ryzom/server/src/frontend_service/frontend_service.cpp index d0e23a5ef..377bef856 100644 --- a/code/ryzom/server/src/frontend_service/frontend_service.cpp +++ b/code/ryzom/server/src/frontend_service/frontend_service.cpp @@ -1334,7 +1334,7 @@ void CFrontEndService::init() CActionGeneric::ServerSide = true; } - catch ( Exception& e ) + catch (const Exception &e) { nlerror( "Error: %s", e.what() ); } diff --git a/code/ryzom/server/src/frontend_service/id_impulsions.cpp b/code/ryzom/server/src/frontend_service/id_impulsions.cpp index eb0bec55e..9fe16151f 100644 --- a/code/ryzom/server/src/frontend_service/id_impulsions.cpp +++ b/code/ryzom/server/src/frontend_service/id_impulsions.cpp @@ -82,7 +82,7 @@ void impulsionCmd( CEntityId& sender, CBitMemStream &bms, TGameCycle gamecycle, bms.serial(cmd); bms.serial(arg); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -119,7 +119,7 @@ void impulsionCmd( CEntityId& sender, CBitMemStream &bms, TGameCycle gamecycle, bms.serial(cmd); bms.serial(arg); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -147,7 +147,7 @@ void impulsionCmd( CEntityId& sender, CBitMemStream &bms, TGameCycle gamecycle, // { // bms.serial(stringId); // } -// catch( Exception& e ) +// catch(const Exception &e) // { // nlwarning(" %s", e.what()); // return; @@ -173,7 +173,7 @@ void impulsionPhraseLearn( CEntityId& sender, CBitMemStream &bms, TGameCycle gam bms.serial( phraseId ); bms.serial( phraseDesc ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -203,7 +203,7 @@ void impulsionPhraseMemorize( CEntityId& sender, CBitMemStream &bms, TGameCycle bms.serial( phraseId ); bms.serial( phraseDesc ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -238,7 +238,7 @@ void impulsionExecuteFaber( CEntityId& sender, CBitMemStream &bms, TGameCycle ga bms.serialCont( rmSelected ); bms.serialCont( rmFormulaSelected ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -276,7 +276,7 @@ void cbImpulsionGetNpcIconDesc( CEntityId& sender, CBitMemStream &bms, TGameCycl CUnifiedNetwork::getInstance()->send("EGS", msgout); //nldebug("Forwarding GET_DESC to EGS (%hu NPCs)", nb8 ); } - catch ( Exception& e ) + catch (const Exception &e) { nlwarning(" %s", e.what()); return; @@ -475,7 +475,7 @@ void routeImpulsionIdFromClient( NLMISC::CBitMemStream& bms, const NLMISC::CEnti CUnifiedNetwork::getInstance()->send("BBS", msgout); }*/ } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s %s", msgName.c_str(), e.what() ); return; diff --git a/code/ryzom/server/src/frontend_service/uid_impulsions.cpp b/code/ryzom/server/src/frontend_service/uid_impulsions.cpp index 97b8b2b1d..71d2cf177 100644 --- a/code/ryzom/server/src/frontend_service/uid_impulsions.cpp +++ b/code/ryzom/server/src/frontend_service/uid_impulsions.cpp @@ -147,7 +147,7 @@ static void impulsionStringRequestUid(uint32 uid, CBitMemStream &bms, TGameCycle { bms.serial(stringId); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s", e.what()); return; @@ -307,7 +307,7 @@ void routeImpulsionUidFromClient( NLMISC::CBitMemStream& bms, const uint32& user } } } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s %s", msgName.c_str(), e.what() ); return; diff --git a/code/ryzom/server/src/gpm_service/gpm_service.cpp b/code/ryzom/server/src/gpm_service/gpm_service.cpp index 7e82d1d3d..1a6cf72e7 100644 --- a/code/ryzom/server/src/gpm_service/gpm_service.cpp +++ b/code/ryzom/server/src/gpm_service/gpm_service.cpp @@ -182,7 +182,7 @@ void cbEGSConnection( const std::string &serviceName, NLNET::TServiceId serviceI // msgout.serialCont( continentsNames ), // CUnifiedNetwork::getInstance()->send( "EGS", msgout ); // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // nlwarning(" UsedContinents not found, no continent used"); // } @@ -350,7 +350,7 @@ void CGlobalPositionManagerService::init() CWorldPositionManager::loadContinent(name, continents[i].ContinentName, continents[i].ContinentInstance); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning(" UsedContinents not found, no continent used"); } diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index ef11c30d2..4ae2815d4 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -412,7 +412,7 @@ void CWorldPositionManager::loadPatatsInFile(const string &file) { _PatatSubscribeManager.usePrim(file); } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning("Couldn't load '%s' : %s", file.c_str(), e.what()); } diff --git a/code/ryzom/server/src/input_output_service/commands.cpp b/code/ryzom/server/src/input_output_service/commands.cpp index 66c30db8f..3e91d1e87 100644 --- a/code/ryzom/server/src/input_output_service/commands.cpp +++ b/code/ryzom/server/src/input_output_service/commands.cpp @@ -538,7 +538,7 @@ NLMISC_COMMAND(mute,"Mute or unmute a player. the player can be muted for a fixe { IOS->getChatManager().getClient(charInfos->DataSetIndex).mute( delay ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } diff --git a/code/ryzom/server/src/input_output_service/input_output_service.cpp b/code/ryzom/server/src/input_output_service/input_output_service.cpp index 0a9c193e8..30b7186c3 100644 --- a/code/ryzom/server/src/input_output_service/input_output_service.cpp +++ b/code/ryzom/server/src/input_output_service/input_output_service.cpp @@ -346,7 +346,7 @@ void CInputOutputService::init() // CConfigFile::CVar& cvDynamicDB = ConfigFile.getVar("DynamicDB"); // dynamicDBFileName = cvDynamicDB.asString(); // } -// catch(EUnknownVar &) +// catch(const EUnknownVar &) // { // nlwarning(" using default chat files"); // } @@ -358,7 +358,7 @@ void CInputOutputService::init() CConfigFile::CVar& cvMaxDistShout = ConfigFile.getVar("MaxDistShout"); MaxDistShout = cvMaxDistShout.asInt(); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlinfo(" using default chat max distance values"); } diff --git a/code/ryzom/server/src/input_output_service/messages.cpp b/code/ryzom/server/src/input_output_service/messages.cpp index 5b39242b9..5c314f4a8 100644 --- a/code/ryzom/server/src/input_output_service/messages.cpp +++ b/code/ryzom/server/src/input_output_service/messages.cpp @@ -120,7 +120,7 @@ void cbImpulsionChat( CMessage& msgin, const string &serviceName, TServiceId ser { msgin.serial(ucstr); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -140,7 +140,7 @@ void cbImpulsionChat( CMessage& msgin, const string &serviceName, TServiceId ser IOS->getChatManager().getClient(senderRow).updateAudience(); IOS->getChatManager().chat( senderRow, ucstr ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } @@ -161,7 +161,7 @@ void cbImpulsionChatTeam( CMessage& msgin, const string &serviceName, TServiceId { msgin.serial(ucstr); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -188,7 +188,7 @@ void cbImpulsionChatTeam( CMessage& msgin, const string &serviceName, TServiceId // reset chat mode to old value IOS->getChatManager().getClient(senderRow).setChatMode( chatModeBck ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } @@ -211,7 +211,7 @@ void cbImpulsionTell( CMessage& msgin, const string &serviceName, TServiceId ser msgin.serial(receiver); msgin.serial(str); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -245,7 +245,7 @@ static void updateIgnoreStatus(CMessage& msgin, const string &serviceName, TServ msgin.serial(ignoredId); IOS->getChatManager().getClient(TheDataset.getDataSetRow(senderId)).setIgnoreStatus(ignoredId, ignored); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -288,7 +288,7 @@ void cbImpulsionUnignoreAll( CMessage& msgin, const string &serviceName, TServic IOS->getChatManager().getClient(TheDataset.getDataSetRow(senderId)).setIgnoreStatus(*it, false); } } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -311,7 +311,7 @@ void cbImpulsionFilter( CMessage& msgin, const string &serviceName, TServiceId s { msgin.serial( filterId ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -324,7 +324,7 @@ void cbImpulsionFilter( CMessage& msgin, const string &serviceName, TServiceId s { IOS->getChatManager().getClient(TheDataset.getDataSetRow(sender)).filter( filterId ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } @@ -369,7 +369,7 @@ void cbImpulsionChatMode( CMessage& msgin, const string &serviceName, TServiceId msgin.serial( chatMode ); msgin.serial(chanID); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -400,7 +400,7 @@ void cbImpulsionChatMode( CMessage& msgin, const string &serviceName, TServiceId nlwarning("(CHAT_MODE) The chat mode %d is out of enum !", chatMode); } } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } @@ -427,7 +427,7 @@ void cbImpulsionAfkTxt( CMessage& msgin, const string &serviceName, TServiceId s { msgin.serial( afkTxt ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -528,7 +528,7 @@ static void cbChatMessage(CMessage& msgin, const string &serviceName, TServiceId msgin.serial(entityId); msgin.serial(str); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -546,7 +546,7 @@ static void cbChatMessage(CMessage& msgin, const string &serviceName, TServiceId if ( oldMode != CChatGroup::say ) IOS->getChatManager().getClient(entityId).setChatMode(oldMode); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); } @@ -565,7 +565,7 @@ static void cbChatMessage(CMessage& msgin, const string &serviceName, TServiceId { msgin.serial( entityId ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -595,7 +595,7 @@ static void cbCharacterName(CMessage& msgin, const string &serviceName, TService // character's name msgin.serial( name ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -621,7 +621,7 @@ static void cbCharacterNameId(CMessage& msgin, const string &serviceName, TServi // character's string Id msgin.serial( stringId ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -662,7 +662,7 @@ static void cbCharacterNameAndLang(CMessage& msgin, const string &serviceName, T // privilege msgin.serial( havePrivilege ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -695,7 +695,7 @@ static void cbCharacterEventFaction(CMessage& msgin, const string &serviceName, // event faction msgin.serial( eventFaction ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s", e.what()); return; @@ -734,7 +734,7 @@ static void cbAddGroup( CMessage& msgin, const string &serviceName, TServiceId s msgin.serial( gId ); msgin.serial( gType ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -765,7 +765,7 @@ static void cbAddNamedGroup( CMessage& msgin, const string &serviceName, TServic msgin.serial( gType ); msgin.serial( name ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -793,7 +793,7 @@ static void cbRemoveGroup( CMessage& msgin, const string &serviceName, TServiceI { msgin.serial( gId ); } - catch( Exception& e ) + catch(const Exception &e) { nlwarning(" %s",e.what()); return; @@ -820,7 +820,7 @@ static void cbAddToGroup( CMessage& msgin, const string &serviceName, TServiceId msgin.serial( gId ); msgin.serial( charId ); } - catch( Exception& e ) + catch(const Exception& e) { nlwarning(" %s",e.what()); return; @@ -860,7 +860,7 @@ static void cbRemoveFromGroup( CMessage& msgin, const string &serviceName, TServ msgin.serial( gId ); msgin.serial( charId ); } - catch( Exception& e ) + catch(const Exception& e) { nlwarning(" %s",e.what()); return; @@ -896,7 +896,7 @@ static void cbRemoveFromGroup( CMessage& msgin, const string &serviceName, TServ // msgin.serial( clientId ); // msgin.serial( entityId ); // } -// catch( Exception& e ) +// catch(const Exception& e) // { // nlwarning(" %s",e.what()); // return; @@ -915,7 +915,7 @@ static void cbRemoveFromGroup( CMessage& msgin, const string &serviceName, TServ // IOS->getChatManager().addDynStr( clientId, entityInfos->OldNameIndex, serviceId ); // } // } -// catch( CChatManager::EChatClient& e ) +// catch(const CChatManager::EChatClient& e) // { // nlwarning(" %s",e.what()); // } @@ -986,7 +986,7 @@ void cbNpcTell( CMessage& msgin, const string &serviceName, TServiceId serviceId // CChatClient &client = cm.getClient(sender); cm.sendChat2(CChatGroup::tell, receiver, phraseId, sender); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcTell : ignoring chat because NPC info not available yet"); } @@ -1037,7 +1037,7 @@ void cbNpcTellEx( CMessage& msgin, const string &serviceName, TServiceId service // CChatClient &client = cm.getClient(sender); cm.sendChat2Ex(CChatGroup::tell, receiver, phraseId, sender); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcTell : ignoring chat because NPC info not available yet"); } @@ -1075,7 +1075,7 @@ void cbNpcChatEx( CMessage& msgin, const string &serviceName, TServiceId service client.updateAudience(); cm.chat2Ex(sender, phraseId); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcChatEx : ignoring chat because NPC info not available yet"); } @@ -1112,7 +1112,7 @@ void cbNpcChat( CMessage& msgin, const string &serviceName, TServiceId serviceId client.updateAudience(); cm.chat2(sender, phraseId); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcChat : ignoring chat because NPC info not available yet"); } @@ -1159,7 +1159,7 @@ void cbNpcChatParam( CMessage& msgin, const string &serviceName, NLNET::TService client.updateAudience(); cm.chatParam(sender, phraseId, params); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcChat : ignoring chat because NPC info not available yet"); } @@ -1196,7 +1196,7 @@ void cbNpcChatSentence( CMessage& msgin, const string &serviceName, TServiceId s client.updateAudience(); cm.chat(sender, sentence); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcChatSentence : ignoring chat because NPC info not available yet"); } @@ -1316,7 +1316,7 @@ void cbGroupDynString( CMessage& msgin, const string &serviceName, TServiceId se } } } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbGroupDynString : ignoring group message because entity info not available yet"); } @@ -1439,7 +1439,7 @@ void cbUniverseMode( CMessage& msgin, const string &serviceName, TServiceId serv { IOS->getChatManager().getClient(TheDataset.getDataSetRow(userId)).setChatMode( type ); } - catch( Exception& e ) + catch(const Exception& e) { nlwarning(" %s",e.what()); } @@ -1500,7 +1500,7 @@ void cbEmoteCrowd( CMessage& msgin, const string &serviceName, TServiceId servic // send the phrase cm.sendEmoteTextToAudience(sender, phraseTextId, params,ignored); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("cbNpcChatEx : ignoring chat because NPC info not available yet"); } @@ -1549,7 +1549,7 @@ void cbCustomEmote( CMessage& msgin, const string &serviceName, TServiceId servi // send the phrase cm.sendEmoteCustomTextToAll(sender, emoteCustomText); } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning(" exception, ignoring emote"); } diff --git a/code/ryzom/server/src/input_output_service/string_manager.cpp b/code/ryzom/server/src/input_output_service/string_manager.cpp index dcea3f2b0..6e61f1220 100644 --- a/code/ryzom/server/src/input_output_service/string_manager.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager.cpp @@ -709,7 +709,7 @@ void CStringManager::broadcastSystemMessage(NLNET::CMessage &message, bool debug } } } - catch(CChatManager::EChatClient e) + catch(const CChatManager::EChatClient &e) { nlwarning("%s", e.what()); } @@ -1084,7 +1084,7 @@ void CStringManager::updateUserLanguage( uint32 userId, TServiceId frontEndId, c { CUnifiedNetwork::getInstance()->send( frontEndId, msgout); } - catch( Exception& e ) + catch(const Exception& e) { nlwarning( "CStringManager::updateUserLanguage : Error : %s", e.what() ); } @@ -1102,7 +1102,7 @@ void CStringManager::setPhrase(NLNET::CMessage &message) message.serial(phraseName); message.serial(phraseContent); } - catch( Exception& e ) + catch(const Exception& e) { nlwarning(" %s",e.what()); return; diff --git a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp index 94af5e29b..57b8758af 100644 --- a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp @@ -1820,7 +1820,7 @@ void CStringManager::init(NLMISC::CLog *log) CConfigFile::CVar& cvDebugString = NLNET::IService::getInstance()->ConfigFile.getVar("ReadTranslationWork"); ReadTranslationWork = cvDebugString.asInt() != 0; } - catch(EUnknownVar &) + catch(const EUnknownVar &) { log->displayNL(" using default ReadTranslationWork (false)"); } @@ -1832,7 +1832,7 @@ void CStringManager::init(NLMISC::CLog *log) CConfigFile::CVar& cvDebugString = NLNET::IService::getInstance()->ConfigFile.getVar("ReadWorkOnly"); readWorkOnly = cvDebugString.asInt() != 0; } - catch(EUnknownVar &) + catch(const EUnknownVar &) { log->displayNL(" using default ReadWorkOnly (false)"); } @@ -1844,7 +1844,7 @@ void CStringManager::init(NLMISC::CLog *log) TranslationWorkPath = cvWorkPath.asString(); TranslationWorkPath = CPath::standardizePath(TranslationWorkPath, true); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { log->displayNL(" using default DebugStringManager (%s)", TranslationWorkPath.c_str()); } diff --git a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp index dda21de4f..b2fe5417e 100644 --- a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp +++ b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp @@ -293,7 +293,7 @@ void CMailForumService::cbOpenSession( CMessage& msgin, const std::string &servi openSession(shardId, userName, cookie); } - catch(Exception& e) + catch(const Exception& e) { nlwarning("Failed to open session: %s", e.what()); } @@ -311,7 +311,7 @@ void CMailForumService::cbCloseSession( CMessage& msgin, const std::string &serv closeSession(shardId, userName); } - catch(Exception& e) + catch(const Exception& e) { nlwarning("Failed to close session: %s", e.what()); } @@ -330,7 +330,7 @@ void CMailForumService::cbRemoveUser( CMessage& msgin, const std::string &servic removeUser(shardId, userName); } - catch(Exception& e) + catch(const Exception& e) { nlwarning("Failed to remove user: %s", e.what()); } @@ -349,7 +349,7 @@ void CMailForumService::cbRemoveGuild( CMessage& msgin, const std::string &servi removeGuild(shardId, guildName); } - catch(Exception& e) + catch(const Exception& e) { nlwarning("Failed to remove guild: %s", e.what()); } @@ -408,7 +408,7 @@ void CMailForumService::cbChangeUserName( CMessage& msgin, const std::string &se changeUserName(shardId, oldName, newName); } - catch(Exception& e) + catch(const Exception& e) { nlwarning("Failed to close session: %s", e.what()); } diff --git a/code/ryzom/server/src/mirror_service/mirror_service.cpp b/code/ryzom/server/src/mirror_service/mirror_service.cpp index 8a0c4d5a1..e90b4d7c9 100644 --- a/code/ryzom/server/src/mirror_service/mirror_service.cpp +++ b/code/ryzom/server/src/mirror_service/mirror_service.cpp @@ -1227,7 +1227,7 @@ void CMirrorService::processReceivedDelta( CMessage& msgin, TServiceId serviceId ++currentBlock; } } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { nlwarning( "Stream overflow in received delta from %s, currentBlock=%u nbMsgs=%u iMsg=%u currentState=%u", servStr(serviceId).c_str(), currentBlock, nbMsgs, i, currentState ); @@ -2068,7 +2068,7 @@ void CMirrorService::processDataSetEntitiesSubscription( const std::string& data nlinfo( "ROWMGT: MS %hu subscribes to dataset %s", msId.get(), dataSetName.c_str() ); allocateEntityTrackers( NDataSets[dataSetName], msId, clientServiceId, false, newTagOfRemoteMS ); } - catch ( EMirror& ) + catch (const EMirror&) { nlwarning( "MIRROR: Invalid dataset while receiving subscription" ); } @@ -2892,7 +2892,7 @@ void CMirrorService::receiveAcknowledgeAddEntityTrackerMS( NLNET::CMessage& msgi }*/ } } - catch( EMirror& ) + catch(const EMirror& ) { nlwarning( "Invalid dataset name %s for receiving ack of addEntityTracker", datasetname.c_str() ); } @@ -3323,7 +3323,7 @@ void CMirrorService::receiveSyncMirrorInformation( CMessage& msgin, TServiceId s nlinfo( "Resync from client service %s succeeded", servStr(serviceId).c_str() ); } - catch ( EMirror& ) + catch (const EMirror&) { nlwarning( "Dataset not found (SYNCMI)" ); } @@ -3697,7 +3697,7 @@ void cbAddRemoveRemoteClientService( NLNET::CMessage& msgin, const std::string & msgin.serial( tagOfNewClientService ); msgin.serial( remoteMSVersion ); } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) {} if ( MirrorServiceVersion != remoteMSVersion ) nlerror( "MS version mismatch! This MS: %s; Remote MS-%hu: %s", MirrorServiceVersion.c_str(), serviceId.get(), remoteMSVersion.c_str() ); @@ -3723,7 +3723,7 @@ void cbReleaseEntitiesInRanges( NLNET::CMessage& msgin, const std::string &servi { MSInstance->releaseEntitiesInRanges( MSInstance->NDataSets[datasetName], erasedRanges ); } - catch ( EMirror& ) + catch (const EMirror&) { nlwarning( "Dataset %s not found", datasetName.c_str() ); } @@ -3747,7 +3747,7 @@ void cbRecvBindingCountersByMessage( NLNET::CMessage& msgin, const std::string & { MSInstance->NDataSets[datasetName].receiveAllBindingCounters( msgin ); } - catch ( EMirror& ) + catch (const EMirror&) { nlwarning( "Dataset %s not found", datasetName.c_str() ); } @@ -3871,7 +3871,7 @@ NLMISC_COMMAND( displayMSTrackers, "Display the trackers for one of all dataset( { MSInstance->NDataSets[args[0]].displayTrackers(); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } diff --git a/code/ryzom/server/src/mirror_service/mirror_service.h b/code/ryzom/server/src/mirror_service/mirror_service.h index 7eea96a40..74d588915 100644 --- a/code/ryzom/server/src/mirror_service/mirror_service.h +++ b/code/ryzom/server/src/mirror_service/mirror_service.h @@ -375,7 +375,7 @@ public: } ++_NbChangesPushed; } - catch ( NLMISC::EReallocationFailed& ) + catch (const NLMISC::EReallocationFailed&) { nlwarning( "ERROR: Can't reallocate DeltaBuffer (E%u propIndex %hd %s NbChangesPushed %d oldpos %d bufpos %d bufsize %u StoredNbChangesPushedProps %d NbChangesPushedInTickProps %d StoredNbChangesPushedRowMgt %d NbChangesPushedInTickRowMgt %d)", datasetrow.getIndex(), propIndex, _DataSet->propIsList(propIndex) ? "list" : "normal", diff --git a/code/ryzom/server/src/monitor_service/service_main.cpp b/code/ryzom/server/src/monitor_service/service_main.cpp index deb906dcf..d4f3e8d56 100644 --- a/code/ryzom/server/src/monitor_service/service_main.cpp +++ b/code/ryzom/server/src/monitor_service/service_main.cpp @@ -208,7 +208,7 @@ void connectToDatabase() DatabaseLogin = IService::getInstance ()->ConfigFile.getVar("DatabaseLogin").asString (); DatabasePassword = IService::getInstance ()->ConfigFile.getVar("DatabasePassword").asString (); } - catch(EConfigFile &e) + catch(const EConfigFile &e) { nlwarning(e.what()); return; diff --git a/code/ryzom/server/src/pd_lib/pd_messages.cpp b/code/ryzom/server/src/pd_lib/pd_messages.cpp index 5d6ad7162..dee2a6a9b 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.cpp +++ b/code/ryzom/server/src/pd_lib/pd_messages.cpp @@ -898,7 +898,7 @@ void CUpdateLog::displayLogs(const CDBDescriptionParser& description, { file.serialCont(logs); } - catch (NLMISC::Exception&) + catch (const NLMISC::Exception&) { break; } @@ -1032,7 +1032,7 @@ void CUpdateLog::processLogs(const std::string& path, { file.serialCont(logs); } - catch (NLMISC::Exception&) + catch (const NLMISC::Exception&) { break; } diff --git a/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp b/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp index 57fb67b69..05fbbdc50 100644 --- a/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp +++ b/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp @@ -976,7 +976,7 @@ public: _ServiceInstances.addUniqueService( uniqueServices.asString(i), true ); } } - catch(Exception &) + catch(const Exception &) {} try { @@ -986,7 +986,7 @@ public: _ServiceInstances.addUniqueService( uniqueServicesM.asString(i), false ); } } - catch(Exception &) + catch(const Exception &) {} /* diff --git a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp index 9e471c0d3..e7854d8ce 100644 --- a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp +++ b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp @@ -1240,7 +1240,7 @@ public: { string FrontendServiceName = ConfigFile.getVar ("FrontendServiceName").asString(); - try { FrontEndAddress = ConfigFile.getVar ("FrontEndAddress").asString(); } catch(Exception &) { } + try { FrontEndAddress = ConfigFile.getVar ("FrontEndAddress").asString(); } catch(const Exception &) { } nlinfo ("Waiting frontend services named '%s'", FrontendServiceName.c_str()); diff --git a/code/ryzom/server/src/server_share/continent_container.cpp b/code/ryzom/server/src/server_share/continent_container.cpp index 080cc3d5a..a6986574d 100644 --- a/code/ryzom/server/src/server_share/continent_container.cpp +++ b/code/ryzom/server/src/server_share/continent_container.cpp @@ -288,7 +288,7 @@ void CContinentContainer::initPacsPrim(const string &path) nlwarning("Couldn't load prim block '%s'", fileNames[k].c_str()); } } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning("Couldn't load Pacs Primitive Block file '%s': %s", fileNames[k].c_str(), e.what()); } @@ -389,7 +389,7 @@ void CContinentContainer::loadPacsPrims(const CSheet &sheet, NLPACS::UMoveContai } } } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Failed to load IG '%s': %s", igs[i].c_str(), e.what()); } diff --git a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp index 4d8b9f486..437ebc925 100644 --- a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp @@ -837,7 +837,7 @@ bool CNameManager::loadAccountNamesFromDatabase() // { // CEntityIdTranslator::getInstance()->load(BsiGlobal.getLocalPath() + "eid_translation.data", IService::getInstance()->ConfigFile.getVar("InvalidEntityNamesFilename").asString()); // } -// catch(Exception &) +// catch(const Exception &) // { // // if we can't load the file, we force a check coherency // nlwarning("Can't load the eid_translation.data"); diff --git a/code/ryzom/server/src/tick_service/range_mirror_manager.cpp b/code/ryzom/server/src/tick_service/range_mirror_manager.cpp index a3421ceb8..a08df3a5a 100644 --- a/code/ryzom/server/src/tick_service/range_mirror_manager.cpp +++ b/code/ryzom/server/src/tick_service/range_mirror_manager.cpp @@ -400,7 +400,7 @@ void CRangeMirrorManager::saveRanges() else throw EFileNotOpened( RANGE_MANAGER_BACKUP_FILE ); } - catch ( Exception& e ) + catch (const Exception &e) { nlwarning( "Can't save ranges: %s", e.what() ); } @@ -428,7 +428,7 @@ void CRangeMirrorManager::loadRanges() throw EFileNotOpened( RANGE_MANAGER_BACKUP_FILE ); nlinfo( "RangeMirrorManager: successfully loaded ranges" ); } - catch ( Exception& e ) + catch (const Exception &e) { nlinfo( "Can't load ranges: %s", e.what() ); // Info because not a problem } diff --git a/code/ryzom/server/src/tick_service/tick_service.cpp b/code/ryzom/server/src/tick_service/tick_service.cpp index c80773f83..504eacc70 100644 --- a/code/ryzom/server/src/tick_service/tick_service.cpp +++ b/code/ryzom/server/src/tick_service/tick_service.cpp @@ -149,7 +149,7 @@ static void cbHaltTick(CMessage& msgin, const string &serviceName, NLNET::TServi { msgin.serial(reason); } - catch(Exception&) + catch(const Exception&) { } @@ -600,7 +600,7 @@ void CTickService::init() { _GameTime = ConfigFile.getVar("GameTime").asFloat(); } - catch(Exception &) + catch(const Exception &) { // init the game time _GameTime = 0.0f; @@ -611,7 +611,7 @@ void CTickService::init() _GameCycle = ConfigFile.getVar("GameCycle").asInt(); _SavedGameCycle = _GameCycle; } - catch(Exception &) + catch(const Exception &) { // init the game cycle from file loadGameCycle(); @@ -622,7 +622,7 @@ void CTickService::init() { _TickTimeStep = ConfigFile.getVar("TickTimeStep").asFloat(); } - catch(Exception &) + catch(const Exception &) { // tick service time step between two ticks _TickTimeStep = 0.1f; @@ -632,7 +632,7 @@ void CTickService::init() { _GameTimeStep = ConfigFile.getVar("GameTimeStep").asFloat(); } - catch(Exception &) + catch(const Exception &) { // game time between two ticks _GameTimeStep = 0.1f; @@ -747,7 +747,7 @@ bool CTickService::saveGameCycle() */ return true; } - catch ( Exception& e ) + catch (const Exception &e) { nlwarning( "Can't save game cycle: %s", e.what() ); return false; @@ -810,7 +810,7 @@ bool CTickService::loadGameCycle() // nlinfo( "Loaded game cycle %u from %s, will be saved every %u game cycles", _GameCycle, (CPath::standardizePath(IService::getInstance()->SaveFilesDirectory.toString()) + GAME_CYCLE_FILE).c_str(), INTERVAL_FOR_SAVING_GAME_CYCLE ); // return true; // } -// catch ( Exception& e ) +// catch (const Exception &e) // { // nlwarning( "Can't load game cycle: %s", e.what() ); // _GameCycle = 0; diff --git a/code/ryzom/tools/leveldesign/export/export.cpp b/code/ryzom/tools/leveldesign/export/export.cpp index 49b79193e..28e32db23 100644 --- a/code/ryzom/tools/leveldesign/export/export.cpp +++ b/code/ryzom/tools/leveldesign/export/export.cpp @@ -2146,7 +2146,7 @@ void CExport::loadLandscape (const string &LandFile) inFile.close (); _Landscape->addZone (zone); } - catch(Exception &/*e*/) + catch(const Exception &/*e*/) { if (_ExportCB != NULL) _ExportCB->dispWarning (string("Cant load ") + ZoneName + string(".zone(l,w)")); diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp index 824a89ef3..550091c8f 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) system((string("\"C:\\Program Files\\Beyond Compare 2\\bc2.exe\" ")+string(tmp)+"/compiled_mission.script test_compilateur.script").c_str()); } - catch(EParseException e) + catch(const EParseException &e) { nlwarning(e.Why.c_str()); return -1; @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) } */ } - catch (EParseException e) + catch (const EParseException &e) { CPrimitiveContext::instance().CurrentLigoConfig = NULL; nlerror("Compilation error : '%s'", e.Why.c_str()); diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp index 814239949..a833c6b93 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp @@ -620,7 +620,7 @@ bool CMissionCompiler::compileMissions(IPrimitive *rootPrim, const std::string & // { compileMission(missionTrees[i], primFileName); // } -// catch (EParseException e) +// catch (const EParseException &e) // { // nlwarning("Error while parsing a mission: '%s'", e.Why.c_str()); // ret = false; diff --git a/code/ryzom/tools/leveldesign/mp_generator/main.cpp b/code/ryzom/tools/leveldesign/mp_generator/main.cpp index 68e18172e..d775f0e06 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/main.cpp +++ b/code/ryzom/tools/leveldesign/mp_generator/main.cpp @@ -1569,7 +1569,7 @@ int main( int argc, char* argv[] ) { GenerateDoc(); } - catch(Exception &e) + catch(const Exception &e) { nlwarning(e.what()); nlwarning("HTML Doc generation failed\n"); diff --git a/code/ryzom/tools/leveldesign/prim_export/main.cpp b/code/ryzom/tools/leveldesign/prim_export/main.cpp index c8fe449ce..0dbf9da1a 100644 --- a/code/ryzom/tools/leveldesign/prim_export/main.cpp +++ b/code/ryzom/tools/leveldesign/prim_export/main.cpp @@ -854,7 +854,7 @@ int main (int argc, char**argv) nlwarning ("Error : can't open the file (%s) for reading", files[i].c_str ()); } } - catch(Exception &e) + catch(const Exception &e) { // Error in the log nlwarning ("Error loading zone file (%s) : %s", files[i].c_str (), e.what ()); @@ -919,7 +919,7 @@ int main (int argc, char**argv) nlwarning ("Error : can't open the file (%s) for reading", files[i].c_str ()); } } - catch(Exception &e) + catch(const Exception &e) { // Error in the log nlwarning ("Error loading primitive file (%s) : %s", files[i].c_str (), e.what ()); diff --git a/code/ryzom/tools/make_alias_file/make_alias_file.cpp b/code/ryzom/tools/make_alias_file/make_alias_file.cpp index 0bb4369b2..17caf3b9a 100644 --- a/code/ryzom/tools/make_alias_file/make_alias_file.cpp +++ b/code/ryzom/tools/make_alias_file/make_alias_file.cpp @@ -182,7 +182,7 @@ int main( int argc, char ** argv ) sheetPaths.push_back( cvSheetPaths.asString(i) ); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("var 'SheetPaths' not found"); } @@ -202,7 +202,7 @@ int main( int argc, char ** argv ) CConfigFile::CVar &cvAliasFilename = configFile.getVar("AliasFilename"); aliasFilename = cvAliasFilename.asString(); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("var 'AliasFilename' not found"); } @@ -218,7 +218,7 @@ int main( int argc, char ** argv ) extensions.push_back( cvExtensions.asString(i) ); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("var 'Extensions' not found"); } diff --git a/code/ryzom/tools/server/build_world_packed_col/build_world_packed_col.cpp b/code/ryzom/tools/server/build_world_packed_col/build_world_packed_col.cpp index a2688d0ee..8b44ae3ae 100644 --- a/code/ryzom/tools/server/build_world_packed_col/build_world_packed_col.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/build_world_packed_col.cpp @@ -84,7 +84,7 @@ int main(int argc, char* argv[]) { cf.load(argv[1]); } - catch(EStream &) + catch(const EStream &) { nlwarning("Error while reading config file\n"); return -1; @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) { sep.loadCompleteIslands(); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { return -1; } @@ -161,7 +161,7 @@ int main(int argc, char* argv[]) CIFile f(islandPath); tmpPW.serialZoneNames(f); } - catch(EStream &) + catch(const EStream &) { tmpPW.ZoneNames.clear(); } @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) CIFile f(islandPath); f.serial(packedIsland->PW); } - catch(EStream &) + catch(const EStream &) { mustRebuild = true; // damaged file or bad version ? -> force rebuild delete packedIsland; // remove whatever was serialized @@ -225,7 +225,7 @@ int main(int argc, char* argv[]) COFile f(islandPath); f.serial(packedIsland->PW); } - catch(EStream &) + catch(const EStream &) { nlwarning("Island %s not saved.", ep.Island.c_str()); } @@ -388,7 +388,7 @@ int main(int argc, char* argv[]) tgaHM.writeTGA(f, 0, true); } } - catch(EStream &e) + catch(const EStream &e) { e; // avoid compile warning nlwarning(e.what()); diff --git a/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp b/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp index b391d244d..4d083ea84 100644 --- a/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp @@ -261,7 +261,7 @@ void CPackedWorldBuilder::build(const std::vector &zoneNames, const nlinfo("Retrieving zone %d / %d from cache\n", (int) currZoneIndex + 1, (int) zones.size()); } } - catch(EStream &) + catch(const EStream &) { } } @@ -295,7 +295,7 @@ void CPackedWorldBuilder::build(const std::vector &zoneNames, const zoneGrid(lx, ly)->Zone.serial(stream); zoneGrid(lx, ly)->Loaded = true; } - catch(Exception &) + catch(const Exception &) { nlwarning("Error while loading zone %s : zone not loaded \n", zoneGrid(lx, ly)->Path.c_str()); } @@ -362,7 +362,7 @@ void CPackedWorldBuilder::build(const std::vector &zoneNames, const CPackedZoneBase *pb = packedZoneGrid(x, y); f.serialPolyPtr(pb); } - catch(EStream &e) + catch(const EStream &e) { printf("Error while writing packed zone to cache : \n %s \n", e.what()); } diff --git a/code/ryzom/tools/server/build_world_packed_col/test_col_world.cpp b/code/ryzom/tools/server/build_world_packed_col/test_col_world.cpp index db0dbd899..a9a7506b5 100644 --- a/code/ryzom/tools/server/build_world_packed_col/test_col_world.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/test_col_world.cpp @@ -233,7 +233,7 @@ static void configFileChanged(const std::string &filename) } } } - catch(EStream &) + catch(const EStream &) { printf("Error while reading config file\n"); } @@ -293,12 +293,12 @@ int main(int argc, char* argv[]) addLandscapeIG = addLandscapeIGVarPtr->asInt() != 0; } } - catch(EStream &) + catch(const EStream &) { printf("Error while reading config file\n"); return -1; } - catch(EConfigFile &e) + catch(const EConfigFile &e) { printf(e.what()); return -1; @@ -462,7 +462,7 @@ int main(int argc, char* argv[]) mustRebuild = false; printf("Retrieving zone %d / %d from cache\n", (int) currZoneIndex + 1, (int) zones.size()); } - catch(EStream &) + catch(const EStream &) { } } @@ -496,7 +496,7 @@ int main(int argc, char* argv[]) zoneGrid(lx, ly)->Zone.serial(stream); zoneGrid(lx, ly)->Loaded = true; } - catch(EStream &) + catch(const EStream &) { printf("Error while loading zone %s : zone not loaded \n"); } @@ -563,7 +563,7 @@ int main(int argc, char* argv[]) CPackedZoneBase *pb = packedZoneGrid(x, y); f.serialPolyPtr(pb); } - catch(EStream &e) + catch(const EStream &e) { printf("Error while writing packed zone to cache : \n %s \n", e.what()); } diff --git a/code/ryzom/tools/server/build_world_packed_col/village.cpp b/code/ryzom/tools/server/build_world_packed_col/village.cpp index d4495a9d9..5a0d2e623 100644 --- a/code/ryzom/tools/server/build_world_packed_col/village.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/village.cpp @@ -256,7 +256,7 @@ void CIGInfo::load(TShapeCache &shapeCache) ig->serial(stream); IG = ig; // commit } - catch(EStream &e) + catch(const EStream &e) { nlwarning(e.what()); } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cpp b/code/ryzom/tools/sheets_packer/sheets_packer.cpp index abb0530ad..ae64497eb 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cpp @@ -68,14 +68,14 @@ int main(int argc, char **argv) if(!init()) return EXIT_FAILURE; } - catch(EFatalError &) { return EXIT_FAILURE; /* nothing to do */ } - catch(Exception &e) + catch(const EFatalError &) { return EXIT_FAILURE; /* nothing to do */ } + catch(const Exception &e) { try { nlerror ("Initialization of the application failed : %s", e.what()); } - catch(EFatalError &) + catch(const EFatalError &) { // nothing to do } @@ -90,14 +90,14 @@ int main(int argc, char **argv) { release(); } - catch(EFatalError &) { return EXIT_FAILURE; /* nothing to do */ } - catch(Exception &e) + catch(const EFatalError &) { return EXIT_FAILURE; /* nothing to do */ } + catch(const Exception &e) { try { nlerror ("Release of the application failed: %s", e.what()); } - catch(EFatalError &) + catch(const EFatalError &) { // nothing to do } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp index 77e05a7f7..760a61869 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp @@ -170,7 +170,7 @@ void setValues() for (uint i = 0; i < cvDataPath.size(); i++) AppCfg.DataPath.push_back(cvDataPath.asString(i)); } - catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");} + catch(const EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");} // World sheet name READ_STRING(WorldSheet) @@ -192,7 +192,7 @@ void setValues() DebugLog->addNegativeFilter (cvTmp.asString(k).c_str()); } } - catch(EUnknownVar &) {} + catch(const EUnknownVar &) {} try { CConfigFile::CVar &cvTmp = AppCfg.ConfigFile.getVar("NegFiltersInfo"); @@ -201,7 +201,7 @@ void setValues() InfoLog->addNegativeFilter (cvTmp.asString(k).c_str()); } } - catch(EUnknownVar &) {} + catch(const EUnknownVar &) {} try { CConfigFile::CVar &cvTmp = AppCfg.ConfigFile.getVar("NegFiltersWarning"); @@ -210,7 +210,7 @@ void setValues() WarningLog->addNegativeFilter (cvTmp.asString(k).c_str()); } } - catch(EUnknownVar &) {} + catch(const EUnknownVar &) {} }// load // diff --git a/code/ryzom/tools/skill_extractor/skill_extractor.cpp b/code/ryzom/tools/skill_extractor/skill_extractor.cpp index 24500f45d..532f72556 100644 --- a/code/ryzom/tools/skill_extractor/skill_extractor.cpp +++ b/code/ryzom/tools/skill_extractor/skill_extractor.cpp @@ -225,7 +225,7 @@ sint main( sint argc, char ** argv ) { configFile.load( "skill_extractor.cfg" ); } - catch(Exception &e ) + catch(const Exception &e ) { nlwarning(" skill_extractor.cfg %s",e.what()); return 1;