Skip to content

Commit c5edc00

Browse files
committed
[SharedCache] Fix misc compiler warnings
These are from clang so there are still a bunch of warnings on GCC and MSVC
1 parent acea6d4 commit c5edc00

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

view/sharedcache/core/DSCView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class DSCView : public BinaryNinja::BinaryView {
12-
bool m_parseOnly;
12+
[[maybe_unused]] bool m_parseOnly;
1313
public:
1414

1515
DSCView(const std::string &typeName, BinaryView *data, bool parseOnly = false);

view/sharedcache/core/ObjC.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ void DSCObjCProcessor::LoadCategories(VMReader* reader, Ref<Section> classPtrSec
549549
if (size == 0)
550550
return;
551551
auto ptrSize = m_data->GetAddressSize();
552-
auto ptrCount = size / m_data->GetAddressSize();
553552

554553
auto classPtrSectionStart = classPtrSection->GetStart();
555554
auto classPtrSectionEnd = classPtrSection->GetEnd();

view/sharedcache/core/SharedCache.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address)
15391539
}
15401540

15411541
SharedCacheMachOHeader targetHeader;
1542-
CacheImage* targetImage = nullptr;
15431542
MemoryRegion* targetSegment = nullptr;
15441543

15451544
for (auto& image : MutableState().images)
@@ -1549,7 +1548,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address)
15491548
if (region.start <= address && region.start + region.size > address)
15501549
{
15511550
targetHeader = MutableState().headers[image.headerLocation];
1552-
targetImage = &image;
15531551
targetSegment = &region;
15541552
break;
15551553
}
@@ -2532,7 +2530,6 @@ void SharedCache::InitializeHeader(
25322530
vm->MappingAtAddress(header.linkeditSegment.vmaddr)
25332531
.first.fileAccessor->lock()
25342532
->ReadBuffer(header.functionStarts.funcoff, header.functionStarts.funcsize);
2535-
size_t i = 0;
25362533
uint64_t curfunc = header.textBase;
25372534
uint64_t curOffset;
25382535

view/sharedcache/core/SharedCache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,13 @@ namespace SharedCacheCore {
578578
bool m_metadataValid = false;
579579

580580
/* VIEWSTATE END -- NOTHING PAST THIS IS SERIALIZED */
581-
std::shared_ptr<ViewSpecificState> m_viewSpecificState;
582581

583582
/* API VIEW START */
584583
BinaryNinja::Ref<BinaryNinja::BinaryView> m_dscView;
585584
/* API VIEW END */
586585

586+
std::shared_ptr<ViewSpecificState> m_viewSpecificState;
587+
587588
private:
588589
void PerformInitialLoad();
589590
void DeserializeFromRawView();

0 commit comments

Comments
 (0)