From 27e812461fd59d7f1798e268e1b3f7191b599a3c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 24 Sep 2016 16:45:04 -0700 Subject: [PATCH] Update to the latest SourcePawn and AMTL. --- core/ConsoleDetours.cpp | 10 +++++----- core/logic/Database.cpp | 4 ++-- core/logic/PluginSys.cpp | 6 +++--- core/logic/smn_adt_trie.cpp | 4 ++-- core/logic/smn_database.cpp | 12 ++++++------ public/amtl | 2 +- sourcepawn | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/ConsoleDetours.cpp b/core/ConsoleDetours.cpp index 4bed29d4..0d49d550 100644 --- a/core/ConsoleDetours.cpp +++ b/core/ConsoleDetours.cpp @@ -313,13 +313,13 @@ bool ConsoleDetours::AddListener(IPluginFunction *fun, const char *command) } else { - ke::AutoArray str(UTIL_ToLowerCase(command)); + ke::AutoPtr str(UTIL_ToLowerCase(command)); IChangeableForward *forward; - if (!m_Listeners.retrieve(str, &forward)) + if (!m_Listeners.retrieve(str.get(), &forward)) { forward = forwardsys->CreateForwardEx(NULL, ET_Hook, 3, NULL, Param_Cell, Param_String, Param_Cell); - m_Listeners.insert(str, forward); + m_Listeners.insert(str.get(), forward); } forward->AddFunction(fun); } @@ -335,9 +335,9 @@ bool ConsoleDetours::RemoveListener(IPluginFunction *fun, const char *command) } else { - ke::AutoArray str(UTIL_ToLowerCase(command)); + ke::AutoPtr str(UTIL_ToLowerCase(command)); IChangeableForward *forward; - if (!m_Listeners.retrieve(str, &forward)) + if (!m_Listeners.retrieve(str.get(), &forward)) return false; return forward->RemoveFunction(fun); } diff --git a/core/logic/Database.cpp b/core/logic/Database.cpp index 3ef678db..2f26717a 100644 --- a/core/logic/Database.cpp +++ b/core/logic/Database.cpp @@ -520,7 +520,7 @@ void DBManager::KillWorkerThread() m_QueueEvent.Notify(); } m_Worker->Join(); - m_Worker = NULL; + m_Worker = nullptr; s_OneTimeThreaderErrorMsg = false; m_Terminate = false; } @@ -547,7 +547,7 @@ bool DBManager::AddToThreadQueue(IDBThreadOperation *op, PrioQueueLevel prio) logger->LogError("[SM] Unable to create db threader (error unknown)"); s_OneTimeThreaderErrorMsg = true; } - m_Worker = NULL; + m_Worker = nullptr; return false; } } diff --git a/core/logic/PluginSys.cpp b/core/logic/PluginSys.cpp index 339bac04..d4ae3d59 100644 --- a/core/logic/PluginSys.cpp +++ b/core/logic/PluginSys.cpp @@ -251,7 +251,7 @@ void CPlugin::EvictWithError(PluginStatus status, const char *error_fmt, ...) ke::SafeVsprintf(m_errormsg, sizeof(m_errormsg), error_fmt, ap); va_end(ap); - if (m_pRuntime != NULL) + if (m_pRuntime) { m_pRuntime->SetPauseState(true); } @@ -499,7 +499,7 @@ bool CPlugin::TryCompile() IPluginContext *CPlugin::GetBaseContext() { - if (m_pRuntime == NULL) + if (!m_pRuntime) { return NULL; } @@ -558,7 +558,7 @@ bool CPlugin::IsSilentlyFailed() bool CPlugin::IsDebugging() { - if (m_pRuntime == NULL) + if (!m_pRuntime) { return false; } diff --git a/core/logic/smn_adt_trie.cpp b/core/logic/smn_adt_trie.cpp index fbee7893..de2197d5 100644 --- a/core/logic/smn_adt_trie.cpp +++ b/core/logic/smn_adt_trie.cpp @@ -181,7 +181,7 @@ struct TrieSnapshot } size_t length; - ke::AutoArray keys; + ke::AutoPtr keys; BaseStringTable strings; }; @@ -556,7 +556,7 @@ static cell_t CreateTrieSnapshot(IPluginContext *pContext, const cell_t *params) TrieSnapshot *snapshot = new TrieSnapshot; snapshot->length = pTrie->map.elements(); - snapshot->keys = new int[snapshot->length]; + snapshot->keys = ke::MakeUnique(snapshot->length); size_t i = 0; for (StringHashMap::iterator iter = pTrie->map.iter(); !iter.empty(); iter.next(), i++) snapshot->keys[i] = snapshot->strings.AddString(iter->key.chars(), iter->key.length()); diff --git a/core/logic/smn_database.cpp b/core/logic/smn_database.cpp index 735d5210..e7865e94 100644 --- a/core/logic/smn_database.cpp +++ b/core/logic/smn_database.cpp @@ -1634,8 +1634,8 @@ private: assert(results_.length() == txn_->entries.length()); - ke::AutoArray data(new cell_t[results_.length()]); - ke::AutoArray handles(new cell_t[results_.length()]); + ke::AutoPtr data = ke::MakeUnique(results_.length()); + ke::AutoPtr handles = ke::MakeUnique(results_.length()); for (size_t i = 0; i < results_.length(); i++) { CombinedQuery *obj = new CombinedQuery(results_[i], db_); @@ -1662,8 +1662,8 @@ private: success_->PushCell(dbh); success_->PushCell(data_); success_->PushCell(txn_->entries.length()); - success_->PushArray(handles, results_.length()); - success_->PushArray(data, results_.length()); + success_->PushArray(handles.get(), results_.length()); + success_->PushArray(data.get(), results_.length()); success_->Execute(NULL); // Cleanup. Note we clear results_, since freeing their handles will @@ -1692,7 +1692,7 @@ public: { HandleSecurity sec(ident_, g_pCoreIdent); - ke::AutoArray data(new cell_t[results_.length()]); + ke::AutoPtr data = ke::MakeUnique(results_.length()); for (size_t i = 0; i < txn_->entries.length(); i++) data[i] = txn_->entries[i].data; @@ -1708,7 +1708,7 @@ public: failure_->PushCell(txn_->entries.length()); failure_->PushString(error_.chars()); failure_->PushCell(failIndex_); - failure_->PushArray(data, txn_->entries.length()); + failure_->PushArray(data.get(), txn_->entries.length()); failure_->Execute(NULL); handlesys->FreeHandle(dbh, &sec); diff --git a/public/amtl b/public/amtl index c0a83b78..e3a888ea 160000 --- a/public/amtl +++ b/public/amtl @@ -1 +1 @@ -Subproject commit c0a83b780054b57f145d51f156551e108b93845c +Subproject commit e3a888eab7ee73e7fbff9f3e2f0529a87b284d39 diff --git a/sourcepawn b/sourcepawn index 8b39fef5..836bb7a6 160000 --- a/sourcepawn +++ b/sourcepawn @@ -1 +1 @@ -Subproject commit 8b39fef524a695f7c6fab743cdd531dfeaeff936 +Subproject commit 836bb7a6da1f88b3c795f11e88306c724ccef5dc