Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / lib / lz4 / lz4_decompress.c
index f0f5c5c..26cc602 100644 (file)
 
 #include "lz4defs.h"
 
+static const int dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
+#if LZ4_ARCH64
+static const int dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
+#endif
+
 static int lz4_uncompress(const char *source, char *dest, int osize)
 {
        const BYTE *ip = (const BYTE *) source;
@@ -56,10 +61,6 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
        BYTE *cpy;
        unsigned token;
        size_t length;
-       size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
-#if LZ4_ARCH64
-       size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
-#endif
 
        while (1) {
 
@@ -116,7 +117,7 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
                /* copy repeated sequence */
                if (unlikely((op - ref) < STEPSIZE)) {
 #if LZ4_ARCH64
-                       size_t dec64 = dec64table[op - ref];
+                       int dec64 = dec64table[op - ref];
 #else
                        const int dec64 = 0;
 #endif
@@ -177,11 +178,6 @@ static int lz4_uncompress_unknownoutputsize(const char *source, char *dest,
        BYTE * const oend = op + maxoutputsize;
        BYTE *cpy;
 
-       size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
-#if LZ4_ARCH64
-       size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
-#endif
-
        /* Main Loop */
        while (ip < iend) {
 
@@ -249,7 +245,7 @@ static int lz4_uncompress_unknownoutputsize(const char *source, char *dest,
                /* copy repeated sequence */
                if (unlikely((op - ref) < STEPSIZE)) {
 #if LZ4_ARCH64
-                       size_t dec64 = dec64table[op - ref];
+                       int dec64 = dec64table[op - ref];
 #else
                        const int dec64 = 0;
 #endif