Changed: Constification of catches

This commit is contained in:
kervala 2016-11-20 12:31:48 +01:00
parent 65c74399b0
commit 81825f4e43
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
return true;
}
catch (Exception& e)
catch (const Exception& e)
{
// Print an error message
char msg[512];

View file

@ -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];

View file

@ -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);
}

View file

@ -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;

View file

@ -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; slot<NL3D::CChannelMixer::NumAnimationSlot; slot++)
_ListInstance[instance]->Saved.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);

View file

@ -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;

View file

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

View file

@ -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;

View file

@ -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();

View file

@ -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"));
}

View file

@ -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!"));
}

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);
}
}
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);
}

View file

@ -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);
}

View file

@ -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<INode*>& 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());
}

View file

@ -56,7 +56,7 @@ bool CNelExport::exportInstanceGroup(string filename, vector<INode*>& 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);

View file

@ -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());
}

View file

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

View file

@ -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 &)
{
}
}

View file

@ -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)
{

View file

@ -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());

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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 &)
{
}
}

View file

@ -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);

View file

@ -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());

View file

@ -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;

View file

@ -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;

View file

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

View file

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

View file

@ -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;

View file

@ -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 &)
{
}

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);
}

View file

@ -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;

View file

@ -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];

View file

@ -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());
}

View file

@ -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());

View file

@ -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);

View file

@ -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);

View file

@ -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";

View file

@ -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;

View file

@ -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 ());

View file

@ -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());

View file

@ -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());
}

View file

@ -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 ());
}

View file

@ -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;
}

View file

@ -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 ());
}

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 ());
}
@ -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 ());
}

View file

@ -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());
}
}

View file

@ -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;}

View file

@ -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;