Index: ps/trunk/source/graphics/MapGenerator.h =================================================================== --- ps/trunk/source/graphics/MapGenerator.h +++ ps/trunk/source/graphics/MapGenerator.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -78,7 +78,7 @@ * Thread-safety: * - Initialize and constructor/destructor must be called from the main thread. * - ScriptInterface created and destroyed by thread - * - StructuredClone used to return JS map data - jsvals can't be used across threads/runtimes + * - StructuredClone used to return JS map data - JS:Values can't be used across threads/runtimes. */ class CMapGeneratorWorker { Index: ps/trunk/source/graphics/MapReader.cpp =================================================================== --- ps/trunk/source/graphics/MapReader.cpp +++ ps/trunk/source/graphics/MapReader.cpp @@ -1240,7 +1240,7 @@ } else if (progress == 0) { - // Finished, get results as StructuredClone object, which must be read to obtain the JS val + // Finished, get results as StructuredClone object, which must be read to obtain the JS::Value shared_ptr results = m_MapGen->GetResults(); // Parse data into simulation context Index: ps/trunk/source/gui/CGUI.h =================================================================== --- ps/trunk/source/gui/CGUI.h +++ ps/trunk/source/gui/CGUI.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -16,18 +16,9 @@ */ /* -CGUI - ---Overview-- - - This is the top class of the whole GUI, all objects - and settings are stored within this class. - ---More info-- - - Check GUI.h - -*/ + * This is the top class of the whole GUI, all objects + * and settings are stored within this class. + */ #ifndef INCLUDED_CGUI #define INCLUDED_CGUI @@ -247,7 +238,7 @@ bool GetPreDefinedColor(const CStr& name, CColor& Output) const; shared_ptr GetScriptInterface() { return m_ScriptInterface; }; - jsval GetGlobalObject() { return m_ScriptInterface->GetGlobalObject(); }; + JS::Value GetGlobalObject() { return m_ScriptInterface->GetGlobalObject(); }; private: Index: ps/trunk/source/gui/IGUIObject.h =================================================================== --- ps/trunk/source/gui/IGUIObject.h +++ ps/trunk/source/gui/IGUIObject.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -16,29 +16,11 @@ */ /* -The base class of an object - ---Overview-- - - All objects are derived from this class, it's an ADT - so it can't be used per se - - Also contains a Dummy object which is used for - completely blank objects. - ---Usage-- - - Write about how to use it here - ---Examples-- - - Provide examples of how to use this code, if necessary - ---More info-- - - Check GUI.h - -*/ + * The base class of an object. + * All objects are derived from this class. + * It's an abstract data type, so it can't be used per se. + * Also contains a Dummy object which is used for completely blank objects. + */ #ifndef INCLUDED_IGUIOBJECT #define INCLUDED_IGUIOBJECT @@ -91,26 +73,6 @@ }; /** - * Base settings, all objects possess these settings - * in their m_BaseSettings - * Instructions can be found in the documentations. - */ -/*struct SGUIBaseSettings -{ - //int banan; - bool m_Absolute; - CStr m_Caption; // Is usually set within an XML element and not in the attributes - bool m_Enabled; - bool m_Ghost; - bool m_Hidden; - CClientArea m_Size; - CStr m_Style; - float m_Z; -};*/ - -////////////////////////////////////////////////////////// - -/** * GUI object such as a button or an input-box. * Abstract data type ! */ @@ -124,7 +86,7 @@ // Allow getProperty to access things like GetParent() friend bool JSI_IGUIObject::getProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp); friend bool JSI_IGUIObject::setProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool UNUSED(strict), JS::MutableHandleValue vp); - friend bool JSI_IGUIObject::getComputedSize(JSContext* cx, uint argc, jsval* vp); + friend bool JSI_IGUIObject::getComputedSize(JSContext* cx, uint argc, JS::Value* vp); public: IGUIObject(); Index: ps/trunk/source/gui/scripting/JSInterface_GUITypes.h =================================================================== --- ps/trunk/source/gui/scripting/JSInterface_GUITypes.h +++ ps/trunk/source/gui/scripting/JSInterface_GUITypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,8 +26,8 @@ extern JSClass JSI_class; \ extern JSPropertySpec JSI_props[]; \ extern JSFunctionSpec JSI_methods[]; \ - bool construct(JSContext* cx, uint argc, jsval* vp); \ - bool toString(JSContext* cx, uint argc, jsval* vp); \ + bool construct(JSContext* cx, uint argc, JS::Value* vp); \ + bool toString(JSContext* cx, uint argc, JS::Value* vp); \ } GUISTDTYPE(Size) Index: ps/trunk/source/gui/scripting/JSInterface_GUITypes.cpp =================================================================== --- ps/trunk/source/gui/scripting/JSInterface_GUITypes.cpp +++ ps/trunk/source/gui/scripting/JSInterface_GUITypes.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -35,7 +35,7 @@ JS_FS_END }; -bool JSI_GUISize::construct(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUISize::construct(JSContext* cx, uint argc, JS::Value* vp) { JSAutoRequest rq(cx); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -91,7 +91,7 @@ return CStr::FromDouble(per)+"%"+(pix == 0.0 ? CStr() : pix > 0.0 ? CStr("+")+CStr::FromDouble(pix) : CStr::FromDouble(pix)); } -bool JSI_GUISize::toString(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUISize::toString(JSContext* cx, uint argc, JS::Value* vp) { UNUSED2(argc); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -143,7 +143,7 @@ JS_FS_END }; -bool JSI_GUIColor::construct(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUIColor::construct(JSContext* cx, uint argc, JS::Value* vp) { JSAutoRequest rq(cx); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -173,7 +173,7 @@ return true; } -bool JSI_GUIColor::toString(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUIColor::toString(JSContext* cx, uint argc, JS::Value* vp) { UNUSED2(argc); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -212,7 +212,7 @@ JS_FS_END }; -bool JSI_GUIMouse::construct(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUIMouse::construct(JSContext* cx, uint argc, JS::Value* vp) { JSAutoRequest rq(cx); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -238,7 +238,7 @@ return true; } -bool JSI_GUIMouse::toString(JSContext* cx, uint argc, jsval* vp) +bool JSI_GUIMouse::toString(JSContext* cx, uint argc, JS::Value* vp) { UNUSED2(argc); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); Index: ps/trunk/source/gui/scripting/JSInterface_IGUIObject.h =================================================================== --- ps/trunk/source/gui/scripting/JSInterface_IGUIObject.h +++ ps/trunk/source/gui/scripting/JSInterface_IGUIObject.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -27,11 +27,11 @@ extern JSFunctionSpec JSI_methods[]; bool getProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp); bool setProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool UNUSED(strict), JS::MutableHandleValue vp); - bool construct(JSContext* cx, uint argc, jsval* vp); - bool toString(JSContext* cx, uint argc, jsval* vp); - bool focus(JSContext* cx, uint argc, jsval* vp); - bool blur(JSContext* cx, uint argc, jsval* vp); - bool getComputedSize(JSContext* cx, uint argc, jsval* vp); + bool construct(JSContext* cx, uint argc, JS::Value* vp); + bool toString(JSContext* cx, uint argc, JS::Value* vp); + bool focus(JSContext* cx, uint argc, JS::Value* vp); + bool blur(JSContext* cx, uint argc, JS::Value* vp); + bool getComputedSize(JSContext* cx, uint argc, JS::Value* vp); void init(ScriptInterface& scriptInterface); } Index: ps/trunk/source/gui/scripting/JSInterface_IGUIObject.cpp =================================================================== --- ps/trunk/source/gui/scripting/JSInterface_IGUIObject.cpp +++ ps/trunk/source/gui/scripting/JSInterface_IGUIObject.cpp @@ -587,7 +587,7 @@ } -bool JSI_IGUIObject::construct(JSContext* cx, uint argc, jsval* vp) +bool JSI_IGUIObject::construct(JSContext* cx, uint argc, JS::Value* vp) { JSAutoRequest rq(cx); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -614,7 +614,7 @@ scriptInterface.DefineCustomObjectType(&JSI_class, construct, 1, JSI_props, JSI_methods, NULL, NULL); } -bool JSI_IGUIObject::toString(JSContext* cx, uint UNUSED(argc), jsval* vp) +bool JSI_IGUIObject::toString(JSContext* cx, uint UNUSED(argc), JS::Value* vp) { JSAutoRequest rq(cx); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -632,7 +632,7 @@ return true; } -bool JSI_IGUIObject::focus(JSContext* cx, uint UNUSED(argc), jsval* vp) +bool JSI_IGUIObject::focus(JSContext* cx, uint UNUSED(argc), JS::Value* vp) { JSAutoRequest rq(cx); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -649,7 +649,7 @@ return true; } -bool JSI_IGUIObject::blur(JSContext* cx, uint UNUSED(argc), jsval* vp) +bool JSI_IGUIObject::blur(JSContext* cx, uint UNUSED(argc), JS::Value* vp) { JSAutoRequest rq(cx); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); @@ -666,7 +666,7 @@ return true; } -bool JSI_IGUIObject::getComputedSize(JSContext* cx, uint UNUSED(argc), jsval* vp) +bool JSI_IGUIObject::getComputedSize(JSContext* cx, uint UNUSED(argc), JS::Value* vp) { JSAutoRequest rq(cx); JS::CallReceiver rec = JS::CallReceiverFromVp(vp); Index: ps/trunk/source/scriptinterface/NativeWrapperDecls.h =================================================================== --- ps/trunk/source/scriptinterface/NativeWrapperDecls.h +++ ps/trunk/source/scriptinterface/NativeWrapperDecls.h @@ -70,21 +70,21 @@ // (Definition comes later, since it depends on some things we haven't defined yet) #define OVERLOADS(z, i, data) \ template \ - static bool call(JSContext* cx, uint argc, jsval* vp); + static bool call(JSContext* cx, uint argc, JS::Value* vp); BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~) #undef OVERLOADS // Similar, for class methods #define OVERLOADS(z, i, data) \ template \ - static bool callMethod(JSContext* cx, uint argc, jsval* vp); + static bool callMethod(JSContext* cx, uint argc, JS::Value* vp); BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~) #undef OVERLOADS // const methods #define OVERLOADS(z, i, data) \ template \ - static bool callMethodConst(JSContext* cx, uint argc, jsval* vp); + static bool callMethodConst(JSContext* cx, uint argc, JS::Value* vp); BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~) #undef OVERLOADS Index: ps/trunk/source/scriptinterface/NativeWrapperDefns.h =================================================================== --- ps/trunk/source/scriptinterface/NativeWrapperDefns.h +++ ps/trunk/source/scriptinterface/NativeWrapperDefns.h @@ -112,7 +112,7 @@ // JSFastNative-compatible function that wraps the function identified in the template argument list #define OVERLOADS(z, i, data) \ template \ - bool ScriptInterface::call(JSContext* cx, uint argc, jsval* vp) \ + bool ScriptInterface::call(JSContext* cx, uint argc, JS::Value* vp) \ { \ JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \ JSAutoRequest rq(cx); \ @@ -128,7 +128,7 @@ // Same idea but for methods #define OVERLOADS(z, i, data) \ template \ - bool ScriptInterface::callMethod(JSContext* cx, uint argc, jsval* vp) \ + bool ScriptInterface::callMethod(JSContext* cx, uint argc, JS::Value* vp) \ { \ JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \ JSAutoRequest rq(cx); \ @@ -148,7 +148,7 @@ // const methods #define OVERLOADS(z, i, data) \ template \ - bool ScriptInterface::callMethodConst(JSContext* cx, uint argc, jsval* vp) \ + bool ScriptInterface::callMethodConst(JSContext* cx, uint argc, JS::Value* vp) \ { \ JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \ JSAutoRequest rq(cx); \ Index: ps/trunk/source/scriptinterface/ScriptInterface.h =================================================================== --- ps/trunk/source/scriptinterface/ScriptInterface.h +++ ps/trunk/source/scriptinterface/ScriptInterface.h @@ -134,7 +134,7 @@ JSObject* CreateCustomObject(const std::string & typeName) const; void DefineCustomObjectType(JSClass *clasp, JSNative constructor, uint minArgs, JSPropertySpec *ps, JSFunctionSpec *fs, JSPropertySpec *static_ps, JSFunctionSpec *static_fs); - jsval GetGlobalObject(); + JS::Value GetGlobalObject(); JSClass* GetGlobalClass(); @@ -269,12 +269,12 @@ JS::Value CloneValueFromOtherContext(const ScriptInterface& otherContext, JS::HandleValue val) const; /** - * Convert a jsval to a C++ type. (This might trigger GC.) + * Convert a JS::Value to a C++ type. (This might trigger GC.) */ template static bool FromJSVal(JSContext* cx, const JS::HandleValue val, T& ret); /** - * Convert a C++ type to a jsval. (This might trigger GC. The return + * Convert a C++ type to a JS::Value. (This might trigger GC. The return * value must be rooted if you don't want it to be collected.) * NOTE: We are passing the JS::Value by reference instead of returning it by value. * The reason is a memory corruption problem that appears to be caused by a bug in Visual Studio. @@ -303,7 +303,7 @@ bool MathRandom(double& nbr); /** - * Structured clones are a way to serialize 'simple' JS values into a buffer + * Structured clones are a way to serialize 'simple' JS::Values into a buffer * that can safely be passed between contexts and runtimes and threads. * A StructuredClone can be stored and read multiple times if desired. * We wrap them in shared_ptr so memory management is automatic and Index: ps/trunk/source/scriptinterface/ScriptInterface.cpp =================================================================== --- ps/trunk/source/scriptinterface/ScriptInterface.cpp +++ ps/trunk/source/scriptinterface/ScriptInterface.cpp @@ -138,7 +138,7 @@ // Functions in the global namespace: -bool print(JSContext* cx, uint argc, jsval* vp) +bool print(JSContext* cx, uint argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); for (uint i = 0; i < args.length(); ++i) @@ -153,7 +153,7 @@ return true; } -bool logmsg(JSContext* cx, uint argc, jsval* vp) +bool logmsg(JSContext* cx, uint argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (args.length() < 1) @@ -170,7 +170,7 @@ return true; } -bool warn(JSContext* cx, uint argc, jsval* vp) +bool warn(JSContext* cx, uint argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (args.length() < 1) @@ -187,7 +187,7 @@ return true; } -bool error(JSContext* cx, uint argc, jsval* vp) +bool error(JSContext* cx, uint argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (args.length() < 1) @@ -204,7 +204,7 @@ return true; } -bool deepcopy(JSContext* cx, uint argc, jsval* vp) +bool deepcopy(JSContext* cx, uint argc, JS::Value* vp) { JSAutoRequest rq(cx); @@ -223,7 +223,7 @@ return true; } -bool ProfileStart(JSContext* cx, uint argc, jsval* vp) +bool ProfileStart(JSContext* cx, uint argc, JS::Value* vp) { const char* name = "(ProfileStart)"; @@ -252,7 +252,7 @@ return true; } -bool ProfileStop(JSContext* UNUSED(cx), uint UNUSED(argc), jsval* vp) +bool ProfileStop(JSContext* UNUSED(cx), uint UNUSED(argc), JS::Value* vp) { JS::CallReceiver rec = JS::CallReceiverFromVp(vp); if (CProfileManager::IsInitialised() && ThreadUtil::IsMainThread()) @@ -264,7 +264,7 @@ return true; } -bool ProfileAttribute(JSContext* cx, uint argc, jsval* vp) +bool ProfileAttribute(JSContext* cx, uint argc, JS::Value* vp) { const char* name = "(ProfileAttribute)"; @@ -308,7 +308,7 @@ } } -bool Math_random(JSContext* cx, uint UNUSED(argc), jsval* vp) +bool Math_random(JSContext* cx, uint UNUSED(argc), JS::Value* vp) { JS::CallReceiver rec = JS::CallReceiverFromVp(vp); double r; @@ -580,7 +580,7 @@ return ok; } -jsval ScriptInterface::GetGlobalObject() +JS::Value ScriptInterface::GetGlobalObject() { JSAutoRequest rq(m->m_cx); return JS::ObjectValue(*JS::CurrentGlobalOrNull(m->m_cx)); Index: ps/trunk/source/scriptinterface/tests/test_ScriptConversions.h =================================================================== --- ps/trunk/source/scriptinterface/tests/test_ScriptConversions.h +++ ps/trunk/source/scriptinterface/tests/test_ScriptConversions.h @@ -135,7 +135,7 @@ roundtrip(1073741823, "1073741823"); // JSVAL_INT_MAX { - TestLogger log; // swallow warnings about values not being stored as INT jsvals + TestLogger log; // swallow warnings about values not being stored as integer JS::Values roundtrip(1073741824, "1073741824"); // JSVAL_INT_MAX+1 roundtrip(-1073741825, "-1073741825"); // JSVAL_INT_MIN-1 roundtrip(1073741824, "1073741824"); // JSVAL_INT_MAX+1 Index: ps/trunk/source/simulation2/components/CCmpAIManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpAIManager.cpp +++ ps/trunk/source/simulation2/components/CCmpAIManager.cpp @@ -64,7 +64,7 @@ * will block until it's actually completed, so the rest of the engine should avoid * reading it for as long as possible. * - * JS values are passed between the game and AI threads using ScriptInterface::StructuredClone. + * JS::Values are passed between the game and AI threads using ScriptInterface::StructuredClone. * * TODO: actually the thread isn't implemented yet, because performance hasn't been * sufficiently problematic to justify the complexity yet, but the CAIWorker interface Index: ps/trunk/source/simulation2/docs/SimulationDocs.h =================================================================== --- ps/trunk/source/simulation2/docs/SimulationDocs.h +++ ps/trunk/source/simulation2/docs/SimulationDocs.h @@ -110,7 +110,7 @@ For methods exposed to scripts like this, the arguments should be simple types or const references. Check scriptinterface/NativeWrapperDefns.h for which simple types are pass-by-value. -The arguments and return types will be automatically converted between C++ and JS values. +The arguments and return types will be automatically converted between C++ and JS::Values. To do this, @c ToJSVal and @c FromJSVal must be defined (if they haven't already been defined for another method), as described below. @@ -135,7 +135,7 @@ (They could go in different files if that turns out to be cleaner - it doesn't matter where they're defined as long as the linker finds them). -To convert from a C++ type @c T to a JS value, define: +To convert from a C++ type @c T to a JS::Value, define: @code template<> void ScriptInterface::ToJSVal(JSContext* cx, JS::MutableHandleValue ret, const T& val) @@ -149,7 +149,7 @@ On error, you should execute @c ret.setUndefined() and probably report an error message somehow. Be careful about JS garbage collection (don't let it collect the objects you're constructing before you return them). -To convert from a JS value to a C++ type @c T, define: +To convert from a JS::Value to a C++ type @c T, define: @code template<> bool ScriptInterface::FromJSVal(JSContext* cx, JS::HandleValue v, T& out) Index: ps/trunk/source/simulation2/serialization/DebugSerializer.h =================================================================== --- ps/trunk/source/simulation2/serialization/DebugSerializer.h +++ ps/trunk/source/simulation2/serialization/DebugSerializer.h @@ -28,7 +28,7 @@ NONCOPYABLE(CDebugSerializer); public: /** - * @param scriptInterface Script interface corresponding to any jsvals passed to ScriptVal() + * @param scriptInterface Script interface corresponding to any JS::Value passed to ScriptVal() * @param stream Stream to receive UTF-8 encoded output * @param includeDebugInfo If true then additional non-deterministic data will be included in the output */ Index: ps/trunk/source/simulation2/serialization/IDeserializer.h =================================================================== --- ps/trunk/source/simulation2/serialization/IDeserializer.h +++ ps/trunk/source/simulation2/serialization/IDeserializer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -55,7 +55,7 @@ virtual void StringASCII(const char* name, std::string& out, uint32_t minlength, uint32_t maxlength); virtual void String(const char* name, std::wstring& out, uint32_t minlength, uint32_t maxlength); - /// Deserialize a jsval, replacing 'out' + /// Deserialize a JS::Value, replacing 'out' virtual void ScriptVal(const char* name, JS::MutableHandleValue out) = 0; /// Deserialize an object value, appending properties to object 'objVal' Index: ps/trunk/source/simulation2/serialization/StdDeserializer.h =================================================================== --- ps/trunk/source/simulation2/serialization/StdDeserializer.h +++ ps/trunk/source/simulation2/serialization/StdDeserializer.h @@ -48,7 +48,7 @@ virtual void Get(const char* name, u8* data, size_t len); private: - jsval ReadScriptVal(const char* name, JS::HandleObject appendParent); + JS::Value ReadScriptVal(const char* name, JS::HandleObject appendParent); void ReadStringLatin1(const char* name, std::vector& str); void ReadStringUTF16(const char* name, utf16string& str); Index: ps/trunk/source/simulation2/serialization/StdDeserializer.cpp =================================================================== --- ps/trunk/source/simulation2/serialization/StdDeserializer.cpp +++ ps/trunk/source/simulation2/serialization/StdDeserializer.cpp @@ -122,7 +122,7 @@ //////////////////////////////////////////////////////////////// -jsval CStdDeserializer::ReadScriptVal(const char* UNUSED(name), JS::HandleObject appendParent) +JS::Value CStdDeserializer::ReadScriptVal(const char* UNUSED(name), JS::HandleObject appendParent) { JSContext* cx = m_ScriptInterface.GetContext(); JSAutoRequest rq(cx); Index: ps/trunk/source/simulation2/system/Entity.h =================================================================== --- ps/trunk/source/simulation2/system/Entity.h +++ ps/trunk/source/simulation2/system/Entity.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2017 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -48,7 +48,7 @@ // aren't retained in saved games, etc) // The distinction is encoded in the entity ID, so that they're easily distinguished. // -// We want all entity_id_ts to fit in jsval ints, i.e. 1-2^30 .. 2^30-1 (inclusive) +// We want all entity_id_ts to fit in an integer JS::Value, i.e. 1-2^30 .. 2^30-1 (inclusive) // We want them to be unsigned ints (actually it shouldn't matter but unsigned seems simpler) // We want 1 tag bit // So we have 1 JS-reserved bit, 1 unused sign bit, 1 local tag bit, 29 counter bits Index: ps/trunk/source/simulation2/system/ParamNode.h =================================================================== --- ps/trunk/source/simulation2/system/ParamNode.h +++ ps/trunk/source/simulation2/system/ParamNode.h @@ -186,7 +186,7 @@ */ const CParamNode& GetChild(const char* name) const; // (Children are returned as const in order to allow future optimisations, where we assume - // a node is always modified explicitly and not indirectly via its children, e.g. to cache jsvals) + // a node is always modified explicitly and not indirectly via its children, e.g. to cache JS::Values) /** * Returns true if this is a valid CParamNode, false if it represents a non-existent node @@ -240,8 +240,8 @@ void ToXML(std::wostream& strm) const; /** - * Returns a jsval representation of this node and its children. - * If @p cacheValue is true, then the same jsval will be returned each time + * Returns a JS::Value representation of this node and its children. + * If @p cacheValue is true, then the same JS::Value will be returned each time * this is called (regardless of whether you passed the same @p cx - be careful * to only use the cache in one context). * When caching, the lifetime of @p cx must be longer than the lifetime of this node. Index: ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp =================================================================== --- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp +++ ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp @@ -505,7 +505,7 @@ wxString helpData; helpFile.ReadAll(&helpData); AtObj data = AtlasObject::LoadFromJSON(std::string(helpData)); - #define ADD_HELP_ITEM(id) \ +#define ADD_HELP_ITEM(id) \ do { \ if (!data[#id].hasContent()) \ break; \ @@ -519,7 +519,7 @@ } while (0) ADD_HELP_ITEM(Manual); ADD_HELP_ITEM(ReportBug); - #undef ADD_HELP_ITEM +#undef ADD_HELP_ITEM } else wxLogError(_("'%ls' does not exist"), helpPath.GetFullPath().c_str());