From abc72eb94ee5dd245cb50dd47da94e875f244b20 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 19 Feb 2025 23:22:25 -0500 Subject: [SharedCache] Remove some dead code and misc lints --- view/sharedcache/core/SharedCache.cpp | 13 +++---------- view/sharedcache/ui/SharedCacheUINotifications.cpp | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'view/sharedcache') diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index 5860be5d..6fe0dc24 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -1449,7 +1449,7 @@ SharedCache::SharedCache(BinaryNinja::Ref dscView) : return; } - sharedCacheReferences++; + ++sharedCacheReferences; INIT_SHAREDCACHE_API_OBJECT() if (!DeserializeFromRawView(lock)) { @@ -1494,7 +1494,7 @@ SharedCache::SharedCache(BinaryNinja::Ref dscView) : } SharedCache::~SharedCache() { - sharedCacheReferences--; + --sharedCacheReferences; } SharedCache* SharedCache::GetFromDSCView(BinaryNinja::Ref dscView) @@ -3636,19 +3636,12 @@ std::string SharedCacheMetadata::InstallNameForImageBaseAddress(uint64_t baseAdd } // namespace SharedCacheCore -namespace { - -[[maybe_unused]] DSCViewType* g_dscViewType; - -} - void InitDSCViewType() { MMappedFileAccessor::InitialVMSetup(); std::atexit(VMShutdown); static DSCViewType type; BinaryViewType::Register(&type); - g_dscViewType = &type; } extern "C" @@ -3688,7 +3681,7 @@ extern "C" bool BNDSCViewLoadImageWithInstallName(BNSharedCache* cache, char* name, bool skipObjC) { std::string imageName = std::string(name); - // FIXME !!!!!!!! BNFreeString(name); + BNFreeString(name); if (cache->object) return cache->object->LoadImageWithInstallName(imageName, skipObjC); diff --git a/view/sharedcache/ui/SharedCacheUINotifications.cpp b/view/sharedcache/ui/SharedCacheUINotifications.cpp index 6979bac3..9d5893f9 100644 --- a/view/sharedcache/ui/SharedCacheUINotifications.cpp +++ b/view/sharedcache/ui/SharedCacheUINotifications.cpp @@ -48,7 +48,6 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q if (!ah->isBoundAction("Load Image by Name")) { ah->bindAction("Load Image by Name", UIAction([view = view](const UIActionContext& ctx) { - Ref cache = new SharedCacheAPI::SharedCache(view); DisplayDSCPicker(ctx.context, view); })); ah->bindAction("Load Section by Address", UIAction([view = view](const UIActionContext& ctx) { -- cgit v1.3.1