1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
--- bzip2-0.1pl2.c 1997-08-30 01:32:15.000000000 +0200
+++ 32767.c 2011-08-20 12:02:19.000000000 +0200
@@ -1,18 +1,13 @@
-
-/*-----------------------------------------------------------*/
-/*--- A block-sorting, lossless compressor bzip2.c ---*/
-/*-----------------------------------------------------------*/
-
-/*--
- This program is bzip2, a lossless, block-sorting data compressor,
- version 0.1pl2, dated 29-Aug-1997.
-
+/* This is an ancient version of bzip2 (0.1pl2) modified to produce
+ blocks with constant number of 32767 selectors.
+ Note that this program is full of bugs! Use with care!
+ */
+/*-
+ Copyright (C) 2011 Mikolaj Izdebski
Copyright (C) 1996, 1997 by Julian Seward.
- Guildford, Surrey, UK
- email: jseward@acm.org
- This program is free software; you can redistribute it and/or modify
+ This program 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
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@@ -23,8 +18,18 @@
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
- The GNU General Public License is contained in the file LICENSE.
+/*-----------------------------------------------------------*/
+/*--- A block-sorting, lossless compressor bzip2.c ---*/
+/*-----------------------------------------------------------*/
+
+/*--
+ This program is bzip2, a lossless, block-sorting data compressor,
+ version 0.1pl2, dated 29-Aug-1997.
+
+ Copyright (C) 1996, 1997 by Julian Seward.
+ Guildford, Surrey, UK
+ email: jseward@acm.org
This program is based on (at least) the work of:
@@ -160,5 +165,5 @@
run rather slowly. gcc version 2.x is recommended.
--*/
- #ifdef __GNUC__
+ #if 0
#define INLINE inline
#define NORETURN __attribute__ ((noreturn))
@@ -476,5 +481,5 @@
#define N_ITERS 4
-#define MAX_SELECTORS (2 + (900000 / G_SIZE))
+#define MAX_SELECTORS 32767
Bool inUse[256];
@@ -1337,7 +1342,4 @@
if (!(nGroups < 8)) panic ( "sendMTFValues(1)" );
- if (!(nSelectors < 32768 &&
- nSelectors <= (2 + (900000 / G_SIZE))))
- panic ( "sendMTFValues(2)" );
@@ -1398,4 +1400,5 @@
/*--- Now the selectors. ---*/
+ nSelectors = 32767;
nBytes = bytesOut;
bsW ( 3, nGroups );
@@ -1443,5 +1446,4 @@
selCtr++;
}
- if (!(selCtr == nSelectors)) panic ( "sendMTFValues(5)" );
if (verbosity >= 3)
|