summaryrefslogtreecommitdiff
path: root/lzo/src
diff options
context:
space:
mode:
Diffstat (limited to 'lzo/src')
-rw-r--r--lzo/src/compr1b.h5
-rw-r--r--lzo/src/compr1c.h5
-rw-r--r--lzo/src/config1.h7
-rw-r--r--lzo/src/config1a.h9
-rw-r--r--lzo/src/config1b.h9
-rw-r--r--lzo/src/config1c.h9
-rw-r--r--lzo/src/config1f.h7
-rw-r--r--lzo/src/config1x.h11
-rw-r--r--lzo/src/config1y.h7
-rw-r--r--lzo/src/config1z.h7
-rw-r--r--lzo/src/config2a.h13
-rw-r--r--lzo/src/lzo1.c13
-rw-r--r--lzo/src/lzo1_99.c7
-rw-r--r--lzo/src/lzo1_cm.ch3
-rw-r--r--lzo/src/lzo1_d.ch19
-rw-r--r--lzo/src/lzo1a.c31
-rw-r--r--lzo/src/lzo1a_99.c7
-rw-r--r--lzo/src/lzo1a_cm.ch3
-rw-r--r--lzo/src/lzo1a_cr.ch5
-rw-r--r--lzo/src/lzo1a_de.h5
-rw-r--r--lzo/src/lzo1b_1.c3
-rw-r--r--lzo/src/lzo1b_2.c3
-rw-r--r--lzo/src/lzo1b_3.c3
-rw-r--r--lzo/src/lzo1b_4.c3
-rw-r--r--lzo/src/lzo1b_5.c3
-rw-r--r--lzo/src/lzo1b_6.c3
-rw-r--r--lzo/src/lzo1b_7.c3
-rw-r--r--lzo/src/lzo1b_8.c3
-rw-r--r--lzo/src/lzo1b_9.c3
-rw-r--r--lzo/src/lzo1b_99.c3
-rw-r--r--lzo/src/lzo1b_9x.c17
-rw-r--r--lzo/src/lzo1b_c.ch17
-rw-r--r--lzo/src/lzo1b_cc.c19
-rw-r--r--lzo/src/lzo1b_cc.h5
-rw-r--r--lzo/src/lzo1b_cm.ch3
-rw-r--r--lzo/src/lzo1b_cr.ch3
-rw-r--r--lzo/src/lzo1b_d.ch13
-rw-r--r--lzo/src/lzo1b_d1.c3
-rw-r--r--lzo/src/lzo1b_d2.c5
-rw-r--r--lzo/src/lzo1b_de.h5
-rw-r--r--lzo/src/lzo1b_r.ch3
-rw-r--r--lzo/src/lzo1b_rr.c3
-rw-r--r--lzo/src/lzo1b_sm.ch11
-rw-r--r--lzo/src/lzo1b_tm.ch7
-rw-r--r--lzo/src/lzo1b_xx.c3
-rw-r--r--lzo/src/lzo1c_1.c3
-rw-r--r--lzo/src/lzo1c_2.c3
-rw-r--r--lzo/src/lzo1c_3.c3
-rw-r--r--lzo/src/lzo1c_4.c3
-rw-r--r--lzo/src/lzo1c_5.c3
-rw-r--r--lzo/src/lzo1c_6.c3
-rw-r--r--lzo/src/lzo1c_7.c3
-rw-r--r--lzo/src/lzo1c_8.c3
-rw-r--r--lzo/src/lzo1c_9.c3
-rw-r--r--lzo/src/lzo1c_99.c3
-rw-r--r--lzo/src/lzo1c_9x.c17
-rw-r--r--lzo/src/lzo1c_cc.c19
-rw-r--r--lzo/src/lzo1c_cc.h5
-rw-r--r--lzo/src/lzo1c_d1.c3
-rw-r--r--lzo/src/lzo1c_d2.c5
-rw-r--r--lzo/src/lzo1c_rr.c3
-rw-r--r--lzo/src/lzo1c_xx.c3
-rw-r--r--lzo/src/lzo1f_1.c15
-rw-r--r--lzo/src/lzo1f_9x.c17
-rw-r--r--lzo/src/lzo1f_d.ch11
-rw-r--r--lzo/src/lzo1f_d1.c3
-rw-r--r--lzo/src/lzo1f_d2.c5
-rw-r--r--lzo/src/lzo1x_1.c24
-rw-r--r--lzo/src/lzo1x_1k.c24
-rw-r--r--lzo/src/lzo1x_1l.c24
-rw-r--r--lzo/src/lzo1x_1o.c25
-rw-r--r--lzo/src/lzo1x_9x.c104
-rw-r--r--lzo/src/lzo1x_c.ch422
-rw-r--r--lzo/src/lzo1x_d.ch70
-rw-r--r--lzo/src/lzo1x_d1.c3
-rw-r--r--lzo/src/lzo1x_d2.c5
-rw-r--r--lzo/src/lzo1x_d3.c5
-rw-r--r--lzo/src/lzo1x_o.c3
-rw-r--r--lzo/src/lzo1x_oo.ch3
-rw-r--r--lzo/src/lzo1y_1.c24
-rw-r--r--lzo/src/lzo1y_9x.c5
-rw-r--r--lzo/src/lzo1y_d1.c3
-rw-r--r--lzo/src/lzo1y_d2.c5
-rw-r--r--lzo/src/lzo1y_d3.c3
-rw-r--r--lzo/src/lzo1y_o.c3
-rw-r--r--lzo/src/lzo1z_9x.c5
-rw-r--r--lzo/src/lzo1z_d1.c3
-rw-r--r--lzo/src/lzo1z_d2.c5
-rw-r--r--lzo/src/lzo1z_d3.c3
-rw-r--r--lzo/src/lzo2a_9x.c43
-rw-r--r--lzo/src/lzo2a_d.ch5
-rw-r--r--lzo/src/lzo2a_d1.c3
-rw-r--r--lzo/src/lzo2a_d2.c5
-rw-r--r--lzo/src/lzo_conf.h141
-rw-r--r--lzo/src/lzo_crc.c5
-rw-r--r--lzo/src/lzo_dict.h32
-rw-r--r--lzo/src/lzo_dll.ch3
-rw-r--r--lzo/src/lzo_func.ch122
-rw-r--r--lzo/src/lzo_init.c95
-rw-r--r--lzo/src/lzo_mchw.ch28
-rw-r--r--lzo/src/lzo_ptr.c3
-rw-r--r--lzo/src/lzo_ptr.h13
-rw-r--r--lzo/src/lzo_str.c16
-rw-r--r--lzo/src/lzo_swd.ch199
-rw-r--r--lzo/src/lzo_util.c8
-rw-r--r--lzo/src/miniacc.h881
-rw-r--r--lzo/src/stats1a.h7
-rw-r--r--lzo/src/stats1b.h9
-rw-r--r--lzo/src/stats1c.h5
109 files changed, 2016 insertions, 843 deletions
diff --git a/lzo/src/compr1b.h b/lzo/src/compr1b.h
index be0d2005..de46b0a5 100644
--- a/lzo/src/compr1b.h
+++ b/lzo/src/compr1b.h
@@ -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
@@ -38,7 +41,7 @@
*/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1b.h"
diff --git a/lzo/src/compr1c.h b/lzo/src/compr1c.h
index 8b29f9ae..44dcdcf2 100644
--- a/lzo/src/compr1c.h
+++ b/lzo/src/compr1c.h
@@ -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
@@ -38,7 +41,7 @@
*/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1c.h"
diff --git a/lzo/src/config1.h b/lzo/src/config1.h
index b223150e..14dc1317 100644
--- a/lzo/src/config1.h
+++ b/lzo/src/config1.h
@@ -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
@@ -44,12 +47,12 @@
*/
#ifndef __LZO_CONFIG1_H
-#define __LZO_CONFIG1_H
+#define __LZO_CONFIG1_H 1
#include "lzo_conf.h"
#include "lzo/lzo1.h"
-#define LZO_NO_R1
+#define LZO_NO_R1 1
#include "config1a.h"
#endif /* already included */
diff --git a/lzo/src/config1a.h b/lzo/src/config1a.h
index 4f9be442..3c0f24cf 100644
--- a/lzo/src/config1a.h
+++ b/lzo/src/config1a.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_CONFIG1A_H
-#define __LZO_CONFIG1A_H
+#define __LZO_CONFIG1A_H 1
#include "lzo_conf.h"
#include "lzo/lzo1a.h"
@@ -120,7 +123,7 @@
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
-# define LZO_COLLECT_STATS
+# define LZO_COLLECT_STATS 1
#endif
@@ -132,7 +135,7 @@
#define M3L_BITS CHAR_BIT
#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 1)
#define _MAX_OFFSET _M2_MAX_OFFSET
-#define LZO_NO_M3
+#define LZO_NO_M3 1
#include "lzo1b_de.h"
#include "stats1b.h"
diff --git a/lzo/src/config1b.h b/lzo/src/config1b.h
index f471f4fe..33bb638d 100644
--- a/lzo/src/config1b.h
+++ b/lzo/src/config1b.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_CONFIG1B_H
-#define __LZO_CONFIG1B_H
+#define __LZO_CONFIG1B_H 1
#include "lzo_conf.h"
#include "lzo/lzo1b.h"
@@ -92,7 +95,7 @@
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
-#define LZO_EOF_CODE
+#define LZO_EOF_CODE 1
/***********************************************************************
@@ -118,7 +121,7 @@
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
-# define LZO_COLLECT_STATS
+# define LZO_COLLECT_STATS 1
#endif
diff --git a/lzo/src/config1c.h b/lzo/src/config1c.h
index e8d566fb..32ca1f3a 100644
--- a/lzo/src/config1c.h
+++ b/lzo/src/config1c.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_CONFIG1C_H
-#define __LZO_CONFIG1C_H
+#define __LZO_CONFIG1C_H 1
#include "lzo_conf.h"
#include "lzo/lzo1c.h"
@@ -92,7 +95,7 @@
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
-#define LZO_EOF_CODE
+#define LZO_EOF_CODE 1
/***********************************************************************
@@ -118,7 +121,7 @@
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
-# define LZO_COLLECT_STATS
+# define LZO_COLLECT_STATS 1
#endif
diff --git a/lzo/src/config1f.h b/lzo/src/config1f.h
index cb4d4c1b..6a77efc2 100644
--- a/lzo/src/config1f.h
+++ b/lzo/src/config1f.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_CONFIG1F_H
-#define __LZO_CONFIG1F_H
+#define __LZO_CONFIG1F_H 1
#include "lzo_conf.h"
#include "lzo/lzo1f.h"
@@ -55,7 +58,7 @@
//
************************************************************************/
-#define LZO_EOF_CODE
+#define LZO_EOF_CODE 1
#undef LZO_DETERMINISTIC
#define M2_MAX_OFFSET 0x0800
diff --git a/lzo/src/config1x.h b/lzo/src/config1x.h
index e123bf3d..f52d1b88 100644
--- a/lzo/src/config1x.h
+++ b/lzo/src/config1x.h
@@ -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
@@ -45,10 +48,10 @@
#ifndef __LZO_CONFIG1X_H
-#define __LZO_CONFIG1X_H
+#define __LZO_CONFIG1X_H 1
#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
-# define LZO1X
+# define LZO1X 1
#endif
#include "lzo_conf.h"
@@ -61,7 +64,9 @@
//
************************************************************************/
-#define LZO_EOF_CODE
+#ifndef LZO_EOF_CODE
+#define LZO_EOF_CODE 1
+#endif
#undef LZO_DETERMINISTIC
#define M1_MAX_OFFSET 0x0400
diff --git a/lzo/src/config1y.h b/lzo/src/config1y.h
index 84d546a3..ed5a7e4e 100644
--- a/lzo/src/config1y.h
+++ b/lzo/src/config1y.h
@@ -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
@@ -45,10 +48,10 @@
#ifndef __LZO_CONFIG1Y_H
-#define __LZO_CONFIG1Y_H
+#define __LZO_CONFIG1Y_H 1
#if !defined(LZO1Y)
-# define LZO1Y
+# define LZO1Y 1
#endif
#include "lzo_conf.h"
diff --git a/lzo/src/config1z.h b/lzo/src/config1z.h
index 5762af33..27ef74e0 100644
--- a/lzo/src/config1z.h
+++ b/lzo/src/config1z.h
@@ -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
@@ -45,10 +48,10 @@
#ifndef __LZO_CONFIG1Z_H
-#define __LZO_CONFIG1Z_H
+#define __LZO_CONFIG1Z_H 1
#if !defined(LZO1Z)
-# define LZO1Z
+# define LZO1Z 1
#endif
#include "lzo_conf.h"
diff --git a/lzo/src/config2a.h b/lzo/src/config2a.h
index ba38ca57..f290132d 100644
--- a/lzo/src/config2a.h
+++ b/lzo/src/config2a.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_CONFIG2A_H
-#define __LZO_CONFIG2A_H
+#define __LZO_CONFIG2A_H 1
#include "lzo_conf.h"
#include "lzo/lzo2a.h"
@@ -82,9 +85,9 @@
************************************************************************/
#if 1
-#define N 8191 /* size of ring buffer */
+#define SWD_N 8191 /* size of ring buffer */
#else
-#define N 16383 /* size of ring buffer */
+#define SWD_N 16383 /* size of ring buffer */
#endif
#define M1_MIN_LEN 2
@@ -95,7 +98,7 @@
/* add a special code so that the decompressor can detect the
* end of the compressed data block (overhead is 3 bytes per block) */
-#define LZO_EOF_CODE
+#define LZO_EOF_CODE 1
#undef LZO_DETERMINISTIC
@@ -123,7 +126,7 @@
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
-# define LZO_COLLECT_STATS
+# define LZO_COLLECT_STATS 1
#endif
diff --git a/lzo/src/lzo1.c b/lzo/src/lzo1.c
index de231642..edf1c3af 100644
--- a/lzo/src/lzo1.c
+++ b/lzo/src/lzo1.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
@@ -364,7 +367,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
goto the_end;
/* init dictionary */
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
@@ -374,7 +377,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
DVAL_NEXT(dv,ip);
do {
- lzo_uint m_off;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
lzo_uint dindex;
DINDEX1(dindex,ip);
@@ -400,13 +403,13 @@ literal:
match:
UPDATE_I(dict,0,dindex,ip,in);
-#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
m_pos_sav = m_pos;
#endif
m_pos += 3;
{
/* we have found a match (of at least length 3) */
-#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR)
+#if !defined(NDEBUG) && !(LZO_DICT_USE_PTR)
assert((m_pos_sav = ip - m_off) == (m_pos - 3));
#endif
/* 1) store the current literal run */
@@ -613,7 +616,7 @@ lzo1_compress ( const lzo_bytep in , lzo_uint in_len,
int r = LZO_E_OK;
/* don't try to compress a block that's too short */
- if (in_len <= 0)
+ if (in_len == 0)
*out_len = 0;
else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
{
diff --git a/lzo/src/lzo1_99.c b/lzo/src/lzo1_99.c
index c1952d81..b23695d2 100644
--- a/lzo/src/lzo1_99.c
+++ b/lzo/src/lzo1_99.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
@@ -49,7 +52,7 @@
//
************************************************************************/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1.h"
@@ -66,7 +69,7 @@ _lzo1_do_compress ( const lzo_bytep in, lzo_uint in_len,
int r;
/* 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;
diff --git a/lzo/src/lzo1_cm.ch b/lzo/src/lzo1_cm.ch
index f0116f4d..148c9faf 100644
--- a/lzo/src/lzo1_cm.ch
+++ b/lzo/src/lzo1_cm.ch
@@ -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
diff --git a/lzo/src/lzo1_d.ch b/lzo/src/lzo1_d.ch
index c1dad39f..40a5bfdc 100644
--- a/lzo/src/lzo1_d.ch
+++ b/lzo/src/lzo1_d.ch
@@ -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
@@ -47,7 +50,7 @@
# define LZO_TEST_OVERRUN_OUTPUT 2
# endif
# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-# define LZO_TEST_OVERRUN_LOOKBEHIND
+# define LZO_TEST_OVERRUN_LOOKBEHIND 1
# endif
#endif
@@ -61,7 +64,7 @@
// TEST_OP test output overrun at loop begin
// NEED_OP test output overrun at every output byte
//
-// TEST_LB test match postion
+// TEST_LB test match position
//
// The fastest decompressor results when testing for no overruns
// and using LZO_EOF_CODE.
@@ -118,33 +121,33 @@
#if defined(TEST_IP)
-# define HAVE_TEST_IP
+# define HAVE_TEST_IP 1
#else
# define TEST_IP 1
#endif
#if defined(TEST_OP)
-# define HAVE_TEST_OP
+# define HAVE_TEST_OP 1
#else
# define TEST_OP 1
#endif
#if defined(NEED_IP)
-# define HAVE_NEED_IP
+# define HAVE_NEED_IP 1
#else
# define NEED_IP(x) ((void) 0)
#endif
#if defined(NEED_OP)
-# define HAVE_NEED_OP
+# define HAVE_NEED_OP 1
#else
# define NEED_OP(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-# define HAVE_ANY_IP
+# define HAVE_ANY_IP 1
#endif
#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-# define HAVE_ANY_OP
+# define HAVE_ANY_OP 1
#endif
diff --git a/lzo/src/lzo1a.c b/lzo/src/lzo1a.c
index c5713591..37020dd6 100644
--- a/lzo/src/lzo1a.c
+++ b/lzo/src/lzo1a.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
@@ -63,7 +66,7 @@
/* Collect statistics */
#if 0 && !defined(LZO_COLLECT_STATS)
-# define LZO_COLLECT_STATS
+# define LZO_COLLECT_STATS 1
#endif
@@ -102,7 +105,7 @@
#endif
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
static lzo1a_stats_t lzo_statistics;
lzo1a_stats_t *lzo1a_stats = &lzo_statistics;
# define lzo_stats lzo1a_stats
@@ -194,9 +197,9 @@ literal:
m_pos = op - MIN_OFFSET;
m_pos -= t | (((lzo_uint) *ip++) << OBITS);
assert(m_pos >= out); assert(m_pos < op);
- *op++ = *m_pos++;
- *op++ = *m_pos++;
- *op++ = *m_pos++;
+ *op++ = m_pos[0];
+ *op++ = m_pos[1];
+ *op++ = m_pos[2];
*op++ = *ip++;
}
}
@@ -283,7 +286,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
ii = ip; /* point to start of current literal run */
/* init dictionary */
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
@@ -291,7 +294,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
DVAL_NEXT(dv,ip);
do {
- lzo_uint m_off;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
lzo_uint dindex;
DINDEX1(dindex,ip);
@@ -316,7 +319,7 @@ literal:
match:
UPDATE_I(dict,0,dindex,ip,in);
-#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
assert(m_pos == NULL || m_pos >= in);
m_pos_sav = m_pos;
#endif
@@ -324,7 +327,7 @@ match:
{
/* we have found a match (of at least length 3) */
-#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR)
+#if !defined(NDEBUG) && !(LZO_DICT_USE_PTR)
assert((m_pos_sav = ip - m_off) == (m_pos - 3));
#endif
@@ -452,7 +455,7 @@ match:
*op++ = LZO_BYTE(m_off >> OBITS);
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_stats->short_matches++;
lzo_stats->short_match[m_len]++;
if (m_off < OSIZE)
@@ -530,7 +533,7 @@ match:
*op++ = LZO_BYTE(m_len - MIN_MATCH_LONG);
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_stats->long_matches++;
lzo_stats->long_match[m_len]++;
#endif
@@ -608,7 +611,7 @@ lzo1a_compress ( const lzo_bytep in , lzo_uint in_len,
int r = LZO_E_OK;
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_memset(lzo_stats,0,sizeof(*lzo_stats));
lzo_stats->rbits = RBITS;
lzo_stats->clevel = CLEVEL;
@@ -628,7 +631,7 @@ lzo1a_compress ( const lzo_bytep in , lzo_uint in_len,
/* don't try to compress a block that's too short */
- if (in_len <= 0)
+ if (in_len == 0)
*out_len = 0;
else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
{
@@ -642,7 +645,7 @@ lzo1a_compress ( const lzo_bytep in , lzo_uint in_len,
r = do_compress(in,in_len,out,out_len,wrkmem);
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
lzo_stats->short_matches -= lzo_stats->r1_matches;
lzo_stats->short_match[MIN_MATCH] -= lzo_stats->r1_matches;
lzo_stats->out_len = *out_len;
diff --git a/lzo/src/lzo1a_99.c b/lzo/src/lzo1a_99.c
index 79bcf73e..57f5f32d 100644
--- a/lzo/src/lzo1a_99.c
+++ b/lzo/src/lzo1a_99.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
@@ -49,7 +52,7 @@
//
************************************************************************/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1a.h"
@@ -66,7 +69,7 @@ _lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len,
int r;
/* 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;
diff --git a/lzo/src/lzo1a_cm.ch b/lzo/src/lzo1a_cm.ch
index de694f9a..d86b891e 100644
--- a/lzo/src/lzo1a_cm.ch
+++ b/lzo/src/lzo1a_cm.ch
@@ -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
diff --git a/lzo/src/lzo1a_cr.ch b/lzo/src/lzo1a_cr.ch
index 62e1b272..9e58e23a 100644
--- a/lzo/src/lzo1a_cr.ch
+++ b/lzo/src/lzo1a_cr.ch
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO1A_CR_H
-#define __LZO1A_CR_H
+#define __LZO1A_CR_H 1
/***********************************************************************
diff --git a/lzo/src/lzo1a_de.h b/lzo/src/lzo1a_de.h
index 97693b1f..3e4b05a0 100644
--- a/lzo/src/lzo1a_de.h
+++ b/lzo/src/lzo1a_de.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_DEFS_H
-#define __LZO_DEFS_H
+#define __LZO_DEFS_H 1
#ifdef __cplusplus
extern "C" {
diff --git a/lzo/src/lzo1b_1.c b/lzo/src/lzo1b_1.c
index bb5afa8a..bad1486a 100644
--- a/lzo/src/lzo1b_1.c
+++ b/lzo/src/lzo1b_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
diff --git a/lzo/src/lzo1b_2.c b/lzo/src/lzo1b_2.c
index e77297b0..0d456b8a 100644
--- a/lzo/src/lzo1b_2.c
+++ b/lzo/src/lzo1b_2.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
diff --git a/lzo/src/lzo1b_3.c b/lzo/src/lzo1b_3.c
index 4a212ff2..af7b12da 100644
--- a/lzo/src/lzo1b_3.c
+++ b/lzo/src/lzo1b_3.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
diff --git a/lzo/src/lzo1b_4.c b/lzo/src/lzo1b_4.c
index bb559cea..9ce8abf3 100644
--- a/lzo/src/lzo1b_4.c
+++ b/lzo/src/lzo1b_4.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
diff --git a/lzo/src/lzo1b_5.c b/lzo/src/lzo1b_5.c
index c0d99b9f..6052f5fd 100644
--- a/lzo/src/lzo1b_5.c
+++ b/lzo/src/lzo1b_5.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
diff --git a/lzo/src/lzo1b_6.c b/lzo/src/lzo1b_6.c
index f1c52c55..d31511ab 100644
--- a/lzo/src/lzo1b_6.c
+++ b/lzo/src/lzo1b_6.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
diff --git a/lzo/src/lzo1b_7.c b/lzo/src/lzo1b_7.c
index 0cf5a214..5545458b 100644
--- a/lzo/src/lzo1b_7.c
+++ b/lzo/src/lzo1b_7.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
diff --git a/lzo/src/lzo1b_8.c b/lzo/src/lzo1b_8.c
index 34263717..693d90ed 100644
--- a/lzo/src/lzo1b_8.c
+++ b/lzo/src/lzo1b_8.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
diff --git a/lzo/src/lzo1b_9.c b/lzo/src/lzo1b_9.c
index 40509564..e6d3fb46 100644
--- a/lzo/src/lzo1b_9.c
+++ b/lzo/src/lzo1b_9.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
diff --git a/lzo/src/lzo1b_99.c b/lzo/src/lzo1b_99.c
index df274a09..a0e44462 100644
--- a/lzo/src/lzo1b_99.c
+++ b/lzo/src/lzo1b_99.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
diff --git a/lzo/src/lzo1b_9x.c b/lzo/src/lzo1b_9x.c
index b80eca53..e00186d5 100644
--- a/lzo/src/lzo1b_9x.c
+++ b/lzo/src/lzo1b_9x.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
@@ -45,12 +48,12 @@
//
************************************************************************/
-#define N 0xffffL /* size of ring buffer */
-#define THRESHOLD 2 /* lower limit for match length */
-#define F 2048 /* upper limit for match length */
+#define SWD_N 0xffffL /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
-#define LZO1B
+#define LZO1B 1
#define LZO_COMPRESS_T lzo1b_999_t
#define lzo_swd_t lzo1b_999_swd_t
#include "lzo_mchw.ch"
@@ -240,7 +243,7 @@ lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
assert(m_len > 0);
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
@@ -275,7 +278,7 @@ lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* a literal */
lit++;
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
else
{
@@ -310,7 +313,7 @@ lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
c->codesize = pd(op, out);
diff --git a/lzo/src/lzo1b_c.ch b/lzo/src/lzo1b_c.ch
index 67ef4ff3..a17e3adb 100644
--- a/lzo/src/lzo1b_c.ch
+++ b/lzo/src/lzo1b_c.ch
@@ -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
@@ -44,17 +47,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
@@ -97,7 +100,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;
@@ -109,7 +112,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
#endif
/* init dictionary */
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
#endif
@@ -135,7 +138,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 +228,7 @@ match:
assert(ip <= in_end);
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
{
lzo_uint i;
const lzo_bytep p;
diff --git a/lzo/src/lzo1b_cc.c b/lzo/src/lzo1b_cc.c
index 45b0f851..cc7c2e87 100644
--- a/lzo/src/lzo1b_cc.c
+++ b/lzo/src/lzo1b_cc.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
@@ -38,7 +41,7 @@
*/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1b.h"
@@ -57,14 +60,14 @@ int _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len,
#endif
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
_lzo1b_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 +94,15 @@ int _lzo1b_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 +123,7 @@ int _lzo1b_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 lzo1b_stats = &lzo_statistics;
diff --git a/lzo/src/lzo1b_cc.h b/lzo/src/lzo1b_cc.h
index a984dadd..fef3556c 100644
--- a/lzo/src/lzo1b_cc.h
+++ b/lzo/src/lzo1b_cc.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO1B_CC_H
-#define __LZO1B_CC_H
+#define __LZO1B_CC_H 1
/***********************************************************************
diff --git a/lzo/src/lzo1b_cm.ch b/lzo/src/lzo1b_cm.ch
index f47884bf..7bd50a78 100644
--- a/lzo/src/lzo1b_cm.ch
+++ b/lzo/src/lzo1b_cm.ch
@@ -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
diff --git a/lzo/src/lzo1b_cr.ch b/lzo/src/lzo1b_cr.ch
index f98e0a50..61cc7f6e 100644
--- a/lzo/src/lzo1b_cr.ch
+++ b/lzo/src/lzo1b_cr.ch
@@ -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
diff --git a/lzo/src/lzo1b_d.ch b/lzo/src/lzo1b_d.ch
index e38fad58..fe5f3611 100644
--- a/lzo/src/lzo1b_d.ch
+++ b/lzo/src/lzo1b_d.ch
@@ -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
@@ -95,8 +98,8 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
NEED_IP(t); NEED_OP(t);
#if 1 && defined(LZO_UNALIGNED_OK_4)
do {
- * (lzo_uint32p) (op+0) = * (const lzo_uint32p) (ip+0);
- * (lzo_uint32p) (op+4) = * (const lzo_uint32p) (ip+4);
+ UA_COPY32(op+0, ip+0);
+ UA_COPY32(op+4, ip+4);
op += 8; ip += 8;
t -= 8;
} while (t > 0);
@@ -114,7 +117,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
if (t >= 4)
{
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) ip;
+ UA_COPY32(op, ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -205,10 +208,10 @@ match:
#if defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (M3_MIN_LEN - 1) && (op - m_pos) >= 4)
{
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY32(op, m_pos);
op += 4; m_pos += 4; t -= 4 - (M3_MIN_LEN - 1);
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY32(op, m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
diff --git a/lzo/src/lzo1b_d1.c b/lzo/src/lzo1b_d1.c
index 1228ccc5..3b15686b 100644
--- a/lzo/src/lzo1b_d1.c
+++ b/lzo/src/lzo1b_d1.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
diff --git a/lzo/src/lzo1b_d2.c b/lzo/src/lzo1b_d2.c
index b39138d4..1c54d583 100644
--- a/lzo/src/lzo1b_d2.c
+++ b/lzo/src/lzo1b_d2.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
@@ -40,7 +43,7 @@
#include "config1b.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1b_decompress_safe
#include "lzo1b_d.ch"
diff --git a/lzo/src/lzo1b_de.h b/lzo/src/lzo1b_de.h
index badba73e..5cba46f3 100644
--- a/lzo/src/lzo1b_de.h
+++ b/lzo/src/lzo1b_de.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_DEFS_H
-#define __LZO_DEFS_H
+#define __LZO_DEFS_H 1
#ifdef __cplusplus
extern "C" {
diff --git a/lzo/src/lzo1b_r.ch b/lzo/src/lzo1b_r.ch
index b350748b..c8ebbc54 100644
--- a/lzo/src/lzo1b_r.ch
+++ b/lzo/src/lzo1b_r.ch
@@ -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
diff --git a/lzo/src/lzo1b_rr.c b/lzo/src/lzo1b_rr.c
index c4a3fc4e..e9eb24c8 100644
--- a/lzo/src/lzo1b_rr.c
+++ b/lzo/src/lzo1b_rr.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
diff --git a/lzo/src/lzo1b_sm.ch b/lzo/src/lzo1b_sm.ch
index aa67f219..89ba3a77 100644
--- a/lzo/src/lzo1b_sm.ch
+++ b/lzo/src/lzo1b_sm.ch
@@ -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
@@ -79,7 +82,7 @@
const lzo_bytep ip_sav;
unsigned j = DD_SIZE;
lzo_uint x_len;
- lzo_uint x_off;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, x_off, 0);
DVAL_ASSERT(dv,ip);
@@ -89,10 +92,10 @@
#if !defined(NDEBUG)
const lzo_bytep z_pos = NULL;
#endif
-#if defined(LZO_DICT_USE_PTR)
+#if (LZO_DICT_USE_PTR)
m_pos = *d;
assert((z_pos = m_pos) == *d);
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
assert(m_pos == NULL || m_pos >= in);
assert(m_pos == NULL || m_pos < ip);
#endif
@@ -111,7 +114,7 @@
((void)(0));
else if (*m_pos++ == *ip++ && *m_pos++ == *ip++ && *m_pos++ == *ip++)
{
-#if !defined(LZO_DICT_USE_PTR)
+#if !(LZO_DICT_USE_PTR)
assert((z_pos = ip - 3 - x_off) == (m_pos - 3));
#endif
/* a match */
diff --git a/lzo/src/lzo1b_tm.ch b/lzo/src/lzo1b_tm.ch
index 6d929def..94c79e2a 100644
--- a/lzo/src/lzo1b_tm.ch
+++ b/lzo/src/lzo1b_tm.ch
@@ -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
@@ -53,8 +56,8 @@
#if (DD_BITS == 0)
try_match:
-#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR)
-#if defined(LZO_DETERMINISTIC)
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
+#if (LZO_DETERMINISTIC)
assert(m_pos == NULL || m_pos >= in);
assert(m_pos == NULL || m_pos < ip);
#endif
diff --git a/lzo/src/lzo1b_xx.c b/lzo/src/lzo1b_xx.c
index 11cfe358..49d4dd12 100644
--- a/lzo/src/lzo1b_xx.c
+++ b/lzo/src/lzo1b_xx.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
diff --git a/lzo/src/lzo1c_1.c b/lzo/src/lzo1c_1.c
index 94358823..98dbfae7 100644
--- a/lzo/src/lzo1c_1.c
+++ b/lzo/src/lzo1c_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
diff --git a/lzo/src/lzo1c_2.c b/lzo/src/lzo1c_2.c
index b2b52b21..181fa9dc 100644
--- a/lzo/src/lzo1c_2.c
+++ b/lzo/src/lzo1c_2.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
diff --git a/lzo/src/lzo1c_3.c b/lzo/src/lzo1c_3.c
index 5b1ea992..9f5ea878 100644
--- a/lzo/src/lzo1c_3.c
+++ b/lzo/src/lzo1c_3.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
diff --git a/lzo/src/lzo1c_4.c b/lzo/src/lzo1c_4.c
index 043c93df..61e4b5d3 100644
--- a/lzo/src/lzo1c_4.c
+++ b/lzo/src/lzo1c_4.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
diff --git a/lzo/src/lzo1c_5.c b/lzo/src/lzo1c_5.c
index e25968f5..0efcf2ad 100644
--- a/lzo/src/lzo1c_5.c
+++ b/lzo/src/lzo1c_5.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
diff --git a/lzo/src/lzo1c_6.c b/lzo/src/lzo1c_6.c
index cc14297b..5074171b 100644
--- a/lzo/src/lzo1c_6.c
+++ b/lzo/src/lzo1c_6.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
diff --git a/lzo/src/lzo1c_7.c b/lzo/src/lzo1c_7.c
index e41ebdb6..437f0445 100644
--- a/lzo/src/lzo1c_7.c
+++ b/lzo/src/lzo1c_7.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
diff --git a/lzo/src/lzo1c_8.c b/lzo/src/lzo1c_8.c
index f7542e73..2a6a67ed 100644
--- a/lzo/src/lzo1c_8.c
+++ b/lzo/src/lzo1c_8.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
diff --git a/lzo/src/lzo1c_9.c b/lzo/src/lzo1c_9.c
index f84a01a2..df961e18 100644
--- a/lzo/src/lzo1c_9.c
+++ b/lzo/src/lzo1c_9.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
diff --git a/lzo/src/lzo1c_99.c b/lzo/src/lzo1c_99.c
index cd604029..0cc1c2d3 100644
--- a/lzo/src/lzo1c_99.c
+++ b/lzo/src/lzo1c_99.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
diff --git a/lzo/src/lzo1c_9x.c b/lzo/src/lzo1c_9x.c
index d96c3e9a..4b7091ff 100644
--- a/lzo/src/lzo1c_9x.c
+++ b/lzo/src/lzo1c_9x.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
@@ -45,12 +48,12 @@
//
************************************************************************/
-#define N 16383 /* size of ring buffer */
-#define THRESHOLD 2 /* lower limit for match length */
-#define F 2048 /* upper limit for match length */
+#define SWD_N 16383 /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
-#define LZO1C
+#define LZO1C 1
#define LZO_COMPRESS_T lzo1c_999_t
#define lzo_swd_t lzo1c_999_swd_t
#include "lzo_mchw.ch"
@@ -246,7 +249,7 @@ lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
assert(m_len > 0);
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
@@ -281,7 +284,7 @@ lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* a literal */
lit++;
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
else
{
@@ -324,7 +327,7 @@ lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
c->codesize = pd(op, out);
diff --git a/lzo/src/lzo1c_cc.c b/lzo/src/lzo1c_cc.c
index 6e367df6..9618cf3c 100644
--- a/lzo/src/lzo1c_cc.c
+++ b/lzo/src/lzo1c_cc.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
@@ -38,7 +41,7 @@
*/
-#define LZO_NEED_DICT_H
+#define LZO_NEED_DICT_H 1
#include "config1c.h"
@@ -57,14 +60,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 +94,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 +123,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;
diff --git a/lzo/src/lzo1c_cc.h b/lzo/src/lzo1c_cc.h
index 14c59040..c2f081da 100644
--- a/lzo/src/lzo1c_cc.h
+++ b/lzo/src/lzo1c_cc.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO1C_CC_H
-#define __LZO1C_CC_H
+#define __LZO1C_CC_H 1
/***********************************************************************
diff --git a/lzo/src/lzo1c_d1.c b/lzo/src/lzo1c_d1.c
index f27438c4..940820cf 100644
--- a/lzo/src/lzo1c_d1.c
+++ b/lzo/src/lzo1c_d1.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
diff --git a/lzo/src/lzo1c_d2.c b/lzo/src/lzo1c_d2.c
index 030fef8c..b055311f 100644
--- a/lzo/src/lzo1c_d2.c
+++ b/lzo/src/lzo1c_d2.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
@@ -40,7 +43,7 @@
#include "config1c.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1c_decompress_safe
#include "lzo1b_d.ch"
diff --git a/lzo/src/lzo1c_rr.c b/lzo/src/lzo1c_rr.c
index ec279f8b..6a516f68 100644
--- a/lzo/src/lzo1c_rr.c
+++ b/lzo/src/lzo1c_rr.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
diff --git a/lzo/src/lzo1c_xx.c b/lzo/src/lzo1c_xx.c
index f6a547f9..c9af645d 100644
--- a/lzo/src/lzo1c_xx.c
+++ b/lzo/src/lzo1c_xx.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
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;
}
diff --git a/lzo/src/lzo1f_9x.c b/lzo/src/lzo1f_9x.c
index 4240a771..3846651a 100644
--- a/lzo/src/lzo1f_9x.c
+++ b/lzo/src/lzo1f_9x.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
@@ -45,12 +48,12 @@
//
************************************************************************/
-#define N 16383 /* size of ring buffer */
-#define THRESHOLD 2 /* lower limit for match length */
-#define F 2048 /* upper limit for match length */
+#define SWD_N 16383 /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
-#define LZO1F
+#define LZO1F 1
#define LZO_COMPRESS_T lzo1f_999_t
#define lzo_swd_t lzo1f_999_swd_t
#include "lzo_mchw.ch"
@@ -221,7 +224,7 @@ lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
if (m_len > 0 && lazy_match_min_gain >= 0 && c->look > m_len)
{
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
assert(c->look > 0);
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
@@ -272,7 +275,7 @@ lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* a literal */
lit++;
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
else
{
@@ -290,7 +293,7 @@ lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* 2 - code match */
op = code_match(c,op,m_len,m_off);
r = find_match(c,swd,m_len,1+ahead);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
c->codesize = pd(op, out);
diff --git a/lzo/src/lzo1f_d.ch b/lzo/src/lzo1f_d.ch
index 282ab35d..9e942f51 100644
--- a/lzo/src/lzo1f_d.ch
+++ b/lzo/src/lzo1f_d.ch
@@ -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
@@ -91,7 +94,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
if (t >= 4)
{
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) ip;
+ UA_COPY32(op, ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -142,7 +145,7 @@ match:
NEED_IP(2);
m_pos = op;
#if defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= (* (const lzo_ushortp) ip) >> 2;
+ m_pos -= UA_GET16(ip) >> 2;
ip += 2;
#else
m_pos -= *ip++ >> 2;
@@ -157,10 +160,10 @@ match:
#if defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY32(op, m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- * (lzo_uint32p) op = * (const lzo_uint32p) m_pos;
+ UA_COPY32(op, m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
diff --git a/lzo/src/lzo1f_d1.c b/lzo/src/lzo1f_d1.c
index 7f70bfdb..0b80696d 100644
--- a/lzo/src/lzo1f_d1.c
+++ b/lzo/src/lzo1f_d1.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
diff --git a/lzo/src/lzo1f_d2.c b/lzo/src/lzo1f_d2.c
index 1e65dcf7..7bc407d1 100644
--- a/lzo/src/lzo1f_d2.c
+++ b/lzo/src/lzo1f_d2.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
@@ -40,7 +43,7 @@
#include "config1f.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1f_decompress_safe
#include "lzo1f_d.ch"
diff --git a/lzo/src/lzo1x_1.c b/lzo/src/lzo1x_1.c
index ac4b85cd..ca60c44a 100644
--- a/lzo/src/lzo1x_1.c
+++ b/lzo/src/lzo1x_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
@@ -38,13 +41,30 @@
*/
-#define LZO_NEED_DICT_H
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t unsigned short
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
#define D_BITS 14
+#endif
#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
-
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+#ifndef DO_COMPRESS
#define DO_COMPRESS lzo1x_1_compress
+#endif
#include "lzo1x_c.ch"
diff --git a/lzo/src/lzo1x_1k.c b/lzo/src/lzo1x_1k.c
index e100ff19..4d312221 100644
--- a/lzo/src/lzo1x_1k.c
+++ b/lzo/src/lzo1x_1k.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
@@ -38,13 +41,30 @@
*/
-#define LZO_NEED_DICT_H
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t unsigned short
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
#define D_BITS 11
+#endif
#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,3,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
-
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+#ifndef DO_COMPRESS
#define DO_COMPRESS lzo1x_1_11_compress
+#endif
#include "lzo1x_c.ch"
diff --git a/lzo/src/lzo1x_1l.c b/lzo/src/lzo1x_1l.c
index 15718306..018bedd9 100644
--- a/lzo/src/lzo1x_1l.c
+++ b/lzo/src/lzo1x_1l.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
@@ -38,13 +41,30 @@
*/
-#define LZO_NEED_DICT_H
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t unsigned short
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
#define D_BITS 12
+#endif
#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,4,5)) >> 5)
#define D_INDEX2(d,p) d = d ^ D_MASK
-
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+#ifndef DO_COMPRESS
#define DO_COMPRESS lzo1x_1_12_compress
+#endif
#include "lzo1x_c.ch"
diff --git a/lzo/src/lzo1x_1o.c b/lzo/src/lzo1x_1o.c
index 979ca448..b3cba7e0 100644
--- a/lzo/src/lzo1x_1o.c
+++ b/lzo/src/lzo1x_1o.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
@@ -38,13 +41,31 @@
*/
-#define LZO_NEED_DICT_H
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t unsigned short
+#define D_BITS 13
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
#define D_BITS 15
+#endif
#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
-
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+#ifndef DO_COMPRESS
#define DO_COMPRESS lzo1x_1_15_compress
+#endif
#include "lzo1x_c.ch"
diff --git a/lzo/src/lzo1x_9x.c b/lzo/src/lzo1x_9x.c
index b108bf8e..f910a69e 100644
--- a/lzo/src/lzo1x_9x.c
+++ b/lzo/src/lzo1x_9x.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
@@ -39,7 +42,7 @@
#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
-# define LZO1X
+# define LZO1X 1
#endif
#if defined(LZO1X)
@@ -57,9 +60,9 @@
//
************************************************************************/
-#define N M4_MAX_OFFSET /* size of ring buffer */
-#define THRESHOLD 1 /* lower limit for match length */
-#define F 2048 /* upper limit for match length */
+#define SWD_N M4_MAX_OFFSET /* size of ring buffer */
+#define SWD_THRESHOLD 1 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
#define SWD_BEST_OFF (LZO_MAX3( M2_MAX_LEN, M3_MAX_LEN, M4_MAX_LEN ) + 1)
@@ -103,7 +106,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len,
lzo_callback_p cb,
- int try_lazy,
+ int try_lazy_parm,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
@@ -127,8 +130,8 @@ code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
/*
static lzo_uint last_m_len = 0, last_m_off = 0;
static lzo_uint prev_m_off[4];
- static int prev_m_off_ptr = 0;
- int i;
+ static unsigned prev_m_off_ptr = 0;
+ unsigned i;
//if (m_len >= 3 && m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
if (m_len >= 3 && m_len <= M2_MAX_LEN)
@@ -142,7 +145,7 @@ code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
{
for (i = 0; i < 4; i++)
if (m_off == prev_m_off[i])
- printf("prev_m_off %d: %5ld\n",i,(long)m_off);
+ printf("prev_m_off %u: %5ld\n",i,(long)m_off);
}
}
last_m_len = m_len;
@@ -343,15 +346,15 @@ code_run ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii,
//
************************************************************************/
-static int
+static lzo_uint
len_of_coded_match ( lzo_uint m_len, lzo_uint m_off, lzo_uint lit )
{
- int n = 4;
+ lzo_uint n = 4;
if (m_len < 2)
- return -1;
+ return 0;
if (m_len == 2)
- return (m_off <= M1_MAX_OFFSET && lit > 0 && lit < 4) ? 2 : -1;
+ return (m_off <= M1_MAX_OFFSET && lit > 0 && lit < 4) ? 2 : 0;
if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
return 2;
if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && lit >= 4)
@@ -380,20 +383,20 @@ len_of_coded_match ( lzo_uint m_len, lzo_uint m_off, lzo_uint lit )
}
return n;
}
- return -1;
+ return 0;
}
-static lzo_int
-min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, int l1, int l2, int l3)
+static lzo_uint
+min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, lzo_uint l1, lzo_uint l2, lzo_uint l3)
{
- lzo_int lazy_match_min_gain = 0;
+ lzo_uint lazy_match_min_gain;
assert (ahead >= 1);
- lazy_match_min_gain += ahead;
+ lazy_match_min_gain = ahead;
#if 0
- if (l3 > 0)
+ if (l3)
lit2 -= ahead;
#endif
@@ -403,10 +406,10 @@ min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, int l1, int l2, int l3)
lazy_match_min_gain += (lit2 <= 18) ? 0 : 1;
lazy_match_min_gain += (l2 - l1) * 2;
- if (l3 > 0)
+ if (l3)
lazy_match_min_gain -= (ahead - l3) * 2;
- if (lazy_match_min_gain < 0)
+ if ((lzo_int) lazy_match_min_gain < 0)
lazy_match_min_gain = 0;
#if 0
@@ -535,7 +538,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len,
lzo_callback_p cb,
- int try_lazy,
+ int try_lazy_parm,
lzo_uint good_length,
lzo_uint max_lazy,
lzo_uint nice_length,
@@ -549,6 +552,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
LZO_COMPRESS_T cc;
LZO_COMPRESS_T * const c = &cc;
lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ lzo_uint try_lazy;
int r;
/* sanity check */
@@ -564,19 +568,20 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
/* setup parameter defaults */
/* number of lazy match tries */
- if (try_lazy < 0)
+ try_lazy = (lzo_uint) try_lazy_parm;
+ if (try_lazy_parm < 0)
try_lazy = 1;
/* reduce lazy match search if we already have a match with this length */
- if (good_length <= 0)
+ if (good_length == 0)
good_length = 32;
/* do not try a lazy match if we already have a match with this length */
- if (max_lazy <= 0)
+ if (max_lazy == 0)
max_lazy = 32;
/* stop searching for longer matches than this one */
- if (nice_length <= 0)
+ if (nice_length == 0)
nice_length = 0;
/* don't search more positions than this */
- if (max_chain <= 0)
+ if (max_chain == 0)
max_chain = SWD_MAX_CHAIN;
c->init = 0;
@@ -607,7 +612,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
{
lzo_uint ahead;
lzo_uint max_ahead;
- int l1, l2, l3;
+ lzo_uint l1, l2, l3;
c->codesize = pd(op, out);
@@ -648,7 +653,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lit++;
swd->max_chain = max_chain;
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
continue;
}
@@ -660,10 +665,9 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
assert_match(swd,m_len,m_off);
-
/* shall we try a lazy match ? */
ahead = 0;
- if (try_lazy <= 0 || m_len >= max_lazy)
+ if (try_lazy == 0 || m_len >= max_lazy)
{
/* no */
l1 = 0;
@@ -675,7 +679,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
l1 = len_of_coded_match(m_len,m_off,lit);
assert(l1 > 0);
#if 1
- max_ahead = LZO_MIN((lzo_uint)try_lazy, (lzo_uint)l1 - 1);
+ max_ahead = LZO_MIN(try_lazy, l1 - 1);
#else
max_ahead = LZO_MIN3(try_lazy, l1, m_len - 1);
#endif
@@ -684,7 +688,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
while (ahead < max_ahead && c->look > m_len)
{
- lzo_int lazy_match_min_gain;
+ lzo_uint lazy_match_min_gain;
if (m_len >= good_length)
swd->max_chain = max_chain >> 2;
@@ -693,7 +697,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
r = find_match(c,swd,1,0);
ahead++;
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
assert(c->look > 0);
assert(ii + lit + ahead == c->bp);
@@ -713,7 +717,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
better_match(swd,&c->m_len,&c->m_off);
#endif
l2 = len_of_coded_match(c->m_len,c->m_off,lit+ahead);
- if (l2 < 0)
+ if (l2 == 0)
continue;
#if 0
if (c->m_len == m_len && l2 >= l1)
@@ -723,7 +727,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
#if 1
/* compressed-data compatibility [see above] */
- l3 = (op == out) ? -1 : len_of_coded_match(ahead,m_off,lit);
+ l3 = (op == out) ? 0 : len_of_coded_match(ahead,m_off,lit);
#else
l3 = len_of_coded_match(ahead,m_off,lit);
#endif
@@ -734,7 +738,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
c->lazy++;
assert_match(swd,c->m_len,c->m_off);
- if (l3 > 0)
+ if (l3)
{
/* code previous run */
op = code_run(c,op,ii,lit,ahead);
@@ -762,7 +766,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
op = code_match(c,op,m_len,m_off);
swd->max_chain = max_chain;
r = find_match(c,swd,m_len,1+ahead);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
lazy_match_done: ;
}
@@ -812,24 +816,24 @@ lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len,
{
static const struct
{
- int try_lazy;
+ int try_lazy_parm;
lzo_uint good_length;
lzo_uint max_lazy;
lzo_uint nice_length;
lzo_uint max_chain;
lzo_uint32 flags;
} c[9] = {
- { 0, 0, 0, 8, 4, 0 }, /* faster compression */
- { 0, 0, 0, 16, 8, 0 },
- { 0, 0, 0, 32, 16, 0 },
-
- { 1, 4, 4, 16, 16, 0 },
- { 1, 8, 16, 32, 32, 0 },
- { 1, 8, 16, 128, 128, 0 },
-
- { 2, 8, 32, 128, 256, 0 },
- { 2, 32, 128, F, 2048, 1 },
- { 2, F, F, F, 4096, 1 } /* max. compression */
+ /* faster compression */
+ { 0, 0, 0, 8, 4, 0 },
+ { 0, 0, 0, 16, 8, 0 },
+ { 0, 0, 0, 32, 16, 0 },
+ { 1, 4, 4, 16, 16, 0 },
+ { 1, 8, 16, 32, 32, 0 },
+ { 1, 8, 16, 128, 128, 0 },
+ { 2, 8, 32, 128, 256, 0 },
+ { 2, 32, 128, SWD_F, 2048, 1 },
+ { 2, SWD_F, SWD_F, SWD_F, 4096, 1 }
+ /* max. compression */
};
if (compression_level < 1 || compression_level > 9)
@@ -838,7 +842,7 @@ lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len,
compression_level -= 1;
return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem,
dict, dict_len, cb,
- c[compression_level].try_lazy,
+ c[compression_level].try_lazy_parm,
c[compression_level].good_length,
c[compression_level].max_lazy,
#if 0
diff --git a/lzo/src/lzo1x_c.ch b/lzo/src/lzo1x_c.ch
index 08d615e2..b2646249 100644
--- a/lzo/src/lzo1x_c.ch
+++ b/lzo/src/lzo1x_c.ch
@@ -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
@@ -39,6 +42,23 @@
+#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
+ /* choose a unique name to better help PGO optimizations */
+# define do_compress LZO_CPP_ECONCAT2(DO_COMPRESS,_core)
+#endif
+
+#if defined(UA_GET64) && (LZO_ABI_BIG_ENDIAN)
+# define WANT_lzo_bitops_clz64 1
+#elif defined(UA_GET64) && (LZO_ABI_LITTLE_ENDIAN)
+# define WANT_lzo_bitops_ctz64 1
+#elif defined(UA_GET32) && (LZO_ABI_BIG_ENDIAN)
+# define WANT_lzo_bitops_clz32 1
+#elif defined(UA_GET32) && (LZO_ABI_LITTLE_ENDIAN)
+# define WANT_lzo_bitops_ctz32 1
+#endif
+#include "lzo_func.ch"
+
+
/***********************************************************************
// compress a block of data.
************************************************************************/
@@ -46,12 +66,12 @@
static __lzo_noinline lzo_uint
do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
- lzo_voidp wrkmem )
+ lzo_uint ti, lzo_voidp wrkmem)
{
register const lzo_bytep ip;
lzo_bytep op;
const lzo_bytep const in_end = in + in_len;
- const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5;
+ const lzo_bytep const ip_end = in + in_len - 20;
const lzo_bytep ii;
lzo_dict_p const dict = (lzo_dict_p) wrkmem;
@@ -59,14 +79,17 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
ip = in;
ii = ip;
- ip += 4;
+ ip += ti < 4 ? 4 - ti : 0;
for (;;)
{
- register const lzo_bytep m_pos;
- lzo_uint m_off;
+ const lzo_bytep m_pos;
+#if !(LZO_DETERMINISTIC)
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
lzo_uint m_len;
lzo_uint dindex;
-
+next:
+ if __lzo_unlikely(ip >= ip_end)
+ break;
DINDEX1(dindex,ip);
GINDEX(m_pos,m_off,dict,dindex,in);
if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
@@ -83,210 +106,250 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
goto try_match;
goto literal;
-
try_match:
-#if 1 && defined(LZO_UNALIGNED_OK_2)
- if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
+#if defined(UA_GET32)
+ if (UA_GET32(m_pos) != UA_GET32(ip))
#else
- if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
#endif
{
+ /* a literal */
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ ip += 1 + ((ip - ii) >> 5);
+ continue;
}
- else
- {
- if __lzo_likely(m_pos[2] == ip[2])
- {
-#if 0
- if (m_off <= M2_MAX_OFFSET)
- goto match;
- if (lit <= 3)
- goto match;
- if (lit == 3) /* better compression, but slower */
- {
- assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
- *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
- goto code_match;
- }
- if (m_pos[3] == ip[3])
-#endif
- goto match;
- }
- else
- {
- /* still need a better way for finding M1 matches */
-#if 0
- /* a M1 match */
-#if 0
- if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
+/*match:*/
+ UPDATE_I(dict,0,dindex,ip,in);
#else
- if (m_off <= M1_MAX_OFFSET && lit == 3)
-#endif
- {
- register lzo_uint t;
-
- t = lit;
- assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
- do *op++ = *ii++; while (--t > 0);
- assert(ii == ip);
- m_off -= 1;
- *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
- *op++ = LZO_BYTE(m_off >> 2);
- ip += 2;
- goto match_done;
- }
-#endif
- }
- }
-
-
- /* a literal */
+ lzo_uint m_off;
+ lzo_uint m_len;
+ {
+ lzo_uint32 dv;
+ lzo_uint dindex;
literal:
- UPDATE_I(dict,0,dindex,ip,in);
- ++ip;
+ ip += 1 + ((ip - ii) >> 5);
+next:
if __lzo_unlikely(ip >= ip_end)
break;
- continue;
-
+ dv = UA_GET32(ip);
+ dindex = DINDEX(dv,ip);
+ GINDEX(m_off,m_pos,in+dict,dindex,in);
+ UPDATE_I(dict,0,dindex,ip,in);
+ if __lzo_unlikely(dv != UA_GET32(m_pos))
+ goto literal;
+ }
+#endif
/* a match */
-match:
- UPDATE_I(dict,0,dindex,ip,in);
- /* store current literal run */
- if (pd(ip,ii) > 0)
- {
- register lzo_uint t = pd(ip,ii);
+ ii -= ti; ti = 0;
+ {
+ register lzo_uint t = pd(ip,ii);
+ if (t != 0)
+ {
if (t <= 3)
{
- assert(op - 2 > out);
op[-2] |= LZO_BYTE(t);
+#if defined(UA_COPY32)
+ UA_COPY32(op, ii);
+ op += t;
+#else
+ { do *op++ = *ii++; while (--t > 0); }
+#endif
}
- else if (t <= 18)
+#if defined(UA_COPY32) || defined(UA_COPY64)
+ else if (t <= 16)
+ {
*op++ = LZO_BYTE(t - 3);
+#if defined(UA_COPY64)
+ UA_COPY64(op, ii);
+ UA_COPY64(op+8, ii+8);
+#else
+ UA_COPY32(op, ii);
+ UA_COPY32(op+4, ii+4);
+ UA_COPY32(op+8, ii+8);
+ UA_COPY32(op+12, ii+12);
+#endif
+ op += t;
+ }
+#endif
else
{
- register lzo_uint tt = t - 18;
-
- *op++ = 0;
- while (tt > 255)
+ if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
{
- tt -= 255;
+ register lzo_uint tt = t - 18;
*op++ = 0;
+ while __lzo_unlikely(tt > 255)
+ {
+ tt -= 255;
+#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
+ * (volatile unsigned char *) op++ = 0;
+#else
+ *op++ = 0;
+#endif
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
}
- assert(tt > 0);
- *op++ = LZO_BYTE(tt);
+#if defined(UA_COPY32) || defined(UA_COPY64)
+ do {
+#if defined(UA_COPY64)
+ UA_COPY64(op, ii);
+ UA_COPY64(op+8, ii+8);
+#else
+ UA_COPY32(op, ii);
+ UA_COPY32(op+4, ii+4);
+ UA_COPY32(op+8, ii+8);
+ UA_COPY32(op+12, ii+12);
+#endif
+ op += 16; ii += 16; t -= 16;
+ } while (t >= 16); if (t > 0)
+#endif
+ { do *op++ = *ii++; while (--t > 0); }
}
- do *op++ = *ii++; while (--t > 0);
}
-
- /* code the match */
- assert(ii == ip);
- ip += 3;
- if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
- m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
-#ifdef LZO1Y
- || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
- || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
+ }
+ m_len = 4;
+ {
+#if defined(UA_GET64)
+ lzo_uint64 v;
+ v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 8;
+ v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz64)
+ m_len += lzo_bitops_clz64(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (64 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (64 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz64)
+ m_len += lzo_bitops_ctz64(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
#endif
- )
+#elif defined(UA_GET32)
+ lzo_uint32 v;
+ v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 4;
+ v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz32)
+ m_len += lzo_bitops_clz32(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (32 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (32 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz32)
+ m_len += lzo_bitops_ctz32(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
+#endif
+#else
+ if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
+ do {
+ m_len += 1;
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (ip[m_len] == m_pos[m_len]);
+ }
+#endif
+ }
+m_len_done:
+ m_off = pd(ip,m_pos);
+ ip += m_len;
+ ii = ip;
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
{
- --ip;
- m_len = pd(ip, ii);
- assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
-
- if (m_off <= M2_MAX_OFFSET)
- {
- m_off -= 1;
+ m_off -= 1;
#if defined(LZO1X)
- *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
- *op++ = LZO_BYTE(m_off >> 3);
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
#elif defined(LZO1Y)
- *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
- *op++ = LZO_BYTE(m_off >> 2);
+ *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
#endif
- }
- else if (m_off <= M3_MAX_OFFSET)
- {
- m_off -= 1;
+ }
+ else if (m_off <= M3_MAX_OFFSET)
+ {
+ m_off -= 1;
+ if (m_len <= M3_MAX_LEN)
*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
- goto m3_m4_offset;
- }
else
-#if defined(LZO1X)
{
- m_off -= 0x4000;
- assert(m_off > 0); assert(m_off <= 0x7fff);
- *op++ = LZO_BYTE(M4_MARKER |
- ((m_off & 0x4000) >> 11) | (m_len - 2));
- goto m3_m4_offset;
- }
-#elif defined(LZO1Y)
- goto m4_match;
+ m_len -= M3_MAX_LEN;
+ *op++ = M3_MARKER | 0;
+ while __lzo_unlikely(m_len > 255)
+ {
+ m_len -= 255;
+#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
+ * (volatile unsigned char *) op++ = 0;
+#else
+ *op++ = 0;
#endif
+ }
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
}
else
{
- {
- const lzo_bytep end = in_end;
- const lzo_bytep m = m_pos + M2_MAX_LEN + 1;
- while (ip < end && *m == *ip)
- m++, ip++;
- m_len = pd(ip, ii);
- }
- assert(m_len > M2_MAX_LEN);
-
- if (m_off <= M3_MAX_OFFSET)
- {
- m_off -= 1;
- if (m_len <= 33)
- *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
- else
- {
- m_len -= 33;
- *op++ = M3_MARKER | 0;
- goto m3_m4_len;
- }
- }
+ m_off -= 0x4000;
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2));
else
{
-#if defined(LZO1Y)
-m4_match:
-#endif
- m_off -= 0x4000;
- assert(m_off > 0); assert(m_off <= 0x7fff);
- if (m_len <= M4_MAX_LEN)
- *op++ = LZO_BYTE(M4_MARKER |
- ((m_off & 0x4000) >> 11) | (m_len - 2));
- else
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8));
+ while __lzo_unlikely(m_len > 255)
{
- m_len -= M4_MAX_LEN;
- *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
-m3_m4_len:
- while (m_len > 255)
- {
- m_len -= 255;
- *op++ = 0;
- }
- assert(m_len > 0);
- *op++ = LZO_BYTE(m_len);
+ m_len -= 255;
+#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
+ * (volatile unsigned char *) op++ = 0;
+#else
+ *op++ = 0;
+#endif
}
+ *op++ = LZO_BYTE(m_len);
}
-
-m3_m4_offset:
- *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off << 2);
*op++ = LZO_BYTE(m_off >> 6);
}
-
-#if 0
-match_done:
-#endif
- ii = ip;
- if __lzo_unlikely(ip >= ip_end)
- break;
+ goto next;
}
*out_len = pd(op, out);
- return pd(in_end,ii);
+ return pd(in_end,ii-ti);
}
@@ -299,16 +362,30 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
+ const lzo_bytep ip = in;
lzo_bytep op = out;
- lzo_uint t;
+ lzo_uint l = in_len;
+ lzo_uint t = 0;
- if __lzo_unlikely(in_len <= M2_MAX_LEN + 5)
- t = in_len;
- else
+ while (l > 20)
{
- t = do_compress(in,in_len,op,out_len,wrkmem);
+ lzo_uint ll = l;
+ lzo_uintptr_t ll_end;
+#if 0 || (LZO_DETERMINISTIC)
+ ll = LZO_MIN(ll, 49152);
+#endif
+ ll_end = (lzo_uintptr_t)ip + ll;
+ if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll)
+ break;
+#if (LZO_DETERMINISTIC)
+ lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t));
+#endif
+ t = do_compress(ip,ll,op,out_len,t,wrkmem);
+ ip += ll;
op += *out_len;
+ l -= ll;
}
+ t += l;
if (t > 0)
{
@@ -328,7 +405,13 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
while (tt > 255)
{
tt -= 255;
+#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
+ /* prevent the compiler from transforming this loop
+ * into a memset() call */
+ * (volatile unsigned char *) op++ = 0;
+#else
*op++ = 0;
+#endif
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
@@ -348,4 +431,3 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
/*
vi:ts=4:et
*/
-
diff --git a/lzo/src/lzo1x_d.ch b/lzo/src/lzo1x_d.ch
index d068866b..49cf3266 100644
--- a/lzo/src/lzo1x_d.ch
+++ b/lzo/src/lzo1x_d.ch
@@ -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
@@ -41,17 +44,6 @@
#include "lzo1_d.ch"
-#undef __COPY4
-#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
-
-#undef COPY4
-#if defined(LZO_UNALIGNED_OK_4)
-# define COPY4(dst,src) __COPY4(dst,src)
-#elif defined(LZO_ALIGNED_OK_4)
-# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
-#endif
-
-
/***********************************************************************
// decompress a block of data.
************************************************************************/
@@ -134,19 +126,36 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
}
/* copy literals */
assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+ t += 3;
+ if (t >= 8) do
+ {
+ UA_COPY64(op,ip);
+ op += 8; ip += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY32(op,ip);
+ op += 4; ip += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ }
+#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
- COPY4(op,ip);
+ UA_COPY32(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
- COPY4(op,ip);
+ UA_COPY32(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -159,7 +168,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
else
#endif
#endif
-#if !defined(LZO_UNALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
@@ -284,7 +293,7 @@ match:
}
#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
m_pos = op - 1;
- m_pos -= (* (const lzo_ushortp) ip) >> 2;
+ m_pos -= UA_GET16(ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
@@ -329,7 +338,7 @@ match:
#if defined(LZO1Z)
m_pos -= (ip[0] << 6) + (ip[1] >> 2);
#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= (* (const lzo_ushortp) ip) >> 2;
+ m_pos -= UA_GET16(ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
@@ -378,7 +387,28 @@ match:
#else /* !COPY_DICT */
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+ if (op - m_pos >= 8)
+ {
+ t += (3 - 1);
+ if (t >= 8) do
+ {
+ UA_COPY64(op,m_pos);
+ op += 8; m_pos += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY32(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = m_pos[0];
+ if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
+ }
+ }
+ else
+#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
#if !defined(LZO_UNALIGNED_OK_4)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
@@ -387,10 +417,10 @@ match:
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
- COPY4(op,m_pos);
+ UA_COPY32(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- COPY4(op,m_pos);
+ UA_COPY32(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
diff --git a/lzo/src/lzo1x_d1.c b/lzo/src/lzo1x_d1.c
index 5fbd9b2d..aa61399f 100644
--- a/lzo/src/lzo1x_d1.c
+++ b/lzo/src/lzo1x_d1.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
diff --git a/lzo/src/lzo1x_d2.c b/lzo/src/lzo1x_d2.c
index f6c84cb6..10a3efe1 100644
--- a/lzo/src/lzo1x_d2.c
+++ b/lzo/src/lzo1x_d2.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
@@ -40,7 +43,7 @@
#include "config1x.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1x_decompress_safe
#include "lzo1x_d.ch"
diff --git a/lzo/src/lzo1x_d3.c b/lzo/src/lzo1x_d3.c
index ffaa6802..93cea502 100644
--- a/lzo/src/lzo1x_d3.c
+++ b/lzo/src/lzo1x_d3.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
@@ -40,7 +43,7 @@
#include "config1x.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define SLOW_MEMCPY(a,b,l) { do *a++ = *b++; while (--l > 0); }
diff --git a/lzo/src/lzo1x_o.c b/lzo/src/lzo1x_o.c
index 89cd1bc7..76a5353e 100644
--- a/lzo/src/lzo1x_o.c
+++ b/lzo/src/lzo1x_o.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
diff --git a/lzo/src/lzo1x_oo.ch b/lzo/src/lzo1x_oo.ch
index e978f399..6bd2cf17 100644
--- a/lzo/src/lzo1x_oo.ch
+++ b/lzo/src/lzo1x_oo.ch
@@ -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
diff --git a/lzo/src/lzo1y_1.c b/lzo/src/lzo1y_1.c
index 0c2b0840..e5490098 100644
--- a/lzo/src/lzo1y_1.c
+++ b/lzo/src/lzo1y_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
@@ -38,13 +41,30 @@
*/
-#define LZO_NEED_DICT_H
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t unsigned short
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
#define D_BITS 14
+#endif
#define D_INDEX1(d,p) d = DX3(p,5,5,6); d += d >> 5; d = DM(d)
#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
-
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
#include "config1y.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+#ifndef DO_COMPRESS
#define DO_COMPRESS lzo1y_1_compress
+#endif
#include "lzo1x_c.ch"
diff --git a/lzo/src/lzo1y_9x.c b/lzo/src/lzo1y_9x.c
index 6275ccd9..dc875768 100644
--- a/lzo/src/lzo1y_9x.c
+++ b/lzo/src/lzo1y_9x.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
@@ -38,5 +41,5 @@
*/
-#define LZO1Y
+#define LZO1Y 1
#include "lzo1x_9x.c"
diff --git a/lzo/src/lzo1y_d1.c b/lzo/src/lzo1y_d1.c
index b6c830d8..59129bde 100644
--- a/lzo/src/lzo1y_d1.c
+++ b/lzo/src/lzo1y_d1.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
diff --git a/lzo/src/lzo1y_d2.c b/lzo/src/lzo1y_d2.c
index 5bc4b6d7..d2da8fa5 100644
--- a/lzo/src/lzo1y_d2.c
+++ b/lzo/src/lzo1y_d2.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
@@ -40,7 +43,7 @@
#include "config1y.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1y_decompress_safe
#include "lzo1x_d.ch"
diff --git a/lzo/src/lzo1y_d3.c b/lzo/src/lzo1y_d3.c
index b6300c68..58cae1d7 100644
--- a/lzo/src/lzo1y_d3.c
+++ b/lzo/src/lzo1y_d3.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
diff --git a/lzo/src/lzo1y_o.c b/lzo/src/lzo1y_o.c
index 5f3b1e87..702ca555 100644
--- a/lzo/src/lzo1y_o.c
+++ b/lzo/src/lzo1y_o.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
diff --git a/lzo/src/lzo1z_9x.c b/lzo/src/lzo1z_9x.c
index 289d5ec9..4c25ba39 100644
--- a/lzo/src/lzo1z_9x.c
+++ b/lzo/src/lzo1z_9x.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
@@ -38,5 +41,5 @@
*/
-#define LZO1Z
+#define LZO1Z 1
#include "lzo1x_9x.c"
diff --git a/lzo/src/lzo1z_d1.c b/lzo/src/lzo1z_d1.c
index b505985e..e4e865c8 100644
--- a/lzo/src/lzo1z_d1.c
+++ b/lzo/src/lzo1z_d1.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
diff --git a/lzo/src/lzo1z_d2.c b/lzo/src/lzo1z_d2.c
index 55420246..96d12d61 100644
--- a/lzo/src/lzo1z_d2.c
+++ b/lzo/src/lzo1z_d2.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
@@ -40,7 +43,7 @@
#include "config1z.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo1z_decompress_safe
#include "lzo1x_d.ch"
diff --git a/lzo/src/lzo1z_d3.c b/lzo/src/lzo1z_d3.c
index b244040a..1e9db9df 100644
--- a/lzo/src/lzo1z_d3.c
+++ b/lzo/src/lzo1z_d3.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
diff --git a/lzo/src/lzo2a_9x.c b/lzo/src/lzo2a_9x.c
index 020e227b..cd54f192 100644
--- a/lzo/src/lzo2a_9x.c
+++ b/lzo/src/lzo2a_9x.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
@@ -46,11 +49,11 @@
//
************************************************************************/
-#define THRESHOLD 1 /* lower limit for match length */
-#define F 2048 /* upper limit for match length */
+#define SWD_THRESHOLD 1 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
-#define LZO2A
+#define LZO2A 1
#define LZO_COMPRESS_T lzo2a_999_t
#define lzo_swd_t lzo2a_999_swd_t
#include "lzo_mchw.ch"
@@ -130,17 +133,17 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
return r;
while (c->look > 0)
{
- int lazy_match_min_gain = 0;
- int extra1 = 0;
- int extra2 = 0;
+ lzo_uint lazy_match_min_gain = 0;
+#if (SWD_N >= 8192)
+ lzo_uint extra1 = 0;
+#endif
+ lzo_uint extra2 = 0;
lzo_uint ahead = 0;
- LZO_UNUSED(extra1);
-
m_len = c->m_len;
m_off = c->m_off;
-#if (N >= 8192)
+#if (SWD_N >= 8192)
if (m_off >= 8192)
{
if (m_len < M3_MIN_LEN)
@@ -153,7 +156,9 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
{
lazy_match_min_gain = 2;
+#if (SWD_N >= 8192)
extra1 = 3;
+#endif
extra2 = 2;
}
else if (m_len >= 10)
@@ -161,7 +166,9 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
else if (m_len >= 3)
{
lazy_match_min_gain = 1;
+#if (SWD_N >= 8192)
extra1 = 1;
+#endif
}
else
m_len = 0;
@@ -170,13 +177,13 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
/* try a lazy match */
if (lazy_match_min_gain > 0 && c->look > m_len)
{
- int lit = swd->b_char;
+ unsigned char lit = LZO_BYTE(swd->b_char);
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
assert(c->look > 0);
-#if (N >= 8192)
+#if (SWD_N >= 8192)
if (m_off < 8192 && c->m_off >= 8192)
lazy_match_min_gain += extra1;
else
@@ -193,7 +200,7 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
lazy_match_min_gain -= 1;
}
- if (lazy_match_min_gain < 1)
+ if ((lzo_int) lazy_match_min_gain < 1)
lazy_match_min_gain = 1;
if (c->m_len >= m_len + lazy_match_min_gain)
@@ -225,13 +232,13 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
putbyte(swd->b_char);
c->lit_bytes++;
r = find_match(c,swd,1,0);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
else
{
assert(m_len >= M1_MIN_LEN);
assert(m_off > 0);
- assert(m_off <= N);
+ assert(m_off <= SWD_N);
/* 2 - code match */
if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
@@ -242,7 +249,7 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
putbyte(m_off - 1);
c->m1++;
}
-#if (N >= 8192)
+#if (SWD_N >= 8192)
else if (m_off >= 8192)
{
unsigned len = m_len;
@@ -279,7 +286,7 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
lzo_uint len = m_len;
putbyte(m_off & 31);
putbyte(m_off >> 5);
-#if (N >= 8192)
+#if (SWD_N >= 8192)
putbit(0);
#endif
len -= 10 - 1;
@@ -293,7 +300,7 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
}
}
r = find_match(c,swd,m_len,1+ahead);
- assert(r == 0);
+ assert(r == 0); LZO_UNUSED(r);
}
c->codesize = pd(op, out);
diff --git a/lzo/src/lzo2a_d.ch b/lzo/src/lzo2a_d.ch
index 5822ac04..48e51caa 100644
--- a/lzo/src/lzo2a_d.ch
+++ b/lzo/src/lzo2a_d.ch
@@ -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
@@ -108,7 +111,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
t >>= 5;
if (t == 0)
{
-#if (N >= 8192)
+#if (SWD_N >= 8192)
NEEDBITS(1);
t = MASKBITS(1);
DUMPBITS(1);
diff --git a/lzo/src/lzo2a_d1.c b/lzo/src/lzo2a_d1.c
index 33fc9feb..55446d03 100644
--- a/lzo/src/lzo2a_d1.c
+++ b/lzo/src/lzo2a_d1.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
diff --git a/lzo/src/lzo2a_d2.c b/lzo/src/lzo2a_d2.c
index 0be669fd..29859b38 100644
--- a/lzo/src/lzo2a_d2.c
+++ b/lzo/src/lzo2a_d2.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
@@ -40,7 +43,7 @@
#include "config2a.h"
-#define LZO_TEST_OVERRUN
+#define LZO_TEST_OVERRUN 1
#define DO_DECOMPRESS lzo2a_decompress_safe
#include "lzo2a_d.ch"
diff --git a/lzo/src/lzo_conf.h b/lzo/src/lzo_conf.h
index 85e10808..5fcf9635 100644
--- a/lzo/src/lzo_conf.h
+++ b/lzo/src/lzo_conf.h
@@ -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
@@ -45,25 +48,25 @@
#ifndef __LZO_CONF_H
-#define __LZO_CONF_H
+#define __LZO_CONF_H 1
#if !defined(__LZO_IN_MINILZO)
-#if defined(LZO_CFG_FREESTANDING)
+#if (LZO_CFG_FREESTANDING)
# define LZO_LIBC_FREESTANDING 1
# define LZO_OS_FREESTANDING 1
# define ACC_LIBC_FREESTANDING 1
# define ACC_OS_FREESTANDING 1
#endif
-#if defined(LZO_CFG_NO_UNALIGNED)
+#if (LZO_CFG_NO_UNALIGNED)
# define ACC_CFG_NO_UNALIGNED 1
#endif
-#if defined(LZO_ARCH_GENERIC)
+#if (LZO_ARCH_GENERIC)
# define ACC_ARCH_GENERIC 1
#endif
-#if defined(LZO_ABI_NEUTRAL_ENDIAN)
+#if (LZO_ABI_NEUTRAL_ENDIAN)
# define ACC_ABI_NEUTRAL_ENDIAN 1
#endif
-#if defined(LZO_HAVE_CONFIG_H)
+#if (LZO_HAVE_CONFIG_H)
# define ACC_CONFIG_NO_HEADER 1
#endif
#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
@@ -92,15 +95,18 @@
# pragma warning(disable: 4127 4701)
#endif
#if (LZO_CC_MSC && (_MSC_VER >= 1300))
- /* avoid `-Wall' warnings in system header files */
+ /* avoid '-Wall' warnings in system header files */
# pragma warning(disable: 4820)
/* avoid warnings about inlining */
# pragma warning(disable: 4514 4710 4711)
#endif
#if (LZO_CC_SUNPROC)
+#if !defined(__cplusplus)
# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
+# pragma error_messages(off,E_STATEMENT_NOT_REACHED)
+#endif
#endif
@@ -108,7 +114,7 @@
//
************************************************************************/
-#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR)
+#if (__LZO_MMODEL_HUGE) && !(LZO_HAVE_MM_HUGE_PTR)
# error "this should not happen - check defines for __huge"
#endif
@@ -125,41 +131,45 @@
#include "miniacc.h"
-#if defined(LZO_CFG_FREESTANDING)
+#if (LZO_CFG_FREESTANDING)
# undef HAVE_MEMCMP
# undef HAVE_MEMCPY
# undef HAVE_MEMMOVE
# undef HAVE_MEMSET
#endif
-#if !defined(HAVE_MEMCMP)
+#if !(HAVE_MEMCMP)
# undef memcmp
# define memcmp(a,b,c) lzo_memcmp(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
+#elif !(__LZO_MMODEL_HUGE)
+# undef lzo_memcmp
# define lzo_memcmp(a,b,c) memcmp(a,b,c)
#endif
-#if !defined(HAVE_MEMCPY)
+#if !(HAVE_MEMCPY)
# undef memcpy
# define memcpy(a,b,c) lzo_memcpy(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
+#elif !(__LZO_MMODEL_HUGE)
+# undef lzo_memcpy
# define lzo_memcpy(a,b,c) memcpy(a,b,c)
#endif
-#if !defined(HAVE_MEMMOVE)
+#if !(HAVE_MEMMOVE)
# undef memmove
# define memmove(a,b,c) lzo_memmove(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
+#elif !(__LZO_MMODEL_HUGE)
+# undef lzo_memmove
# define lzo_memmove(a,b,c) memmove(a,b,c)
#endif
-#if !defined(HAVE_MEMSET)
+#if !(HAVE_MEMSET)
# undef memset
# define memset(a,b,c) lzo_memset(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
+#elif !(__LZO_MMODEL_HUGE)
+# undef lzo_memset
# define lzo_memset(a,b,c) memset(a,b,c)
#endif
#undef NDEBUG
-#if defined(LZO_CFG_FREESTANDING)
+#if (LZO_CFG_FREESTANDING)
# undef LZO_DEBUG
# define NDEBUG 1
# undef assert
@@ -179,13 +189,24 @@
#endif
#if !defined(__lzo_inline)
-# define __lzo_inline
+# define __lzo_inline /*empty*/
#endif
#if !defined(__lzo_forceinline)
-# define __lzo_forceinline
+# define __lzo_forceinline /*empty*/
#endif
#if !defined(__lzo_noinline)
-# define __lzo_noinline
+# define __lzo_noinline /*empty*/
+#endif
+
+#if (LZO_CFG_PGO)
+# undef __acc_likely
+# undef __acc_unlikely
+# undef __lzo_likely
+# undef __lzo_unlikely
+# define __acc_likely(e) (e)
+# define __acc_unlikely(e) (e)
+# define __lzo_likely(e) (e)
+# define __lzo_unlikely(e) (e)
#endif
@@ -238,24 +259,69 @@
* even if it is allowed by your system.
*/
-#if 1 && !defined(LZO_CFG_NO_UNALIGNED)
-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC)
# if (LZO_SIZEOF_SHORT == 2)
-# define LZO_UNALIGNED_OK_2
+# define LZO_UNALIGNED_OK_2 1
# endif
# if (LZO_SIZEOF_INT == 4)
-# define LZO_UNALIGNED_OK_4
+# define LZO_UNALIGNED_OK_4 1
# endif
#endif
+#if 1 && (LZO_ARCH_AMD64)
+# if defined(LZO_UINT64_MAX)
+# define LZO_UNALIGNED_OK_8 1
+# endif
#endif
-
+#if (LZO_CFG_NO_UNALIGNED)
+# undef LZO_UNALIGNED_OK_2
+# undef LZO_UNALIGNED_OK_4
+# undef LZO_UNALIGNED_OK_8
+#endif
+
+#undef UA_GET16
+#undef UA_SET16
+#undef UA_COPY16
+#undef UA_GET32
+#undef UA_SET32
+#undef UA_COPY32
+#undef UA_GET64
+#undef UA_SET64
+#undef UA_COPY64
#if defined(LZO_UNALIGNED_OK_2)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2)
+# if 1 && defined(ACC_UA_COPY16)
+# define UA_GET16 ACC_UA_GET16
+# define UA_SET16 ACC_UA_SET16
+# define UA_COPY16 ACC_UA_COPY16
+# else
+# define UA_GET16(p) (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p))
+# define UA_SET16(p,v) ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v))
+# define UA_COPY16(d,s) UA_SET16(d, UA_GET16(s))
+# endif
#endif
-#if defined(LZO_UNALIGNED_OK_4)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-#elif defined(LZO_ALIGNED_OK_4)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+# if 1 && defined(ACC_UA_COPY32)
+# define UA_GET32 ACC_UA_GET32
+# define UA_SET32 ACC_UA_SET32
+# define UA_COPY32 ACC_UA_COPY32
+# else
+# define UA_GET32(p) (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p))
+# define UA_SET32(p,v) ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v))
+# define UA_COPY32(d,s) UA_SET32(d, UA_GET32(s))
+# endif
+#endif
+#if defined(LZO_UNALIGNED_OK_8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8)
+# if 1 && defined(ACC_UA_COPY64)
+# define UA_GET64 ACC_UA_GET64
+# define UA_SET64 ACC_UA_SET64
+# define UA_COPY64 ACC_UA_COPY64
+# else
+# define UA_GET64(p) (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p))
+# define UA_SET64(p,v) ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v))
+# define UA_COPY64(d,s) UA_SET64(d, UA_GET64(s))
+# endif
#endif
@@ -279,8 +345,6 @@
// some globals
************************************************************************/
-__LZO_EXTERN_C int __lzo_init_done;
-__LZO_EXTERN_C const char __lzo_copyright[];
LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
@@ -298,15 +362,20 @@ LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
* then the initialization of the dictionary becomes a relevant
* magnitude for compression speed.
*/
-#define LZO_DETERMINISTIC
+#ifndef LZO_DETERMINISTIC
+#define LZO_DETERMINISTIC 1
+#endif
-#define LZO_DICT_USE_PTR
+#ifndef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 1
#if 0 && (LZO_ARCH_I086)
# undef LZO_DICT_USE_PTR
+# define LZO_DICT_USE_PTR 0
+#endif
#endif
-#if defined(LZO_DICT_USE_PTR)
+#if (LZO_DICT_USE_PTR)
# define lzo_dict_t const lzo_bytep
# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
#else
diff --git a/lzo/src/lzo_crc.c b/lzo/src/lzo_crc.c
index 83941ab2..f5632cfc 100644
--- a/lzo/src/lzo_crc.c
+++ b/lzo/src/lzo_crc.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
@@ -112,7 +115,7 @@ lzo_get_crc32_table(void)
#if 1
#define LZO_DO1(buf,i) \
- crc = table[((int)crc ^ buf[i]) & 0xff] ^ (crc >> 8)
+ crc = table[((unsigned)crc ^ buf[i]) & 0xff] ^ (crc >> 8)
#else
#define LZO_DO1(buf,i) \
crc = table[(unsigned char)((unsigned char)crc ^ buf[i])] ^ (crc >> 8)
diff --git a/lzo/src/lzo_dict.h b/lzo/src/lzo_dict.h
index 043a1e2b..961522c2 100644
--- a/lzo/src/lzo_dict.h
+++ b/lzo/src/lzo_dict.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_DICT_H
-#define __LZO_DICT_H
+#define __LZO_DICT_H 1
#ifdef __cplusplus
extern "C" {
@@ -97,10 +100,10 @@ extern "C" {
#if (D_BITS != DL_BITS + DD_BITS)
# error "D_BITS does not match"
#endif
-#if (D_BITS < 8 || D_BITS > 18)
+#if (D_BITS < 6 || D_BITS > 18)
# error "invalid D_BITS"
#endif
-#if (DL_BITS < 8 || DL_BITS > 20)
+#if (DL_BITS < 6 || DL_BITS > 20)
# error "invalid DL_BITS"
#endif
#if (DD_BITS < 0 || DD_BITS > 6)
@@ -169,7 +172,7 @@ extern "C" {
#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
/* incremental hash like in gzip/zlib (deflate) */
-# define __LZO_HASH_INCREMENTAL
+# define __LZO_HASH_INCREMENTAL 1
# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT)
# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2])
# define _DINDEX(dv,p) (dv)
@@ -177,7 +180,7 @@ extern "C" {
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
/* incremental LZO hash version A */
-# define __LZO_HASH_INCREMENTAL
+# define __LZO_HASH_INCREMENTAL 1
# define DVAL_FIRST(dv,p) dv = _DV_A((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
@@ -186,7 +189,7 @@ extern "C" {
#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
/* incremental LZO hash version B */
-# define __LZO_HASH_INCREMENTAL
+# define __LZO_HASH_INCREMENTAL 1
# define DVAL_FIRST(dv,p) dv = _DV_B((p),5)
# define DVAL_NEXT(dv,p) \
dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5)))
@@ -219,7 +222,12 @@ extern "C" {
#if !defined(DVAL_ASSERT)
#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
-static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
+#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_LLVM)
+static void __attribute__((__unused__))
+#else
+static void
+#endif
+DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
{
lzo_xint df;
DVAL_FIRST(df,(p));
@@ -236,11 +244,11 @@ static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
// dictionary updating
************************************************************************/
-#if defined(LZO_DICT_USE_PTR)
+#if (LZO_DICT_USE_PTR)
# define DENTRY(p,in) (p)
# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex]
#else
-# define DENTRY(p,in) ((lzo_uint) ((p)-(in)))
+# define DENTRY(p,in) ((lzo_dict_t) pd(p, in))
# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex]
#endif
@@ -267,7 +275,7 @@ static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
// test for a match
************************************************************************/
-#if defined(LZO_DICT_USE_PTR)
+#if (LZO_DICT_USE_PTR)
/* m_pos is either NULL or a valid pointer */
#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
@@ -278,7 +286,7 @@ static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
(BOUNDS_CHECKING_OFF_IN_EXPR(( \
m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \
PTR_LT(m_pos,in) || \
- (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \
+ (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) == 0 || \
m_off > max_offset )))
#else
@@ -296,7 +304,7 @@ static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
#endif
-#if defined(LZO_DETERMINISTIC)
+#if (LZO_DETERMINISTIC)
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
#else
# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
diff --git a/lzo/src/lzo_dll.ch b/lzo/src/lzo_dll.ch
index 346cb275..3f56a3b8 100644
--- a/lzo/src/lzo_dll.ch
+++ b/lzo/src/lzo_dll.ch
@@ -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
diff --git a/lzo/src/lzo_func.ch b/lzo/src/lzo_func.ch
new file mode 100644
index 00000000..a85b71f0
--- /dev/null
+++ b/lzo/src/lzo_func.ch
@@ -0,0 +1,122 @@
+/* lzo_func.ch -- functions
+
+ 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
+ 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
+ All Rights Reserved.
+
+ The LZO library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ The LZO library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+/***********************************************************************
+// bitops
+************************************************************************/
+
+#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#include <intrin.h>
+#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
+#pragma intrinsic(_BitScanReverse)
+static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
+{
+ unsigned long r;
+ (void) _BitScanReverse(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_clz32 lzo_bitops_clz32
+#endif
+#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
+#pragma intrinsic(_BitScanReverse64)
+static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
+{
+ unsigned long r;
+ (void) _BitScanReverse64(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_clz64 lzo_bitops_clz64
+#endif
+#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
+#pragma intrinsic(_BitScanForward)
+static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
+{
+ unsigned long r;
+ (void) _BitScanForward(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_ctz32 lzo_bitops_ctz32
+#endif
+#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
+#pragma intrinsic(_BitScanForward64)
+static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
+{
+ unsigned long r;
+ (void) _BitScanForward64(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_ctz64 lzo_bitops_ctz64
+#endif
+
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
+#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
+#endif
+#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
+#endif
+#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
+#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
+#endif
+#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
+#endif
+#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
+#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
+#endif
+#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
+#endif
+#endif
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/lzo/src/lzo_init.c b/lzo/src/lzo_init.c
index 6977891d..2872949c 100644
--- a/lzo/src/lzo_init.c
+++ b/lzo/src/lzo_init.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
@@ -67,6 +70,11 @@
ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32)
ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4)
+#if defined(LZO_UINT64_MAX)
+ ACCCHK_ASSERT(sizeof(lzo_uint64) == 8)
+ ACCCHK_ASSERT_IS_SIGNED_T(lzo_int64)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64)
+#endif
#if !defined(__LZO_UINTPTR_T_IS_POINTER)
ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
@@ -86,35 +94,92 @@
//
************************************************************************/
+#define WANT_lzo_bitops_clz32 1
+#define WANT_lzo_bitops_clz64 1
+#define WANT_lzo_bitops_ctz32 1
+#define WANT_lzo_bitops_ctz64 1
+#include "lzo_func.ch"
+
+#if 0
+#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
+#else
+static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
+{
+ return (lzo_voidp) ((lzo_bytep) ptr + off);
+}
+#endif
+
LZO_PUBLIC(int)
_lzo_config_check(void)
{
lzo_bool r = 1;
- union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u;
- lzo_uintptr_t p;
+ union {
+ lzo_xint a[2]; unsigned char b[2*LZO_MAX(8,sizeof(lzo_xint))];
+#if defined(LZO_UNALIGNED_OK_8)
+ lzo_uint64 c[2];
+#endif
+ unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2];
+ } u;
+ lzo_voidp p;
+ u.a[0] = u.a[1] = 0;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_bytep) p) == 0);
#if !defined(LZO_CFG_NO_CONFIG_CHECK)
#if defined(LZO_ABI_BIG_ENDIAN)
- u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128;
- r &= (u.l[0] == 128);
+ u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
#endif
#if defined(LZO_ABI_LITTLE_ENDIAN)
- u.l[0] = u.l[1] = 0; u.c[0] = 128;
- r &= (u.l[0] == 128);
+ u.a[0] = u.a[1] = 0; u.b[0] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
#endif
#if defined(LZO_UNALIGNED_OK_2)
- p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
- u.l[0] = u.l[1] = 0;
- r &= ((* (const lzo_ushortp) (p+1)) == 0);
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 1; u.b[sizeof(unsigned short) + 1] = 2;
+ p = u2p(&u, 1);
+ r &= ((* (lzo_ushortp) p) == 0);
#endif
#if defined(LZO_UNALIGNED_OK_4)
- p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
- u.l[0] = u.l[1] = 0;
- r &= ((* (const lzo_uint32p) (p+1)) == 0);
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 3; u.b[sizeof(lzo_uint32) + 1] = 4;
+ p = u2p(&u, 1);
+ r &= ((* (lzo_uint32p) p) == 0);
+#endif
+#if defined(LZO_UNALIGNED_OK_8)
+ u.c[0] = u.c[1] = 0;
+ u.b[0] = 5; u.b[sizeof(lzo_uint64) + 1] = 6;
+ p = u2p(&u, 1);
+ r &= ((* (lzo_uint64p) p) == 0);
+#endif
+#if defined(lzo_bitops_clz32)
+ { unsigned i; lzo_uint32 v = 1;
+ for (i = 0; i < 32; i++, v <<= 1)
+ r &= lzo_bitops_clz32(v) == 31 - i;
+ }
+#endif
+#if defined(lzo_bitops_clz64)
+ { unsigned i; lzo_uint64 v = 1;
+ for (i = 0; i < 64; i++, v <<= 1)
+ r &= lzo_bitops_clz64(v) == 63 - i;
+ }
+#endif
+#if defined(lzo_bitops_ctz32)
+ { unsigned i; lzo_uint32 v = 1;
+ for (i = 0; i < 32; i++, v <<= 1)
+ r &= lzo_bitops_ctz32(v) == i;
+ }
+#endif
+#if defined(lzo_bitops_ctz64)
+ { unsigned i; lzo_uint64 v = 1;
+ for (i = 0; i < 64; i++, v <<= 1)
+ r &= lzo_bitops_ctz64(v) == i;
+ }
#endif
#endif
- LZO_UNUSED(u); LZO_UNUSED(p);
return r == 1 ? LZO_E_OK : LZO_E_ERROR;
}
@@ -123,8 +188,6 @@ _lzo_config_check(void)
//
************************************************************************/
-int __lzo_init_done = 0;
-
LZO_PUBLIC(int)
__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
int s6, int s7, int s8, int s9)
@@ -141,8 +204,6 @@ __lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
#endif
#undef ACCCHK_ASSERT
- __lzo_init_done = 1;
-
if (v == 0)
return LZO_E_ERROR;
diff --git a/lzo/src/lzo_mchw.ch b/lzo/src/lzo_mchw.ch
index a8c4fec5..fec8d92b 100644
--- a/lzo/src/lzo_mchw.ch
+++ b/lzo/src/lzo_mchw.ch
@@ -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
@@ -44,7 +47,7 @@
typedef struct
{
- int init;
+ unsigned init;
lzo_uint look; /* bytes in lookahead buffer */
@@ -115,9 +118,9 @@ 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))
+#elif (LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+ /* work around a code generation 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
@@ -148,11 +151,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 +184,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 +210,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)
diff --git a/lzo/src/lzo_ptr.c b/lzo/src/lzo_ptr.c
index 064bddf1..46e6e353 100644
--- a/lzo/src/lzo_ptr.c
+++ b/lzo/src/lzo_ptr.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
diff --git a/lzo/src/lzo_ptr.h b/lzo/src/lzo_ptr.h
index e286a702..6aa1fc84 100644
--- a/lzo/src/lzo_ptr.h
+++ b/lzo/src/lzo_ptr.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_PTR_H
-#define __LZO_PTR_H
+#define __LZO_PTR_H 1
#ifdef __cplusplus
extern "C" {
@@ -57,7 +60,7 @@ extern "C" {
************************************************************************/
#if !defined(lzo_uintptr_t)
-# if defined(__LZO_MMODEL_HUGE)
+# if (__LZO_MMODEL_HUGE)
# define lzo_uintptr_t unsigned long
# else
# define lzo_uintptr_t acc_uintptr_t
@@ -72,7 +75,7 @@ extern "C" {
//
************************************************************************/
-/* Always use the safe (=integral) version for pointer-comparisions.
+/* Always use the safe (=integral) version for pointer-comparisons.
* The compiler should optimize away the additional casts anyway.
*
* Note that this only works if the representation and ordering
@@ -125,6 +128,10 @@ typedef union
lzo_uint a_lzo_uint;
lzo_int32 a_lzo_int32;
lzo_uint32 a_lzo_uint32;
+#if defined(LZO_UINT64_MAX)
+ lzo_int64 a_lzo_int64;
+ lzo_uint64 a_lzo_uint64;
+#endif
ptrdiff_t a_ptrdiff_t;
lzo_uintptr_t a_lzo_uintptr_t;
lzo_voidp a_lzo_voidp;
diff --git a/lzo/src/lzo_str.c b/lzo/src/lzo_str.c
index bf08960f..faeb5b54 100644
--- a/lzo/src/lzo_str.c
+++ b/lzo/src/lzo_str.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
@@ -50,17 +53,20 @@
// slow but portable <string.h> stuff, only used in assertions
************************************************************************/
-#if !defined(__LZO_MMODEL_HUGE)
+#if !(__LZO_MMODEL_HUGE)
# undef ACC_HAVE_MM_HUGE_PTR
#endif
#define acc_hsize_t lzo_uint
#define acc_hvoid_p lzo_voidp
#define acc_hbyte_p lzo_bytep
#define ACCLIB_PUBLIC(r,f) LZO_PUBLIC(r) f
-#define acc_hmemcmp lzo_memcmp
-#define acc_hmemcpy lzo_memcpy
-#define acc_hmemmove lzo_memmove
-#define acc_hmemset lzo_memset
+#ifndef __ACCLIB_FUNCNAME
+#define __ACCLIB_FUNCNAME(f) f
+#endif
+#define acc_hmemcmp __ACCLIB_FUNCNAME(lzo_memcmp)
+#define acc_hmemcpy __ACCLIB_FUNCNAME(lzo_memcpy)
+#define acc_hmemmove __ACCLIB_FUNCNAME(lzo_memmove)
+#define acc_hmemset __ACCLIB_FUNCNAME(lzo_memset)
#define ACC_WANT_ACCLIB_HMEMCPY 1
#include "miniacc.h"
#undef ACCLIB_PUBLIC
diff --git a/lzo/src/lzo_swd.ch b/lzo/src/lzo_swd.ch
index aa4b17c0..a8d8b396 100644
--- a/lzo/src/lzo_swd.ch
+++ b/lzo/src/lzo_swd.ch
@@ -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
@@ -41,22 +44,18 @@
#if (LZO_UINT_MAX < LZO_0xffffffffL)
# error "LZO_UINT_MAX"
#endif
+#if defined(LZO_DEBUG)
+# include <stdio.h>
+#endif
+#if defined(__LZO_CHECKER)
+# include <stdlib.h>
+#endif
/***********************************************************************
//
************************************************************************/
-#ifndef SWD_N
-# define SWD_N N
-#endif
-#ifndef SWD_F
-# define SWD_F F
-#endif
-#ifndef SWD_THRESHOLD
-# define SWD_THRESHOLD THRESHOLD
-#endif
-
/* unsigned type for dictionary access - don't waste memory here */
#if (0UL + SWD_N + SWD_F + SWD_F < 0UL + USHRT_MAX)
typedef unsigned short swd_uint;
@@ -89,22 +88,25 @@
#endif
#endif
-#if (SWD_THRESHOLD == 1) && !defined(HEAD2)
+#if !(SWD_NO_HEAD2) && (SWD_THRESHOLD == 1) && !defined(HEAD2)
# if 1 && defined(LZO_UNALIGNED_OK_2)
-# define HEAD2(b,p) (* (lzo_ushortp) &(b[p]))
+# define HEAD2(b,p) UA_GET16((b)+(p))
# else
# define HEAD2(b,p) (b[p] ^ ((unsigned)b[p+1]<<8))
# endif
# define NIL2 SWD_UINT_MAX
#endif
+#ifndef IF_HEAD2
+#define IF_HEAD2(s) /*empty*/
+#endif
typedef struct
{
/* public - "built-in" */
- lzo_uint n;
- lzo_uint f;
- lzo_uint threshold;
+ lzo_uint swd_n;
+ lzo_uint swd_f;
+ lzo_uint swd_threshold;
/* public - configuration */
lzo_uint max_chain;
@@ -211,11 +213,12 @@ lzo_swd_t;
/* Access macro for head3.
- * head3[key] may be uninitialized, but then its value will never be used.
+ * head3[key] may be uninitialized if the list is emtpy,
+ * but then its value will never be used.
*/
#if defined(__LZO_CHECKER)
# define s_get_head3(s,key) \
- ((s->llen3[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key])
+ ((s_llen3(s)[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key])
#else
# define s_get_head3(s,key) s_head3(s)[key]
#endif
@@ -231,12 +234,12 @@ void swd_initdict(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
s->dict = s->dict_end = NULL;
s->dict_len = 0;
- if (!dict || dict_len <= 0)
+ if (!dict || dict_len == 0)
return;
- if (dict_len > s->n)
+ if (dict_len > s->swd_n)
{
- dict += dict_len - s->n;
- dict_len = s->n;
+ dict += dict_len - s->swd_n;
+ dict_len = s->swd_n;
}
s->dict = dict;
@@ -252,25 +255,28 @@ void swd_insertdict(lzo_swd_p s, lzo_uint node, lzo_uint len)
{
lzo_uint key;
- s->node_count = s->n - len;
+ s->node_count = s->swd_n - len;
s->first_rp = node;
- while (len-- > 0)
+ if (len) do
{
key = HEAD3(s_b(s),node);
s_succ3(s)[node] = s_get_head3(s,key);
s_head3(s)[key] = SWD_UINT(node);
- s_best3(s)[node] = SWD_UINT(s->f + 1);
+ s_best3(s)[node] = SWD_UINT(s->swd_f + 1);
s_llen3(s)[key]++;
- assert(s_llen3(s)[key] <= SWD_N);
+ assert(s_llen3(s)[key] <= s->swd_n);
#ifdef HEAD2
- key = HEAD2(s_b(s),node);
- s_head2(s)[key] = SWD_UINT(node);
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),node);
+ s_head2(s)[key] = SWD_UINT(node);
+ }
#endif
node++;
}
+ while (--len != 0);
}
@@ -281,50 +287,62 @@ void swd_insertdict(lzo_swd_p s, lzo_uint node, lzo_uint len)
static
int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
{
- lzo_uint i = 0;
- int c = 0;
-
#if defined(__LZO_CHECKER)
- s->b = malloc(SWD_N + SWD_F + SWD_F);
- s->head3 = malloc(sizeof(swd_uint) * SWD_HSIZE);
- s->succ3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
- s->best3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
- s->llen3 = malloc(sizeof(swd_uint) * SWD_HSIZE);
+ s->b = (lzo_bytep) malloc(SWD_N + SWD_F + SWD_F);
+ s->head3 = (swd_uintp) malloc(sizeof(swd_uint) * SWD_HSIZE);
+ s->succ3 = (swd_uintp) malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
+ s->best3 = (swd_uintp) malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
+ s->llen3 = (swd_uintp) malloc(sizeof(swd_uint) * SWD_HSIZE);
#ifdef HEAD2
- s->head2 = malloc(sizeof(swd_uint) * 65536L);
+ IF_HEAD2(s) {
+ s->head2 = (swd_uintp) malloc(sizeof(swd_uint) * 65536L);
+ }
#endif
#endif
- s->n = SWD_N;
- s->f = SWD_F;
- s->threshold = SWD_THRESHOLD;
+ s->m_len = 0;
+ s->m_off = 0;
+#if defined(SWD_BEST_OFF)
+ {
+ unsigned i;
+ for (i = 0; i < SWD_BEST_OFF; i++)
+ s->best_off[i] = s->best_pos[i] = 0;
+ }
+#endif
+
+ s->swd_n = SWD_N;
+ s->swd_f = SWD_F;
+ s->swd_threshold = SWD_THRESHOLD;
/* defaults */
s->max_chain = SWD_MAX_CHAIN;
- s->nice_length = SWD_F;
+ s->nice_length = s->swd_f;
s->use_best_off = 0;
s->lazy_insert = 0;
- s->b_size = s->n + s->f;
+ s->b_size = s->swd_n + s->swd_f;
#if 0
- if (2 * s->f >= s->n || s->b_size + s->f >= SWD_UINT_MAX)
+ if (2 * s->swd_f >= s->swd_n || s->b_size + s->swd_f >= SWD_UINT_MAX)
return LZO_E_ERROR;
#else
LZO_COMPILE_TIME_ASSERT(!(0ul + 2 * SWD_F >= SWD_N))
LZO_COMPILE_TIME_ASSERT(!(0ul + SWD_N + SWD_F + SWD_F >= SWD_UINT_MAX))
#endif
s->b_wrap = s_b(s) + s->b_size;
- s->node_count = s->n;
+ s->node_count = s->swd_n;
- lzo_memset(s_llen3(s), 0, sizeof(s_llen3(s)[0]) * (lzo_uint)SWD_HSIZE);
+ lzo_memset(s_llen3(s), 0, (lzo_uint)sizeof(s_llen3(s)[0]) * (lzo_uint)SWD_HSIZE);
#ifdef HEAD2
+ IF_HEAD2(s) {
#if 1
- lzo_memset(s_head2(s), 0xff, sizeof(s_head2(s)[0]) * 65536L);
- assert(s_head2(s)[0] == NIL2);
+ lzo_memset(s_head2(s), 0xff, (lzo_uint)sizeof(s_head2(s)[0]) * 65536L);
+ assert(s_head2(s)[0] == NIL2);
#else
- for (i = 0; i < 65536L; i++)
- s_head2(s)[i] = NIL2;
+ lzo_uint32 i;
+ for (i = 0; i < 65536L; i++)
+ s_head2(s)[i] = NIL2;
#endif
+ }
#endif
s->ip = 0;
@@ -332,21 +350,22 @@ int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
s->bp = s->ip;
s->first_rp = s->ip;
- assert(s->ip + s->f <= s->b_size);
+ assert(s->ip + s->swd_f <= s->b_size);
#if 1
s->look = (lzo_uint) (s->c->in_end - s->c->ip);
if (s->look > 0)
{
- if (s->look > s->f)
- s->look = s->f;
+ if (s->look > s->swd_f)
+ s->look = s->swd_f;
lzo_memcpy(&s_b(s)[s->ip],s->c->ip,s->look);
s->c->ip += s->look;
s->ip += s->look;
}
#else
s->look = 0;
- while (s->look < s->f)
+ while (s->look < s->swd_f)
{
+ int c;
if ((c = getbyte(*(s->c))) < 0)
break;
s_b(s)[s->ip] = LZO_BYTE(c);
@@ -366,15 +385,15 @@ int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
else
s->rp += s->b_size - s->node_count;
-#if defined(__LZO_CHECKER)
+#if 1 || defined(__LZO_CHECKER)
/* initialize memory for the first few HEAD3 (if s->ip is not far
* enough ahead to do this job for us). The value doesn't matter. */
- if (s->look < 3)
- lzo_memset(&s_b(s)[s->bp+s->look],0,3);
+ if (s->look < 3) {
+ lzo_bytep p = &s_b(s)[s->bp+s->look];
+ p[0] = p[1] = p[2] = 0;
+ }
#endif
- LZO_UNUSED(i);
- LZO_UNUSED(c);
return LZO_E_OK;
}
@@ -418,14 +437,14 @@ void swd_getbyte(lzo_swd_p s)
#if defined(__LZO_CHECKER)
/* initialize memory - value doesn't matter */
s_b(s)[s->ip] = 0;
- if (s->ip < s->f)
+ if (s->ip < s->swd_f)
s->b_wrap[s->ip] = 0;
#endif
}
else
{
s_b(s)[s->ip] = LZO_BYTE(c);
- if (s->ip < s->f)
+ if (s->ip < s->swd_f)
s->b_wrap[s->ip] = LZO_BYTE(c);
}
if (++s->ip == s->b_size)
@@ -452,9 +471,10 @@ void swd_remove_node(lzo_swd_p s, lzo_uint node)
if (s->first_rp != LZO_UINT_MAX)
{
if (node != s->first_rp)
- printf("Remove %5u: %5u %5u %5u %5u %6u %6u\n",
- node, s->rp, s->ip, s->bp, s->first_rp,
- s->ip - node, s->ip - s->bp);
+ printf("Remove %5ld: %5ld %5ld %5ld %5ld %6ld %6ld\n",
+ (long)node, (long)s->rp, (long)s->ip, (long)s->bp,
+ (long)s->first_rp, (long)(s->ip - node),
+ (long)(s->ip - s->bp));
assert(node == s->first_rp);
s->first_rp = LZO_UINT_MAX;
}
@@ -465,10 +485,12 @@ void swd_remove_node(lzo_swd_p s, lzo_uint node)
--s_llen3(s)[key];
#ifdef HEAD2
- key = HEAD2(s_b(s),node);
- assert(s_head2(s)[key] != NIL2);
- if ((lzo_uint) s_head2(s)[key] == node)
- s_head2(s)[key] = NIL2;
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),node);
+ assert(s_head2(s)[key] != NIL2);
+ if ((lzo_uint) s_head2(s)[key] == node)
+ s_head2(s)[key] = NIL2;
+ }
#endif
}
else
@@ -485,7 +507,7 @@ void swd_accept(lzo_swd_p s, lzo_uint n)
{
assert(n <= s->look);
- while (n--)
+ if (n) do
{
lzo_uint key;
@@ -495,18 +517,20 @@ void swd_accept(lzo_swd_p s, lzo_uint n)
key = HEAD3(s_b(s),s->bp);
s_succ3(s)[s->bp] = s_get_head3(s,key);
s_head3(s)[key] = SWD_UINT(s->bp);
- s_best3(s)[s->bp] = SWD_UINT(s->f + 1);
+ s_best3(s)[s->bp] = SWD_UINT(s->swd_f + 1);
s_llen3(s)[key]++;
- assert(s_llen3(s)[key] <= SWD_N);
+ assert(s_llen3(s)[key] <= s->swd_n);
#ifdef HEAD2
/* add bp into HEAD2 */
- key = HEAD2(s_b(s),s->bp);
- s_head2(s)[key] = SWD_UINT(s->bp);
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),s->bp);
+ s_head2(s)[key] = SWD_UINT(s->bp);
+ }
#endif
swd_getbyte(s);
- }
+ } while (--n != 0);
}
@@ -550,7 +574,7 @@ void swd_search(lzo_swd_p s, lzo_uint node, lzo_uint cnt)
#if 0 && defined(LZO_UNALIGNED_OK_4)
p1 += 3; p2 += 3;
- while (p1 < px && * (const lzo_uint32p) p1 == * (const lzo_uint32p) p2)
+ while (p1 + 4 <= px && UA_GET32(p1) == UA_GET32(p2))
p1 += 4, p2 += 4;
while (p1 < px && *p1 == *p2)
p1 += 1, p2 += 1;
@@ -562,8 +586,8 @@ void swd_search(lzo_swd_p s, lzo_uint node, lzo_uint cnt)
#ifdef LZO_DEBUG
if (lzo_memcmp(bp,&b[node],i) != 0)
- printf("%5ld %5ld %02x%02x %02x%02x\n",
- (long)s->bp, (long) node,
+ printf("%5ld %5ld %5ld %02x/%02x %02x/%02x\n",
+ (long)s->bp, (long) node, (long) i,
bp[0], bp[1], b[node], b[node+1]);
#endif
assert(lzo_memcmp(bp,&b[node],i) == 0);
@@ -611,7 +635,7 @@ lzo_bool swd_search2(lzo_swd_p s)
return 0;
#ifdef LZO_DEBUG
if (lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) != 0)
- printf("%5ld %5ld %02x%02x %02x%02x\n", (long)s->bp, (long)key,
+ printf("%5ld %5ld %02x/%02x %02x/%02x\n", (long)s->bp, (long)key,
s_b(s)[s->bp], s_b(s)[s->bp+1], s_b(s)[key], s_b(s)[key+1]);
#endif
assert(lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) == 0);
@@ -648,7 +672,7 @@ void swd_findbest(lzo_swd_p s)
key = HEAD3(s_b(s),s->bp);
node = s_succ3(s)[s->bp] = s_get_head3(s,key);
cnt = s_llen3(s)[key]++;
- assert(s_llen3(s)[key] <= SWD_N + SWD_F);
+ assert(s_llen3(s)[key] <= s->swd_n + s->swd_f);
if (cnt > s->max_chain && s->max_chain > 0)
cnt = s->max_chain;
s_head3(s)[key] = SWD_UINT(s->bp);
@@ -660,15 +684,17 @@ void swd_findbest(lzo_swd_p s)
if (s->look == 0)
s->b_char = -1;
s->m_off = 0;
- s_best3(s)[s->bp] = SWD_UINT(s->f + 1);
+ s_best3(s)[s->bp] = SWD_UINT(s->swd_f + 1);
}
else
{
-#ifdef HEAD2
- if (swd_search2(s))
+#if defined(HEAD2)
+ if (swd_search2(s) && s->look >= 3)
+ swd_search(s,node,cnt);
+#else
+ if (s->look >= 3)
+ swd_search(s,node,cnt);
#endif
- if (s->look >= 3)
- swd_search(s,node,cnt);
if (s->m_len > len)
s->m_off = swd_pos2off(s,s->m_pos);
s_best3(s)[s->bp] = SWD_UINT(s->m_len);
@@ -676,7 +702,7 @@ void swd_findbest(lzo_swd_p s)
#if defined(SWD_BEST_OFF)
if (s->use_best_off)
{
- int i;
+ unsigned i;
for (i = 2; i < SWD_BEST_OFF; i++)
if (s->best_pos[i] > 0)
s->best_off[i] = swd_pos2off(s,s->best_pos[i]-1);
@@ -690,14 +716,17 @@ void swd_findbest(lzo_swd_p s)
#ifdef HEAD2
/* add bp into HEAD2 */
- key = HEAD2(s_b(s),s->bp);
- s_head2(s)[key] = SWD_UINT(s->bp);
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),s->bp);
+ s_head2(s)[key] = SWD_UINT(s->bp);
+ }
#endif
}
#undef HEAD3
#undef HEAD2
+#undef IF_HEAD2
#undef s_get_head3
diff --git a/lzo/src/lzo_util.c b/lzo/src/lzo_util.c
index c3bfb407..1e4a9e33 100644
--- a/lzo/src/lzo_util.c
+++ b/lzo/src/lzo_util.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
@@ -49,18 +52,17 @@
* keep this copyright string in the executable of your product.
.*/
-const char __lzo_copyright[] =
+static const char __lzo_copyright[] =
#if !defined(__LZO_IN_MINLZO)
/* save space as some people want a really small decompressor */
LZO_VERSION_STRING;
#else
"\r\n\n"
"LZO data compression library.\n"
- "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer\n"
+ "$Copyright: LZO Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\n"
"<markus@oberhumer.com>\n"
"http://www.oberhumer.com $\n\n"
"$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n"
- "$Built: " __DATE__ " " __TIME__ " $\n"
"$Info: " LZO_INFO_STRING " $\n";
#endif
diff --git a/lzo/src/miniacc.h b/lzo/src/miniacc.h
index 6701dbff..0487a004 100644
--- a/lzo/src/miniacc.h
+++ b/lzo/src/miniacc.h
@@ -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
@@ -40,7 +43,7 @@
#ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1
-#define ACC_VERSION 20080430L
+#define ACC_VERSION 20110125L
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
# define __CYGWIN__ __CYGWIN32__
#endif
@@ -84,15 +87,15 @@
#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
# pragma option -h
#endif
-#if defined(ACC_CFG_NO_CONFIG_HEADER)
+#if (ACC_CFG_NO_CONFIG_HEADER)
#elif defined(ACC_CFG_CONFIG_HEADER)
# include ACC_CFG_CONFIG_HEADER
#else
#endif
-#if defined(ACC_CFG_NO_LIMITS_H)
-#elif defined(ACC_LIBC_NAKED) || defined(ACC_BROKEN_LIMITS_H)
+#if (ACC_CFG_NO_LIMITS_H)
+#elif (ACC_LIBC_NAKED) || (ACC_BROKEN_LIMITS_H)
#ifndef __ACC_FALLBACK_LIMITS_H_INCLUDED
-#define __ACC_FALLBACK_LIMITS_H_INCLUDED
+#define __ACC_FALLBACK_LIMITS_H_INCLUDED 1
#undef CHAR_BIT
#define CHAR_BIT 8
#ifndef MB_LEN_MAX
@@ -197,7 +200,7 @@
#endif
#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
# define ptrdiff_t long
-# define _PTRDIFF_T_DEFINED
+# define _PTRDIFF_T_DEFINED 1
#endif
#if (UINT_MAX == ACC_0xffffL)
# undef __ACC_RENAME_A
@@ -341,9 +344,9 @@
# define ACC_EXTERN_C extern
#endif
#if !defined(__ACC_OS_OVERRIDE)
-#if defined(ACC_OS_FREESTANDING)
+#if (ACC_OS_FREESTANDING)
# define ACC_INFO_OS "freestanding"
-#elif defined(ACC_OS_EMBEDDED)
+#elif (ACC_OS_EMBEDDED)
# define ACC_INFO_OS "embedded"
#elif 1 && defined(__IAR_SYSTEMS_ICC__)
# define ACC_OS_EMBEDDED 1
@@ -552,12 +555,27 @@
# define ACC_CC_PELLESC 1
# define ACC_INFO_CC "Pelles C"
# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__POCC__)
-#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
-# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# else
+# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# endif
+# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
+# define ACC_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
+# else
+# define ACC_CC_CLANG_CLANG 0x010000L
+# endif
+# define ACC_CC_CLANG ACC_CC_CLANG_GNUC
+# define ACC_INFO_CC "clang"
+# define ACC_INFO_CCVER __VERSION__
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
# else
-# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
# endif
+# define ACC_CC_LLVM ACC_CC_LLVM_GNUC
# define ACC_INFO_CC "llvm-gcc"
# define ACC_INFO_CCVER __VERSION__
#elif defined(__GNUC__) && defined(__VERSION__)
@@ -578,6 +596,10 @@
# define ACC_CC_AZTECC 1
# define ACC_INFO_CC "Aztec C"
# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__CODEGEARC__)
+# define ACC_CC_CODEGEARC 1
+# define ACC_INFO_CC "CodeGear C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CODEGEARC__)
#elif defined(__BORLANDC__)
# define ACC_CC_BORLANDC 1
# define ACC_INFO_CC "Borland C"
@@ -708,7 +730,7 @@
#if 0 && (ACC_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
# error "ACC_CC_MSC: _MSC_FULL_VER is not defined"
#endif
-#if !defined(__ACC_ARCH_OVERRIDE) && !defined(ACC_ARCH_GENERIC) && defined(_CRAY)
+#if !defined(__ACC_ARCH_OVERRIDE) && !(ACC_ARCH_GENERIC) && defined(_CRAY)
# if (UINT_MAX > ACC_0xffffffffL) && defined(_CRAY)
# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
# define ACC_ARCH_CRAY_MPP 1
@@ -718,7 +740,7 @@
# endif
#endif
#if !defined(__ACC_ARCH_OVERRIDE)
-#if defined(ACC_ARCH_GENERIC)
+#if (ACC_ARCH_GENERIC)
# define ACC_INFO_ARCH "generic"
#elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
# define ACC_ARCH_I086 1
@@ -753,6 +775,9 @@
#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
# define ACC_ARCH_AVR 1
# define ACC_INFO_ARCH "avr"
+#elif defined(__avr32__) || defined(__AVR32__)
+# define ACC_ARCH_AVR32 1
+# define ACC_INFO_ARCH "avr32"
#elif defined(__bfin__)
# define ACC_ARCH_BLACKFIN 1
# define ACC_INFO_ARCH "blackfin"
@@ -875,10 +900,10 @@
# define ACC_ARCH_I086PM 1
# define ACC_ARCH_IA16PM 1
#endif
-#if defined(ACC_ARCH_ARM_THUMB) && !defined(ACC_ARCH_ARM)
+#if (ACC_ARCH_ARM_THUMB) && !(ACC_ARCH_ARM)
# error "this should not happen"
#endif
-#if defined(ACC_ARCH_I086PM) && !defined(ACC_ARCH_I086)
+#if (ACC_ARCH_I086PM) && !(ACC_ARCH_I086)
# error "this should not happen"
#endif
#if (ACC_ARCH_I086)
@@ -951,7 +976,7 @@
#elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295))
# undef ACC_HAVE_MM_HUGE_ARRAY
#endif
-#if (ACC_ARCH_I086PM) && !defined(ACC_HAVE_MM_HUGE_PTR)
+#if (ACC_ARCH_I086PM) && !(ACC_HAVE_MM_HUGE_PTR)
# if (ACC_OS_DOS16)
# error "this should not happen"
# elif (ACC_CC_ZORTECHC)
@@ -1167,7 +1192,7 @@ extern "C" {
#if (ACC_ARCH_I086 && ACC_CC_DMC)
#elif (ACC_CC_CILLY) && defined(__GNUC__)
# define ACC_SIZEOF_LONG_LONG 8
-#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define ACC_SIZEOF_LONG_LONG 8
#elif ((ACC_OS_WIN32 || ACC_OS_WIN64 || defined(_WIN32)) && ACC_CC_MSC && (_MSC_VER >= 1400))
# define ACC_SIZEOF_LONG_LONG 8
@@ -1201,12 +1226,12 @@ extern "C" {
#endif
#endif
#endif
-#if defined(__cplusplus) && defined(ACC_CC_GNUC)
+#if defined(__cplusplus) && (ACC_CC_GNUC)
# if (ACC_CC_GNUC < 0x020800ul)
# undef ACC_SIZEOF_LONG_LONG
# endif
#endif
-#if defined(ACC_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+#if (ACC_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
# undef ACC_SIZEOF_LONG_LONG
#endif
#if !defined(ACC_SIZEOF_VOID_P)
@@ -1305,15 +1330,17 @@ extern "C" {
# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_SIZE_T
#endif
#endif
-#if defined(ACC_ABI_NEUTRAL_ENDIAN)
+#if (ACC_ABI_NEUTRAL_ENDIAN)
# undef ACC_ABI_BIG_ENDIAN
# undef ACC_ABI_LITTLE_ENDIAN
-#elif !defined(ACC_ABI_BIG_ENDIAN) && !defined(ACC_ABI_LITTLE_ENDIAN)
+#elif !(ACC_ABI_BIG_ENDIAN) && !(ACC_ABI_LITTLE_ENDIAN)
#if (ACC_ARCH_ALPHA) && (ACC_ARCH_CRAY_MPP)
# define ACC_ABI_BIG_ENDIAN 1
+#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
+# define ACC_ABI_LITTLE_ENDIAN 1
#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430)
# define ACC_ABI_LITTLE_ENDIAN 1
-#elif (ACC_ARCH_M68K || ACC_ARCH_S390)
+#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390)
# define ACC_ABI_BIG_ENDIAN 1
#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
# if (__LITTLE_ENDIAN__ == 1)
@@ -1335,14 +1362,14 @@ extern "C" {
# define ACC_ABI_LITTLE_ENDIAN 1
#endif
#endif
-#if defined(ACC_ABI_BIG_ENDIAN) && defined(ACC_ABI_LITTLE_ENDIAN)
+#if (ACC_ABI_BIG_ENDIAN) && (ACC_ABI_LITTLE_ENDIAN)
# error "this should not happen"
#endif
-#if defined(ACC_ABI_BIG_ENDIAN)
+#if (ACC_ABI_BIG_ENDIAN)
# define ACC_INFO_ABI_ENDIAN "be"
-#elif defined(ACC_ABI_LITTLE_ENDIAN)
+#elif (ACC_ABI_LITTLE_ENDIAN)
# define ACC_INFO_ABI_ENDIAN "le"
-#elif defined(ACC_ABI_NEUTRAL_ENDIAN)
+#elif (ACC_ABI_NEUTRAL_ENDIAN)
# define ACC_INFO_ABI_ENDIAN "neutral"
#endif
#if (ACC_SIZEOF_INT == 1 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2)
@@ -1368,15 +1395,15 @@ extern "C" {
# define ACC_INFO_ABI_PM "ip32l64"
#endif
#if !defined(__ACC_LIBC_OVERRIDE)
-#if defined(ACC_LIBC_NAKED)
+#if (ACC_LIBC_NAKED)
# define ACC_INFO_LIBC "naked"
-#elif defined(ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_FREESTANDING)
# define ACC_INFO_LIBC "freestanding"
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
# define ACC_INFO_LIBC "mfreestanding"
-#elif defined(ACC_LIBC_ISOC90)
+#elif (ACC_LIBC_ISOC90)
# define ACC_INFO_LIBC "isoc90"
-#elif defined(ACC_LIBC_ISOC99)
+#elif (ACC_LIBC_ISOC99)
# define ACC_INFO_LIBC "isoc99"
#elif defined(__dietlibc__)
# define ACC_LIBC_DIETLIBC 1
@@ -1408,22 +1435,24 @@ extern "C" {
#if !defined(__acc_gnuc_extension__)
#if (ACC_CC_GNUC >= 0x020800ul)
# define __acc_gnuc_extension__ __extension__
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_gnuc_extension__ __extension__
#else
-# define __acc_gnuc_extension__
+# define __acc_gnuc_extension__ /*empty*/
#endif
#endif
#if !defined(__acc_ua_volatile)
# define __acc_ua_volatile volatile
#endif
#if !defined(__acc_alignof)
-#if (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
+#if (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
# define __acc_alignof(e) __alignof__(e)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
# define __acc_alignof(e) __alignof__(e)
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
# define __acc_alignof(e) __alignof(e)
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_alignof(e) __alignof__(e)
#endif
#endif
#if defined(__acc_alignof)
@@ -1434,7 +1463,7 @@ extern "C" {
# define __acc_constructor __attribute__((__constructor__,__used__))
#elif (ACC_CC_GNUC >= 0x020700ul)
# define __acc_constructor __attribute__((__constructor__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_constructor __attribute__((__constructor__))
#endif
#endif
@@ -1446,14 +1475,14 @@ extern "C" {
# define __acc_destructor __attribute__((__destructor__,__used__))
#elif (ACC_CC_GNUC >= 0x020700ul)
# define __acc_destructor __attribute__((__destructor__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_destructor __attribute__((__destructor__))
#endif
#endif
#if defined(__acc_destructor)
# define __acc_HAVE_destructor 1
#endif
-#if defined(__acc_HAVE_destructor) && !defined(__acc_HAVE_constructor)
+#if (__acc_HAVE_destructor) && !(__acc_HAVE_constructor)
# error "this should not happen"
#endif
#if !defined(__acc_inline)
@@ -1462,7 +1491,7 @@ extern "C" {
# define __acc_inline inline
#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
# define __acc_inline __inline
-#elif (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
+#elif (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
# define __acc_inline __inline__
#elif (ACC_CC_DMC)
# define __acc_inline __inline
@@ -1472,6 +1501,8 @@ extern "C" {
# define __acc_inline __inline
#elif (ACC_CC_MSC && (_MSC_VER >= 900))
# define __acc_inline __inline
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_inline __inline__
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define __acc_inline inline
#endif
@@ -1479,7 +1510,7 @@ extern "C" {
#if defined(__acc_inline)
# define __acc_HAVE_inline 1
#else
-# define __acc_inline
+# define __acc_inline /*empty*/
#endif
#if !defined(__acc_forceinline)
#if (ACC_CC_GNUC >= 0x030200ul)
@@ -1488,16 +1519,18 @@ extern "C" {
# define __acc_forceinline __forceinline
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
# define __acc_forceinline __inline__ __attribute__((__always_inline__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_forceinline __inline__ __attribute__((__always_inline__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __acc_forceinline __forceinline
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_forceinline __inline__ __attribute__((__always_inline__))
#endif
#endif
#if defined(__acc_forceinline)
# define __acc_HAVE_forceinline 1
#else
-# define __acc_forceinline
+# define __acc_forceinline /*empty*/
#endif
#if !defined(__acc_noinline)
#if 1 && (ACC_ARCH_I386) && (ACC_CC_GNUC >= 0x040000ul) && (ACC_CC_GNUC < 0x040003ul)
@@ -1508,7 +1541,7 @@ extern "C" {
# define __acc_noinline __declspec(noinline)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
# define __acc_noinline __attribute__((__noinline__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_noinline __attribute__((__noinline__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
# define __acc_noinline __declspec(noinline)
@@ -1517,14 +1550,16 @@ extern "C" {
# else
# define __acc_noinline __declspec(noinline)
# endif
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_noinline __attribute__((__noinline__))
#endif
#endif
#if defined(__acc_noinline)
# define __acc_HAVE_noinline 1
#else
-# define __acc_noinline
+# define __acc_noinline /*empty*/
#endif
-#if (defined(__acc_HAVE_forceinline) || defined(__acc_HAVE_noinline)) && !defined(__acc_HAVE_inline)
+#if (__acc_HAVE_forceinline || __acc_HAVE_noinline) && !(__acc_HAVE_inline)
# error "this should not happen"
#endif
#if !defined(__acc_noreturn)
@@ -1534,7 +1569,7 @@ extern "C" {
# define __acc_noreturn __declspec(noreturn)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
# define __acc_noreturn __attribute__((__noreturn__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_noreturn __attribute__((__noreturn__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __acc_noreturn __declspec(noreturn)
@@ -1543,16 +1578,16 @@ extern "C" {
#if defined(__acc_noreturn)
# define __acc_HAVE_noreturn 1
#else
-# define __acc_noreturn
+# define __acc_noreturn /*empty*/
#endif
#if !defined(__acc_nothrow)
#if (ACC_CC_GNUC >= 0x030300ul)
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) && defined(__cplusplus)
# define __acc_nothrow __declspec(nothrow)
-#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 900) && ACC_CC_SYNTAX_GNUC)
# define __acc_nothrow __attribute__((__nothrow__))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
# define __acc_nothrow __declspec(nothrow)
@@ -1561,14 +1596,14 @@ extern "C" {
#if defined(__acc_nothrow)
# define __acc_HAVE_nothrow 1
#else
-# define __acc_nothrow
+# define __acc_nothrow /*empty*/
#endif
#if !defined(__acc_restrict)
#if (ACC_CC_GNUC >= 0x030400ul)
# define __acc_restrict __restrict__
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
# define __acc_restrict __restrict__
-#elif (ACC_CC_LLVM)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM)
# define __acc_restrict __restrict__
#elif (ACC_CC_MSC && (_MSC_VER >= 1400))
# define __acc_restrict __restrict
@@ -1577,7 +1612,7 @@ extern "C" {
#if defined(__acc_restrict)
# define __acc_HAVE_restrict 1
#else
-# define __acc_restrict
+# define __acc_restrict /*empty*/
#endif
#if !defined(__acc_likely) && !defined(__acc_unlikely)
#if (ACC_CC_GNUC >= 0x030200ul)
@@ -1586,7 +1621,7 @@ extern "C" {
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
# define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
-#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
#endif
@@ -1606,7 +1641,7 @@ extern "C" {
# define ACC_UNUSED(var) ((void) &var)
# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PELLESC || ACC_CC_TURBOC)
# define ACC_UNUSED(var) if (&var) ; else
-# elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define ACC_UNUSED(var) ((void) var)
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED(var) if (&var) ; else
@@ -1625,7 +1660,7 @@ extern "C" {
# define ACC_UNUSED_FUNC(func) ((void) func)
# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
# define ACC_UNUSED_FUNC(func) if (func) ; else
-# elif (ACC_CC_LLVM)
+# elif (ACC_CC_CLANG || ACC_CC_LLVM)
# define ACC_UNUSED_FUNC(func) ((void) &func)
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED_FUNC(func) if (func) ; else
@@ -1640,7 +1675,7 @@ extern "C" {
#if !defined(ACC_UNUSED_LABEL)
# if (ACC_CC_WATCOMC) && defined(__cplusplus)
# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
-# elif (ACC_CC_INTELC || ACC_CC_WATCOMC)
+# elif (ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC)
# define ACC_UNUSED_LABEL(l) if (0) goto l
# else
# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
@@ -1655,6 +1690,15 @@ extern "C" {
# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
# endif
#endif
+#if !defined(ACC_UNCONST_CAST)
+# if 0 && defined(__cplusplus)
+# define ACC_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((acc_uintptr_t) ((const void *) (e))))))
+# else
+# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
+# endif
+#endif
#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
@@ -1683,7 +1727,7 @@ extern "C" {
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
# define __acc_cdecl __cdecl
-# define __acc_cdecl_atexit
+# define __acc_cdecl_atexit /*empty*/
# define __acc_cdecl_main __cdecl
# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
# define __acc_cdecl_qsort __pascal
@@ -1724,24 +1768,24 @@ extern "C" {
# define __acc_cdecl cdecl
#endif
#if !defined(__acc_cdecl)
-# define __acc_cdecl
+# define __acc_cdecl /*empty*/
#endif
#if !defined(__acc_cdecl_atexit)
-# define __acc_cdecl_atexit
+# define __acc_cdecl_atexit /*empty*/
#endif
#if !defined(__acc_cdecl_main)
-# define __acc_cdecl_main
+# define __acc_cdecl_main /*empty*/
#endif
#if !defined(__acc_cdecl_qsort)
-# define __acc_cdecl_qsort
+# define __acc_cdecl_qsort /*empty*/
#endif
#if !defined(__acc_cdecl_sighandler)
-# define __acc_cdecl_sighandler
+# define __acc_cdecl_sighandler /*empty*/
#endif
#if !defined(__acc_cdecl_va)
# define __acc_cdecl_va __acc_cdecl
#endif
-#if !defined(ACC_CFG_NO_WINDOWS_H)
+#if !(ACC_CFG_NO_WINDOWS_H)
#if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64)
# if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
# elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
@@ -1787,7 +1831,7 @@ extern "C" {
#elif (ACC_ARCH_POWERPC)
# define ACC_OPT_PREFER_PREINC 1
# define ACC_OPT_PREFER_PREDEC 1
-# if defined(ACC_ABI_BIG_ENDIAN)
+# if (ACC_ABI_BIG_ENDIAN)
# define ACC_OPT_UNALIGNED16 1
# define ACC_OPT_UNALIGNED32 1
# endif
@@ -1801,28 +1845,29 @@ extern "C" {
# define ACC_OPT_PREFER_POSTINC 1
# define ACC_OPT_PREFER_PREDEC 1
#endif
-#if !defined(ACC_CFG_NO_INLINE_ASM)
-#if defined(ACC_CC_LLVM)
+#ifndef ACC_CFG_NO_INLINE_ASM
+#if (ACC_CC_LLVM)
# define ACC_CFG_NO_INLINE_ASM 1
#endif
#endif
-#if !defined(ACC_CFG_NO_UNALIGNED)
-#if defined(ACC_ABI_NEUTRAL_ENDIAN) || defined(ACC_ARCH_GENERIC)
+#ifndef ACC_CFG_NO_UNALIGNED
+#if (ACC_ABI_NEUTRAL_ENDIAN) || (ACC_ARCH_GENERIC)
# define ACC_CFG_NO_UNALIGNED 1
#endif
#endif
-#if defined(ACC_CFG_NO_UNALIGNED)
+#if (ACC_CFG_NO_UNALIGNED)
# undef ACC_OPT_UNALIGNED16
# undef ACC_OPT_UNALIGNED32
# undef ACC_OPT_UNALIGNED64
#endif
-#if defined(ACC_CFG_NO_INLINE_ASM)
+#if (ACC_CFG_NO_INLINE_ASM)
#elif (ACC_ARCH_I386 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
# define ACC_ASM_SYNTAX_MSC 1
#elif (ACC_OS_WIN64 && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
-#elif (ACC_ARCH_I386 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
+#elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC == 0x011f00ul))
+#elif (ACC_ARCH_I386 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
# define ACC_ASM_SYNTAX_GNUC 1
-#elif (ACC_ARCH_AMD64 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
+#elif (ACC_ARCH_AMD64 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
# define ACC_ASM_SYNTAX_GNUC 1
#endif
#if (ACC_ASM_SYNTAX_GNUC)
@@ -1877,16 +1922,16 @@ extern "C" {
#define ACC_INFO_STRING \
ACC_INFO_ARCH __ACC_INFOSTR_MM __ACC_INFOSTR_PM __ACC_INFOSTR_ENDIAN \
" " __ACC_INFOSTR_OSNAME __ACC_INFOSTR_LIBC " " ACC_INFO_CC __ACC_INFOSTR_CCVER
-#if defined(ACC_CFG_NO_CONFIG_HEADER)
+#if (ACC_CFG_NO_CONFIG_HEADER)
#elif defined(ACC_CFG_CONFIG_HEADER)
#else
-#if !defined(ACC_CFG_AUTO_NO_HEADERS)
-#if defined(ACC_LIBC_NAKED)
-#elif defined(ACC_LIBC_FREESTANDING)
+#if !(ACC_CFG_AUTO_NO_HEADERS)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
# define HAVE_LIMITS_H 1
# define HAVE_STDARG_H 1
# define HAVE_STDDEF_H 1
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
# define HAVE_LIMITS_H 1
# define HAVE_SETJMP_H 1
# define HAVE_STDARG_H 1
@@ -1902,9 +1947,7 @@ extern "C" {
#define HAVE_FCNTL_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
-#ifndef HAVE_MALLOC_H
#define HAVE_MALLOC_H 1
-#endif
#define HAVE_MEMORY_H 1
#define HAVE_SETJMP_H 1
#define HAVE_SIGNAL_H 1
@@ -2138,10 +2181,10 @@ extern "C" {
#endif
#endif
#endif
-#if !defined(ACC_CFG_AUTO_NO_FUNCTIONS)
-#if defined(ACC_LIBC_NAKED)
-#elif defined(ACC_LIBC_FREESTANDING)
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
+#if !(ACC_CFG_AUTO_NO_FUNCTIONS)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
# define HAVE_LONGJMP 1
# define HAVE_MEMCMP 1
# define HAVE_MEMCPY 1
@@ -2292,8 +2335,12 @@ extern "C" {
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_INTELC)
+# ifndef snprintf
# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
# define vsnprintf _vsnprintf
+# endif
#elif (ACC_CC_LCCWIN32)
# define utime _utime
#elif (ACC_CC_MSC)
@@ -2304,8 +2351,16 @@ extern "C" {
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# elif (_MSC_VER < 1500)
+# ifndef snprintf
# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
# define vsnprintf _vsnprintf
+# endif
+# else
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
# endif
# if ((_MSC_VER < 800) && ACC_OS_WIN16)
# undef HAVE_ALLOCA
@@ -2441,7 +2496,7 @@ extern "C" {
#endif
#endif
#endif
-#if !defined(ACC_CFG_AUTO_NO_SIZES)
+#if !(ACC_CFG_AUTO_NO_SIZES)
#if !defined(SIZEOF_SHORT) && defined(ACC_SIZEOF_SHORT)
# define SIZEOF_SHORT ACC_SIZEOF_SHORT
#endif
@@ -2470,11 +2525,11 @@ extern "C" {
# define SIZEOF_PTRDIFF_T ACC_SIZEOF_PTRDIFF_T
#endif
#endif
-#if defined(HAVE_SIGNAL) && !defined(RETSIGTYPE)
+#if (HAVE_SIGNAL) && !defined(RETSIGTYPE)
# define RETSIGTYPE void
#endif
#endif
-#if defined(ACC_CFG_NO_ACC_TYPE_H)
+#if (ACC_CFG_NO_ACC_TYPE_H)
#else
#if (ACC_SIZEOF_LONG_LONG+0 > 0)
__acc_gnuc_extension__ typedef long long acc_llong_t;
@@ -2496,7 +2551,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_SHORT == 2)
# define acc_int16e_t short int
# define acc_uint16e_t unsigned short int
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
# define acc_int16e_t __acc_int16e_hi_t
@@ -2523,12 +2578,12 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_LONG_LONG == 4)
# define acc_int32e_t acc_llong_t
# define acc_uint32e_t acc_ullong_t
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
# define acc_uint32e_t __acc_uint32e_si_t
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
@@ -2546,7 +2601,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#endif
#if !defined(acc_int64e_t)
#if (ACC_SIZEOF___INT64 == 8)
-# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_TYPE_PREFER___INT64)
+# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
# define ACC_CFG_TYPE_PREFER___INT64 1
# endif
#endif
@@ -2558,7 +2613,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
# define acc_int64e_t long int
# define acc_uint64e_t unsigned long int
# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
-#elif (ACC_SIZEOF_LONG_LONG == 8) && !defined(ACC_CFG_TYPE_PREFER___INT64)
+#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
# define acc_int64e_t acc_llong_t
# define acc_uint64e_t acc_ullong_t
# if (ACC_CC_BORLANDC)
@@ -2789,7 +2844,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#if defined(__cplusplus)
}
#endif
-# if defined(ACC_CFG_NO_ACC_UA_H)
+# if (ACC_CFG_NO_ACC_UA_H)
# else
#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul))
#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
@@ -2812,7 +2867,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#endif
#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET16(p,v) (* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p) = (acc_uint16e_t) (v))
+#define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
@@ -2820,7 +2875,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
#endif
-#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline)
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
#if !defined(ACC_UA_GET_LE16)
extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
@@ -2848,7 +2903,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
#endif
#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET32(p,v) (* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p) = (acc_uint32e_t) (v))
+#define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
@@ -2856,7 +2911,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
#endif
-#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline)
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
#if !defined(ACC_UA_GET_LE32)
extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
@@ -2884,7 +2939,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsi
#endif
#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET64(p,v) (* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p) = (acc_uint64l_t) (v))
+#define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
@@ -2924,7 +2979,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_SHORT == 2)
# define acc_int16e_t short int
# define acc_uint16e_t unsigned short int
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
# define acc_int16e_t __acc_int16e_hi_t
@@ -2951,12 +3006,12 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_LONG_LONG == 4)
# define acc_int32e_t acc_llong_t
# define acc_uint32e_t acc_ullong_t
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
# define acc_uint32e_t __acc_uint32e_si_t
-#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
@@ -2974,7 +3029,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#endif
#if !defined(acc_int64e_t)
#if (ACC_SIZEOF___INT64 == 8)
-# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_TYPE_PREFER___INT64)
+# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
# define ACC_CFG_TYPE_PREFER___INT64 1
# endif
#endif
@@ -2986,7 +3041,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
# define acc_int64e_t long int
# define acc_uint64e_t unsigned long int
# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
-#elif (ACC_SIZEOF_LONG_LONG == 8) && !defined(ACC_CFG_TYPE_PREFER___INT64)
+#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
# define acc_int64e_t acc_llong_t
# define acc_uint64e_t acc_ullong_t
# if (ACC_CC_BORLANDC)
@@ -3239,7 +3294,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#endif
#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET16(p,v) (* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p) = (acc_uint16e_t) (v))
+#define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
@@ -3247,7 +3302,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
#endif
-#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline)
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
#if !defined(ACC_UA_GET_LE16)
extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
@@ -3275,7 +3330,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
#endif
#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET32(p,v) (* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p) = (acc_uint32e_t) (v))
+#define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
@@ -3283,7 +3338,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
#endif
-#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline)
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
#if !defined(ACC_UA_GET_LE32)
extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
@@ -3311,7 +3366,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsi
#endif
#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
-#define ACC_UA_SET64(p,v) (* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p) = (acc_uint64l_t) (v))
+#define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
#if (ACC_ABI_BIG_ENDIAN)
# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
@@ -3329,9 +3384,9 @@ extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsi
# undef ACC_WANT_ACC_INCD_H
#ifndef __ACC_INCD_H_INCLUDED
#define __ACC_INCD_H_INCLUDED 1
-#if defined(ACC_LIBC_NAKED)
+#if (ACC_LIBC_NAKED)
#ifndef __ACC_FALLBACK_STDDEF_H_INCLUDED
-#define __ACC_FALLBACK_STDDEF_H_INCLUDED
+#define __ACC_FALLBACK_STDDEF_H_INCLUDED 1
#if defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__ acc_fallback_ptrdiff_t;
#elif defined(__MIPS_PSX2__)
@@ -3377,14 +3432,14 @@ typedef unsigned short wchar_t;
#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
#endif
#endif
-#elif defined(ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_FREESTANDING)
# if HAVE_STDDEF_H
# include <stddef.h>
# endif
# if HAVE_STDINT_H
# include <stdint.h>
# endif
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
# if HAVE_STDIO_H
# include <stdio.h>
# endif
@@ -3396,7 +3451,7 @@ typedef unsigned short wchar_t;
# endif
#else
#include <stdio.h>
-#if defined(HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
+#if (HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
# include <time.h>
#endif
#if HAVE_SYS_TYPES_H
@@ -3439,64 +3494,64 @@ typedef unsigned short wchar_t;
# undef ACC_WANT_ACC_INCE_H
#ifndef __ACC_INCE_H_INCLUDED
#define __ACC_INCE_H_INCLUDED 1
-#if defined(ACC_LIBC_NAKED)
-#elif defined(ACC_LIBC_FREESTANDING)
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
-# if defined(HAVE_SETJMP_H)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# if (HAVE_SETJMP_H)
# include <setjmp.h>
# endif
#else
-#if defined(HAVE_STDARG_H)
+#if (HAVE_STDARG_H)
# include <stdarg.h>
#endif
-#if defined(HAVE_CTYPE_H)
+#if (HAVE_CTYPE_H)
# include <ctype.h>
#endif
-#if defined(HAVE_ERRNO_H)
+#if (HAVE_ERRNO_H)
# include <errno.h>
#endif
-#if defined(HAVE_MALLOC_H)
+#if (HAVE_MALLOC_H)
# include <malloc.h>
#endif
-#if defined(HAVE_ALLOCA_H)
+#if (HAVE_ALLOCA_H)
# include <alloca.h>
#endif
-#if defined(HAVE_FCNTL_H)
+#if (HAVE_FCNTL_H)
# include <fcntl.h>
#endif
-#if defined(HAVE_DIRENT_H)
+#if (HAVE_DIRENT_H)
# include <dirent.h>
#endif
-#if defined(HAVE_SETJMP_H)
+#if (HAVE_SETJMP_H)
# include <setjmp.h>
#endif
-#if defined(HAVE_SIGNAL_H)
+#if (HAVE_SIGNAL_H)
# include <signal.h>
#endif
-#if defined(TIME_WITH_SYS_TIME)
+#if (TIME_WITH_SYS_TIME)
# include <sys/time.h>
# include <time.h>
-#elif defined(HAVE_TIME_H)
+#elif (HAVE_TIME_H)
# include <time.h>
#endif
-#if defined(HAVE_UTIME_H)
+#if (HAVE_UTIME_H)
# include <utime.h>
-#elif defined(HAVE_SYS_UTIME_H)
+#elif (HAVE_SYS_UTIME_H)
# include <sys/utime.h>
#endif
-#if defined(HAVE_IO_H)
+#if (HAVE_IO_H)
# include <io.h>
#endif
-#if defined(HAVE_DOS_H)
+#if (HAVE_DOS_H)
# include <dos.h>
#endif
-#if defined(HAVE_DIRECT_H)
+#if (HAVE_DIRECT_H)
# include <direct.h>
#endif
-#if defined(HAVE_SHARE_H)
+#if (HAVE_SHARE_H)
# include <share.h>
#endif
-#if defined(ACC_CC_NDPC)
+#if (ACC_CC_NDPC)
# include <os.h>
#endif
#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
@@ -3509,9 +3564,9 @@ typedef unsigned short wchar_t;
# undef ACC_WANT_ACC_INCI_H
#ifndef __ACC_INCI_H_INCLUDED
#define __ACC_INCI_H_INCLUDED 1
-#if defined(ACC_LIBC_NAKED)
-#elif defined(ACC_LIBC_FREESTANDING)
-#elif defined(ACC_LIBC_MOSTLY_FREESTANDING)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
#else
#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# include <tos.h>
@@ -3547,10 +3602,10 @@ typedef unsigned short wchar_t;
# include <i86.h>
# endif
#endif
-#if defined(HAVE_SYS_MMAN_H)
+#if (HAVE_SYS_MMAN_H)
# include <sys/mman.h>
#endif
-#if defined(HAVE_SYS_RESOURCE_H)
+#if (HAVE_SYS_RESOURCE_H)
# include <sys/resource.h>
#endif
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
@@ -3605,9 +3660,9 @@ typedef unsigned short wchar_t;
# endif
#endif
#if !defined(__ACCLIB_CONST_CAST_RETURN)
-#if 1 && (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#if 1 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (acc_uintptr_t) (var);
-#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACCLIB_CONST_CAST_RETURN(type,var) \
{ union { type a; const type b; } u; u.b = (var); return u.a; }
#else
@@ -3738,10 +3793,10 @@ ACCLIB_EXTERN_NOINLINE(long, acc_vget_long) (long, int);
ACCLIB_EXTERN_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t, int);
#endif
ACCLIB_EXTERN_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t, int);
-#if !defined(ACC_CFG_NO_FLOAT)
+#if !(ACC_CFG_NO_FLOAT)
ACCLIB_EXTERN_NOINLINE(float, acc_vget_float) (float, int);
#endif
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_EXTERN_NOINLINE(double, acc_vget_double) (double, int);
#endif
ACCLIB_EXTERN_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p, int);
@@ -3784,7 +3839,7 @@ ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
# elif (ACC_OS_OS2 || ACC_OS_OS216)
# elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
-# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H))
+# elif (ACC_OS_WIN32 && !(ACC_HAVE_WINDOWS_H))
# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
# undef __ACCLIB_USE_OPENDIR
# endif
@@ -3876,7 +3931,7 @@ ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_query) (void);
ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_enable) (int);
ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_qemu) (void);
ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void);
-#if !defined(acc_int64l_t) || defined(ACC_CFG_NO_DOUBLE)
+#if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
# undef __ACCLIB_PCLOCK_USE_RDTSC
# undef __ACCLIB_PCLOCK_USE_PERFCTR
# undef __ACCLIB_UCLOCK_USE_RDTSC
@@ -3906,7 +3961,7 @@ typedef struct {
ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p);
ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p);
ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p);
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p);
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t);
#endif
@@ -3932,17 +3987,16 @@ typedef struct acc_pclock_t acc_pclock_t;
#define ACC_PCLOCK_MONOTONIC 1
#define ACC_PCLOCK_PROCESS_CPUTIME_ID 2
#define ACC_PCLOCK_THREAD_CPUTIME_ID 3
-#define ACC_PCLOCK_REALTIME_HR 4
-#define ACC_PCLOCK_MONOTONIC_HR 5
struct acc_pclock_handle_t {
acclib_handle_t h;
int mode;
+ int read_error;
const char* name;
int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
#if defined(acc_int64l_t)
acc_uint64l_t ticks_base;
#endif
-#if defined(__ACCLIB_PCLOCK_USE_PERFCTR)
+#if (__ACCLIB_PCLOCK_USE_PERFCTR)
acc_perfctr_handle_t pch;
#endif
};
@@ -3959,11 +4013,11 @@ ACCLIB_EXTERN(int, acc_pclock_open) (acc_pclock_handle_p, int);
ACCLIB_EXTERN(int, acc_pclock_open_default) (acc_pclock_handle_p);
ACCLIB_EXTERN(int, acc_pclock_close) (acc_pclock_handle_p);
ACCLIB_EXTERN(void, acc_pclock_read) (acc_pclock_handle_p, acc_pclock_p);
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_EXTERN(double, acc_pclock_get_elapsed) (acc_pclock_handle_p, const acc_pclock_p, const acc_pclock_p);
#endif
ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned);
-#if !defined(acc_int64l_t) || defined(ACC_CFG_NO_DOUBLE)
+#if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
# undef __ACCLIB_UCLOCK_USE_QPC
#elif (ACC_OS_CYGWIN || ACC_OS_EMX || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
# define __ACCLIB_UCLOCK_USE_QPC 1
@@ -3973,11 +4027,12 @@ ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned);
typedef struct {
acclib_handle_t h;
int mode;
+ int read_error;
const char* name;
-#if defined(__ACCLIB_UCLOCK_USE_PERFCTR)
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
acc_perfctr_handle_t pch;
#endif
-#if defined(__ACCLIB_UCLOCK_USE_QPC)
+#if (__ACCLIB_UCLOCK_USE_QPC)
double qpf;
#endif
} acc_uclock_handle_t;
@@ -3985,7 +4040,7 @@ typedef struct {
union {
acc_uint32l_t t32;
#if !(ACC_OS_DOS16 || ACC_OS_WIN16)
-# if !defined(ACC_CFG_NO_DOUBLE)
+# if !(ACC_CFG_NO_DOUBLE)
double td;
# endif
# if defined(acc_int64l_t)
@@ -3993,13 +4048,13 @@ typedef struct {
# endif
#endif
} ticks;
-#if defined(__ACCLIB_UCLOCK_USE_RDTSC)
+#if (__ACCLIB_UCLOCK_USE_RDTSC)
acc_uint64l_t tsc;
#endif
-#if defined(__ACCLIB_UCLOCK_USE_PERFCTR)
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
acc_perfctr_clock_t pcc;
#endif
-#if defined(__ACCLIB_UCLOCK_USE_QPC)
+#if (__ACCLIB_UCLOCK_USE_QPC)
acc_int64l_t qpc;
#endif
} acc_uclock_t;
@@ -4012,7 +4067,7 @@ typedef struct {
ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p);
ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p);
ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p);
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p);
#endif
ACCLIB_EXTERN(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p, unsigned);
@@ -4034,12 +4089,13 @@ struct acc_getopt_longopt_t {
};
struct acc_getopt_t {
void *user;
+ const char *progname;
+ int bad_option;
char *optarg;
void (*opterr)(acc_getopt_p, const char*, void *);
int optind;
int optopt;
int errcount;
- const char* progname;
int argc; char** argv;
int eof; int shortpos;
int pending_rotate_first, pending_rotate_middle;
@@ -4128,7 +4184,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
# define ACC_CXX_NOTHROW throw()
#endif
#if !defined(ACC_CXX_NOTHROW)
-# define ACC_CXX_NOTHROW
+# define ACC_CXX_NOTHROW /*empty*/
#endif
#if defined(__ACC_CXX_DO_NEW)
#elif (ACC_CC_NDPC || ACC_CC_PGI)
@@ -4165,7 +4221,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
-# elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_PGI)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
@@ -4178,7 +4234,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
# define ACC_CXX_DISABLE_NEW_DELETE private:
#elif (ACC_CC_HIGHC)
# define ACC_CXX_DISABLE_NEW_DELETE private:
-#elif !defined(__ACC_CXX_HAVE_ARRAY_NEW)
+#elif !(__ACC_CXX_HAVE_ARRAY_NEW)
# define ACC_CXX_DISABLE_NEW_DELETE \
protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \
@@ -4287,11 +4343,11 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
#if (SIZEOF_LONG >= 8)
ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,64) == 0xffffffffffffffffUL)
#endif
-#if !defined(ACC_BROKEN_INTEGRAL_PROMOTION)
+#if !(ACC_BROKEN_INTEGRAL_PROMOTION)
ACCCHK_ASSERT(__ACC_MASK_GEN(1u,SIZEOF_INT*8) == ~0u)
ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul)
#endif
-#if !defined(ACC_BROKEN_SIGNED_RIGHT_SHIFT)
+#if !(ACC_BROKEN_SIGNED_RIGHT_SHIFT)
ACCCHK_ASSERT(((-1) >> 7) == -1)
#endif
ACCCHK_ASSERT(((1) >> 7) == 0)
@@ -4340,7 +4396,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT_IS_SIGNED_T(short)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
-#if !defined(ACC_ABI_I8LP16)
+#if !(ACC_ABI_I8LP16)
ACCCHK_ASSERT(sizeof(short) >= 2)
#endif
ACCCHK_ASSERT(sizeof(short) >= sizeof(char))
@@ -4354,7 +4410,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT_IS_SIGNED_T(int)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
-#if !defined(ACC_ABI_I8LP16)
+#if !(ACC_ABI_I8LP16)
ACCCHK_ASSERT(sizeof(int) >= 2)
#endif
ACCCHK_ASSERT(sizeof(int) >= sizeof(short))
@@ -4367,7 +4423,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT_IS_SIGNED_T(long)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
-#if !defined(ACC_ABI_I8LP16)
+#if !(ACC_ABI_I8LP16)
ACCCHK_ASSERT(sizeof(long) >= 4)
#endif
ACCCHK_ASSERT(sizeof(long) >= sizeof(int))
@@ -4386,7 +4442,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
-#if !defined(ACC_BROKEN_SIZEOF)
+#if !(ACC_BROKEN_SIZEOF)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0))
# if (ACC_HAVE_MM_HUGE_PTR)
ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0))
@@ -4404,7 +4460,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
ACCCHK_ASSERT(4 == sizeof(void __huge*))
ACCCHK_ASSERT(4 == sizeof(char __huge*))
#endif
-#if defined(ACC_ABI_I8LP16)
+#if (ACC_ABI_I8LP16)
ACCCHK_ASSERT((((1u << 7) + 1) >> 7) == 1)
ACCCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1)
#else
@@ -4647,7 +4703,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
#elif (ACC_CC_NDPC)
#elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
-#elif !defined(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+#elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
#endif
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
@@ -4888,13 +4944,13 @@ ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
#if !defined(ACCLIB_PUBLIC_NOINLINE)
# if !defined(__acc_noinline)
# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
-# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
+# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
# else
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
# endif
#endif
-#if (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
+#if (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
extern void* volatile __acc_vget_ptr;
void* volatile __attribute__((__used__)) __acc_vget_ptr = (void *) 0;
#else
@@ -4932,13 +4988,13 @@ ACCLIB_PUBLIC_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t v, int ex
{
__ACCLIB_VGET_BODY(acc_hsize_t)
}
-#if !defined(ACC_CFG_NO_FLOAT)
+#if !(ACC_CFG_NO_FLOAT)
ACCLIB_PUBLIC_NOINLINE(float, acc_vget_float) (float v, int expr)
{
__ACCLIB_VGET_BODY(float)
}
#endif
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_PUBLIC_NOINLINE(double, acc_vget_double) (double v, int expr)
{
__ACCLIB_VGET_BODY(double)
@@ -4969,7 +5025,7 @@ ACCLIB_PUBLIC_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoi
#endif
ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc_hsize_t len)
{
-#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP)
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP)
const acc_hbyte_p p1 = (const acc_hbyte_p) s1;
const acc_hbyte_p p2 = (const acc_hbyte_p) s2;
if __acc_likely(len > 0) do
@@ -4986,7 +5042,7 @@ ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc
}
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
{
-#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY)
acc_hbyte_p p1 = (acc_hbyte_p) dest;
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
if (!(len > 0) || p1 == p2)
@@ -5001,7 +5057,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src
}
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
{
-#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE)
acc_hbyte_p p1 = (acc_hbyte_p) dest;
const acc_hbyte_p p2 = (const acc_hbyte_p) src;
if (!(len > 0) || p1 == p2)
@@ -5027,7 +5083,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p sr
}
ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemset) (acc_hvoid_p s, int c, acc_hsize_t len)
{
-#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET)
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
acc_hbyte_p p = (acc_hbyte_p) s;
if __acc_likely(len > 0) do
*p++ = (unsigned char) c;
@@ -5113,12 +5169,12 @@ ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r)
{
acc_uint32l_t v;
if __acc_unlikely(r->n == 624) {
- int i = 0, j;
+ unsigned i = 0, j;
r->n = 0;
do {
- j = i - 623; if (j < 0) j += 624;
+ j = i - 623; if ((int) j < 0) j += 624;
v = (r->s[i] & ACC_UINT32_C(0x80000000)) ^ (r->s[j] & ACC_UINT32_C(0x7fffffff));
- j = i - 227; if (j < 0) j += 624;
+ j = i - 227; if ((int) j < 0) j += 624;
r->s[i] = r->s[j] ^ (v >> 1);
if (v & 1) r->s[i] ^= ACC_UINT32_C(0x9908b0df);
} while (++i != 624);
@@ -5151,12 +5207,12 @@ ACCLIB_PUBLIC(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p r)
{
acc_uint64l_t v;
if __acc_unlikely(r->n == 312) {
- int i = 0, j;
+ unsigned i = 0, j;
r->n = 0;
do {
- j = i - 311; if (j < 0) j += 312;
+ j = i - 311; if ((int) j < 0) j += 312;
v = (r->s[i] & ACC_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & ACC_UINT64_C(0x7fffffff));
- j = i - 156; if (j < 0) j += 312;
+ j = i - 156; if ((int) j < 0) j += 312;
r->s[i] = r->s[j] ^ (v >> 1);
if (v & 1) r->s[i] ^= ACC_UINT64_C(0xb5026f5aa96619e9);
} while (++i != 312);
@@ -5241,7 +5297,7 @@ ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned
ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
#endif
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
-#if !defined(ACC_CC_AZTECC)
+#if !(ACC_CC_AZTECC)
ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
{
void __far* p = 0;
@@ -5299,6 +5355,206 @@ ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
}
#endif
#endif
+#if defined(ACC_WANT_ACCLIB_GETOPT)
+# undef ACC_WANT_ACCLIB_GETOPT
+#define __ACCLIB_GETOPT_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(void, acc_getopt_init) (acc_getopt_p g,
+ int start_argc, int argc, char** argv)
+{
+ memset(g, 0, sizeof(*g));
+ g->optind = start_argc;
+ g->argc = argc; g->argv = argv;
+ g->optopt = -1;
+}
+static int __ACCLIB_FUNCNAME(acc_getopt_rotate) (char** p, int first, int middle, int last)
+{
+ int i = middle, n = middle - first;
+ if (first >= middle || middle >= last) return 0;
+ for (;;)
+ {
+ char* t = p[first]; p[first] = p[i]; p[i] = t;
+ if (++first == middle)
+ {
+ if (++i == last) break;
+ middle = i;
+ }
+ else if (++i == last)
+ i = middle;
+ }
+ return n;
+}
+static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const char* f, ...)
+{
+ if (g->opterr)
+ {
+#if (HAVE_STDARG_H)
+ struct { va_list ap; } s;
+ va_start(s.ap, f);
+ g->opterr(g, f, &s);
+ va_end(s.ap);
+#else
+ g->opterr(g, f, NULL);
+#endif
+ }
+ ++g->errcount;
+ return ret;
+}
+ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
+ const char* shortopts,
+ const acc_getopt_longopt_p longopts,
+ int* longind)
+{
+#define pe __ACCLIB_FUNCNAME(acc_getopt_perror)
+ int ordering = ACC_GETOPT_PERMUTE;
+ int missing_arg_ret = g->bad_option;
+ char* a;
+ if (shortopts)
+ {
+ if (*shortopts == '-' || *shortopts == '+')
+ ordering = *shortopts++ == '-' ? ACC_GETOPT_RETURN_IN_ORDER : ACC_GETOPT_REQUIRE_ORDER;
+ if (*shortopts == ':')
+ missing_arg_ret = *shortopts++;
+ }
+ g->optarg = NULL;
+ if (g->optopt == -1)
+ g->optopt = g->bad_option;
+ if (longind)
+ *longind = -1;
+ if (g->eof)
+ return -1;
+ if (g->shortpos)
+ goto acc_label_next_shortopt;
+ g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ if (ordering == ACC_GETOPT_PERMUTE)
+ {
+ while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
+ ++g->optind;
+ g->pending_rotate_middle = g->optind;
+ }
+ if (g->optind >= g->argc)
+ {
+ g->optind = g->pending_rotate_first;
+ goto acc_label_eof;
+ }
+ a = g->argv[g->optind];
+ if (a[0] == '-' && a[1] == '-')
+ {
+ size_t l = 0;
+ const acc_getopt_longopt_p o;
+ const acc_getopt_longopt_p o1 = NULL;
+ const acc_getopt_longopt_p o2 = NULL;
+ int need_exact = 0;
+ ++g->optind;
+ if (!a[2])
+ goto acc_label_eof;
+ for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
+ ++l;
+ for (o = longopts; l && o && o->name; ++o)
+ {
+ if (strncmp(a, o->name, l) != 0)
+ continue;
+ if (!o->name[l])
+ goto acc_label_found_o;
+ need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG;
+ if (o1) o2 = o;
+ else o1 = o;
+ }
+ if (!o1 || need_exact)
+ return pe(g, g->bad_option, "unrecognized option '--%s'", a);
+ if (o2)
+ return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
+ o = o1;
+ acc_label_found_o:
+ a += l;
+ switch (o->has_arg & 0x2f)
+ {
+ case ACC_GETOPT_OPTIONAL_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ break;
+ case ACC_GETOPT_REQUIRED_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ else if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
+ break;
+ case ACC_GETOPT_REQUIRED_ARG | 0x20:
+ if (a[0] && a[1])
+ g->optarg = a + 1;
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
+ break;
+ default:
+ if (a[0])
+ return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
+ break;
+ }
+ if (longind)
+ *longind = (int) (o - longopts);
+ if (o->flag)
+ {
+ *o->flag = o->val;
+ return 0;
+ }
+ return o->val;
+ }
+ if (a[0] == '-' && a[1])
+ {
+ unsigned char c;
+ const char* s;
+ acc_label_next_shortopt:
+ a = g->argv[g->optind] + ++g->shortpos;
+ c = (unsigned char) *a++; s = NULL;
+ if (c != ':' && shortopts)
+ s = strchr(shortopts, c);
+ if (!s || s[1] != ':')
+ {
+ if (!a[0])
+ ++g->optind, g->shortpos = 0;
+ if (!s)
+ {
+ g->optopt = c;
+ return pe(g, g->bad_option, "invalid option '-%c'", c);
+ }
+ }
+ else
+ {
+ ++g->optind, g->shortpos = 0;
+ if (a[0])
+ g->optarg = a;
+ else if (s[2] != ':')
+ {
+ if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ else
+ {
+ g->optopt = c;
+ return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
+ }
+ }
+ }
+ return c;
+ }
+ if (ordering == ACC_GETOPT_RETURN_IN_ORDER)
+ {
+ ++g->optind;
+ g->optarg = a;
+ return 1;
+ }
+acc_label_eof:
+ g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ g->eof = 1;
+ return -1;
+#undef pe
+}
+#endif
#if defined(ACC_WANT_ACCLIB_HALLOC)
# undef ACC_WANT_ACCLIB_HALLOC
#define __ACCLIB_HALLOC_CH_INCLUDED 1
@@ -5345,7 +5601,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
return p;
#if 0 && defined(__palmos__)
p = MemPtrNew(size);
-#elif !defined(ACC_HAVE_MM_HUGE_PTR)
+#elif !(ACC_HAVE_MM_HUGE_PTR)
if (size < (size_t) -1)
p = malloc((size_t) size);
#else
@@ -5375,7 +5631,7 @@ ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
p = farmalloc(size);
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
p = farmalloc(size);
-#elif defined(ACC_CC_AZTECC)
+#elif (ACC_CC_AZTECC)
p = lmalloc(size);
#else
if (size < (size_t) -1)
@@ -5391,7 +5647,7 @@ ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p)
return;
#if 0 && defined(__palmos__)
MemPtrFree(p);
-#elif !defined(ACC_HAVE_MM_HUGE_PTR)
+#elif !(ACC_HAVE_MM_HUGE_PTR)
free(p);
#else
#if (__ACCLIB_HALLOC_USE_DAH)
@@ -5413,7 +5669,7 @@ ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p)
farfree((void __far*) p);
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
farfree((void __far*) p);
-#elif defined(ACC_CC_AZTECC)
+#elif (ACC_CC_AZTECC)
lfree(p);
#else
free(p);
@@ -5589,7 +5845,43 @@ ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size)
#if !defined(ACCLIB_PUBLIC)
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
#endif
-#if defined(HAVE_GETTIMEOFDAY)
+#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_AMD64 && ACC_ASM_SYNTAX_GNUC)
+#ifndef acc_pclock_syscall_clock_gettime
+#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
+#endif
+static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ long r;
+ __asm__ __volatile__("syscall\n" : "=a" (r) : "0" (228), "D" (clockid), "S" (ts) : __ACC_ASM_CLOBBER);
+ return r;
+}
+#endif
+#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_I386 && ACC_ASM_SYNTAX_GNUC)
+#ifndef acc_pclock_syscall_clock_gettime
+#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
+#endif
+static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ long r;
+ __asm__ __volatile__("int $0x80\n" : "=a" (r) : "0" (265), "b" (clockid), "c" (ts) : __ACC_ASM_CLOBBER);
+ return r;
+}
+#endif
+#if 0 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_r_syscall
+#define acc_pclock_read_clock_gettime_r_syscall acc_pclock_read_clock_gettime_r_syscall
+#endif
+static int acc_pclock_read_clock_gettime_r_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(0, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETTIMEOFDAY)
#ifndef acc_pclock_read_gettimeofday
#define acc_pclock_read_gettimeofday acc_pclock_read_gettimeofday
#endif
@@ -5633,6 +5925,20 @@ static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c)
ACC_UNUSED(h); return 0;
}
#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_m_syscall
+#define acc_pclock_read_clock_gettime_m_syscall acc_pclock_read_clock_gettime_m_syscall
+#endif
+static int acc_pclock_read_clock_gettime_m_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(1, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC)
#ifndef acc_pclock_read_uclock
#define acc_pclock_read_uclock acc_pclock_read_uclock
@@ -5650,11 +5956,11 @@ static int acc_pclock_read_uclock(acc_pclock_handle_p h, acc_pclock_p c)
ACC_UNUSED(h); return 0;
}
#endif
-#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t)
-#ifndef acc_pclock_read_clock_gettime_p
-#define acc_pclock_read_clock_gettime_p acc_pclock_read_clock_gettime_p
+#if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_clock_gettime_p_libc
+#define acc_pclock_read_clock_gettime_p_libc acc_pclock_read_clock_gettime_p_libc
#endif
-static int acc_pclock_read_clock_gettime_p(acc_pclock_handle_p h, acc_pclock_p c)
+static int acc_pclock_read_clock_gettime_p_libc(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
@@ -5664,6 +5970,20 @@ static int acc_pclock_read_clock_gettime_p(acc_pclock_handle_p h, acc_pclock_p c
ACC_UNUSED(h); return 0;
}
#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_p_syscall
+#define acc_pclock_read_clock_gettime_p_syscall acc_pclock_read_clock_gettime_p_syscall
+#endif
+static int acc_pclock_read_clock_gettime_p_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(2, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
#ifndef acc_pclock_read_getprocesstimes
#define acc_pclock_read_getprocesstimes acc_pclock_read_getprocesstimes
@@ -5684,7 +6004,7 @@ static int acc_pclock_read_getprocesstimes(acc_pclock_handle_p h, acc_pclock_p c
ACC_UNUSED(h); return 0;
}
#endif
-#if defined(HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
+#if (HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
#ifndef acc_pclock_read_getrusage
#define acc_pclock_read_getrusage acc_pclock_read_getrusage
#endif
@@ -5712,7 +6032,7 @@ static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c)
acc_perfctr_clock_t pcc;
double secs;
acc_uint64l_t nsecs;
- acc_perfctr_read(&h->pch, &pcc);
+ __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &pcc);
if __acc_unlikely(h->ticks_base == 0)
h->ticks_base = pcc.tsc;
else
@@ -5724,11 +6044,11 @@ static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c)
ACC_UNUSED(h); return 0;
}
#endif
-#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t)
-#ifndef acc_pclock_read_clock_gettime_t
-#define acc_pclock_read_clock_gettime_t acc_pclock_read_clock_gettime_t
+#if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_clock_gettime_t_libc
+#define acc_pclock_read_clock_gettime_t_libc acc_pclock_read_clock_gettime_t_libc
#endif
-static int acc_pclock_read_clock_gettime_t(acc_pclock_handle_p h, acc_pclock_p c)
+static int acc_pclock_read_clock_gettime_t_libc(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
@@ -5738,6 +6058,20 @@ static int acc_pclock_read_clock_gettime_t(acc_pclock_handle_p h, acc_pclock_p c
ACC_UNUSED(h); return 0;
}
#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_t_syscall
+#define acc_pclock_read_clock_gettime_t_syscall acc_pclock_read_clock_gettime_t_syscall
+#endif
+static int acc_pclock_read_clock_gettime_t_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(3, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
#ifndef acc_pclock_read_getthreadtimes
#define acc_pclock_read_getthreadtimes acc_pclock_read_getthreadtimes
@@ -5764,6 +6098,7 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
int i;
h->h = (acclib_handle_t) 0;
h->mode = -1;
+ h->read_error = 2;
h->name = NULL;
h->gettime = 0;
#if defined(acc_int64l_t)
@@ -5771,70 +6106,100 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
#endif
switch (mode)
{
- case ACC_PCLOCK_REALTIME_HR:
-# if defined(acc_pclock_read_gettimeofday)
- h->gettime = acc_pclock_read_gettimeofday;
- h->name = "gettimeofday";
-# endif
- break;
case ACC_PCLOCK_REALTIME:
+# if defined(acc_pclock_read_clock_gettime_r_syscall)
+ if (acc_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_r_syscall;
+ h->name = "CLOCK_REALTIME/syscall";
+ break;
+ }
+# endif
# if defined(acc_pclock_read_gettimeofday)
- h->gettime = acc_pclock_read_gettimeofday;
- h->name = "gettimeofday";
+ if (acc_pclock_read_gettimeofday(h, &c) == 0) {
+ h->gettime = acc_pclock_read_gettimeofday;
+ h->name = "gettimeofday";
+ break;
+ }
# endif
break;
- case ACC_PCLOCK_MONOTONIC_HR:
+ case ACC_PCLOCK_MONOTONIC:
+# if defined(acc_pclock_read_clock_gettime_m_syscall)
+ if (acc_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_m_syscall;
+ h->name = "CLOCK_MONOTONIC/syscall";
+ break;
+ }
+# endif
# if defined(acc_pclock_read_uclock)
- h->gettime = acc_pclock_read_uclock;
- h->name = "uclock";
+ if (acc_pclock_read_uclock(h, &c) == 0) {
+ h->gettime = acc_pclock_read_uclock;
+ h->name = "uclock";
+ break;
+ }
# endif
- break;
- case ACC_PCLOCK_MONOTONIC:
# if defined(acc_pclock_read_clock)
- if (!h->gettime) {
+ if (acc_pclock_read_clock(h, &c) == 0) {
h->gettime = acc_pclock_read_clock;
h->name = "clock";
+ break;
}
# endif
break;
case ACC_PCLOCK_PROCESS_CPUTIME_ID:
# if defined(acc_pclock_read_perfctr)
- if (acc_perfctr_open(&h->pch) == 0) {
+ if (__ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0) {
h->gettime = acc_pclock_read_perfctr;
h->name = "perfctr";
break;
}
# endif
# if defined(acc_pclock_read_getprocesstimes)
- if (!h->gettime && acc_pclock_read_getprocesstimes(h, &c) == 0) {
+ if (acc_pclock_read_getprocesstimes(h, &c) == 0) {
h->gettime = acc_pclock_read_getprocesstimes;
h->name = "GetProcessTimes";
break;
}
# endif
-# if defined(acc_pclock_read_clock_gettime_p)
- if (!h->gettime && acc_pclock_read_clock_gettime_p(h, &c) == 0) {
- h->gettime = acc_pclock_read_clock_gettime_p;
- h->name = "CLOCK_PROCESS_CPUTIME_ID";
+# if defined(acc_pclock_read_clock_gettime_p_syscall)
+ if (acc_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_p_syscall;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_p_libc)
+ if (acc_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_p_libc;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
break;
}
# endif
# if defined(acc_pclock_read_getrusage)
- h->gettime = acc_pclock_read_getrusage;
- h->name = "getrusage";
+ if (acc_pclock_read_getrusage(h, &c) == 0) {
+ h->gettime = acc_pclock_read_getrusage;
+ h->name = "getrusage";
+ break;
+ }
# endif
break;
case ACC_PCLOCK_THREAD_CPUTIME_ID:
# if defined(acc_pclock_read_getthreadtimes)
- if (!h->gettime && acc_pclock_read_getthreadtimes(h, &c) == 0) {
+ if (acc_pclock_read_getthreadtimes(h, &c) == 0) {
h->gettime = acc_pclock_read_getthreadtimes;
h->name = "GetThreadTimes";
}
# endif
-# if defined(acc_pclock_read_clock_gettime_t)
- if (!h->gettime && acc_pclock_read_clock_gettime_t(h, &c) == 0) {
- h->gettime = acc_pclock_read_clock_gettime_t;
- h->name = "CLOCK_THREAD_CPUTIME_ID";
+# if defined(acc_pclock_read_clock_gettime_t_syscall)
+ if (acc_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_t_syscall;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_t_libc)
+ if (acc_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_t_libc;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
break;
}
# endif
@@ -5845,26 +6210,23 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
if (!h->h)
h->h = (acclib_handle_t) 1;
h->mode = mode;
+ h->read_error = 0;
if (!h->name)
h->name = "unknown";
for (i = 0; i < 10; i++) {
- acc_pclock_read(h, &c);
+ __ACCLIB_FUNCNAME(acc_pclock_read)(h, &c);
}
return 0;
}
ACCLIB_PUBLIC(int, acc_pclock_open_default) (acc_pclock_handle_p h)
{
- if (acc_pclock_open(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0)
- return 0;
- if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC_HR) == 0)
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0)
return 0;
- if (acc_pclock_open(h, ACC_PCLOCK_REALTIME_HR) == 0)
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_MONOTONIC) == 0)
return 0;
- if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC) == 0)
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_REALTIME) == 0)
return 0;
- if (acc_pclock_open(h, ACC_PCLOCK_REALTIME) == 0)
- return 0;
- if (acc_pclock_open(h, ACC_PCLOCK_THREAD_CPUTIME_ID) == 0)
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_THREAD_CPUTIME_ID) == 0)
return 0;
return -1;
}
@@ -5875,7 +6237,7 @@ ACCLIB_PUBLIC(int, acc_pclock_close) (acc_pclock_handle_p h)
h->name = NULL;
h->gettime = 0;
#if (__ACCLIB_PCLOCK_USE_PERFCTR)
- acc_perfctr_close(&h->pch);
+ __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
#endif
return 0;
}
@@ -5885,6 +6247,7 @@ ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c)
if (h->gettime(h, c) == 0)
return;
}
+ h->read_error = 1;
#if defined(acc_int64l_t)
c->tv_sec = 0;
#else
@@ -5893,7 +6256,7 @@ ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c)
#endif
c->tv_nsec = 0;
}
-#if !defined(ACC_CFG_NO_DOUBLE)
+#if !(ACC_CFG_NO_DOUBLE)
ACCLIB_PUBLIC(double, acc_pclock_get_elapsed) (acc_pclock_handle_p h, const acc_pclock_p start, const acc_pclock_p stop)
{
double tstop, tstart;
@@ -5915,7 +6278,7 @@ ACCLIB_PUBLIC(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p h, unsigned
{
if (h->h) {
#if (__ACCLIB_PCLOCK_USE_PERFCTR)
- return acc_perfctr_flush_cpu_cache(&h->pch, flags);
+ return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
#endif
}
ACC_UNUSED(h); ACC_UNUSED(flags);
@@ -6000,10 +6363,11 @@ ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
#endif
h->h = (acclib_handle_t) 1;
h->mode = 0;
+ h->read_error = 0;
h->name = NULL;
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
h->pch.h = 0;
- if (h->mode == 0 && acc_perfctr_open(&h->pch) == 0)
+ if (h->mode == 0 && __ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0)
h->mode = 2;
#endif
#if (__ACCLIB_UCLOCK_USE_QPC)
@@ -6018,7 +6382,7 @@ ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
#endif
for (i = 0; i < 10; i++) {
acc_uclock_t c;
- acc_uclock_read(h, &c);
+ __ACCLIB_FUNCNAME(acc_uclock_read)(h, &c);
}
return 0;
}
@@ -6028,18 +6392,18 @@ ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h)
h->mode = -1;
h->name = NULL;
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
- acc_perfctr_close(&h->pch);
+ __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
#endif
return 0;
}
ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
{
#if (__ACCLIB_UCLOCK_USE_RDTSC)
- acc_tsc_read((acc_uint32e_t*) (void*) &c->tsc);
+ __ACCLIB_FUNCNAME(acc_tsc_read)((acc_uint32e_t*) (void*) &c->tsc);
#endif
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
if (h->pch.h) {
- acc_perfctr_read(&h->pch, &c->pcc);
+ __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &c->pcc);
if (h->mode > 0 && h->mode <= 2)
return;
}
@@ -6053,6 +6417,7 @@ ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
return;
} else {
h->mode = 0; h->qpf = 0.0; c->qpc = 0;
+ h->read_error = 1;
}
}
#endif
@@ -6104,7 +6469,7 @@ ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
if (h->pch.h && h->mode == 2) {
if (!h->name) h->name = "perfctr";
- return acc_perfctr_get_elapsed(&h->pch, &start->pcc, &stop->pcc);
+ return __ACCLIB_FUNCNAME(acc_perfctr_get_elapsed)(&h->pch, &start->pcc, &stop->pcc);
}
#endif
#if (__ACCLIB_UCLOCK_USE_QPC)
@@ -6159,7 +6524,7 @@ ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned
{
if (h->h) {
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
- return acc_perfctr_flush_cpu_cache(&h->pch, flags);
+ return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
#endif
}
ACC_UNUSED(h); ACC_UNUSED(flags);
@@ -6183,7 +6548,7 @@ ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned
#if !defined(ACCLIB_PUBLIC_NOINLINE)
# if !defined(__acc_noinline)
# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
-# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
+# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
# else
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
@@ -6195,7 +6560,7 @@ ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned
#endif
ACCLIB_PUBLIC(const char *, acc_getenv) (const char *s)
{
-#if defined(HAVE_GETENV)
+#if (HAVE_GETENV)
return getenv(s);
#else
ACC_UNUSED(s); return (const char *) 0;
@@ -6273,7 +6638,7 @@ ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
return -1;
#elif (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
int r;
-#if !defined(ACC_CC_ZORTECHC)
+#if !(ACC_CC_ZORTECHC)
ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
#endif
ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
@@ -6291,7 +6656,7 @@ ACCLIB_PUBLIC(int, acc_isatty) (int fd)
{
if (fd < 0)
return 0;
-#if (ACC_OS_DOS16 && !defined(ACC_CC_AZTECC))
+#if (ACC_OS_DOS16 && !(ACC_CC_AZTECC))
{
union REGS ri, ro;
ri.x.ax = 0x4400; ri.x.bx = fd;
@@ -6320,7 +6685,7 @@ ACCLIB_PUBLIC(int, acc_isatty) (int fd)
}
}
#endif
-#if defined(HAVE_ISATTY)
+#if (HAVE_ISATTY)
return (isatty(fd)) ? 1 : 0;
#else
return 0;
@@ -6328,7 +6693,7 @@ ACCLIB_PUBLIC(int, acc_isatty) (int fd)
}
ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
{
-#if !defined(HAVE_MKDIR)
+#if !(HAVE_MKDIR)
ACC_UNUSED(name); ACC_UNUSED(mode);
return -1;
#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
@@ -6345,13 +6710,15 @@ ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
# else
return mkdir(name);
# endif
+#elif (ACC_CC_WATCOMC)
+ return mkdir(name, (mode_t) mode);
#else
return mkdir(name, mode);
#endif
}
ACCLIB_PUBLIC(int, acc_rmdir) (const char* name)
{
-#if !defined(HAVE_RMDIR)
+#if !(HAVE_RMDIR)
ACC_UNUSED(name);
return -1;
#elif ((ACC_OS_DOS16 || ACC_OS_DOS32) && (ACC_CC_HIGHC || ACC_CC_PACIFICC))
@@ -6403,7 +6770,7 @@ ACCLIB_PUBLIC_NOINLINE(void, acc_debug_break) (void)
#elif (ACC_ARCH_I086)
#elif (ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
DebugBreak();
-#elif defined(ACC_CFG_NO_INLINE_ASM) && (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
+#elif (ACC_CFG_NO_INLINE_ASM) && (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
DebugBreak();
#elif (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
__asm__ __volatile__("int $3\n" : : : __ACC_ASM_CLOBBER);
@@ -6412,7 +6779,7 @@ ACCLIB_PUBLIC_NOINLINE(void, acc_debug_break) (void)
#elif (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
DebugBreak();
#else
- * (volatile int *) 0x1 = -1;
+ * (volatile unsigned long *) (volatile void *) (size_t) 0x1 = ~0ul;
#endif
}
ACCLIB_PUBLIC_NOINLINE(void, acc_debug_nop) (void)
@@ -6474,7 +6841,7 @@ ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_qemu) (void)
unsigned r = 0;
#if (ACC_OS_POSIX_LINUX || ACC_OS_WIN32 || ACC_OS_WIN64)
const char* p;
- p = acc_getenv("ACC_ENV_RUNNING_ON_QEMU");
+ p = __ACCLIB_FUNCNAME(acc_getenv)("ACC_ENV_RUNNING_ON_QEMU");
if (p) {
if (p[0] == 0) r = 0;
else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = p[0] - '0';
@@ -6536,7 +6903,7 @@ ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
acc_psp_init_module(argc, argv, -1);
}
#endif
-#if !defined(__ACCLIB_HAVE_ACC_WILDARGV)
+#if !(__ACCLIB_HAVE_ACC_WILDARGV)
#define __ACCLIB_HAVE_ACC_WILDARGV 1
ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
{
diff --git a/lzo/src/stats1a.h b/lzo/src/stats1a.h
index 5116f80b..577f50c8 100644
--- a/lzo/src/stats1a.h
+++ b/lzo/src/stats1a.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_STATS1A_H
-#define __LZO_STATS1A_H
+#define __LZO_STATS1A_H 1
#ifdef __cplusplus
extern "C" {
@@ -58,7 +61,7 @@ extern "C" {
// used for finetuning, view with a debugger
************************************************************************/
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
# define LZO_STATS(expr) expr
#else
# define LZO_STATS(expr) ((void) 0)
diff --git a/lzo/src/stats1b.h b/lzo/src/stats1b.h
index b24f71ed..e3ced967 100644
--- a/lzo/src/stats1b.h
+++ b/lzo/src/stats1b.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_STATS1B_H
-#define __LZO_STATS1B_H
+#define __LZO_STATS1B_H 1
#ifdef __cplusplus
extern "C" {
@@ -58,14 +61,14 @@ extern "C" {
// Examine the symbol 'lzo1b_stats' with a debugger.
************************************************************************/
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
# define LZO_STATS(expr) expr
#else
# define LZO_STATS(expr) ((void) 0)
#endif
-#if defined(LZO_COLLECT_STATS)
+#if (LZO_COLLECT_STATS)
typedef struct
{
diff --git a/lzo/src/stats1c.h b/lzo/src/stats1c.h
index 8d261e78..8a0d3a5d 100644
--- a/lzo/src/stats1c.h
+++ b/lzo/src/stats1c.h
@@ -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
@@ -45,7 +48,7 @@
#ifndef __LZO_STATS1C_H
-#define __LZO_STATS1C_H
+#define __LZO_STATS1C_H 1
#define lzo1b_stats_t lzo1c_stats_t
#define lzo1b_stats lzo1c_stats