summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-05-20 00:53:48 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-05-20 00:53:48 (GMT)
commit7f92b091744ec0dd3b5aa8ca2bafadc459606ce8 (patch)
tree958bb70fa58f1818bdf69ed280a748422303da36
parent4db6b03fceac50961a8f127aa2eda73d3373a1fe (diff)
downloadlz4-7f92b091744ec0dd3b5aa8ca2bafadc459606ce8.zip
lz4-7f92b091744ec0dd3b5aa8ca2bafadc459606ce8.tar.gz
lz4-7f92b091744ec0dd3b5aa8ca2bafadc459606ce8.tar.bz2
Fixed : compilation errors using Visual 2012
-rwxr-xr-x[-rw-r--r--]lz4.c5
-rwxr-xr-x[-rw-r--r--]programs/fullbench.c34
2 files changed, 18 insertions, 21 deletions
diff --git a/lz4.c b/lz4.c
index 98a6ea8..9a28d68 100644..100755
--- a/lz4.c
+++ b/lz4.c
@@ -492,10 +492,8 @@ int LZ4_compress_generic(
while ((ip>anchor) && (ref > lowLimit) && (unlikely(ip[-1]==ref[-1]))) { ip--; ref--; }
{
- unsigned litLength;
-
/* Encode Literal length */
- litLength = (ip - anchor);
+ unsigned litLength = (unsigned)(ip - anchor);
token = op++;
if ((limitedOutput) && (unlikely(op + litLength + (2 + 1 + LASTLITERALS) + (litLength/255) > oend))) return 0; /* Check output limit */
if (litLength>=RUN_MASK)
@@ -768,7 +766,6 @@ int LZ4_compress_usingDict (LZ4_dict_t* LZ4_dict, const char* source, char* dest
matchLength = LZ4_count(ip+MINMATCH, ref+MINMATCH, matchlimit);
else
{
- matchLength = 0;
const BYTE* dicLimit = ip + (dictEnd - ref);
if (dicLimit > matchlimit) dicLimit = matchlimit;
matchLength = LZ4_count(ip+MINMATCH, ref+MINMATCH, dicLimit);
diff --git a/programs/fullbench.c b/programs/fullbench.c
index 01b807c..fe13d0b 100644..100755
--- a/programs/fullbench.c
+++ b/programs/fullbench.c
@@ -254,103 +254,103 @@ static U64 BMK_GetFileSize(char* infilename)
Benchmark function
*********************************************************/
-static inline int local_LZ4_compress_limitedOutput(const char* in, char* out, int inSize)
+static int local_LZ4_compress_limitedOutput(const char* in, char* out, int inSize)
{
return LZ4_compress_limitedOutput(in, out, inSize, LZ4_compressBound(inSize));
}
static void* stateLZ4;
-static inline int local_LZ4_compress_withState(const char* in, char* out, int inSize)
+static int local_LZ4_compress_withState(const char* in, char* out, int inSize)
{
return LZ4_compress_withState(stateLZ4, in, out, inSize);
}
-static inline int local_LZ4_compress_limitedOutput_withState(const char* in, char* out, int inSize)
+static int local_LZ4_compress_limitedOutput_withState(const char* in, char* out, int inSize)
{
return LZ4_compress_limitedOutput_withState(stateLZ4, in, out, inSize, LZ4_compressBound(inSize));
}
static void* ctx;
-static inline int local_LZ4_compress_continue(const char* in, char* out, int inSize)
+static int local_LZ4_compress_continue(const char* in, char* out, int inSize)
{
return LZ4_compress_continue(ctx, in, out, inSize);
}
-static inline int local_LZ4_compress_limitedOutput_continue(const char* in, char* out, int inSize)
+static int local_LZ4_compress_limitedOutput_continue(const char* in, char* out, int inSize)
{
return LZ4_compress_limitedOutput_continue(ctx, in, out, inSize, LZ4_compressBound(inSize));
}
LZ4_dict_t LZ4_dict;
-static inline void* local_LZ4_resetDictT(const char* fake)
+static void* local_LZ4_resetDictT(const char* fake)
{
(void)fake;
memset(&LZ4_dict, 0, sizeof(LZ4_dict_t));
return NULL;
}
-static inline int local_LZ4_compress_usingDict(const char* in, char* out, int inSize)
+static int local_LZ4_compress_usingDict(const char* in, char* out, int inSize)
{
return LZ4_compress_usingDict(&LZ4_dict, in, out, inSize);
}
static void* stateLZ4HC;
-static inline int local_LZ4_compressHC_withStateHC(const char* in, char* out, int inSize)
+static int local_LZ4_compressHC_withStateHC(const char* in, char* out, int inSize)
{
return LZ4_compressHC_withStateHC(stateLZ4HC, in, out, inSize);
}
-static inline int local_LZ4_compressHC_limitedOutput_withStateHC(const char* in, char* out, int inSize)
+static int local_LZ4_compressHC_limitedOutput_withStateHC(const char* in, char* out, int inSize)
{
return LZ4_compressHC_limitedOutput_withStateHC(stateLZ4HC, in, out, inSize, LZ4_compressBound(inSize));
}
-static inline int local_LZ4_compressHC_limitedOutput(const char* in, char* out, int inSize)
+static int local_LZ4_compressHC_limitedOutput(const char* in, char* out, int inSize)
{
return LZ4_compressHC_limitedOutput(in, out, inSize, LZ4_compressBound(inSize));
}
-static inline int local_LZ4_compressHC_continue(const char* in, char* out, int inSize)
+static int local_LZ4_compressHC_continue(const char* in, char* out, int inSize)
{
return LZ4_compressHC_continue(ctx, in, out, inSize);
}
-static inline int local_LZ4_compressHC_limitedOutput_continue(const char* in, char* out, int inSize)
+static int local_LZ4_compressHC_limitedOutput_continue(const char* in, char* out, int inSize)
{
return LZ4_compressHC_limitedOutput_continue(ctx, in, out, inSize, LZ4_compressBound(inSize));
}
-static inline int local_LZ4_decompress_fast(const char* in, char* out, int inSize, int outSize)
+static int local_LZ4_decompress_fast(const char* in, char* out, int inSize, int outSize)
{
(void)inSize;
LZ4_decompress_fast(in, out, outSize);
return outSize;
}
-static inline int local_LZ4_decompress_fast_withPrefix64k(const char* in, char* out, int inSize, int outSize)
+static int local_LZ4_decompress_fast_withPrefix64k(const char* in, char* out, int inSize, int outSize)
{
(void)inSize;
LZ4_decompress_fast_withPrefix64k(in, out, outSize);
return outSize;
}
-static inline int local_LZ4_decompress_fast_usingDict(const char* in, char* out, int inSize, int outSize)
+static int local_LZ4_decompress_fast_usingDict(const char* in, char* out, int inSize, int outSize)
{
(void)inSize;
LZ4_decompress_fast_usingDict(in, out, outSize, in - 65536, 65536);
return outSize;
}
-static inline int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int inSize, int outSize)
+static int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int inSize, int outSize)
{
(void)inSize;
LZ4_decompress_safe_usingDict(in, out, inSize, outSize, in - 65536, 65536);
return outSize;
}
-static inline int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSize, int outSize)
+static int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSize, int outSize)
{
return LZ4_decompress_safe_partial(in, out, inSize, outSize - 5, outSize);
}