summaryrefslogtreecommitdiff
path: root/src/lzo1c_cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lzo1c_cc.c')
-rw-r--r--src/lzo1c_cc.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/lzo1c_cc.c b/src/lzo1c_cc.c
index 6e367df..f6999db 100644
--- a/src/lzo1c_cc.c
+++ b/src/lzo1c_cc.c
@@ -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
@@ -38,7 +26,7 @@
*/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1c.h"
@@ -57,14 +45,14 @@ int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len,
#endif
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
_lzo1c_stats_init(lzo_stats);
lzo_stats->in_len = in_len;
#endif
/* don't try to compress a block that's too short */
- if (in_len <= 0)
+ if (in_len == 0)
{
*out_len = 0;
r = LZO_E_OK;
@@ -91,15 +79,15 @@ int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len,
if (r == LZO_E_OK)
{
lzo_bytep 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;
}
#endif
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_stats->out_len = *out_len;
lzo_stats->match_bytes =
1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches +
@@ -120,7 +108,7 @@ int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len,
/* lzo_stats_t is still defined */
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
static lzo_stats_t lzo_statistics;
lzo_stats_t * const lzo1c_stats = &lzo_statistics;