diff options
author | W. Felix Handte <w@felixhandte.com> | 2018-02-02 16:45:59 (GMT) |
---|---|---|
committer | W. Felix Handte <w@felixhandte.com> | 2018-03-12 18:58:43 (GMT) |
commit | aa36e118f10d825ceb3899d3e137d643ed469331 (patch) | |
tree | aaa0cd948eeb1a07cc1c056a6a297476c4ff9769 /lib | |
parent | d6a3024dbb6375190e6e02ad8b06aae28e76b946 (diff) | |
download | lz4-aa36e118f10d825ceb3899d3e137d643ed469331.zip lz4-aa36e118f10d825ceb3899d3e137d643ed469331.tar.gz lz4-aa36e118f10d825ceb3899d3e137d643ed469331.tar.bz2 |
Const-ify Table Arg to LZ4_getPosition(OnHash)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -509,14 +509,14 @@ LZ4_FORCE_INLINE void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_ LZ4_putPositionOnHash(p, h, tableBase, tableType, srcBase); } -static const BYTE* LZ4_getPositionOnHash(U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) +static const BYTE* LZ4_getPositionOnHash(U32 h, const void* tableBase, tableType_t tableType, const BYTE* srcBase) { - if (tableType == byPtr) { const BYTE** hashTable = (const BYTE**) tableBase; return hashTable[h]; } - if (tableType == byU32) { const U32* const hashTable = (U32*) tableBase; return hashTable[h] + srcBase; } - { const U16* const hashTable = (U16*) tableBase; return hashTable[h] + srcBase; } /* default, to ensure a return */ + if (tableType == byPtr) { const BYTE* const* hashTable = (const BYTE* const*) tableBase; return hashTable[h]; } + if (tableType == byU32) { const U32* const hashTable = (const U32*) tableBase; return hashTable[h] + srcBase; } + { const U16* const hashTable = (const U16*) tableBase; return hashTable[h] + srcBase; } /* default, to ensure a return */ } -LZ4_FORCE_INLINE const BYTE* LZ4_getPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) +LZ4_FORCE_INLINE const BYTE* LZ4_getPosition(const BYTE* p, const void* tableBase, tableType_t tableType, const BYTE* srcBase) { U32 const h = LZ4_hashPosition(p, tableType); return LZ4_getPositionOnHash(h, tableBase, tableType, srcBase); |