summaryrefslogtreecommitdiff
path: root/src/lzo1f_d.ch
diff options
context:
space:
mode:
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-12-23 14:06:25 +0100
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-12-23 14:06:25 +0100
commit79a9578a33ecd3093970bd18df677edc9214fafb (patch)
tree8ae5c6780a1fcd2124e71f27ad9b4256acd24268 /src/lzo1f_d.ch
parent1bb1ce141783168d44a38cd1bb6b822eb13114fc (diff)
downloadlzo-79a9578a33ecd3093970bd18df677edc9214fafb.tar.gz
lzo-79a9578a33ecd3093970bd18df677edc9214fafb.tar.bz2
lzo-79a9578a33ecd3093970bd18df677edc9214fafb.zip
Imported Upstream version 2.08upstream/2.08sandbox/kevinthierry/upstream
Diffstat (limited to 'src/lzo1f_d.ch')
-rw-r--r--src/lzo1f_d.ch42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/lzo1f_d.ch b/src/lzo1f_d.ch
index 282ab35..b22916e 100644
--- a/src/lzo1f_d.ch
+++ b/src/lzo1f_d.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
@@ -50,10 +38,10 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
- register const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
const lzo_bytep const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
@@ -67,7 +55,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
t = *ip++;
if (t > 31)
@@ -81,17 +69,18 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
{
t += 255;
ip++;
+ TEST_IV(t);
NEED_IP(1);
}
t += 31 + *ip++;
}
/* copy literals */
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
-#if defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED32)
if (t >= 4)
{
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) ip;
+ UA_COPY4(op, ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -102,7 +91,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
t = *ip++;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
/* handle matches */
if (t < 32)
@@ -135,14 +124,15 @@ match:
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 31 + *ip++;
}
NEED_IP(2);
m_pos = op;
-#if defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
ip += 2;
#else
m_pos -= *ip++ >> 2;
@@ -154,13 +144,13 @@ match:
/* copy match */
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);