From 279a34237bcabec9c6802397efb87e33a0517720 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 1 May 2020 01:53:53 +0200 Subject: [PATCH] I don't see any reason to get a pointer, I want a ref instead --- include/wrenpp/def_configuration.hpp | 2 +- include/wrenpp/vm.hpp | 2 +- src/main.cpp | 4 ++-- src/wren/dynafunc_maker.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wrenpp/def_configuration.hpp b/include/wrenpp/def_configuration.hpp index dd90b58..13dd488 100644 --- a/include/wrenpp/def_configuration.hpp +++ b/include/wrenpp/def_configuration.hpp @@ -23,7 +23,7 @@ namespace wren { class VM; - typedef void(*foreign_method_t)(VM*); + typedef void(*foreign_method_t)(VM&); class DefConfiguration : public Configuration { public: diff --git a/include/wrenpp/vm.hpp b/include/wrenpp/vm.hpp index 533c7fd..f430e3c 100644 --- a/include/wrenpp/vm.hpp +++ b/include/wrenpp/vm.hpp @@ -32,7 +32,7 @@ namespace wren { class VM; class DynafuncMaker; - typedef void(*foreign_method_t)(VM*); + typedef void(*foreign_method_t)(VM&); typedef void(*finalizer_t)(void*); struct foreign_class_t { diff --git a/src/main.cpp b/src/main.cpp index 84931c4..8bf637f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,8 +55,8 @@ const char* raw_fetch_env (const char* name) noexcept { return val_ptr; } -void user_get_env (wren::VM* vm) { - set(*vm, 0, raw_fetch_env(wren::get(*vm, 1))); +void user_get_env (wren::VM& vm) { + set(vm, 0, raw_fetch_env(wren::get(vm, 1))); } class MyConfig : public wren::DefConfiguration { diff --git a/src/wren/dynafunc_maker.hpp b/src/wren/dynafunc_maker.hpp index a8a6e6b..b32a0bf 100644 --- a/src/wren/dynafunc_maker.hpp +++ b/src/wren/dynafunc_maker.hpp @@ -21,7 +21,7 @@ namespace wren { class VM; - typedef void(*foreign_method_t)(VM*); + typedef void(*foreign_method_t)(VM&); class DynafuncMaker { public: