From 52cadf0d2dc6728886e1f35fca7331e2d2f107b4 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Mon, 3 Sep 2018 22:09:08 +0000 Subject: [PATCH] [NFC] Fixed enum constant in boolean context error Summary: /home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:656:59: warning: enum constant in boolean context [-Wint-in-bool-context] if (mh.magic == llvm::MachO::MH_CIGAM || llvm::MachO::MH_MAGIC) ^~~~~~~~ /home/xbolva00/LLVM/llvm/tools/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:658:62: warning: enum constant in boolean context [-Wint-in-bool-context] if (mh.magic == llvm::MachO::MH_CIGAM_64 || llvm::MachO::MH_MAGIC_64) Reviewers: JDevlieghere, teemperor Reviewed By: teemperor Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D51600 llvm-svn: 341340 --- .../DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 00dd1df..404226b 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -652,11 +652,12 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule( llvm::MachO::mach_header mh; size_t size_to_read = 512; - if (ReadMachHeader (m_load_address, process, mh)) { - if (mh.magic == llvm::MachO::MH_CIGAM || llvm::MachO::MH_MAGIC) - size_to_read = sizeof (llvm::MachO::mach_header) + mh.sizeofcmds; - if (mh.magic == llvm::MachO::MH_CIGAM_64 || llvm::MachO::MH_MAGIC_64) - size_to_read = sizeof (llvm::MachO::mach_header_64) + mh.sizeofcmds; + if (ReadMachHeader(m_load_address, process, mh)) { + if (mh.magic == llvm::MachO::MH_CIGAM || mh.magic == llvm::MachO::MH_MAGIC) + size_to_read = sizeof(llvm::MachO::mach_header) + mh.sizeofcmds; + if (mh.magic == llvm::MachO::MH_CIGAM_64 || + mh.magic == llvm::MachO::MH_MAGIC_64) + size_to_read = sizeof(llvm::MachO::mach_header_64) + mh.sizeofcmds; } ModuleSP memory_module_sp = -- 2.7.4