summaryrefslogtreecommitdiff
path: root/src/lzo1b_c.ch
diff options
context:
space:
mode:
Diffstat (limited to 'src/lzo1b_c.ch')
-rw-r--r--src/lzo1b_c.ch38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/lzo1b_c.ch b/src/lzo1b_c.ch
index 67ef4ff..4fb79d4 100644
--- a/src/lzo1b_c.ch
+++ b/src/lzo1b_c.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,17 +32,17 @@
************************************************************************/
#if !defined(LZO_HAVE_R1) && !defined(LZO_NO_R1)
-# define LZO_HAVE_R1
+# define LZO_HAVE_R1 1
#endif
#if !defined(LZO_HAVE_M3) && !defined(LZO_NO_M3)
# if (M3O_BITS < 8)
-# define LZO_HAVE_M3
+# define LZO_HAVE_M3 1
# endif
#endif
-#define MI
+#define MI /*empty*/
#define SI MI
#if (DD_BITS > 0)
#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,drun,dv,ii,in); MI
@@ -71,12 +59,15 @@
// I really apologize for this spaghetti code.
************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
LZO_PRIVATE(int)
do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register const lzo_bytep ip;
+ const lzo_bytep ip;
#if (DD_BITS > 0)
#if defined(__LZO_HASH_INCREMENTAL)
lzo_xint dv;
@@ -97,7 +88,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_stats->r_bits = R_BITS;
lzo_stats->m3o_bits = M3O_BITS;
lzo_stats->dd_bits = DD_BITS;
@@ -105,11 +96,11 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_stats->d_bits = D_BITS;
lzo_stats->min_lookahead = MIN_LOOKAHEAD;
lzo_stats->max_lookbehind = MAX_LOOKBEHIND;
- lzo_stats->compress_id = LZO_CPP_MACRO_EXPAND(COMPRESS_ID);
+ lzo_stats->compress_id = LZO_PP_MACRO_EXPAND(COMPRESS_ID);
#endif
/* init dictionary */
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
@@ -135,7 +126,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
#if !defined(NDEBUG)
const lzo_bytep m_pos_sav = NULL;
#endif
- lzo_uint m_off;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
#if (DD_BITS == 0)
lzo_uint dindex;
#endif
@@ -225,7 +216,7 @@ match:
assert(ip <= in_end);
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
{
lzo_uint i;
const lzo_bytep p;
@@ -263,6 +254,9 @@ match:
*out_len = pd(op, out);
return LZO_E_OK; /* compression went ok */
}
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
/*