diff --git a/source/gui/scripting/JSInterface_GUITypes.cpp b/source/gui/scripting/JSInterface_GUITypes.cpp index 9bf6665972..1fa9f39d45 100644 --- a/source/gui/scripting/JSInterface_GUITypes.cpp +++ b/source/gui/scripting/JSInterface_GUITypes.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -120,7 +120,7 @@ JSBool JSI_GUISize::toString(JSContext* cx, uintN argc, jsval* vp) SIDE(bottom); #undef SIDE } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, ""))); return JS_TRUE; diff --git a/source/gui/scripting/JSInterface_IGUIObject.cpp b/source/gui/scripting/JSInterface_IGUIObject.cpp index 6b7c6b58e6..2eb71dd154 100644 --- a/source/gui/scripting/JSInterface_IGUIObject.cpp +++ b/source/gui/scripting/JSInterface_IGUIObject.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -193,7 +193,7 @@ JSBool JSI_IGUIObject::getProperty(JSContext* cx, JSObject* obj, jsid id, jsval* P(percent, bottom, rbottom); #undef P } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { debug_warn(L"Error creating size object!"); break; @@ -670,7 +670,7 @@ JSBool JSI_IGUIObject::getComputedSize(JSContext* cx, uintN argc, jsval* vp) g_ScriptingHost.SetObjectProperty_Double(obj, "top", size.top); g_ScriptingHost.SetObjectProperty_Double(obj, "bottom", size.bottom); } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { debug_warn(L"Error creating size object!"); return JS_FALSE; diff --git a/source/lib/code_generation.h b/source/lib/code_generation.h index 00481dbbd1..30ef8f1fb1 100644 --- a/source/lib/code_generation.h +++ b/source/lib/code_generation.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 Wildfire Games +/* Copyright (c) 2013 Wildfire Games * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -99,7 +99,7 @@ STMT(\ {\ ptr = new type();\ }\ - catch(std::bad_alloc)\ + catch(std::bad_alloc&)\ {\ ptr = 0;\ } diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index ffb409b977..879e777dd3 100644 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 Wildfire Games +/* Copyright (c) 2013 Wildfire Games * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -447,7 +447,7 @@ static Status call_init_and_reload(Handle h, H_Type type, HDATA* hd, const PIVFS if(err == INFO::OK) warn_if_invalid(hd); } - catch(std::bad_alloc) + catch(std::bad_alloc&) { err = ERR::NO_MEM; } diff --git a/source/main.cpp b/source/main.cpp index 9ef9cd8084..28c75bd5ab 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -258,7 +258,7 @@ static int ProgressiveLoad() break; } } - catch (PSERROR_Game_World_MapLoadFailed e) + catch (PSERROR_Game_World_MapLoadFailed& e) { // Map loading failed diff --git a/source/maths/scripting/JSInterface_Vector3D.cpp b/source/maths/scripting/JSInterface_Vector3D.cpp index a07a0e1d3e..986c04d0c4 100644 --- a/source/maths/scripting/JSInterface_Vector3D.cpp +++ b/source/maths/scripting/JSInterface_Vector3D.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -179,7 +179,7 @@ JSBool JSI_Vector3D::construct(JSContext* cx, uintN argc, jsval* vp) JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(vector)); return JS_TRUE; } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { // Invalid input (i.e. can't be coerced into doubles) - fail JS_ReportError(cx, "Invalid parameters to Vector3D constructor"); diff --git a/source/ps/Errors.h b/source/ps/Errors.h index 2292c2db64..67453b8e68 100644 --- a/source/ps/Errors.h +++ b/source/ps/Errors.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -58,11 +58,11 @@ And you can use it as an exception: try { foo(); - } catch (PSERROR_ModuleName_FrobnificationFailed e) { + } catch (PSERROR_ModuleName_FrobnificationFailed& e) { // catches that particular error type - } catch (PSERROR_ModuleName e) { + } catch (PSERROR_ModuleName& e) { // catches anything in the hierarchy - } catch (PSERROR e) { + } catch (PSERROR& e) { std::cout << e.what(); } diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 3210d85965..8ad227d9f8 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -1027,7 +1027,7 @@ void InitGraphics(const CmdLineArgs& args, int flags) InitPs(setup_gui, L"page_pregame.xml", data.get()); } } - catch (PSERROR_Game_World_MapLoadFailed e) + catch (PSERROR_Game_World_MapLoadFailed& e) { // Map Loading failed diff --git a/source/ps/World.cpp b/source/ps/World.cpp index 4321f7484c..0a9ee5f3b6 100644 --- a/source/ps/World.cpp +++ b/source/ps/World.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify diff --git a/source/ps/scripting/JSInterface_Console.cpp b/source/ps/scripting/JSInterface_Console.cpp index 1ceda66e2e..f6e9900c56 100644 --- a/source/ps/scripting/JSInterface_Console.cpp +++ b/source/ps/scripting/JSInterface_Console.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -77,7 +77,7 @@ JSBool JSI_Console::setProperty(JSContext* UNUSED(cx), JSObject* UNUSED(obj), js g_Console->SetVisible(ToPrimitive (*vp)); return JS_TRUE; } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { return JS_TRUE; } @@ -110,7 +110,7 @@ JSBool JSI_Console::writeConsole(JSContext* cx, uintN argc, jsval* vp) CStrW arg = g_ScriptingHost.ValueToUCString(JS_ARGV(cx, vp)[i]); output += arg; } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { } } diff --git a/source/scripting/JSConversions.cpp b/source/scripting/JSConversions.cpp index c70e8baf70..09b6a0d00b 100644 --- a/source/scripting/JSConversions.cpp +++ b/source/scripting/JSConversions.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -255,7 +255,7 @@ template<> bool ToPrimitive( JSContext* UNUSED(cx), jsval v, CStrW& Stora { Storage = g_ScriptingHost.ValueToUCString( v ); } - catch( PSERROR_Scripting_ConversionFailed ) + catch( PSERROR_Scripting_ConversionFailed& ) { return( false ); } diff --git a/source/scripting/ScriptGlue.cpp b/source/scripting/ScriptGlue.cpp index 61566a0846..b5e878741b 100644 --- a/source/scripting/ScriptGlue.cpp +++ b/source/scripting/ScriptGlue.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -346,7 +346,7 @@ JSBool SetPaused(JSContext* cx, uintN argc, jsval* vp) g_SoundManager->Pause(g_Game->m_Paused); #endif } - catch (PSERROR_Scripting_ConversionFailed) + catch (PSERROR_Scripting_ConversionFailed&) { JS_ReportError(cx, "Invalid parameter to SetPaused"); } diff --git a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp index b4fd27d951..71272d4bfa 100644 --- a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -103,7 +103,7 @@ QUERYHANDLER(GenerateMap) msg->status = 0; } - catch (PSERROR_Game_World_MapLoadFailed e) + catch (PSERROR_Game_World_MapLoadFailed&) { // Cancel loading LDR_Cancel();