From 69b45e4d66e38e2668decb0eab87e6471730fe1f Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 11 Jun 2016 13:10:38 -0400 Subject: [PATCH] Fixed documentation SNAFUs and typos. Praying for stack_get speed... --- docs/source/api/state.rst | 4 ++-- sol/stack_get.hpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/source/api/state.rst b/docs/source/api/state.rst index 27e8d210..00f4abde 100644 --- a/docs/source/api/state.rst +++ b/docs/source/api/state.rst @@ -56,7 +56,7 @@ This function takes a number of :ref:`sol::lib` as arguments and opens void script(const std::string& code); void script_file(const std::string& filename); -These functions run the desired blob of either code that is in a string, or code that comes from a filename, on the ``lua_State*``. It will not run isolated: any scripts or code run will affect code in other states as well: code ran in this fashion is not isolated. +These functions run the desired blob of either code that is in a string, or code that comes from a filename, on the ``lua_State*``. It will not run isolated: any scripts or code run will affect code in the ``lua_State*`` the object uses as well. Code ran in this fashion is not isolated. If you need isolation, consider creating a new state or traditional Lua sandboxing techniques. .. code-block:: cpp :caption: function: load / load_file @@ -65,7 +65,7 @@ These functions run the desired blob of either code that is in a string, or code sol::load_result load(const std::string& code); sol::load_result load_file(const std::string& filename); -These functions *load* the desired blob of either code that is in a string, or code that comes from a filename, on the ``lua_State*``. It will not run: it returns a ``load_result`` proxy that can be called, turned into a `sol::function`,. or similar, will run the loaded code. +These functions *load* the desired blob of either code that is in a string, or code that comes from a filename, on the ``lua_State*``. It will not run: it returns a ``load_result`` proxy that can be called to actually run the code, turned into a ``sol::function``, a ``sol::protected_function``, or some other abstraction. If it is called, it will run on the object's current ``lua_State*``: it is not isolated. If you need isolation, consider creating a new state or traditional Lua sandboxing techniques. .. code-block:: cpp :caption: function: global table / registry table diff --git a/sol/stack_get.hpp b/sol/stack_get.hpp index 72e4645b..a31bc77b 100644 --- a/sol/stack_get.hpp +++ b/sol/stack_get.hpp @@ -289,7 +289,6 @@ struct getter { } static T* get_no_nil_from(lua_State* L, void* udata, int index = -1) { -#if 0 #ifndef SOL_NO_EXCEPTIONS if (luaL_getmetafield(L, index, &detail::base_class_check_key()[0]) != 0) { void* basecastdata = lua_touserdata(L, -1); @@ -316,7 +315,6 @@ struct getter { lua_pop(L, 1); } #endif // No Runtime Type Information || Exceptions -#endif // Speed test T* obj = static_cast(udata); return obj; }