sl@0
|
1 |
This is an epoc port of zlib (http://www.cdrom.com/pub/infozip/zlib/)
|
sl@0
|
2 |
|
sl@0
|
3 |
Changes made in getting zlib lib to compile.
|
sl@0
|
4 |
|
sl@0
|
5 |
General Changes:
|
sl@0
|
6 |
------------------
|
sl@0
|
7 |
|
sl@0
|
8 |
All .c files renamed to .cpp
|
sl@0
|
9 |
|
sl@0
|
10 |
K&R function defintions are rewritten to conform with ansi C.
|
sl@0
|
11 |
|
sl@0
|
12 |
|
sl@0
|
13 |
|
sl@0
|
14 |
ZLib.h:
|
sl@0
|
15 |
---------
|
sl@0
|
16 |
Since all our files are going to be .cpp files we don't need the extern c stuff so thats been commented out.
|
sl@0
|
17 |
At the start of zlib.h, the macros ZEXPORT, ZEXPORTVA are set to nothing. ZEXTERN is set to IMPORT_C.
|
sl@0
|
18 |
At the end of zlib.h ZEXTERN is set to nothing. This is nasty and hacky but it involes the least
|
sl@0
|
19 |
amount of changes to the zlib code. Anyway it can go if we decide not to export to c interface.
|
sl@0
|
20 |
Every exported function has had EXPORT_C appended to its definition. This affects many files. Again
|
sl@0
|
21 |
if we decide not to export the c interface these changes can be reversed.
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
ZUtil.h:
|
sl@0
|
25 |
-----------
|
sl@0
|
26 |
Includes <e32std.h> at the top.
|
sl@0
|
27 |
Commented out bit of code which checks moew msvc and messes redefines fdopen as _fdopen. Lines 139
|
sl@0
|
28 |
|
sl@0
|
29 |
|
sl@0
|
30 |
|
sl@0
|
31 |
deflate.h:
|
sl@0
|
32 |
------------
|
sl@0
|
33 |
|
sl@0
|
34 |
Added a STATIC_CAST to first two lines of _tr_tally_dist
|
sl@0
|
35 |
|
sl@0
|
36 |
delate.cpp:
|
sl@0
|
37 |
----------
|
sl@0
|
38 |
|
sl@0
|
39 |
#included <e32def.h>
|
sl@0
|
40 |
|
sl@0
|
41 |
Altered C style casts in INSERT_STRING macro to STATIC_CAST and added some more casts
|
sl@0
|
42 |
|
sl@0
|
43 |
Lines 1041 & 1211 commented out. They contained trhe name of a macro in a piece of code which was
|
sl@0
|
44 |
#defed out of the compliation process. Unforntately makmake didn't like it.
|
sl@0
|
45 |
|
sl@0
|
46 |
MSDOS & MACOS? specific stuff has been commented out. I guess this should be replace with an appropriate
|
sl@0
|
47 |
#ifdef but I'm not sure what this should be yet.
|
sl@0
|
48 |
|
sl@0
|
49 |
Added line 284
|
sl@0
|
50 |
s->status = INIT_STATE;
|
sl@0
|
51 |
to fix zlib bug where a memory leak can occur when zalloc fails
|
sl@0
|
52 |
|
sl@0
|
53 |
|
sl@0
|
54 |
infblock.cpp
|
sl@0
|
55 |
-------------
|
sl@0
|
56 |
|
sl@0
|
57 |
This file has been modified to fix a bug in zlib 1.1.3 which can cause a crash when ZALLOC fails.
|
sl@0
|
58 |
Essentially what happens is that in certain circumstances s->sub.trees.blens can be deleted twice.
|
sl@0
|
59 |
I have altered infblock.cpp with a patch sent to me by jloup@gzip.org which fixes this problem. I guess
|
sl@0
|
60 |
this fix will appear in zlib 1.1.4.
|
sl@0
|
61 |
|
sl@0
|
62 |
trees.h:
|
sl@0
|
63 |
----------
|
sl@0
|
64 |
The array sizes specified for _dist_code & _length_code have been removed from the square brackets as
|
sl@0
|
65 |
it conflicts with another extern definition which appears elsewhere in the code.
|
sl@0
|
66 |
|
sl@0
|
67 |
trees.cpp:
|
sl@0
|
68 |
------------
|
sl@0
|
69 |
|
sl@0
|
70 |
#included <e32def.h>
|
sl@0
|
71 |
|
sl@0
|
72 |
STATIC_CASTS added on lines 594, 607, 679, 730, 225
|
sl@0
|
73 |
|
sl@0
|
74 |
|
sl@0
|
75 |
inftrees.cpp:
|
sl@0
|
76 |
--------------
|
sl@0
|
77 |
commented out unused formal parameter z in inflate_trees_fixed at line 399. Seems to be some global
|
sl@0
|
78 |
data in here. Something is going to have to be done about it.
|
sl@0
|
79 |
|
sl@0
|
80 |
|
sl@0
|
81 |
gzio.cpp:
|
sl@0
|
82 |
----------
|
sl@0
|
83 |
Swapped around includes for zconf.h and stdio.h so we don't get warnings about multiple defintions of
|
sl@0
|
84 |
NULL.
|
sl@0
|
85 |
gzprintf uses to much stack for epoc. Compliation gives a failure to link with _chkstk. Rather than
|
sl@0
|
86 |
reducing the size of the buffer, I'm going to allocate the buffer on the heap.
|
sl@0
|
87 |
|
sl@0
|
88 |
|
sl@0
|
89 |
zconf.h
|
sl@0
|
90 |
-----------
|
sl@0
|
91 |
Commented out lines that include unistd.h
|
sl@0
|
92 |
|
sl@0
|
93 |
Global Variables:
|
sl@0
|
94 |
-------------------
|
sl@0
|
95 |
Since EPOC cannot support writeable global data some modifications were required to the global variables
|
sl@0
|
96 |
in zlib. Conveniently, however, all of the global variables which were no const did not need to be so
|
sl@0
|
97 |
and I believe their non const status was dues to backward compatibility with older compilers. The
|
sl@0
|
98 |
following global variables were made read only to facilitate a marm build.
|
sl@0
|
99 |
|
sl@0
|
100 |
inftrees.cpp:
|
sl@0
|
101 |
-------------
|
sl@0
|
102 |
|
sl@0
|
103 |
fixed_td
|
sl@0
|
104 |
fixed_tl
|
sl@0
|
105 |
inflate_mask
|
sl@0
|
106 |
|
sl@0
|
107 |
trees.cpp:
|
sl@0
|
108 |
----------
|
sl@0
|
109 |
|
sl@0
|
110 |
static_bl_desc
|
sl@0
|
111 |
static_d_desc
|
sl@0
|
112 |
static_l_desc
|
sl@0
|
113 |
table
|
sl@0
|
114 |
z_verbose
|
sl@0
|
115 |
|
sl@0
|
116 |
|
sl@0
|
117 |
deflate.cpp:
|
sl@0
|
118 |
-------------
|
sl@0
|
119 |
delateInit2::my_version
|
sl@0
|
120 |
|
sl@0
|
121 |
|
sl@0
|
122 |
Changes made to remove dependency on the c standard library.
|
sl@0
|
123 |
-------------------------------------------------------------
|
sl@0
|
124 |
|
sl@0
|
125 |
zutil.h
|
sl@0
|
126 |
----------
|
sl@0
|
127 |
the following macros are redefined to make use of the Epoc32 Mem class, zmemcpy, zmemcmp,
|
sl@0
|
128 |
zmemzero.
|
sl@0
|
129 |
|
sl@0
|
130 |
zutil.cpp
|
sl@0
|
131 |
----------
|
sl@0
|
132 |
zcalloc and zfree now call memory functions defined in User.
|
sl@0
|
133 |
|
sl@0
|
134 |
|
sl@0
|
135 |
|
sl@0
|
136 |
|
sl@0
|
137 |
|