summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-12-05 01:10:23 (GMT)
committerYann Collet <cyan@fb.com>2017-12-05 01:10:23 (GMT)
commit6bbe45e1b848a08fe0e74bbe12d4863a6f6fdd91 (patch)
treeb53a81c7139cba277631ec304dc52f80c4ea5e0b /lib
parentde49c5bed94f1217e21dc73fe8a22d7d771ebf2e (diff)
downloadlz4-6bbe45e1b848a08fe0e74bbe12d4863a6f6fdd91.zip
lz4-6bbe45e1b848a08fe0e74bbe12d4863a6f6fdd91.tar.gz
lz4-6bbe45e1b848a08fe0e74bbe12d4863a6f6fdd91.tar.bz2
remove `register` keyword
deprecated in newer C++ versions, and dubious utility
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index cc76eba..213b085 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -85,16 +85,6 @@
#endif
-/*
- * register is ignored when the code built with a C++-17 compiler
- * Remove the keyword when built with C++-17 to silent the warning
- */
-#if defined(__cplusplus) && __cplusplus > 201402L
-# define REGISTER
-#else
-# define REGISTER register
-#endif
-
/*-************************************
* Dependency
@@ -350,7 +340,7 @@ static int g_debuglog_enable = 1;
/*-************************************
* Common functions
**************************************/
-static unsigned LZ4_NbCommonBytes (REGISTER reg_t val)
+static unsigned LZ4_NbCommonBytes (reg_t val)
{
if (LZ4_isLittleEndian()) {
if (sizeof(val)==8) {
@@ -361,7 +351,14 @@ static unsigned LZ4_NbCommonBytes (REGISTER reg_t val)
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctzll((U64)val) >> 3);
# else
- static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 };
+ static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2,
+ 0, 3, 1, 3, 1, 4, 2, 7,
+ 0, 2, 3, 6, 1, 5, 3, 5,
+ 1, 3, 4, 4, 2, 5, 6, 7,
+ 7, 0, 1, 2, 3, 3, 4, 6,
+ 2, 6, 5, 5, 3, 4, 5, 6,
+ 7, 1, 2, 4, 6, 4, 4, 5,
+ 7, 2, 6, 5, 7, 6, 7, 7 };
return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58];
# endif
} else /* 32 bits */ {
@@ -372,7 +369,10 @@ static unsigned LZ4_NbCommonBytes (REGISTER reg_t val)
# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctz((U32)val) >> 3);
# else
- static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 };
+ static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0,
+ 3, 2, 2, 1, 3, 2, 0, 1,
+ 3, 3, 1, 2, 2, 2, 2, 0,
+ 3, 1, 2, 0, 1, 0, 1, 1 };
return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27];
# endif
}