summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorW. Felix Handte <w@felixhandte.com>2018-02-02 16:45:59 (GMT)
committerW. Felix Handte <w@felixhandte.com>2018-03-12 18:58:43 (GMT)
commitaa36e118f10d825ceb3899d3e137d643ed469331 (patch)
treeaaa0cd948eeb1a07cc1c056a6a297476c4ff9769 /lib
parentd6a3024dbb6375190e6e02ad8b06aae28e76b946 (diff)
downloadlz4-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 45cc7c9..46935f8 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -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);