From 607ce603f280a101f869adf591fe1032353636bd Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Wed, 13 Jun 2018 17:47:39 +0000 Subject: [Zucchini] Introduce bit operations into algorithm.h. This CL makes algorithm.h in Chromium match trunk's version. Details: - Add {GetBit(), GetSignedBits(), GetUnsignedBits(), SignedFit()}. These will be used by the ARM Disassembler. - Rename ceil() to AlignCeil() to avoid confusion with ceil() from . - Extensive unit tests. - Minor enum type fix in disassembler_win32.h (offset_t should not be used to represent lengths). Change-Id: Icf9ce254bce2e5a3e9c286dbb5a704aeacd8bc35 Reviewed-on: https://chromium-review.googlesource.com/1098556 Reviewed-by: Samuel Huang Reviewed-by: Greg Thompson Commit-Queue: Samuel Huang Cr-Commit-Position: refs/heads/master@{#566893} NOKEYCHECK=True GitOrigin-RevId: 2c50b5af45fa271f06317419f6b8bfc5f4a80be0 --- disassembler_win32.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'disassembler_win32.h') diff --git a/disassembler_win32.h b/disassembler_win32.h index 8e410ee..29033ce 100644 --- a/disassembler_win32.h +++ b/disassembler_win32.h @@ -30,7 +30,7 @@ struct Win32X86Traits { static constexpr ExecutableType kExeType = kExeTypeWin32X86; enum : uint16_t { kMagic = 0x10B }; enum : uint16_t { kRelocType = 3 }; - enum : offset_t { kVAWidth = 4 }; + enum : uint32_t { kVAWidth = 4 }; static const char kExeTypeString[]; using ImageOptionalHeader = pe::ImageOptionalHeader; @@ -43,7 +43,7 @@ struct Win32X64Traits { static constexpr ExecutableType kExeType = kExeTypeWin32X64; enum : uint16_t { kMagic = 0x20B }; enum : uint16_t { kRelocType = 10 }; - enum : offset_t { kVAWidth = 8 }; + enum : uint32_t { kVAWidth = 8 }; static const char kExeTypeString[]; using ImageOptionalHeader = pe::ImageOptionalHeader64; -- cgit v1.2.3