Changed: Constification of catches

--HG--
branch : develop
This commit is contained in:
kervala 2016-11-20 12:31:48 +01:00
parent ebe7357257
commit 0fb9906929
51 changed files with 146 additions and 147 deletions

View file

@ -144,7 +144,7 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di
// ok // ok
return true; return true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
// Print an error message // Print an error message
char msg[512]; char msg[512];

View file

@ -427,7 +427,7 @@ Value* export_transition_cf (Value** arg_list, int count)
// Serial // Serial
materials[mat].serial (inputXml); materials[mat].serial (inputXml);
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[2048]; char tmp[2048];
@ -541,7 +541,7 @@ Value* export_transition_cf (Value** arg_list, int count)
ok = false; ok = false;
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[512]; 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); CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[512]; 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); CMaxToLigo::errorMessage (tmp, "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[512]; 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); CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog);
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[512]; 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 // Error message
char tmp[512]; 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); CMaxToLigo::errorMessage ("Can't initialise opengl offscreen renderer", "NeL Ligo check zone", *MAXScript_interface, errorInDialog);
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error // Error
char tmp[512]; 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); CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog);
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
char tmp[512]; 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 // Error message
char tmp[512]; char tmp[512];

View file

@ -156,7 +156,7 @@ void CAnimationSetDlg::OnAddAnimation ()
refresh (TRUE); refresh (TRUE);
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
} }
@ -197,7 +197,7 @@ void CAnimationSetDlg::OnAddSkelWt()
refresh (TRUE); refresh (TRUE);
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -118,7 +118,7 @@ NL3D::CParticleSystemProcess *DupPSLocated(const CParticleSystemProcess *in)
return newPS->detach(index); return newPS->detach(index);
} }
} }
catch (NLMISC::EStream &e) catch (const NLMISC::EStream &e)
{ {
nlwarning (e.what()); nlwarning (e.what());
return NULL; return NULL;
@ -154,7 +154,7 @@ NL3D::CPSLocatedBindable *DupPSLocatedBindable(CPSLocatedBindable *in)
return loc->unbind(subIndex); return loc->unbind(subIndex);
} }
} }
catch (NLMISC::EStream &e) catch (const NLMISC::EStream &e)
{ {
nlwarning (e.what()); nlwarning (e.what());
return NULL; return NULL;

View file

@ -318,7 +318,7 @@ void CObjectViewer::loadConfigFile()
for (uint i=0; i<(uint)search_pathes.size(); i++) for (uint i=0; i<(uint)search_pathes.size(); i++)
CPath::addSearchPath (search_pathes.asString(i)); CPath::addSearchPath (search_pathes.asString(i));
} }
catch(EUnknownVar &) catch(const EUnknownVar &)
{} {}
try try
@ -328,7 +328,7 @@ void CObjectViewer::loadConfigFile()
for (uint i=0; i<(uint)recursive_search_pathes.size(); i++) for (uint i=0; i<(uint)recursive_search_pathes.size(); i++)
CPath::addSearchPath (recursive_search_pathes.asString(i), true, false); CPath::addSearchPath (recursive_search_pathes.asString(i), true, false);
} }
catch(EUnknownVar &) catch(const EUnknownVar &)
{} {}
// Add extension remapping // Add extension remapping
@ -345,7 +345,7 @@ void CObjectViewer::loadConfigFile()
CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true); 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++) for (uint i=0; i<(uint)var.size(); i++)
CSoundSystem::addSampleBank(var.asString(i).c_str());*/ 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); //::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"); CConfigFile::CVar &camera_focal = cf.getVar("camera_focal");
_CameraFocal = camera_focal.asFloat(); _CameraFocal = camera_focal.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
} }
@ -404,7 +404,7 @@ void CObjectViewer::loadConfigFile()
CConfigFile::CVar &var = cf.getVar("scene_light_enabled"); CConfigFile::CVar &var = cf.getVar("scene_light_enabled");
_SceneLightEnabled = var.asInt() !=0 ; _SceneLightEnabled = var.asInt() !=0 ;
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_SceneLightEnabled= false; _SceneLightEnabled= false;
} }
@ -415,7 +415,7 @@ void CObjectViewer::loadConfigFile()
_SceneLightSunAmbiant.G = var.asInt(1); _SceneLightSunAmbiant.G = var.asInt(1);
_SceneLightSunAmbiant.B = var.asInt(2); _SceneLightSunAmbiant.B = var.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_SceneLightSunAmbiant= NLMISC::CRGBA::Black; _SceneLightSunAmbiant= NLMISC::CRGBA::Black;
} }
@ -426,7 +426,7 @@ void CObjectViewer::loadConfigFile()
_SceneLightSunDiffuse.G = var.asInt(1); _SceneLightSunDiffuse.G = var.asInt(1);
_SceneLightSunDiffuse.B = var.asInt(2); _SceneLightSunDiffuse.B = var.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_SceneLightSunDiffuse= NLMISC::CRGBA::White; _SceneLightSunDiffuse= NLMISC::CRGBA::White;
} }
@ -437,7 +437,7 @@ void CObjectViewer::loadConfigFile()
_SceneLightSunSpecular.G = var.asInt(1); _SceneLightSunSpecular.G = var.asInt(1);
_SceneLightSunSpecular.B = var.asInt(2); _SceneLightSunSpecular.B = var.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_SceneLightSunSpecular= NLMISC::CRGBA::White; _SceneLightSunSpecular= NLMISC::CRGBA::White;
} }
@ -449,7 +449,7 @@ void CObjectViewer::loadConfigFile()
_SceneLightSunDir.z = var.asFloat(2); _SceneLightSunDir.z = var.asFloat(2);
_SceneLightSunDir.normalize(); _SceneLightSunDir.normalize();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_SceneLightSunDir.set(0, 1, -1); _SceneLightSunDir.set(0, 1, -1);
_SceneLightSunDir.normalize(); _SceneLightSunDir.normalize();
@ -459,7 +459,7 @@ void CObjectViewer::loadConfigFile()
CConfigFile::CVar &var = cf.getVar("object_light_test"); CConfigFile::CVar &var = cf.getVar("object_light_test");
_ObjectLightTestShape= var.asString(); _ObjectLightTestShape= var.asString();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
} }
@ -481,7 +481,7 @@ void CObjectViewer::loadConfigFile()
} }
CNELU::Scene->setAutomaticAnimationSet(as.release()); 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); //::MessageBox(NULL, "No automatic animation path specified, please set 'automatic_animation_path'", "warning", MB_OK);
nlwarning("No automatic animation path specified"); nlwarning("No automatic animation path specified");
@ -493,7 +493,7 @@ void CObjectViewer::loadConfigFile()
CConfigFile::CVar &var = cf.getVar("character_scale_pos"); CConfigFile::CVar &var = cf.getVar("character_scale_pos");
_CharacterScalePos= var.asFloat(); _CharacterScalePos= var.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
} }
@ -838,7 +838,7 @@ bool CObjectViewer::initUI (HWND parent)
{ {
serial (iF); serial (iF);
} }
catch (Exception& e) catch (const Exception& e)
{ {
std::string msg = toString("Error while loading default.ovcgf : %s", e.what()); std::string msg = toString("Error while loading default.ovcgf : %s", e.what());
::MessageBox (NULL, utf8ToTStr(msg), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); ::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; slot<NL3D::CChannelMixer::NumAnimationSlot; slot++) for (uint slot=0; slot<NL3D::CChannelMixer::NumAnimationSlot; slot++)
_ListInstance[instance]->Saved.SlotInfo[slot] = readed[i].SlotInfo[slot]; _ListInstance[instance]->Saved.SlotInfo[slot] = readed[i].SlotInfo[slot];
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
std::string message = toString("Error loading shape %s: %s", readed[i].ShapeFilename.c_str(), e.what()); 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++) for (uint i=0; i<(uint)zones.size(); i++)
_VegetableLandscapeZoneNames.push_back(zones.asString(i).c_str()); _VegetableLandscapeZoneNames.push_back(zones.asString(i).c_str());
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLandscapeTileBank.clear(); _VegetableLandscapeTileBank.clear();
_VegetableLandscapeTileFarBank.clear(); _VegetableLandscapeTileFarBank.clear();
@ -2917,7 +2917,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
// clamp to avoid divide/0. // clamp to avoid divide/0.
_VegetableLandscapeThreshold= max(_VegetableLandscapeThreshold, 0.001f); _VegetableLandscapeThreshold= max(_VegetableLandscapeThreshold, 0.001f);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLandscapeThreshold= 0.003f; _VegetableLandscapeThreshold= 0.003f;
} }
@ -2927,7 +2927,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &tileNear= cf.getVar("veget_landscape_tile_near"); CConfigFile::CVar &tileNear= cf.getVar("veget_landscape_tile_near");
_VegetableLandscapeTileNear= tileNear.asFloat(); _VegetableLandscapeTileNear= tileNear.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLandscapeTileNear= 50; _VegetableLandscapeTileNear= 50;
} }
@ -2939,7 +2939,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
_VegetableLandscapeAmbient.G= color.asInt(1); _VegetableLandscapeAmbient.G= color.asInt(1);
_VegetableLandscapeAmbient.B= color.asInt(2); _VegetableLandscapeAmbient.B= color.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLandscapeAmbient.set(80, 80, 80); _VegetableLandscapeAmbient.set(80, 80, 80);
} }
@ -2951,7 +2951,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
_VegetableLandscapeDiffuse.G= color.asInt(1); _VegetableLandscapeDiffuse.G= color.asInt(1);
_VegetableLandscapeDiffuse.B= color.asInt(2); _VegetableLandscapeDiffuse.B= color.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLandscapeDiffuse.set(255, 255, 255); _VegetableLandscapeDiffuse.set(255, 255, 255);
} }
@ -2961,7 +2961,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &var= cf.getVar("veget_landscape_snap_height"); CConfigFile::CVar &var= cf.getVar("veget_landscape_snap_height");
_VegetableSnapHeight= var.asFloat(); _VegetableSnapHeight= var.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableSnapHeight= 1.70f; _VegetableSnapHeight= 1.70f;
} }
@ -2976,7 +2976,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &var= cf.getVar("veget_texture"); CConfigFile::CVar &var= cf.getVar("veget_texture");
_VegetableTexture= var.asString(); _VegetableTexture= var.asString();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableTexture= ""; _VegetableTexture= "";
} }
@ -2989,7 +2989,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
_VegetableAmbient.G= color.asInt(1); _VegetableAmbient.G= color.asInt(1);
_VegetableAmbient.B= color.asInt(2); _VegetableAmbient.B= color.asInt(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableAmbient.set(80, 80, 80); _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 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; 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 R= 255 - _VegetableAmbient.R; clamp(R, 0, 255); _VegetableDiffuse.R= R;
sint G= 255 - _VegetableAmbient.G; clamp(G, 0, 255); _VegetableDiffuse.G= G; 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.z= var.asFloat(2);
_VegetableLightDir.normalize(); _VegetableLightDir.normalize();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableLightDir.set(0, 1, -1); _VegetableLightDir.set(0, 1, -1);
_VegetableLightDir.normalize(); _VegetableLightDir.normalize();
@ -3031,7 +3031,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
_VegetableWindDir.y= var.asFloat(1); _VegetableWindDir.y= var.asFloat(1);
_VegetableWindDir.z= var.asFloat(2); _VegetableWindDir.z= var.asFloat(2);
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableWindDir.x= 0.5f; _VegetableWindDir.x= 0.5f;
_VegetableWindDir.y= 0.5f; _VegetableWindDir.y= 0.5f;
@ -3043,7 +3043,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &var= cf.getVar("veget_wind_freq"); CConfigFile::CVar &var= cf.getVar("veget_wind_freq");
_VegetableWindFreq= var.asFloat(); _VegetableWindFreq= var.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableWindFreq= 0.5; _VegetableWindFreq= 0.5;
} }
@ -3053,7 +3053,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &var= cf.getVar("veget_wind_power"); CConfigFile::CVar &var= cf.getVar("veget_wind_power");
_VegetableWindPower= var.asFloat(); _VegetableWindPower= var.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableWindPower= 1; _VegetableWindPower= 1;
} }
@ -3063,7 +3063,7 @@ void CObjectViewer::loadVegetableLandscapeCfg(NLMISC::CConfigFile &cf)
CConfigFile::CVar &var= cf.getVar("veget_wind_bend_min"); CConfigFile::CVar &var= cf.getVar("veget_wind_bend_min");
_VegetableWindBendMin= var.asFloat(); _VegetableWindBendMin= var.asFloat();
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
_VegetableWindBendMin= 0; _VegetableWindBendMin= 0;
} }
@ -3863,7 +3863,6 @@ uint CObjectViewer::getNumCamera () const
int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStringID, UINT nType) int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStringID, UINT nType)
{ {
CString caption; CString caption;
CString mess; CString mess;
caption.LoadString(captionStringID); caption.LoadString(captionStringID);

View file

@ -904,7 +904,7 @@ bool CSkeletonScaleDlg::saveCurrentInStream(NLMISC::IStream &f)
ss.serial(f); ss.serial(f);
delete skelShape; delete skelShape;
} }
catch(NLMISC::EStream &) catch(const NLMISC::EStream &)
{ {
MessageBox(_T("Failed to save file!")); MessageBox(_T("Failed to save file!"));
return false; return false;

View file

@ -735,7 +735,7 @@ void CSnapshotToolDlg::OnTimer(UINT_PTR nIDEvent)
} }
sb.reset(); sb.reset();
} }
catch(std::exception &e) catch(const std::exception &e)
{ {
nlwarning(e.what()); nlwarning(e.what());

View file

@ -328,7 +328,7 @@ void CSoundAnimView::refresh(BOOL update)
else else
soundAnim = animManager->findAnimation(name); soundAnim = animManager->findAnimation(name);
} }
catch (exception& e) catch (const exception& e)
{ {
nlwarning("Couldn't find sound animation <%s>: %s", name.c_str(), e.what()); nlwarning("Couldn't find sound animation <%s>: %s", name.c_str(), e.what());
needCreate = true; needCreate = true;

View file

@ -67,7 +67,7 @@ void CSoundSystem::initSoundSystem ()
_AudioMixer->setPackedSheetOption(_PackedSheetPath, true); _AudioMixer->setPackedSheetOption(_PackedSheetPath, true);
_AudioMixer->init(32, true, false, NULL, 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 ! // in case of exeption during mixer init, the mixer is destroyed !
string mess = string("Unable to init sound :") + e.what(); 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... // TODO : boris : Hum, as far as I know, throwing exeption in constructor is a very BAD idea...
_AnimManager = new CSoundAnimManager(_AudioMixer); _AnimManager = new CSoundAnimManager(_AudioMixer);
} }
catch (NLMISC::Exception &e) catch (const NLMISC::Exception &e)
{ {
string mess = string("Unable to init sound :") + e.what(); string mess = string("Unable to init sound :") + e.what();
nlwarning ("Init sound: %s", mess.c_str()); nlwarning ("Init sound: %s", mess.c_str());
@ -109,7 +109,7 @@ void CSoundSystem::initSoundSystem ()
//_AudioMixer->loadSampleBank(NLMISC::CPath::lookup(*it).c_str()); //_AudioMixer->loadSampleBank(NLMISC::CPath::lookup(*it).c_str());
_AudioMixer->loadSampleBank(false, (*it1)); _AudioMixer->loadSampleBank(false, (*it1));
} }
catch (NLMISC::Exception &e) catch (const NLMISC::Exception &e)
{ {
string mess = "Unable to load sound file :" + *it1 string mess = "Unable to load sound file :" + *it1
+ "\n" + e.what(); + "\n" + e.what();
@ -126,7 +126,7 @@ void CSoundSystem::initSoundSystem ()
//_AudioMixer->loadSoundBank(NLMISC::CPath::lookup(*it).c_str()); //_AudioMixer->loadSoundBank(NLMISC::CPath::lookup(*it).c_str());
_AudioMixer->loadSoundBank((*it2).c_str()); _AudioMixer->loadSoundBank((*it2).c_str());
} }
catch (NLMISC::Exception &e) catch (const NLMISC::Exception &e)
{ {
string mess = "Unable to load sound file :" + *it2 string mess = "Unable to load sound file :" + *it2
+ "\n" + e.what(); + "\n" + e.what();

View file

@ -544,7 +544,7 @@ void CVegetableDensityPage::OnButtonVegetableBrowse()
// update 3D view // update 3D view
_VegetableDlg->refreshVegetableDisplay(); _VegetableDlg->refreshVegetableDisplay();
} }
catch (NLMISC::EPathNotFound &ep) catch (const NLMISC::EPathNotFound &ep)
{ {
MessageBox(utf8ToTStr(ep.what()), _T("Can't open file")); MessageBox(utf8ToTStr(ep.what()), _T("Can't open file"));
} }

View file

@ -358,7 +358,7 @@ bool CVegetableDlg::loadVegetableSet(NL3D::CTileVegetableDesc &vegetSet, const
// bkup fileName. // bkup fileName.
_LastVegetSetName= (const char*)fd.GetFileName(); _LastVegetSetName= (const char*)fd.GetFileName();
} }
catch(NLMISC::EStream &) catch(const NLMISC::EStream &)
{ {
ok= false; ok= false;
MessageBox(_T("Failed to load file!")); MessageBox(_T("Failed to load file!"));
@ -629,7 +629,7 @@ void CVegetableDlg::OnButtonVegetableLoadDesc()
// update 3D view // update 3D view
refreshVegetableDisplay(); refreshVegetableDisplay();
} }
catch(NLMISC::EStream &) catch(const NLMISC::EStream &)
{ {
MessageBox(_T("Failed to load file!")); MessageBox(_T("Failed to load file!"));
} }
@ -664,7 +664,7 @@ void CVegetableDlg::OnButtonVegetableSaveDesc()
// save the vegetable // save the vegetable
f.serial(veget); f.serial(veget);
} }
catch(NLMISC::EStream &) catch(const NLMISC::EStream &)
{ {
MessageBox(_T("Failed to save file!")); MessageBox(_T("Failed to save file!"));
} }
@ -735,7 +735,7 @@ void CVegetableDlg::OnButtonVegetableSaveSet()
// save the vegetable set // save the vegetable set
f.serial(vegetSet); f.serial(vegetSet);
} }
catch(NLMISC::EStream &) catch(const NLMISC::EStream &)
{ {
MessageBox(_T("Failed to save file!")); MessageBox(_T("Failed to save file!"));
} }

View file

@ -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); 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); 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); 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); MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -737,7 +737,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP
} }
theIP->RedrawViews(time); theIP->RedrawViews(time);
} }
catch(std::exception &e) catch(const std::exception &e)
{ {
::MessageBox(hWnd, e.what(), "Error", MB_OK | MB_ICONEXCLAMATION); ::MessageBox(hWnd, e.what(), "Error", MB_OK | MB_ICONEXCLAMATION);
} }

View file

@ -233,7 +233,7 @@ bool CNelExport::exportVegetable (const char *sPath, INode& node, TimeValue time
// All is good // All is good
bRet=true; bRet=true;
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Message box // Message box
const char *message = e.what(); const char *message = e.what();
@ -340,7 +340,7 @@ bool CNelExport::exportAnim (const char *sPath, std::vector<INode*>& vectNode, T
bRet = false; bRet = false;
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
if (_ErrorInDialog) if (_ErrorInDialog)
MessageBox (NULL, e.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); 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 // All is good
bRet=true; bRet=true;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning (e.what()); nlwarning (e.what());
} }

View file

@ -56,7 +56,7 @@ bool CNelExport::exportInstanceGroup(string filename, vector<INode*>& vectNode)
pIG->serial (file); pIG->serial (file);
// All is good // All is good
} }
catch (Exception &c) catch (const Exception &c)
{ {
// Cannot save the file // Cannot save the file
MessageBox (NULL, c.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, c.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION);

View file

@ -112,7 +112,7 @@ Value* export_shape_cf (Value** arg_list, int count)
if (theCNelExport.exportMesh (sPath, *node, ip->GetTime())) if (theCNelExport.exportMesh (sPath, *node, ip->GetTime()))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportShape) %s", e.what()); 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())) if (theCNelExport.exportMesh (sPath.c_str(), *node, ip->GetTime()))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportShapeEx) %s", e.what()); 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())) if (theCNelExport.exportSkeleton (sPath, node, ip->GetTime()))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportSkeleton) %s", e.what()); 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()); 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()); 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()); nlwarning ("ERROR (NelExportSkeletonWeight) %s", e.what());
} }
@ -445,7 +445,7 @@ Value* view_shape_cf (Value** arg_list, int count)
theCNelExport.viewMesh (ip->GetTime()); theCNelExport.viewMesh (ip->GetTime());
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR %s", e.what()); 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())) if (theCNelExport.exportVegetable (sPath, *node, ip->GetTime()))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportVegetable) %s", e.what()); 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)) if (theCNelExport.exportCollision (sPath.c_str(), nodes, time))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportCollision) %s", e.what()); 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)) if (theCNelExport.exportPACSPrimitives (sPath.c_str(), nodes, time))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportPACSPrimitives) %s", e.what()); 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())) if (theCNelExport.exportLodCharacter (sPath, *node, ip->GetTime()))
ret = &true_value; ret = &true_value;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("ERROR (NelExportLodCharacter) %s", e.what()); nlwarning ("ERROR (NelExportLodCharacter) %s", e.what());
} }

View file

@ -86,7 +86,7 @@ bool CNelExport::exportSWT(const char *sPath, std::vector<INode*>& vectNode)
// All is good // All is good
return true; return true;
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning (e.what()); nlwarning (e.what());
} }

View file

@ -128,7 +128,7 @@ void regsiterOVPath ()
for (uint i=0; i<(uint)search_pathes.size(); i++) for (uint i=0; i<(uint)search_pathes.size(); i++)
CPath::addSearchPath (search_pathes.asString(i)); CPath::addSearchPath (search_pathes.asString(i));
} }
catch(EUnknownVar &) catch(const EUnknownVar &)
{} {}
try try
@ -138,7 +138,7 @@ void regsiterOVPath ()
for (uint i=0; i<(uint)recursive_search_pathes.size(); i++) for (uint i=0; i<(uint)recursive_search_pathes.size(); i++)
CPath::addSearchPath (recursive_search_pathes.asString(i), true, false); CPath::addSearchPath (recursive_search_pathes.asString(i), true, false);
} }
catch(EUnknownVar &) catch(const EUnknownVar &)
{} {}
// Add extension remapping // Add extension remapping
@ -155,7 +155,7 @@ void regsiterOVPath ()
CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true); CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true);
} }
} }
catch (EUnknownVar &) catch (const EUnknownVar &)
{ {
} }
} }

View file

@ -2628,7 +2628,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
pLightMap->writeTGA (f, 32); pLightMap->writeTGA (f, 32);
} }
} }
catch(Exception &e) catch(const Exception &e)
{ {
if (gOptions.FeedBack != NULL) if (gOptions.FeedBack != NULL)
{ {

View file

@ -284,7 +284,7 @@ Value* import_zone_cf (Value** arg_list, int count)
// Redraw the viewports // Redraw the viewports
ip->RedrawViews(ip->GetTime()); ip->RedrawViews(ip->GetTime());
} }
catch (Exception& e) catch (const Exception& e)
{ {
// Error message // Error message
errorMessage (("Error when loading file "+filename+": "+e.what()).c_str(), "NeL import zone", *ip, dialog); 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()); mprintf ("Error: can't open bank file %s\n", bankName.c_str());
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
// Error message // Error message
mprintf ("Error: %s\n", e.what()); mprintf ("Error: %s\n", e.what());

View file

@ -449,7 +449,7 @@ public:
_bank.serial (file); _bank.serial (file);
} }
} }
catch (NLMISC::EStream& excp) catch (const NLMISC::EStream& excp)
{ {
MessageBox (NULL, excp.what(), "Load error", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, excp.what(), "Load error", MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -191,7 +191,7 @@ bool RPatchMesh::exportZone(INode* pNode, PatchMesh* pPM, NL3D::CZone& zone, CZo
// Ok // Ok
loaded = true; loaded = true;
} }
catch (EStream& stream) catch (const EStream& e)
{ {
MessageBox (NULL, stream.what(), _T("Error"), MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, stream.what(), _T("Error"), MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -3990,7 +3990,7 @@ void EPM_PaintCMode::DoPaint ()
bank.serial (file); bank.serial (file);
bank.computeXRef (); bank.computeXRef ();
} }
catch (EStream& stream) catch (const EStream& stream)
{ {
MessageBox (NULL, stream.what(), "Error", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, stream.what(), "Error", MB_OK|MB_ICONEXCLAMATION);
} }
@ -4075,7 +4075,7 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it)
// ok // ok
return true; return true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
// Print an error message // Print an error message
char msg[512]; char msg[512];
@ -4370,7 +4370,7 @@ DWORD WINAPI myThread (LPVOID vData)
delete pData; delete pData;
} }
catch (Exception& e) catch (const Exception& e)
{ {
MessageBox (NULL, e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -440,7 +440,7 @@ void LoadKeyCfg ()
// Get value // Get value
PainterKeys[key]=value.asInt (); PainterKeys[key]=value.asInt ();
} }
catch (EConfigFile &e) catch (const EConfigFile &e)
{ {
// Something goes wrong... catch that // Something goes wrong... catch that
const char* what=e.what(); const char* what=e.what();
@ -489,7 +489,7 @@ void LoadVarCfg ()
LightDirection.z = light_direction.asFloat (2); LightDirection.z = light_direction.asFloat (2);
} }
} }
catch (EConfigFile &) catch (const EConfigFile &)
{ {
} }
@ -504,7 +504,7 @@ void LoadVarCfg ()
LightDiffuse.B = light_diffuse.asInt (2); LightDiffuse.B = light_diffuse.asInt (2);
} }
} }
catch (EConfigFile &) catch (const EConfigFile &)
{ {
} }
@ -519,7 +519,7 @@ void LoadVarCfg ()
LightAmbiant.B = light_ambiant.asInt (2); LightAmbiant.B = light_ambiant.asInt (2);
} }
} }
catch (EConfigFile &) catch (const EConfigFile &)
{ {
} }
@ -529,7 +529,7 @@ void LoadVarCfg ()
CConfigFile::CVar &light_multiply= cf.getVar ("LightMultiply"); CConfigFile::CVar &light_multiply= cf.getVar ("LightMultiply");
LightMultiply = light_multiply.asFloat (); LightMultiply = light_multiply.asFloat ();
} }
catch (EConfigFile &) catch (const EConfigFile &)
{ {
} }
@ -539,7 +539,7 @@ void LoadVarCfg ()
CConfigFile::CVar &zoom_speed= cf.getVar ("ZoomSpeed"); CConfigFile::CVar &zoom_speed= cf.getVar ("ZoomSpeed");
ZoomSpeed = zoom_speed.asFloat (); ZoomSpeed = zoom_speed.asFloat ();
} }
catch (EConfigFile &) catch (const EConfigFile &)
{ {
} }
} }

View file

@ -409,7 +409,7 @@ bool CPaintColor::loadBrush (const char *brushFileName)
return false; return false;
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
// Error message // Error message
MessageBox ((HWND)CNELU::Driver->getDisplay(), e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); MessageBox ((HWND)CNELU::Driver->getDisplay(), e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION);

View file

@ -302,7 +302,7 @@ void Tile_utility::Load (const std::string& path)
SetBankPathName (path); SetBankPathName (path);
} }
} }
catch (EStream stream) catch (const EStream &stream)
{ {
char tmp[1024]; char tmp[1024];
sprintf (tmp, "Error while loading %s:\n\n%s", path, stream.what()); sprintf (tmp, "Error while loading %s:\n\n%s", path, stream.what());

View file

@ -101,7 +101,7 @@ int main(int argc, char* argv[])
// Add the shape // Add the shape
shapeMesh = streamShape.getShapePointer(); shapeMesh = streamShape.getShapePointer();
} }
catch (Exception& e) catch (const Exception& e)
{ {
cout << "Error : " << e.what() << endl; cout << "Error : " << e.what() << endl;

View file

@ -1409,7 +1409,7 @@ void Browse::OnExportBorder()
else else
error=true; error=true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
const char *toto=e.what (); const char *toto=e.what ();
error=true; error=true;
@ -1454,7 +1454,7 @@ void Browse::OnImportBorder()
else else
error=true; error=true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
const char *toto=e.what (); const char *toto=e.what ();
error=true; error=true;

View file

@ -101,7 +101,7 @@ static bool loadPic(const string &path, std::vector<NLMISC::CBGRA> &tampon, uint
return true; return true;
} }
} }
catch (NLMISC::Exception& ) { } catch (const NLMISC::Exception& ) { }
return false; return false;
} }

View file

@ -51,7 +51,7 @@ static bool loadPic(const string &path, std::vector<NLMISC::CBGRA> &tampon, uint
return true; return true;
} }
} }
catch (NLMISC::Exception& ) { } catch (const NLMISC::Exception& ) { }
return false; return false;
} }

View file

@ -543,7 +543,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked()
else else
error=true; error=true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
const char *toto=e.what (); const char *toto=e.what ();
error=true; error=true;
@ -592,7 +592,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
else else
error=true; error=true;
} }
catch (Exception& e) catch (const Exception& e)
{ {
const char *toto=e.what (); const char *toto=e.what ();
error=true; error=true;

View file

@ -578,7 +578,7 @@ BOOL CLogic_editorDoc::OnSaveDocument( LPCTSTR fileName )
// Close the file // Close the file
file.close (); file.close ();
} }
catch (Exception &) catch (const Exception &)
{ {
} }
@ -646,7 +646,7 @@ BOOL CLogic_editorDoc::load( LPCTSTR fileName )
// Close the file // Close the file
file.close (); file.close ();
} }
catch (Exception &) catch (const Exception &)
{ {
} }

View file

@ -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); MessageBox (NULL, e.what (), "NeL Data Mirror", MB_OK|MB_ICONEXCLAMATION);
} }

View file

@ -188,7 +188,7 @@ BOOL CLog_analyserDlg::OnInitDialog()
cf.load( "log_analyser.cfg" ); cf.load( "log_analyser.cfg" );
LogDateString = cf.getVar( "LogDateString" ).asString().c_str(); LogDateString = cf.getVar( "LogDateString" ).asString().c_str();
} }
catch ( EConfigFile& ) catch (const EConfigFile& )
{*/ {*/
LogDateString = "Log Starting ["; LogDateString = "Log Starting [";
AnalyseFunc = NULL; AnalyseFunc = NULL;

View file

@ -616,7 +616,7 @@ bool CActionStringVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modif
modified = true; modified = true;
} }
catch (Exception &e) catch (const Exception &e)
{ {
ok = false; ok = false;
char message[512]; char message[512];

View file

@ -586,7 +586,7 @@ bool CGeorgesEditApp::loadCfg ()
if (superuser) if (superuser)
Superuser = superuser->asInt () != 0; Superuser = superuser->asInt () != 0;
} }
catch (Exception &) catch (const Exception &)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Can't load georges.cfg config file."); smprintf (message, 512, "Can't load georges.cfg config file.");
@ -647,14 +647,14 @@ bool CGeorgesEditApp::saveCfg ()
{ {
cf.save (); cf.save ();
} }
catch (Exception &) catch (const Exception &)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Can't save georges.cfg config file."); smprintf (message, 512, "Can't save georges.cfg config file.");
outputError (message); outputError (message);
} }
} }
catch (Exception &) catch (const Exception &)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Can't load georges.cfg config file."); smprintf (message, 512, "Can't load georges.cfg config file.");
@ -1197,7 +1197,7 @@ bool CGeorgesEditApp::SerialIntoMemStream (const char *formName, CGeorgesEditDoc
// Ok // Ok
return true; return true;
} }
catch (Exception &) catch (const Exception &)
{ {
nlstop; nlstop;
} }
@ -1454,7 +1454,7 @@ bool CGeorgesEditApp::SerialFromMemStream (const char *formName, CGeorgesEditDoc
return true; return true;
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("Error while paste: %s", e.what()); nlwarning ("Error while paste: %s", e.what());
} }

View file

@ -508,7 +508,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName)
return TRUE; return TRUE;
} }
catch (Exception &e) catch (const Exception &e)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Error while loading Type file: %s", e.what()); smprintf (message, 512, "Error while loading Type file: %s", e.what());
@ -534,7 +534,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName)
return TRUE; return TRUE;
} }
catch (Exception &e) catch (const Exception &e)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Error while loading Type file: %s", e.what()); smprintf (message, 512, "Error while loading Type file: %s", e.what());
@ -623,7 +623,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName)
return FALSE; return FALSE;
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
char message[512]; char message[512];
smprintf (message, 512, "Error while loading Type file: %s", e.what()); 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]; char message[512];
smprintf (message, 512, "Error while loading file: %s", e.what()); smprintf (message, 512, "Error while loading file: %s", e.what());

View file

@ -454,7 +454,7 @@ BOOL CGeorgesImpl::PreTranslateMessage (MSG *pMsg)
{ {
ploader->SetTypPredef( _sxfilename, vsx ); ploader->SetTypPredef( _sxfilename, vsx );
} }
catch (NLMISC::Exception &e) catch (const NLMISC::Exception &e)
{ {
std::string tmp = std::string(e.what()) + "(" + _sxfilename + ")"; std::string tmp = std::string(e.what()) + "(" + _sxfilename + ")";
theApp.m_pMainWnd->MessageBox(tmp.c_str(), "Georges_Lib", MB_ICONERROR | MB_OK); 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 // Write
t.write (outputXml.getDocument ()); t.write (outputXml.getDocument ());
} }
catch (Exception &e) catch (const Exception &e)
{ {
nlwarning ("Error during writing file '%s' : ", filename.c_str (), e.what ()); 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()); theApp.OpenDocumentFile(_sxfullname.c_str());
} }
catch (NLMISC::Exception &e) catch (const NLMISC::Exception &e)
{ {
std::string tmp = std::string(e.what()) + "(" + _sxfullname + ")"; std::string tmp = std::string(e.what()) + "(" + _sxfullname + ")";
theApp.m_pMainWnd->MessageBox(tmp.c_str(), "Georges_Lib", MB_ICONERROR | MB_OK); theApp.m_pMainWnd->MessageBox(tmp.c_str(), "Georges_Lib", MB_ICONERROR | MB_OK);

View file

@ -47,7 +47,7 @@ __declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGE
{ {
return new CSoundPlugin(globalInterface); return new CSoundPlugin(globalInterface);
} }
catch (std::exception &e) catch (const std::exception &e)
{ {
string reason = e.what(); string reason = e.what();
MessageBox (NULL, reason.c_str(), "Sound plugin", MB_OK); MessageBox (NULL, reason.c_str(), "Sound plugin", MB_OK);

View file

@ -121,7 +121,7 @@ BOOL CMissionCompilerFeApp::InitInstance()
mc.installCompiledMission(dlg.LigoConfig, fileName); mc.installCompiledMission(dlg.LigoConfig, fileName);
nbMission += mc.getMissionsCount(); nbMission += mc.getMissionsCount();
} }
catch(EParseException e) catch(const EParseException &e)
{ {
string msg; string msg;
msg + "\r\n"; msg + "\r\n";

View file

@ -479,7 +479,7 @@ void CMissionCompilerFeDlg::compile(BOOL publish)
mc.publishFiles(ServerPathPrim[i], ServerPathText[i], LocalTextPath); mc.publishFiles(ServerPathPrim[i], ServerPathText[i], LocalTextPath);
} }
} }
catch(EParseException e) catch(const EParseException &e)
{ {
string msg; string msg;
msg + "\r\n"; 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()); 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 "; string msg = "In primitive ";
msg += buildPrimPath(e.Primitive) +" : "+e.Why; msg += buildPrimPath(e.Primitive) +" : "+e.Why;

View file

@ -520,7 +520,7 @@ bool CActionImportPrimitive::redo ()
return false; return false;
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ()); theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ());
return false; return false;
@ -610,7 +610,7 @@ bool CActionLoadPrimitive::redo ()
return false; return false;
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ()); theApp.errorMessage ("Error reading the file (%s) : (%s).", _Filename.c_str (), e.what ());
return false; return false;
@ -2488,7 +2488,7 @@ bool CActionAddLandscape::redo ()
result = false; result = false;
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
getMainFrame ()->terminateLoadingDialog (); getMainFrame ()->terminateLoadingDialog ();
theApp.errorMessage ("Error reading file %s : %s", _Filename.c_str (), e.what ()); theApp.errorMessage ("Error reading file %s : %s", _Filename.c_str (), e.what ());

View file

@ -355,7 +355,7 @@ NLMISC::CBitmap *CDataBase::loadBitmap (const std::string &fileName)
nlwarning ("Bitmap not found : %s", fileName.c_str()); nlwarning ("Bitmap not found : %s", fileName.c_str());
} }
} }
catch (Exception& e) catch (const Exception& e)
{ {
pBitmap->makeDummy(); pBitmap->makeDummy();
theApp.errorMessage ("Error while loading bitmap %s : %s", fileName.c_str(), e.what()); theApp.errorMessage ("Error while loading bitmap %s : %s", fileName.c_str(), e.what());

View file

@ -3875,7 +3875,7 @@ void CPrimTexture::buildFromFile(const std::string &filename)
_Width = (uint) width; _Width = (uint) width;
_Height = (uint) height; _Height = (uint) height;
} }
catch (NLMISC::EStream) catch (const NLMISC::EStream &)
{ {
nlwarning("Couldn't retrieve size for %s", filename.c_str()); nlwarning("Couldn't retrieve size for %s", filename.c_str());
} }

View file

@ -925,7 +925,7 @@ NL3D::CTextureBlank *CPrimBitmap::getTexture () const
theApp.errorMessage ("Can't read bitmap %s", filename.c_str ()); 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 ()); theApp.errorMessage ("Error reading bitmap %s : %s", filename.c_str (), e.what ());
} }

View file

@ -858,7 +858,7 @@ void CMainFrame::uninit ()
fileOut.serial(_Environnement); fileOut.serial(_Environnement);
fileOut.close(); fileOut.close();
} }
catch (Exception& e) catch (const Exception& e)
{ {
MessageBox (e.what(), "Warning"); 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 ()); 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); ms.seek(0, NLMISC::IStream::begin);
tmpBitmap.load(ms); tmpBitmap.load(ms);
} }
catch(EStream &) catch(const EStream &)
{ {
return false; return false;
} }

View file

@ -168,7 +168,7 @@ BOOL CWorldEditorApp::InitInstance()
// set the primitive context // set the primitive context
CPrimitiveContext::instance().CurrentLigoConfig = &Config; CPrimitiveContext::instance().CurrentLigoConfig = &Config;
} }
catch (Exception& e) catch (const Exception& e)
{ {
::MessageBox (NULL, e.what(), "Warning", MB_OK|MB_ICONEXCLAMATION); ::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"); 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 ()); errorMessage ("File read error (%s):%s", filename, e.what ());
} }

View file

@ -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 ()); 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 ()); 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 (); clearModifications ();
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
theApp.errorMessage ("Error reading file %s : %s", filename, e.what ()); 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); _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 ()); 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); _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 ()); 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 // Last time
file.close (); file.close ();
} }
catch (Exception &e) catch (const Exception &e)
{ {
theApp.errorMessage ("Error writing file %s : %s", lpszPathName, e.what ()); theApp.errorMessage ("Error writing file %s : %s", lpszPathName, e.what ());
@ -1674,7 +1674,7 @@ void CWorldEditorDoc::updateFiles ()
// Last time // Last time
_DataHierarchy[i].LastModifedTime = NLMISC::CFile::getFileModificationDate (_DataHierarchy[i].Filename); _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 ()); 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 ()); 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 ()); theApp.errorMessage ("Error reading file %s : %s", _DataHierarchy[i].Filename.c_str (), e.what ());
} }

View file

@ -209,7 +209,7 @@ void CGraphPlugin::refreshPrimitives()
} }
AfxMessageBox(err.c_str()); 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()); AfxMessageBox(e.what());
} }
@ -939,7 +939,7 @@ void CGraphPlugin::doSelection(const string& primPath)
_PluginAccess->setCurrentSelection(resSet); _PluginAccess->setCurrentSelection(resSet);
}catch(exception e){ }catch(const exception &e){
GraphDlg->MessageBox(e.what()); GraphDlg->MessageBox(e.what());
} }
} }

View file

@ -582,7 +582,7 @@ void CWorldEditorGraphPluginDlg::OnLButtonDown(UINT nFlags, CPoint point)
tok.top=atoi(strRes2.at(1).c_str()); tok.top=atoi(strRes2.at(1).c_str());
tok.right=atoi(strRes3.at(0).c_str()); tok.right=atoi(strRes3.at(0).c_str());
tok.bottom=atoi(strRes3.at(1).c_str()); tok.bottom=atoi(strRes3.at(1).c_str());
}catch (exception e) {return;} }catch (const exception &e) {return;}

View file

@ -675,7 +675,7 @@ void CPlugin::init(IPluginAccess *pluginAccess)
} }
} }
catch (Exception &e) catch (const Exception &e)
{ {
errorMessage (e.what ()); errorMessage (e.what ());
} }
@ -728,7 +728,7 @@ void CPlugin::connectDisconnect()
CInetAddress addr(_SHost+":48888"); CInetAddress addr(_SHost+":48888");
_Client->connect(addr); _Client->connect(addr);
} }
catch(ESocket &e) catch(const ESocket &e)
{ {
errorMessage (e.what ()); errorMessage (e.what ());
return; return;
@ -777,7 +777,7 @@ void CPlugin::connectDisconnect()
} }
updateConnectionState(); updateConnectionState();
} }
catch (Exception &e) catch (const Exception &e)
{ {
errorMessage (e.what ()); errorMessage (e.what ());
delete _Client; delete _Client;