diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-02 21:42:07 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-02 21:42:07 +0200 |
commit | 21c3e54010129b504891e1786bf425d89328c969 (patch) | |
tree | 2e3eba26f5f0fa454188e1b52c7cab3761c4f208 /lzo/src/lzo1f_1.c | |
parent | d4a1b52faa85df4446560a48c6bcc57f016e0c3c (diff) | |
parent | b42eacfa8da0a642d629714f188cc0fc4c7e601a (diff) |
Merge
Diffstat (limited to 'lzo/src/lzo1f_1.c')
-rw-r--r-- | lzo/src/lzo1f_1.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lzo/src/lzo1f_1.c b/lzo/src/lzo1f_1.c index 27608cee..269887ef 100644 --- a/lzo/src/lzo1f_1.c +++ b/lzo/src/lzo1f_1.c @@ -2,6 +2,9 @@ This file is part of the LZO real-time data compression library. + Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer @@ -84,7 +87,7 @@ int do_compress ( const lzo_bytep in , lzo_uint in_len, for (;;) { register const lzo_bytep m_pos; - lzo_uint m_off; + LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0); lzo_uint m_len; lzo_uint dindex; lzo_uint lit; @@ -108,7 +111,7 @@ int do_compress ( const lzo_bytep in , lzo_uint in_len, try_match: #if 0 && defined(LZO_UNALIGNED_OK_2) - if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip) + if (UA_GET16(m_pos) != UA_GET16(ip)) #else if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) #endif @@ -282,7 +285,7 @@ lzo1f_1_compress ( const lzo_bytep in , lzo_uint in_len, lzo_bytep op = out; int r = LZO_E_OK; - if (in_len <= 0) + if (in_len == 0) *out_len = 0; else if (in_len <= 10) { @@ -296,9 +299,9 @@ lzo1f_1_compress ( const lzo_bytep in , lzo_uint in_len, if (r == LZO_E_OK) { op = out + *out_len; - *op++ = M3_MARKER | 1; - *op++ = 0; - *op++ = 0; + op[0] = M3_MARKER | 1; + op[1] = 0; + op[2] = 0; *out_len += 3; } |