From c3e5d62bf6fb5932ba0b98fc710e849a09701e45 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 8 Nov 2015 13:51:22 -0800 Subject: [PATCH] Update to the latest AMTL: remove PassRef. --- core/GameHooks.cpp | 4 ++-- core/GameHooks.h | 4 ++-- core/logic/ShareSys.cpp | 18 +++++++++--------- core/logic/ShareSys.h | 6 +++--- core/logic_bridge.cpp | 4 ++-- core/provider.h | 4 ++-- public/amtl | 2 +- sourcepawn | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/core/GameHooks.cpp b/core/GameHooks.cpp index e11f2d9f..c462adce 100644 --- a/core/GameHooks.cpp +++ b/core/GameHooks.cpp @@ -138,13 +138,13 @@ void GameHooks::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPla } #endif -ke::PassRef +ke::RefPtr GameHooks::AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback) { return new CommandHook(cmd, callback, false); } -ke::PassRef +ke::RefPtr GameHooks::AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback) { return new CommandHook(cmd, callback, true); diff --git a/core/GameHooks.h b/core/GameHooks.h index 1b9dae6c..58a92d15 100644 --- a/core/GameHooks.h +++ b/core/GameHooks.h @@ -93,8 +93,8 @@ public: } public: - ke::PassRef AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); - ke::PassRef AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); + ke::RefPtr AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); + ke::RefPtr AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); int CommandClient() const { return last_command_client_; diff --git a/core/logic/ShareSys.cpp b/core/logic/ShareSys.cpp index 1d38ebcb..1786ae7c 100644 --- a/core/logic/ShareSys.cpp +++ b/core/logic/ShareSys.cpp @@ -261,11 +261,11 @@ void ShareSystem::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *nat assert(false); } -PassRef ShareSystem::FindNative(const char *name) +RefPtr ShareSystem::FindNative(const char *name) { NativeCache::Result r = m_NtvCache.find(name); if (!r.found()) - return NULL; + return nullptr; return *r; } @@ -368,15 +368,15 @@ void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *native nullptr); } -PassRef ShareSystem::AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv) +AlreadyRefed ShareSystem::AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv) { NativeCache::Insert i = m_NtvCache.findForAdd(ntv->name); if (i.found()) - return NULL; + return nullptr; RefPtr entry = new Native(pOwner, ntv); m_NtvCache.insert(ntv->name, entry); - return entry; + return entry.forget(); } FakeNative::~FakeNative() @@ -400,24 +400,24 @@ void ShareSystem::ClearNativeFromCache(CNativeOwner *pOwner, const char *name) m_NtvCache.remove(r); } -PassRef ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func) +AlreadyRefed ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func) { RefPtr entry(FindNative(name)); if (entry) - return NULL; + return nullptr; AutoPtr fake(new FakeNative(name, pFunc)); fake->gate = g_pSourcePawn2->CreateFakeNative(func, fake); if (!fake->gate) - return NULL; + return nullptr; CNativeOwner *owner = g_PluginSys.GetPluginByCtx(fake->ctx->GetContext()); entry = new Native(owner, fake.take()); m_NtvCache.insert(name, entry); - return entry; + return entry.forget(); } void ShareSystem::AddCapabilityProvider(IExtension *myself, IFeatureProvider *provider, diff --git a/core/logic/ShareSys.h b/core/logic/ShareSys.h index 11c7f3b1..c6d1282c 100644 --- a/core/logic/ShareSys.h +++ b/core/logic/ShareSys.h @@ -122,10 +122,10 @@ public: void BeginBindingFor(CPlugin *pPlugin); void BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly); void BindNativeToPlugin(CPlugin *pPlugin, const ke::RefPtr &pEntry); - ke::PassRef AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func); - ke::PassRef FindNative(const char *name); + ke::AlreadyRefed AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func); + ke::RefPtr FindNative(const char *name); private: - ke::PassRef AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv); + ke::AlreadyRefed AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv); void ClearNativeFromCache(CNativeOwner *pOwner, const char *name); void BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *ntv, uint32_t index, const ke::RefPtr &pEntry); private: diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 6689fd9f..310bd11b 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -750,13 +750,13 @@ bool CoreProviderImpl::LoadBridge(char *error, size_t maxlength) return true; } -ke::PassRef +ke::RefPtr CoreProviderImpl::AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback) { return hooks_.AddCommandHook(cmd, callback); } -ke::PassRef +ke::RefPtr CoreProviderImpl::AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback) { return hooks_.AddPostCommandHook(cmd, callback); diff --git a/core/provider.h b/core/provider.h index 0152eda1..ade45f00 100644 --- a/core/provider.h +++ b/core/provider.h @@ -67,8 +67,8 @@ public: bool IsClientConVarQueryingSupported() override; void DefineCommand(const char *cmd, const char *help, const SourceMod::CommandFunc &callback) override; - ke::PassRef AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); - ke::PassRef AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); + ke::RefPtr AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); + ke::RefPtr AddPostCommandHook(ConCommand *cmd, const CommandHook::Callback &callback); int CommandClient() const { return hooks_.CommandClient(); diff --git a/public/amtl b/public/amtl index 50de9b83..52205706 160000 --- a/public/amtl +++ b/public/amtl @@ -1 +1 @@ -Subproject commit 50de9b831e1691cb513b6e18a49cdf5b4d73c5cb +Subproject commit 522057068a520d75acca00f6682f4d06d1ae18a4 diff --git a/sourcepawn b/sourcepawn index 028d9335..dde42ef1 160000 --- a/sourcepawn +++ b/sourcepawn @@ -1 +1 @@ -Subproject commit 028d93357d452906aac2a5bbfb3284682b5b1173 +Subproject commit dde42ef136c59ae125169a850298b1383e53afb6