From 81825f4e43697f2eaa7b2342a8275b381ab8892b Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Nov 2016 12:31:48 +0100 Subject: [PATCH] Changed: Constification of catches --- .../tools/3d/ligo/plugin_max/max_to_ligo.cpp | 2 +- code/nel/tools/3d/ligo/plugin_max/script.cpp | 18 +++--- .../3d/object_viewer/animation_set_dlg.cpp | 4 +- code/nel/tools/3d/object_viewer/dup_ps.cpp | 4 +- .../tools/3d/object_viewer/object_viewer.cpp | 59 +++++++++---------- .../3d/object_viewer/skeleton_scale_dlg.cpp | 2 +- .../3d/object_viewer/snapshot_tool_dlg.cpp | 2 +- .../3d/object_viewer/sound_anim_view.cpp | 2 +- .../tools/3d/object_viewer/sound_system.cpp | 8 +-- .../object_viewer/vegetable_density_page.cpp | 2 +- .../tools/3d/object_viewer/vegetable_dlg.cpp | 8 +-- .../3d/object_viewer/water_pool_editor.cpp | 4 +- .../3d/plugin_max/nel_export/nel_export.cpp | 2 +- .../nel_export/nel_export_export.cpp | 6 +- .../nel_export/nel_export_scene.cpp | 2 +- .../nel_export/nel_export_script.cpp | 22 +++---- .../plugin_max/nel_export/nel_export_swt.cpp | 2 +- .../plugin_max/nel_export/nel_export_view.cpp | 6 +- .../3d/plugin_max/nel_mesh_lib/calc_lm.cpp | 2 +- .../plugin_max/nel_patch_converter/script.cpp | 4 +- .../plugin_max/nel_patch_lib/nel_patch_mesh.h | 2 +- .../3d/plugin_max/nel_patch_lib/rpo2nel.cpp | 2 +- .../3d/plugin_max/nel_patch_paint/paint.cpp | 6 +- .../plugin_max/nel_patch_paint/paint_ui.cpp | 12 ++-- .../nel_patch_paint/paint_vcolor.cpp | 2 +- .../plugin_max/tile_utility/tile_utility.cpp | 2 +- code/nel/tools/3d/shape2obj/main.cpp | 2 +- code/nel/tools/3d/tile_edit/Browse.cpp | 4 +- code/nel/tools/3d/tile_edit/View.cpp | 2 +- .../tools/3d/tile_edit_qt/browser_model.cpp | 2 +- .../3d/tile_edit_qt/tile_browser_dlg.cpp | 4 +- .../logic_editor_dll/logic_editorDoc.cpp | 4 +- .../tools/misc/data_mirror/data_mirror.cpp | 2 +- .../misc/log_analyser/log_analyserDlg.cpp | 2 +- .../tools/leveldesign/georges_dll/action.cpp | 2 +- .../leveldesign/georges_dll/georges_edit.cpp | 10 ++-- .../georges_dll/georges_edit_doc.cpp | 8 +-- .../georges_dll/georges_implementation.cpp | 6 +- .../georges_plugin_sound.cpp | 2 +- .../mission_compiler_fe.cpp | 2 +- .../mission_compiler_feDlg.cpp | 4 +- .../world_editor/world_editor/action.cpp | 6 +- .../world_editor/builder_zone.cpp | 2 +- .../world_editor/world_editor/display.cpp | 2 +- .../world_editor/editor_primitive.cpp | 2 +- .../world_editor/world_editor/main_frm.cpp | 6 +- .../world_editor/world_editor.cpp | 4 +- .../world_editor/world_editor_doc.cpp | 16 ++--- .../graph_plugin.cpp | 4 +- .../world_editor_graph_plugin_dlg.cpp | 2 +- .../plugin.cpp | 6 +- 51 files changed, 146 insertions(+), 147 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index 5d205285c..7de43f6b9 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -144,7 +144,7 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di // ok return true; } - catch (Exception& e) + catch (const Exception& e) { // Print an error message char msg[512]; diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 134646cbd..d8f8123cd 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -427,7 +427,7 @@ Value* export_transition_cf (Value** arg_list, int count) // Serial materials[mat].serial (inputXml); } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[2048]; @@ -541,7 +541,7 @@ Value* export_transition_cf (Value** arg_list, int count) ok = false; } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -778,7 +778,7 @@ Value* check_zone_with_material_cf (Value** arg_list, int count) CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog); } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -901,7 +901,7 @@ Value* check_zone_with_transition_cf (Value** arg_list, int count) CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog); } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -1313,7 +1313,7 @@ Value* export_zone_cf (Value** arg_list, int count) CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog); } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -1324,7 +1324,7 @@ Value* export_zone_cf (Value** arg_list, int count) } } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -1835,7 +1835,7 @@ bool MakeSnapShot (NLMISC::CBitmap &snapshot, const NL3D::CTileBank &tileBank, c CMaxToLigo::errorMessage ("Can't initialise opengl offscreen renderer", "NeL Ligo check zone", *MAXScript_interface, errorInDialog); } } - catch (Exception &e) + catch (const Exception &e) { // Error char tmp[512]; @@ -2042,7 +2042,7 @@ Value* make_snapshot_cf (Value** arg_list, int count) CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog); } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; @@ -2068,7 +2068,7 @@ Value* make_snapshot_cf (Value** arg_list, int count) } } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; diff --git a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp index 5dd4f64eb..887a24d9e 100644 --- a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp @@ -156,7 +156,7 @@ void CAnimationSetDlg::OnAddAnimation () refresh (TRUE); } } - catch (Exception& e) + catch (const Exception& e) { MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); } @@ -197,7 +197,7 @@ void CAnimationSetDlg::OnAddSkelWt() refresh (TRUE); } } - catch (Exception& e) + catch (const Exception& e) { MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/object_viewer/dup_ps.cpp b/code/nel/tools/3d/object_viewer/dup_ps.cpp index 6d21a7496..11896b8dd 100644 --- a/code/nel/tools/3d/object_viewer/dup_ps.cpp +++ b/code/nel/tools/3d/object_viewer/dup_ps.cpp @@ -118,7 +118,7 @@ NL3D::CParticleSystemProcess *DupPSLocated(const CParticleSystemProcess *in) return newPS->detach(index); } } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning (e.what()); return NULL; @@ -154,7 +154,7 @@ NL3D::CPSLocatedBindable *DupPSLocatedBindable(CPSLocatedBindable *in) return loc->unbind(subIndex); } } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning (e.what()); return NULL; diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index f3c2108fa..cd105ff77 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -318,7 +318,7 @@ void CObjectViewer::loadConfigFile() for (uint i=0; i<(uint)search_pathes.size(); i++) CPath::addSearchPath (search_pathes.asString(i)); } - catch(EUnknownVar &) + catch(const EUnknownVar &) {} try @@ -328,7 +328,7 @@ void CObjectViewer::loadConfigFile() for (uint i=0; i<(uint)recursive_search_pathes.size(); i++) CPath::addSearchPath (recursive_search_pathes.asString(i), true, false); } - catch(EUnknownVar &) + catch(const EUnknownVar &) {} // Add extension remapping @@ -345,7 +345,7 @@ void CObjectViewer::loadConfigFile() CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true); } } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -382,7 +382,7 @@ void CObjectViewer::loadConfigFile() for (uint i=0; i<(uint)var.size(); i++) CSoundSystem::addSampleBank(var.asString(i).c_str());*/ } - catch (EUnknownVar &) + catch (const EUnknownVar &) { //::MessageBox(NULL, "warning : 'sample_path' or 'packed_sheet_path' variable not defined.\nSound will not work properly.", "Objectviewer.cfg", MB_OK|MB_ICONEXCLAMATION); } @@ -393,7 +393,7 @@ void CObjectViewer::loadConfigFile() CConfigFile::CVar &camera_focal = cf.getVar("camera_focal"); _CameraFocal = camera_focal.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -404,7 +404,7 @@ void CObjectViewer::loadConfigFile() CConfigFile::CVar &var = cf.getVar("scene_light_enabled"); _SceneLightEnabled = var.asInt() !=0 ; } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _SceneLightEnabled= false; } @@ -415,7 +415,7 @@ void CObjectViewer::loadConfigFile() _SceneLightSunAmbiant.G = var.asInt(1); _SceneLightSunAmbiant.B = var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _SceneLightSunAmbiant= NLMISC::CRGBA::Black; } @@ -426,7 +426,7 @@ void CObjectViewer::loadConfigFile() _SceneLightSunDiffuse.G = var.asInt(1); _SceneLightSunDiffuse.B = var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _SceneLightSunDiffuse= NLMISC::CRGBA::White; } @@ -437,7 +437,7 @@ void CObjectViewer::loadConfigFile() _SceneLightSunSpecular.G = var.asInt(1); _SceneLightSunSpecular.B = var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _SceneLightSunSpecular= NLMISC::CRGBA::White; } @@ -449,7 +449,7 @@ void CObjectViewer::loadConfigFile() _SceneLightSunDir.z = var.asFloat(2); _SceneLightSunDir.normalize(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _SceneLightSunDir.set(0, 1, -1); _SceneLightSunDir.normalize(); @@ -459,7 +459,7 @@ void CObjectViewer::loadConfigFile() CConfigFile::CVar &var = cf.getVar("object_light_test"); _ObjectLightTestShape= var.asString(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -481,7 +481,7 @@ void CObjectViewer::loadConfigFile() } CNELU::Scene->setAutomaticAnimationSet(as.release()); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { //::MessageBox(NULL, "No automatic animation path specified, please set 'automatic_animation_path'", "warning", MB_OK); nlwarning("No automatic animation path specified"); @@ -493,7 +493,7 @@ void CObjectViewer::loadConfigFile() CConfigFile::CVar &var = cf.getVar("character_scale_pos"); _CharacterScalePos= var.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -838,7 +838,7 @@ bool CObjectViewer::initUI (HWND parent) { serial (iF); } - catch (Exception& e) + catch (const Exception& e) { std::string msg = toString("Error while loading default.ovcgf : %s", e.what()); ::MessageBox (NULL, utf8ToTStr(msg), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); @@ -1826,7 +1826,7 @@ void CObjectViewer::serial (NLMISC::IStream& f) for (uint slot=0; slotSaved.SlotInfo[slot] = readed[i].SlotInfo[slot]; } - catch (Exception &e) + catch (const Exception &e) { // Error message std::string message = toString("Error loading shape %s: %s", readed[i].ShapeFilename.c_str(), e.what()); @@ -2899,7 +2899,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) for (uint i=0; i<(uint)zones.size(); i++) _VegetableLandscapeZoneNames.push_back(zones.asString(i).c_str()); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLandscapeTileBank.clear(); _VegetableLandscapeTileFarBank.clear(); @@ -2917,7 +2917,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) // clamp to avoid divide/0. _VegetableLandscapeThreshold= max(_VegetableLandscapeThreshold, 0.001f); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLandscapeThreshold= 0.003f; } @@ -2927,7 +2927,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &tileNear= cf.getVar("veget_landscape_tile_near"); _VegetableLandscapeTileNear= tileNear.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLandscapeTileNear= 50; } @@ -2939,7 +2939,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) _VegetableLandscapeAmbient.G= color.asInt(1); _VegetableLandscapeAmbient.B= color.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLandscapeAmbient.set(80, 80, 80); } @@ -2951,7 +2951,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) _VegetableLandscapeDiffuse.G= color.asInt(1); _VegetableLandscapeDiffuse.B= color.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLandscapeDiffuse.set(255, 255, 255); } @@ -2961,7 +2961,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &var= cf.getVar("veget_landscape_snap_height"); _VegetableSnapHeight= var.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableSnapHeight= 1.70f; } @@ -2976,7 +2976,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &var= cf.getVar("veget_texture"); _VegetableTexture= var.asString(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableTexture= ""; } @@ -2989,7 +2989,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) _VegetableAmbient.G= color.asInt(1); _VegetableAmbient.B= color.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableAmbient.set(80, 80, 80); } @@ -3002,7 +3002,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) sint G= color.asInt(1) - _VegetableAmbient.G; clamp(G, 0, 255); _VegetableDiffuse.G= G; sint B= color.asInt(2) - _VegetableAmbient.B; clamp(B, 0, 255); _VegetableDiffuse.B= B; } - catch (EUnknownVar &) + catch (const EUnknownVar &) { sint R= 255 - _VegetableAmbient.R; clamp(R, 0, 255); _VegetableDiffuse.R= R; sint G= 255 - _VegetableAmbient.G; clamp(G, 0, 255); _VegetableDiffuse.G= G; @@ -3017,7 +3017,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) _VegetableLightDir.z= var.asFloat(2); _VegetableLightDir.normalize(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableLightDir.set(0, 1, -1); _VegetableLightDir.normalize(); @@ -3031,7 +3031,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) _VegetableWindDir.y= var.asFloat(1); _VegetableWindDir.z= var.asFloat(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableWindDir.x= 0.5f; _VegetableWindDir.y= 0.5f; @@ -3043,7 +3043,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &var= cf.getVar("veget_wind_freq"); _VegetableWindFreq= var.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableWindFreq= 0.5; } @@ -3053,7 +3053,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &var= cf.getVar("veget_wind_power"); _VegetableWindPower= var.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableWindPower= 1; } @@ -3063,7 +3063,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf) CConfigFile::CVar &var= cf.getVar("veget_wind_bend_min"); _VegetableWindBendMin= var.asFloat(); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { _VegetableWindBendMin= 0; } @@ -3863,7 +3863,6 @@ uint CObjectViewer::getNumCamera () const int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStringID, UINT nType) { - CString caption; CString mess; caption.LoadString(captionStringID); diff --git a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp index f111a2e00..06a95c3ae 100644 --- a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp @@ -904,7 +904,7 @@ bool CSkeletonScaleDlg::saveCurrentInStream(NLMISC::IStream &f) ss.serial(f); delete skelShape; } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { MessageBox(_T("Failed to save file!")); return false; diff --git a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp index 6f1f0749c..a8125f43b 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp @@ -735,7 +735,7 @@ void CSnapshotToolDlg::OnTimer(UINT_PTR nIDEvent) } sb.reset(); } - catch(std::exception &e) + catch(const std::exception &e) { nlwarning(e.what()); diff --git a/code/nel/tools/3d/object_viewer/sound_anim_view.cpp b/code/nel/tools/3d/object_viewer/sound_anim_view.cpp index 4435896e8..af4326cd7 100644 --- a/code/nel/tools/3d/object_viewer/sound_anim_view.cpp +++ b/code/nel/tools/3d/object_viewer/sound_anim_view.cpp @@ -328,7 +328,7 @@ void CSoundAnimView::refresh(BOOL update) else soundAnim = animManager->findAnimation(name); } - catch (exception& e) + catch (const exception& e) { nlwarning("Couldn't find sound animation <%s>: %s", name.c_str(), e.what()); needCreate = true; diff --git a/code/nel/tools/3d/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer/sound_system.cpp index e1c3495fb..5a79c3af3 100644 --- a/code/nel/tools/3d/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer/sound_system.cpp @@ -67,7 +67,7 @@ void CSoundSystem::initSoundSystem () _AudioMixer->setPackedSheetOption(_PackedSheetPath, true); _AudioMixer->init(32, true, false, NULL, true); } - catch(NLMISC::Exception &e) + catch(const NLMISC::Exception &e) { // in case of exeption during mixer init, the mixer is destroyed ! string mess = string("Unable to init sound :") + e.what(); @@ -82,7 +82,7 @@ void CSoundSystem::initSoundSystem () // TODO : boris : Hum, as far as I know, throwing exeption in constructor is a very BAD idea... _AnimManager = new CSoundAnimManager(_AudioMixer); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { string mess = string("Unable to init sound :") + e.what(); nlwarning ("Init sound: %s", mess.c_str()); @@ -109,7 +109,7 @@ void CSoundSystem::initSoundSystem () //_AudioMixer->loadSampleBank(NLMISC::CPath::lookup(*it).c_str()); _AudioMixer->loadSampleBank(false, (*it1)); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { string mess = "Unable to load sound file :" + *it1 + "\n" + e.what(); @@ -126,7 +126,7 @@ void CSoundSystem::initSoundSystem () //_AudioMixer->loadSoundBank(NLMISC::CPath::lookup(*it).c_str()); _AudioMixer->loadSoundBank((*it2).c_str()); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { string mess = "Unable to load sound file :" + *it2 + "\n" + e.what(); diff --git a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp index 9dfe95b30..d8f9c2d75 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp @@ -544,7 +544,7 @@ void CVegetableDensityPage::OnButtonVegetableBrowse() // update 3D view _VegetableDlg->refreshVegetableDisplay(); } - catch (NLMISC::EPathNotFound &ep) + catch (const NLMISC::EPathNotFound &ep) { MessageBox(utf8ToTStr(ep.what()), _T("Can't open file")); } diff --git a/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp b/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp index c7e0cf9d2..d7796396b 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_dlg.cpp @@ -358,7 +358,7 @@ bool CVegetableDlg::loadVegetableSet(NL3D::CTileVegetableDesc &vegetSet, const // bkup fileName. _LastVegetSetName= (const char*)fd.GetFileName(); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { ok= false; MessageBox(_T("Failed to load file!")); @@ -629,7 +629,7 @@ void CVegetableDlg::OnButtonVegetableLoadDesc() // update 3D view refreshVegetableDisplay(); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { MessageBox(_T("Failed to load file!")); } @@ -664,7 +664,7 @@ void CVegetableDlg::OnButtonVegetableSaveDesc() // save the vegetable f.serial(veget); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { MessageBox(_T("Failed to save file!")); } @@ -735,7 +735,7 @@ void CVegetableDlg::OnButtonVegetableSaveSet() // save the vegetable set f.serial(vegetSet); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { MessageBox(_T("Failed to save file!")); } diff --git a/code/nel/tools/3d/object_viewer/water_pool_editor.cpp b/code/nel/tools/3d/object_viewer/water_pool_editor.cpp index e9fb36cf9..3b68ae0e5 100644 --- a/code/nel/tools/3d/object_viewer/water_pool_editor.cpp +++ b/code/nel/tools/3d/object_viewer/water_pool_editor.cpp @@ -378,7 +378,7 @@ void CWaterPoolEditor::OnLoadPool() MessageBox (("Unable to open file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } } - catch (NLMISC::Exception& e) + catch (const NLMISC::Exception& e) { MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } @@ -415,7 +415,7 @@ void CWaterPoolEditor::OnSavePool() MessageBox (("Unable to open file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } } - catch (NLMISC::Exception& e) + catch (const NLMISC::Exception& e) { MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index bae035740..3a4722063 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -737,7 +737,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP } theIP->RedrawViews(time); } - catch(std::exception &e) + catch(const std::exception &e) { ::MessageBox(hWnd, e.what(), "Error", MB_OK | MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp index 3143c7c66..b26464f3a 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp @@ -233,7 +233,7 @@ bool CNelExport::exportVegetable (const char *sPath, INode& node, TimeValue time // All is good bRet=true; } - catch (Exception &e) + catch (const Exception &e) { // Message box const char *message = e.what(); @@ -340,7 +340,7 @@ bool CNelExport::exportAnim (const char *sPath, std::vector& vectNode, T bRet = false; } } - catch (Exception& e) + catch (const Exception& e) { if (_ErrorInDialog) MessageBox (NULL, e.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); @@ -408,7 +408,7 @@ bool CNelExport::exportSkeleton (const char *sPath, INode* pNode, TimeValue time // All is good bRet=true; } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what()); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp index 1a007cb8b..af1047d0c 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp @@ -56,7 +56,7 @@ bool CNelExport::exportInstanceGroup(string filename, vector& vectNode) pIG->serial (file); // All is good } - catch (Exception &c) + catch (const Exception &c) { // Cannot save the file MessageBox (NULL, c.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp index 0b779c4d1..71892b417 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp @@ -112,7 +112,7 @@ Value* export_shape_cf (Value** arg_list, int count) if (theCNelExport.exportMesh (sPath, *node, ip->GetTime())) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportShape) %s", e.what()); } @@ -187,7 +187,7 @@ Value* export_shape_ex_cf (Value** arg_list, int count) if (theCNelExport.exportMesh (sPath.c_str(), *node, ip->GetTime())) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportShapeEx) %s", e.what()); } @@ -231,7 +231,7 @@ Value* export_skeleton_cf (Value** arg_list, int count) if (theCNelExport.exportSkeleton (sPath, node, ip->GetTime())) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportSkeleton) %s", e.what()); } @@ -302,7 +302,7 @@ Value* export_animation_cf (Value** arg_list, int count) } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportAnimation) %s", e.what()); } @@ -360,7 +360,7 @@ Value* export_ig_cf (Value** arg_list, int count) } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportInstanceGroup) %s", e.what()); } @@ -419,7 +419,7 @@ Value* export_skeleton_weight_cf (Value** arg_list, int count) } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportSkeletonWeight) %s", e.what()); } @@ -445,7 +445,7 @@ Value* view_shape_cf (Value** arg_list, int count) theCNelExport.viewMesh (ip->GetTime()); } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR %s", e.what()); } @@ -555,7 +555,7 @@ Value* export_vegetable_cf (Value** arg_list, int count) if (theCNelExport.exportVegetable (sPath, *node, ip->GetTime())) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportVegetable) %s", e.what()); } @@ -648,7 +648,7 @@ Value* export_collision_cf (Value** arg_list, int count) if (theCNelExport.exportCollision (sPath.c_str(), nodes, time)) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportCollision) %s", e.what()); } @@ -705,7 +705,7 @@ Value* export_pacs_primitives_cf (Value** arg_list, int count) if (theCNelExport.exportPACSPrimitives (sPath.c_str(), nodes, time)) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportPACSPrimitives) %s", e.what()); } @@ -752,7 +752,7 @@ Value* export_lod_character_cf (Value** arg_list, int count) if (theCNelExport.exportLodCharacter (sPath, *node, ip->GetTime())) ret = &true_value; } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("ERROR (NelExportLodCharacter) %s", e.what()); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp index 496db99ec..d1c47c00e 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp @@ -86,7 +86,7 @@ bool CNelExport::exportSWT(const char *sPath, std::vector& vectNode) // All is good return true; } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what()); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp index f4d5fdaf2..00289b712 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp @@ -128,7 +128,7 @@ void regsiterOVPath () for (uint i=0; i<(uint)search_pathes.size(); i++) CPath::addSearchPath (search_pathes.asString(i)); } - catch(EUnknownVar &) + catch(const EUnknownVar &) {} try @@ -138,7 +138,7 @@ void regsiterOVPath () for (uint i=0; i<(uint)recursive_search_pathes.size(); i++) CPath::addSearchPath (recursive_search_pathes.asString(i), true, false); } - catch(EUnknownVar &) + catch(const EUnknownVar &) {} // Add extension remapping @@ -155,7 +155,7 @@ void regsiterOVPath () CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true); } } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index d82e2a394..dd204537c 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -2628,7 +2628,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB pLightMap->writeTGA (f, 32); } } - catch(Exception &e) + catch(const Exception &e) { if (gOptions.FeedBack != NULL) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 80e715f21..ae2cd2155 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -284,7 +284,7 @@ Value* import_zone_cf (Value** arg_list, int count) // Redraw the viewports ip->RedrawViews(ip->GetTime()); } - catch (Exception& e) + catch (const Exception& e) { // Error message errorMessage (("Error when loading file "+filename+": "+e.what()).c_str(), "NeL import zone", *ip, dialog); @@ -1649,7 +1649,7 @@ load_bank_cf(Value** arg_list, int count) mprintf ("Error: can't open bank file %s\n", bankName.c_str()); } } - catch (Exception& e) + catch (const Exception& e) { // Error message mprintf ("Error: %s\n", e.what()); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h index 42d514eb3..2fc14ee0a 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h @@ -449,7 +449,7 @@ public: _bank.serial (file); } } - catch (NLMISC::EStream& excp) + catch (const NLMISC::EStream& excp) { MessageBox (NULL, excp.what(), "Load error", MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp index 41096352e..87ec430aa 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo2nel.cpp @@ -191,7 +191,7 @@ bool RPatchMesh::exportZone(INode* pNode, PatchMesh* pPM, NL3D::CZone& zone, CZo // Ok loaded = true; } - catch (EStream& stream) + catch (const EStream& e) { MessageBox (NULL, stream.what(), _T("Error"), MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index 73bb142b1..c2ec65fc2 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -3990,7 +3990,7 @@ void EPM_PaintCMode::DoPaint () bank.serial (file); bank.computeXRef (); } - catch (EStream& stream) + catch (const EStream& stream) { MessageBox (NULL, stream.what(), "Error", MB_OK|MB_ICONEXCLAMATION); } @@ -4075,7 +4075,7 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it) // ok return true; } - catch (Exception& e) + catch (const Exception& e) { // Print an error message char msg[512]; @@ -4370,7 +4370,7 @@ DWORD WINAPI myThread (LPVOID vData) delete pData; } - catch (Exception& e) + catch (const Exception& e) { MessageBox (NULL, e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp index b8503c137..413ef88a0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp @@ -440,7 +440,7 @@ void LoadKeyCfg () // Get value PainterKeys[key]=value.asInt (); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { // Something goes wrong... catch that const char* what=e.what(); @@ -489,7 +489,7 @@ void LoadVarCfg () LightDirection.z = light_direction.asFloat (2); } } - catch (EConfigFile &) + catch (const EConfigFile &) { } @@ -504,7 +504,7 @@ void LoadVarCfg () LightDiffuse.B = light_diffuse.asInt (2); } } - catch (EConfigFile &) + catch (const EConfigFile &) { } @@ -519,7 +519,7 @@ void LoadVarCfg () LightAmbiant.B = light_ambiant.asInt (2); } } - catch (EConfigFile &) + catch (const EConfigFile &) { } @@ -529,7 +529,7 @@ void LoadVarCfg () CConfigFile::CVar &light_multiply= cf.getVar ("LightMultiply"); LightMultiply = light_multiply.asFloat (); } - catch (EConfigFile &) + catch (const EConfigFile &) { } @@ -539,7 +539,7 @@ void LoadVarCfg () CConfigFile::CVar &zoom_speed= cf.getVar ("ZoomSpeed"); ZoomSpeed = zoom_speed.asFloat (); } - catch (EConfigFile &) + catch (const EConfigFile &) { } } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp index 27255ce46..e29b00999 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp @@ -409,7 +409,7 @@ bool CPaintColor::loadBrush (const char *brushFileName) return false; } } - catch (Exception &e) + catch (const Exception &e) { // Error message MessageBox ((HWND)CNELU::Driver->getDisplay(), e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp index b1e0583e8..4c4a12f69 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp @@ -302,7 +302,7 @@ void Tile_utility::Load (const std::string& path) SetBankPathName (path); } } - catch (EStream stream) + catch (const EStream &stream) { char tmp[1024]; sprintf (tmp, "Error while loading %s:\n\n%s", path, stream.what()); diff --git a/code/nel/tools/3d/shape2obj/main.cpp b/code/nel/tools/3d/shape2obj/main.cpp index 66d9dd6c4..7d106a887 100644 --- a/code/nel/tools/3d/shape2obj/main.cpp +++ b/code/nel/tools/3d/shape2obj/main.cpp @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) // Add the shape shapeMesh = streamShape.getShapePointer(); } - catch (Exception& e) + catch (const Exception& e) { cout << "Error : " << e.what() << endl; diff --git a/code/nel/tools/3d/tile_edit/Browse.cpp b/code/nel/tools/3d/tile_edit/Browse.cpp index 7c4f6d745..6b81ab1ad 100644 --- a/code/nel/tools/3d/tile_edit/Browse.cpp +++ b/code/nel/tools/3d/tile_edit/Browse.cpp @@ -1409,7 +1409,7 @@ void Browse::OnExportBorder() else error=true; } - catch (Exception& e) + catch (const Exception& e) { const char *toto=e.what (); error=true; @@ -1454,7 +1454,7 @@ void Browse::OnImportBorder() else error=true; } - catch (Exception& e) + catch (const Exception& e) { const char *toto=e.what (); error=true; diff --git a/code/nel/tools/3d/tile_edit/View.cpp b/code/nel/tools/3d/tile_edit/View.cpp index 81f5fe784..bbbbec431 100644 --- a/code/nel/tools/3d/tile_edit/View.cpp +++ b/code/nel/tools/3d/tile_edit/View.cpp @@ -101,7 +101,7 @@ static bool loadPic(const string &path, std::vector &tampon, uint return true; } } - catch (NLMISC::Exception& ) { } + catch (const NLMISC::Exception& ) { } return false; } diff --git a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp index 68c28dbb8..3f57a69df 100644 --- a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp +++ b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp @@ -51,7 +51,7 @@ static bool loadPic(const string &path, std::vector &tampon, uint return true; } } - catch (NLMISC::Exception& ) { } + catch (const NLMISC::Exception& ) { } return false; } diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp index 063b4cf47..83b3d50c3 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp @@ -543,7 +543,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked() else error=true; } - catch (Exception& e) + catch (const Exception& e) { const char *toto=e.what (); error=true; @@ -592,7 +592,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked() else error=true; } - catch (Exception& e) + catch (const Exception& e) { const char *toto=e.what (); error=true; diff --git a/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp b/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp index 0b91c41f4..baf34938c 100644 --- a/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp +++ b/code/nel/tools/logic/logic_editor_dll/logic_editorDoc.cpp @@ -578,7 +578,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName ) // Close the file file.close (); } - catch (Exception &) + catch (const Exception &) { } @@ -646,7 +646,7 @@ BOOL CLogic_editorDoc::load( LPCTSTR fileName ) // Close the file file.close (); } - catch (Exception &) + catch (const Exception &) { } diff --git a/code/nel/tools/misc/data_mirror/data_mirror.cpp b/code/nel/tools/misc/data_mirror/data_mirror.cpp index 930e23873..99a87f547 100644 --- a/code/nel/tools/misc/data_mirror/data_mirror.cpp +++ b/code/nel/tools/misc/data_mirror/data_mirror.cpp @@ -198,7 +198,7 @@ BOOL CData_mirrorApp::InitInstance() } } } - catch (Exception &e) + catch (const Exception &e) { MessageBox (NULL, e.what (), "NeL Data Mirror", MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp b/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp index ae7c6ce00..b5333edcf 100644 --- a/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp +++ b/code/nel/tools/misc/log_analyser/log_analyserDlg.cpp @@ -188,7 +188,7 @@ BOOL CLog_analyserDlg::OnInitDialog() cf.load( "log_analyser.cfg" ); LogDateString = cf.getVar( "LogDateString" ).asString().c_str(); } - catch ( EConfigFile& ) + catch (const EConfigFile& ) {*/ LogDateString = "Log Starting ["; AnalyseFunc = NULL; diff --git a/code/ryzom/tools/leveldesign/georges_dll/action.cpp b/code/ryzom/tools/leveldesign/georges_dll/action.cpp index 3bb3483a1..86eb13080 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/action.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/action.cpp @@ -616,7 +616,7 @@ bool CActionStringVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modif modified = true; } - catch (Exception &e) + catch (const Exception &e) { ok = false; char message[512]; diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp index c1bffe96c..549c953e4 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp @@ -586,7 +586,7 @@ bool CGeorgesEditApp::loadCfg () if (superuser) Superuser = superuser->asInt () != 0; } - catch (Exception &) + catch (const Exception &) { char message[512]; smprintf (message, 512, "Can't load georges.cfg config file."); @@ -647,14 +647,14 @@ bool CGeorgesEditApp::saveCfg () { cf.save (); } - catch (Exception &) + catch (const Exception &) { char message[512]; smprintf (message, 512, "Can't save georges.cfg config file."); outputError (message); } } - catch (Exception &) + catch (const Exception &) { char message[512]; smprintf (message, 512, "Can't load georges.cfg config file."); @@ -1197,7 +1197,7 @@ bool CGeorgesEditApp::SerialIntoMemStream (const char *formName, CGeorgesEditDoc // Ok return true; } - catch (Exception &) + catch (const Exception &) { nlstop; } @@ -1454,7 +1454,7 @@ bool CGeorgesEditApp::SerialFromMemStream (const char *formName, CGeorgesEditDoc return true; } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Error while paste: %s", e.what()); } diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp index 035113bcd..7ecae14db 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp @@ -508,7 +508,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName) return TRUE; } - catch (Exception &e) + catch (const Exception &e) { char message[512]; smprintf (message, 512, "Error while loading Type file: %s", e.what()); @@ -534,7 +534,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName) return TRUE; } - catch (Exception &e) + catch (const Exception &e) { char message[512]; smprintf (message, 512, "Error while loading Type file: %s", e.what()); @@ -623,7 +623,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName) return FALSE; } } - catch (Exception &e) + catch (const Exception &e) { char message[512]; smprintf (message, 512, "Error while loading Type file: %s", e.what()); @@ -815,7 +815,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName) } } - catch (Exception &e) + catch (const Exception &e) { char message[512]; smprintf (message, 512, "Error while loading file: %s", e.what()); diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp index 73fa3fcd9..0cc61ec26 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp @@ -454,7 +454,7 @@ BOOL CGeorgesImpl::PreTranslateMessage (MSG *pMsg) { ploader->SetTypPredef( _sxfilename, vsx ); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { std::string tmp = std::string(e.what()) + "(" + _sxfilename + ")"; theApp.m_pMainWnd->MessageBox(tmp.c_str(), "Georges_Lib", MB_ICONERROR | MB_OK); @@ -515,7 +515,7 @@ void CGeorgesImpl::MakeTyp( const std::string& filename, TType type, TUI ui, con // Write t.write (outputXml.getDocument ()); } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Error during writing file '%s' : ", filename.c_str (), e.what ()); } @@ -581,7 +581,7 @@ void CGeorgesImpl::LoadDocument( const std::string& _sxfullname ) { theApp.OpenDocumentFile(_sxfullname.c_str()); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { std::string tmp = std::string(e.what()) + "(" + _sxfullname + ")"; theApp.m_pMainWnd->MessageBox(tmp.c_str(), "Georges_Lib", MB_ICONERROR | MB_OK); diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/georges_plugin_sound.cpp b/code/ryzom/tools/leveldesign/georges_plugin_sound/georges_plugin_sound.cpp index 292b008ed..dd76b9f9e 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/georges_plugin_sound.cpp +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/georges_plugin_sound.cpp @@ -47,7 +47,7 @@ __declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGE { return new CSoundPlugin(globalInterface); } - catch (std::exception &e) + catch (const std::exception &e) { string reason = e.what(); MessageBox (NULL, reason.c_str(), "Sound plugin", MB_OK); diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.cpp b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.cpp index 0bf9693cc..9cea31379 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.cpp @@ -121,7 +121,7 @@ BOOL CMissionCompilerFeApp::InitInstance() mc.installCompiledMission(dlg.LigoConfig, fileName); nbMission += mc.getMissionsCount(); } - catch(EParseException e) + catch(const EParseException &e) { string msg; msg + "\r\n"; diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_feDlg.cpp b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_feDlg.cpp index d9097d4cf..1d7396ee0 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_feDlg.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_feDlg.cpp @@ -479,7 +479,7 @@ void CMissionCompilerFeDlg::compile(BOOL publish) mc.publishFiles(ServerPathPrim[i], ServerPathText[i], LocalTextPath); } } - catch(EParseException e) + catch(const EParseException &e) { string msg; msg + "\r\n"; @@ -695,7 +695,7 @@ void CMissionCompilerFeDlg::OnSpecialRuncompilertest() system((string("\"C:\\Program Files\\Beyond Compare 2\\bc2.exe\" ")+string(tmp)+"/compiled_mission.script "+ReferenceScript).c_str()); } - catch(EParseException e) + catch(const EParseException &e) { string msg = "In primitive "; msg += buildPrimPath(e.Primitive) +" : "+e.Why; diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/action.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/action.cpp index 0baa3deb2..d597888c6 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/action.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/action.cpp @@ -520,7 +520,7 @@ bool CActionImportPrimitive::redo () return false; } } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ()); return false; @@ -610,7 +610,7 @@ bool CActionLoadPrimitive::redo () return false; } } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ()); return false; @@ -2488,7 +2488,7 @@ bool CActionAddLandscape::redo () result = false; } } - catch (Exception& e) + catch (const Exception& e) { getMainFrame ()->terminateLoadingDialog (); theApp.errorMessage ("Error reading file %s : %s", _Filename.c_str (), e.what ()); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp index 99d8bb881..1e9c1ed3e 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp @@ -355,7 +355,7 @@ NLMISC::CBitmap *CDataBase::loadBitmap (const std::string &fileName) nlwarning ("Bitmap not found : %s", fileName.c_str()); } } - catch (Exception& e) + catch (const Exception& e) { pBitmap->makeDummy(); theApp.errorMessage ("Error while loading bitmap %s : %s", fileName.c_str(), e.what()); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp index 09763d27c..a1c1836a0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp @@ -3875,7 +3875,7 @@ void CPrimTexture::buildFromFile(const std::string &filename) _Width = (uint) width; _Height = (uint) height; } - catch (NLMISC::EStream) + catch (const NLMISC::EStream &) { nlwarning("Couldn't retrieve size for %s", filename.c_str()); } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/editor_primitive.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/editor_primitive.cpp index 896cd1aee..232d405c7 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/editor_primitive.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/editor_primitive.cpp @@ -925,7 +925,7 @@ NL3D::CTextureBlank *CPrimBitmap::getTexture () const theApp.errorMessage ("Can't read bitmap %s", filename.c_str ()); } } - catch (Exception &e) + catch (const Exception &e) { theApp.errorMessage ("Error reading bitmap %s : %s", filename.c_str (), e.what ()); } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp index 17fd397da..f1fd029c0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/main_frm.cpp @@ -858,7 +858,7 @@ void CMainFrame::uninit () fileOut.serial(_Environnement); fileOut.close(); } - catch (Exception& e) + catch (const Exception& e) { MessageBox (e.what(), "Warning"); } @@ -1441,7 +1441,7 @@ struct CViewerConfig } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { printf ("Problem in config file : %s\n", e.what ()); } @@ -4163,7 +4163,7 @@ bool CMainFrame::buildNLBitmapFromTGARsc(HRSRC bm, HMODULE hm, NLMISC::CBitmap & ms.seek(0, NLMISC::IStream::begin); tmpBitmap.load(ms); } - catch(EStream &) + catch(const EStream &) { return false; } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.cpp index 3b6a2fe1f..9029f7dfd 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.cpp @@ -168,7 +168,7 @@ BOOL CWorldEditorApp::InitInstance() // set the primitive context CPrimitiveContext::instance().CurrentLigoConfig = &Config; } - catch (Exception& e) + catch (const Exception& e) { ::MessageBox (NULL, e.what(), "Warning", MB_OK|MB_ICONEXCLAMATION); @@ -588,7 +588,7 @@ bool CWorldEditorApp::initPath (const char *filename, CSplashScreen &splashScree syntaxError (filename, root, "Wrong root node, should be NEL_WORLD_EDITOR_CONFIG"); } } - catch (Exception &e) + catch (const Exception &e) { errorMessage ("File read error (%s):%s", filename, e.what ()); } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor_doc.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor_doc.cpp index 9eeba96b9..7e241d215 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor_doc.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor_doc.cpp @@ -372,7 +372,7 @@ bool CWorldEditorDoc::loadDocument (const char *filename) } } } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } @@ -415,7 +415,7 @@ bool CWorldEditorDoc::loadDocument (const char *filename) } } } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } @@ -436,7 +436,7 @@ bool CWorldEditorDoc::loadDocument (const char *filename) clearModifications (); } } - catch (Exception &e) + catch (const Exception &e) { theApp.errorMessage ("Error reading file %s : %s", filename, e.what ()); @@ -578,7 +578,7 @@ BOOL CWorldEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) _DataHierarchy[i].LastModifedTime = NLMISC::CFile::getFileModificationDate (_DataHierarchy[i].Filename); } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error writing file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } @@ -646,7 +646,7 @@ BOOL CWorldEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) _DataHierarchy[i].LastModifedTime = NLMISC::CFile::getFileModificationDate (_DataHierarchy[i].Filename); } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error writing file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } @@ -720,7 +720,7 @@ BOOL CWorldEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) // Last time file.close (); } - catch (Exception &e) + catch (const Exception &e) { theApp.errorMessage ("Error writing file %s : %s", lpszPathName, e.what ()); @@ -1674,7 +1674,7 @@ void CWorldEditorDoc::updateFiles () // Last time _DataHierarchy[i].LastModifedTime = NLMISC::CFile::getFileModificationDate (_DataHierarchy[i].Filename); } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } @@ -1710,7 +1710,7 @@ void CWorldEditorDoc::updateFiles () theApp.errorMessage ("Can't open file %s for reading.", _DataHierarchy[i].Filename.c_str ()); } } - catch (Exception& e) + catch (const Exception& e) { theApp.errorMessage ("Error reading file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ()); } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp index 048678b14..f21400421 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp @@ -209,7 +209,7 @@ void CGraphPlugin::refreshPrimitives() } AfxMessageBox(err.c_str()); } - catch (exception e) //catch a possible exception from getRootFileName + catch (const exception &e) //catch a possible exception from getRootFileName { AfxMessageBox(e.what()); } @@ -939,7 +939,7 @@ void CGraphPlugin::doSelection(const string& primPath) _PluginAccess->setCurrentSelection(resSet); - }catch(exception e){ + }catch(const exception &e){ GraphDlg->MessageBox(e.what()); } } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/world_editor_graph_plugin_dlg.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/world_editor_graph_plugin_dlg.cpp index f21ead4f5..0525edd5b 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/world_editor_graph_plugin_dlg.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/world_editor_graph_plugin_dlg.cpp @@ -582,7 +582,7 @@ void CWorldEditorGraphPluginDlg::OnLButtonDown(UINT nFlags, CPoint point) tok.top=atoi(strRes2.at(1).c_str()); tok.right=atoi(strRes3.at(0).c_str()); tok.bottom=atoi(strRes3.at(1).c_str()); - }catch (exception e) {return;} + }catch (const exception &e) {return;} diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/plugin.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/plugin.cpp index 14a076694..e2c560602 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/plugin.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/plugin.cpp @@ -675,7 +675,7 @@ void CPlugin::init(IPluginAccess *pluginAccess) } } - catch (Exception &e) + catch (const Exception &e) { errorMessage (e.what ()); } @@ -728,7 +728,7 @@ void CPlugin::connectDisconnect() CInetAddress addr(_SHost+":48888"); _Client->connect(addr); } - catch(ESocket &e) + catch(const ESocket &e) { errorMessage (e.what ()); return; @@ -777,7 +777,7 @@ void CPlugin::connectDisconnect() } updateConnectionState(); } - catch (Exception &e) + catch (const Exception &e) { errorMessage (e.what ()); delete _Client;