Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. CRC32 cleaning #189

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions ebml/EbmlCrc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ DECLARE_EBML_BINARY(EbmlCrc32)
void ResetCRC();
void UpdateByte(binary b);

static const std::array<std::uint32_t, 256> m_tab;
std::uint32_t m_crc;
std::uint32_t m_crc_final{0};

Expand All @@ -71,13 +70,7 @@ DECLARE_EBML_BINARY(EbmlCrc32)
template <class T>
inline unsigned int GetAlignment(T * /* dummy */=nullptr) // VC60 workaround
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
return __alignof(T);
#elif defined(__GNUC__)
return __alignof__(T);
#else
return sizeof(T);
#endif
return alignof(T);
}

template <class T>
Expand Down
2 changes: 1 addition & 1 deletion src/EbmlCrc32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace libebml {

DEFINE_EBML_CLASS_GLOBAL(EbmlCrc32, 0xBF, 1, "EBMLCrc32\0ratamadabapa")

constexpr std::array<std::uint32_t, 256> EbmlCrc32::m_tab {
static constexpr std::array<std::uint32_t, 256> m_tab {
#ifdef WORDS_BIGENDIAN
0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L,
0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L,
Expand Down