summaryrefslogtreecommitdiff
path: root/lzo/src/lzo_mchw.ch
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-06-27 12:46:41 -0700
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-06-29 10:43:01 +0000
commit02ab5d34ba0a90e3b6dd78034d7c470c77500119 (patch)
tree38bb0a5322576be2e308f673f11b22e56769bd1c /lzo/src/lzo_mchw.ch
parentf92b88bc6c65ba71dad92fe7da7b7085607b439a (diff)
downloadsyslinux-baserock/syslinux-4.06-gcc7.tar.gz
lzo: Upgrade to LZO 2.07baserock/syslinux-4.06-gcc7
Use version 2.07 of the LZO compression library. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Backported to the Baserock syslinux 4.06 branch in order to fix these compile failures with GCC 7 (part of the compiler detection preprocessor magic): In file included from src/lzo_init.c:61:0: src/miniacc.h:4415:16: error: variably modified '__acc_cta' at file scope ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0) ^~~~~~~~~ src/miniacc.h:4420:16: error: variably modified '__acc_cta' at file scope ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0) ^~~~~~~~~ In file included from src/lzo_init.c:61:0: src/miniacc.h:4649:16: error: variably modified '__acc_cta' at file scope ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) ^~~~~~~~~ ../mk/build.mk:29: recipe for target 'src/lzo_init.o' failed
Diffstat (limited to 'lzo/src/lzo_mchw.ch')
-rw-r--r--lzo/src/lzo_mchw.ch45
1 files changed, 14 insertions, 31 deletions
diff --git a/lzo/src/lzo_mchw.ch b/lzo/src/lzo_mchw.ch
index a8c4fec5..8273612a 100644
--- a/lzo/src/lzo_mchw.ch
+++ b/lzo/src/lzo_mchw.ch
@@ -2,19 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -44,7 +32,7 @@
typedef struct
{
- int init;
+ unsigned init;
lzo_uint look; /* bytes in lookahead buffer */
@@ -112,15 +100,7 @@ typedef struct
LZO_COMPRESS_T;
-#if (LZO_CC_BORLANDC && LZO_ARCH_I086) && (__BORLANDC__ < 0x0450)
- /* work around a Borland C 3.1 bug */
-# define getbyte(c) ((c).ip < (c).in_end ? (c).ip +=1, (c).ip[-1] : (-1))
-#elif defined(__TURBOC__) && defined(__TOS__)
- /* work around a bug in Turbo C / Pure C (Atari ST) */
-# define getbyte(c) ((c).ip < (c).in_end ? (int)(unsigned) *((c).ip)++ : (-1))
-#else
-# define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
-#endif
+#define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
#include "lzo_swd.ch"
@@ -132,7 +112,7 @@ LZO_COMPRESS_T;
static int
init_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
const lzo_bytep dict, lzo_uint dict_len,
- lzo_uint32 flags )
+ lzo_uint32_t flags )
{
int r;
@@ -148,11 +128,14 @@ init_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
c->lazy = 0;
r = swd_init(s,dict,dict_len);
- if (r != 0)
+ if (r != LZO_E_OK)
+ {
+ swd_exit(s);
return r;
+ }
s->use_best_off = (flags & 1) ? 1 : 0;
- return r;
+ return LZO_E_OK;
}
@@ -178,8 +161,8 @@ find_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
c->textsize += this_len - skip;
}
- s->m_len = 1;
- s->m_len = THRESHOLD;
+ s->m_len = SWD_THRESHOLD;
+ s->m_off = 0;
#ifdef SWD_BEST_OFF
if (s->use_best_off)
lzo_memset(s->best_pos,0,sizeof(s->best_pos));
@@ -204,14 +187,14 @@ find_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
#if 0
/* brute force match search */
- if (c->m_len > THRESHOLD && c->m_len + 1 <= c->look)
+ if (c->m_len > SWD_THRESHOLD && c->m_len + 1 <= c->look)
{
const lzo_bytep ip = c->bp;
const lzo_bytep m = c->bp - c->m_off;
const lzo_bytep in = c->in;
- if (ip - in > N)
- in = ip - N;
+ if (ip - in > s->swd_n)
+ in = ip - s->swd_n;
for (;;)
{
while (*in != *ip)