The R Project SVN R

Rev

Rev 41464 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41464 Rev 41626
1
The changes for R are all to do with portability:
1
The changes for R are all to do with portability:
2
 
2
 
3
__inline__ is not portable.
3
__inline__ is not portable.  We make use of static inlining in the 
-
 
4
file bzlib.c and decompress.c to avoid issues with semantics of 
-
 
5
'extern inline'.
-
 
6
 
4
fdopen is POSIX but not C89
7
fdopen is POSIX but not C89
5
Solaris' cc objects to inlining functions with names starting with 'main'.
8
Solaris' cc objects to inlining functions with names starting with 'main'.
6
C character strings are limited to ca 500 chars.
9
C character strings are limited to ca 500 chars.
7
Various casts were missing.
10
Various casts were missing.
8
 
11
 
9
*** further changes made in November 2006 were not documented ***
12
*** further changes made in November 2006 were not documented ***
10
 
13
 
11
diff -u bzip2-1.0.4/blocksort.c bzip2/blocksort.c
14
diff -u bzip2-1.0.4/blocksort.c bzip2/blocksort.c
12
--- bzip2-1.0.4/blocksort.c	2007-01-03 02:00:55.000000000 +0000
15
--- bzip2-1.0.4/blocksort.c	2007-01-03 02:00:55.000000000 +0000
13
+++ bzip2/blocksort.c	2007-05-07 12:56:52.000000000 +0100
16
+++ bzip2/blocksort.c	2007-05-07 12:56:52.000000000 +0100
14
@@ -28,7 +28,7 @@
17
@@ -28,7 +28,7 @@
15
 
18
 
16
 /*---------------------------------------------*/
19
 /*---------------------------------------------*/
17
 static 
20
 static 
18
-__inline__
21
-__inline__
19
+R_INLINE
22
+R_INLINE
20
 void fallbackSimpleSort ( UInt32* fmap, 
23
 void fallbackSimpleSort ( UInt32* fmap, 
21
                           UInt32* eclass, 
24
                           UInt32* eclass, 
22
                           Int32   lo, 
25
                           Int32   lo, 
23
@@ -342,9 +342,10 @@
26
@@ -342,9 +342,10 @@
24
 /*---------------------------------------------*/
27
 /*---------------------------------------------*/
25
 
28
 
26
 /*---------------------------------------------*/
29
 /*---------------------------------------------*/
27
+/* Solaris cc objects to inlining functions whose names start with `main' */
30
+/* Solaris cc objects to inlining functions whose names start with `main' */
28
 static
31
 static
29
-__inline__
32
-__inline__
30
-Bool mainGtU ( UInt32  i1, 
33
-Bool mainGtU ( UInt32  i1, 
31
+R_INLINE
34
+R_INLINE
32
+Bool BZmainGtU ( UInt32  i1, 
35
+Bool BZmainGtU ( UInt32  i1, 
33
                UInt32  i2,
36
                UInt32  i2,
34
                UChar*  block, 
37
                UChar*  block, 
35
                UInt16* quadrant,
38
                UInt16* quadrant,
36
@@ -355,7 +356,7 @@
39
@@ -355,7 +356,7 @@
37
    UChar  c1, c2;
40
    UChar  c1, c2;
38
    UInt16 s1, s2;
41
    UInt16 s1, s2;
39
 
42
 
40
-   AssertD ( i1 != i2, "mainGtU" );
43
-   AssertD ( i1 != i2, "mainGtU" );
41
+   AssertD ( i1 != i2, "BZmainGtU" );
44
+   AssertD ( i1 != i2, "BZmainGtU" );
42
    /* 1 */
45
    /* 1 */
43
    c1 = block[i1]; c2 = block[i2];
46
    c1 = block[i1]; c2 = block[i2];
44
    if (c1 != c2) return (c1 > c2);
47
    if (c1 != c2) return (c1 > c2);
45
@@ -511,7 +512,7 @@
48
@@ -511,7 +512,7 @@
46
          if (i > hi) break;
49
          if (i > hi) break;
47
          v = ptr[i];
50
          v = ptr[i];
48
          j = i;
51
          j = i;
49
-         while ( mainGtU ( 
52
-         while ( mainGtU ( 
50
+         while ( BZmainGtU ( 
53
+         while ( BZmainGtU ( 
51
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
54
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
52
                  ) ) {
55
                  ) ) {
53
             ptr[j] = ptr[j-h];
56
             ptr[j] = ptr[j-h];
54
@@ -525,7 +526,7 @@
57
@@ -525,7 +526,7 @@
55
          if (i > hi) break;
58
          if (i > hi) break;
56
          v = ptr[i];
59
          v = ptr[i];
57
          j = i;
60
          j = i;
58
-         while ( mainGtU ( 
61
-         while ( mainGtU ( 
59
+         while ( BZmainGtU ( 
62
+         while ( BZmainGtU ( 
60
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
63
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
61
                  ) ) {
64
                  ) ) {
62
             ptr[j] = ptr[j-h];
65
             ptr[j] = ptr[j-h];
63
@@ -539,7 +540,7 @@
66
@@ -539,7 +540,7 @@
64
          if (i > hi) break;
67
          if (i > hi) break;
65
          v = ptr[i];
68
          v = ptr[i];
66
          j = i;
69
          j = i;
67
-         while ( mainGtU ( 
70
-         while ( mainGtU ( 
68
+         while ( BZmainGtU ( 
71
+         while ( BZmainGtU ( 
69
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
72
                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget 
70
                  ) ) {
73
                  ) ) {
71
             ptr[j] = ptr[j-h];
74
             ptr[j] = ptr[j-h];
72
@@ -579,7 +580,7 @@
75
@@ -579,7 +580,7 @@
73
 }
76
 }
74
 
77
 
75
 static 
78
 static 
76
-__inline__
79
-__inline__
77
+R_INLINE
80
+R_INLINE
78
 UChar mmed3 ( UChar a, UChar b, UChar c )
81
 UChar mmed3 ( UChar a, UChar b, UChar c )
79
 {
82
 {
80
    UChar t;
83
    UChar t;
81
diff -u bzip2-1.0.4/bzlib.c bzip2/bzlib.c
84
diff -u bzip2-1.0.4/bzlib.c bzip2/bzlib.c
82
--- bzip2-1.0.4/bzlib.c	2007-01-03 02:00:55.000000000 +0000
85
--- bzip2-1.0.4/bzlib.c	2007-01-03 02:00:55.000000000 +0000
83
+++ bzip2/bzlib.c	2007-05-07 12:56:52.000000000 +0100
86
+++ bzip2/bzlib.c	2007-05-07 12:56:52.000000000 +0100
84
@@ -53,8 +53,9 @@
87
@@ -53,8 +53,9 @@
85
       BZ2_bzlibVersion()
88
       BZ2_bzlibVersion()
86
    );
89
    );
87
 
90
 
88
+   /* split up over-long message */
91
+   /* split up over-long message */
89
    if (errcode == 1007) {
92
    if (errcode == 1007) {
90
-   fprintf(stderr,
93
-   fprintf(stderr,
91
+       fprintf(stderr, "%s%s%s",
94
+       fprintf(stderr, "%s%s%s",
92
       "\n*** A special note about internal error number 1007 ***\n"
95
       "\n*** A special note about internal error number 1007 ***\n"
93
       "\n"
96
       "\n"
94
       "Experience suggests that a common cause of i.e. 1007\n"
97
       "Experience suggests that a common cause of i.e. 1007\n"
95
@@ -62,7 +63,7 @@
98
@@ -62,7 +63,7 @@
96
       "just happens to cross-check the results of huge numbers of\n"
99
       "just happens to cross-check the results of huge numbers of\n"
97
       "memory reads/writes, and so acts (unintendedly) as a stress\n"
100
       "memory reads/writes, and so acts (unintendedly) as a stress\n"
98
       "test of your memory system.\n"
101
       "test of your memory system.\n"
99
-      "\n"
102
-      "\n"
100
+       "\n",
103
+       "\n",
101
       "I suggest the following: try compressing the file again,\n"
104
       "I suggest the following: try compressing the file again,\n"
102
       "possibly monitoring progress in detail with the -vv flag.\n"
105
       "possibly monitoring progress in detail with the -vv flag.\n"
103
       "\n"
106
       "\n"
104
@@ -72,7 +73,7 @@
107
@@ -72,7 +73,7 @@
105
       "  (www.memtest86.com).  At the time of writing it is free (GPLd).\n"
108
       "  (www.memtest86.com).  At the time of writing it is free (GPLd).\n"
106
       "  Memtest86 tests memory much more thorougly than your BIOSs\n"
109
       "  Memtest86 tests memory much more thorougly than your BIOSs\n"
107
       "  power-on test, and may find failures that the BIOS doesn't.\n"
110
       "  power-on test, and may find failures that the BIOS doesn't.\n"
108
-      "\n"
111
-      "\n"
109
+      "\n",
112
+      "\n",
110
       "* If the error can be repeatably reproduced, this is a bug in\n"
113
       "* If the error can be repeatably reproduced, this is a bug in\n"
111
       "  bzip2, and I would very much like to hear about it.  Please\n"
114
       "  bzip2, and I would very much like to hear about it.  Please\n"
112
       "  let me know, and, ideally, save a copy of the file causing the\n"
115
       "  let me know, and, ideally, save a copy of the file causing the\n"
113
@@ -165,7 +166,7 @@
116
@@ -165,7 +166,7 @@
114
    if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
117
    if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
115
    if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
118
    if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
116
 
119
 
117
-   s = BZALLOC( sizeof(EState) );
120
-   s = BZALLOC( sizeof(EState) );
118
+   s = (EState *) BZALLOC( sizeof(EState) );
121
+   s = (EState *) BZALLOC( sizeof(EState) );
119
    if (s == NULL) return BZ_MEM_ERROR;
122
    if (s == NULL) return BZ_MEM_ERROR;
120
    s->strm = strm;
123
    s->strm = strm;
121
 
124
 
122
@@ -174,9 +175,9 @@
125
@@ -174,9 +175,9 @@
123
    s->ftab = NULL;
126
    s->ftab = NULL;
124
 
127
 
125
    n       = 100000 * blockSize100k;
128
    n       = 100000 * blockSize100k;
126
-   s->arr1 = BZALLOC( n                  * sizeof(UInt32) );
129
-   s->arr1 = BZALLOC( n                  * sizeof(UInt32) );
127
-   s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
130
-   s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
128
-   s->ftab = BZALLOC( 65537              * sizeof(UInt32) );
131
-   s->ftab = BZALLOC( 65537              * sizeof(UInt32) );
129
+   s->arr1 = (UInt32 *) BZALLOC( n                  * sizeof(UInt32) );
132
+   s->arr1 = (UInt32 *) BZALLOC( n                  * sizeof(UInt32) );
130
+   s->arr2 = (UInt32 *) BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
133
+   s->arr2 = (UInt32 *) BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
131
+   s->ftab = (UInt32 *) BZALLOC( 65537              * sizeof(UInt32) );
134
+   s->ftab = (UInt32 *) BZALLOC( 65537              * sizeof(UInt32) );
132
 
135
 
133
    if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
136
    if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
134
       if (s->arr1 != NULL) BZFREE(s->arr1);
137
       if (s->arr1 != NULL) BZFREE(s->arr1);
135
@@ -362,7 +363,7 @@
138
@@ -362,7 +363,7 @@
136
 {
139
 {
137
    Bool progress_in  = False;
140
    Bool progress_in  = False;
138
    Bool progress_out = False;
141
    Bool progress_out = False;
139
-   EState* s = strm->state;
142
-   EState* s = strm->state;
140
+   EState* s = (EState *) strm->state;
143
+   EState* s = (EState *) strm->state;
141
    
144
    
142
    while (True) {
145
    while (True) {
143
 
146
 
144
@@ -409,7 +410,7 @@
147
@@ -409,7 +410,7 @@
145
    Bool progress;
148
    Bool progress;
146
    EState* s;
149
    EState* s;
147
    if (strm == NULL) return BZ_PARAM_ERROR;
150
    if (strm == NULL) return BZ_PARAM_ERROR;
148
-   s = strm->state;
151
-   s = strm->state;
149
+   s = (EState *) strm->state;
152
+   s = (EState *) strm->state;
150
    if (s == NULL) return BZ_PARAM_ERROR;
153
    if (s == NULL) return BZ_PARAM_ERROR;
151
    if (s->strm != strm) return BZ_PARAM_ERROR;
154
    if (s->strm != strm) return BZ_PARAM_ERROR;
152
 
155
 
153
@@ -469,7 +470,7 @@
156
@@ -469,7 +470,7 @@
154
 {
157
 {
155
    EState* s;
158
    EState* s;
156
    if (strm == NULL) return BZ_PARAM_ERROR;
159
    if (strm == NULL) return BZ_PARAM_ERROR;
157
-   s = strm->state;
160
-   s = strm->state;
158
+   s = (EState *) strm->state;
161
+   s = (EState *) strm->state;
159
    if (s == NULL) return BZ_PARAM_ERROR;
162
    if (s == NULL) return BZ_PARAM_ERROR;
160
    if (s->strm != strm) return BZ_PARAM_ERROR;
163
    if (s->strm != strm) return BZ_PARAM_ERROR;
161
 
164
 
162
@@ -505,7 +506,7 @@
165
@@ -505,7 +506,7 @@
163
    if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
166
    if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
164
    if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
167
    if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
165
 
168
 
166
-   s = BZALLOC( sizeof(DState) );
169
-   s = BZALLOC( sizeof(DState) );
167
+   s = (DState *) BZALLOC( sizeof(DState) );
170
+   s = (DState *) BZALLOC( sizeof(DState) );
168
    if (s == NULL) return BZ_MEM_ERROR;
171
    if (s == NULL) return BZ_MEM_ERROR;
169
    s->strm                  = strm;
172
    s->strm                  = strm;
170
    strm->state              = s;
173
    strm->state              = s;
171
@@ -683,7 +684,10 @@
174
@@ -683,7 +684,10 @@
172
 
175
 
173
 
176
 
174
 /*---------------------------------------------------*/
177
 /*---------------------------------------------------*/
175
-__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
178
-__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
176
+#ifndef __cplusplus
179
+#ifndef __cplusplus
177
+R_INLINE 
180
+R_INLINE 
178
+#endif
181
+#endif
179
+Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
182
+Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
180
 {
183
 {
181
    Int32 nb, na, mid;
184
    Int32 nb, na, mid;
182
    nb = 0;
185
    nb = 0;
183
@@ -809,7 +813,7 @@
186
@@ -809,7 +813,7 @@
184
    Bool    corrupt;
187
    Bool    corrupt;
185
    DState* s;
188
    DState* s;
186
    if (strm == NULL) return BZ_PARAM_ERROR;
189
    if (strm == NULL) return BZ_PARAM_ERROR;
187
-   s = strm->state;
190
-   s = strm->state;
188
+   s = (DState *) strm->state;
191
+   s = (DState *) strm->state;
189
    if (s == NULL) return BZ_PARAM_ERROR;
192
    if (s == NULL) return BZ_PARAM_ERROR;
190
    if (s->strm != strm) return BZ_PARAM_ERROR;
193
    if (s->strm != strm) return BZ_PARAM_ERROR;
191
 
194
 
192
@@ -862,7 +866,7 @@
195
@@ -862,7 +866,7 @@
193
 {
196
 {
194
    DState* s;
197
    DState* s;
195
    if (strm == NULL) return BZ_PARAM_ERROR;
198
    if (strm == NULL) return BZ_PARAM_ERROR;
196
-   s = strm->state;
199
-   s = strm->state;
197
+   s = (DState *) strm->state;
200
+   s = (DState *) strm->state;
198
    if (s == NULL) return BZ_PARAM_ERROR;
201
    if (s == NULL) return BZ_PARAM_ERROR;
199
    if (s->strm != strm) return BZ_PARAM_ERROR;
202
    if (s->strm != strm) return BZ_PARAM_ERROR;
200
 
203
 
201
@@ -933,7 +937,7 @@
204
@@ -933,7 +937,7 @@
202
    if (ferror(f))
205
    if (ferror(f))
203
       { BZ_SETERR(BZ_IO_ERROR); return NULL; };
206
       { BZ_SETERR(BZ_IO_ERROR); return NULL; };
204
 
207
 
205
-   bzf = malloc ( sizeof(bzFile) );
208
-   bzf = malloc ( sizeof(bzFile) );
206
+   bzf = (bzFile *) malloc ( sizeof(bzFile) );
209
+   bzf = (bzFile *) malloc ( sizeof(bzFile) );
207
    if (bzf == NULL)
210
    if (bzf == NULL)
208
       { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
211
       { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
209
 
212
 
210
@@ -981,7 +985,7 @@
213
@@ -981,7 +985,7 @@
211
       { BZ_SETERR(BZ_OK); return; };
214
       { BZ_SETERR(BZ_OK); return; };
212
 
215
 
213
    bzf->strm.avail_in = len;
216
    bzf->strm.avail_in = len;
214
-   bzf->strm.next_in  = buf;
217
-   bzf->strm.next_in  = buf;
215
+   bzf->strm.next_in  = (char *) buf;
218
+   bzf->strm.next_in  = (char *) buf;
216
 
219
 
217
    while (True) {
220
    while (True) {
218
       bzf->strm.avail_out = BZ_MAX_UNUSED;
221
       bzf->strm.avail_out = BZ_MAX_UNUSED;
219
@@ -1106,7 +1110,7 @@
222
@@ -1106,7 +1110,7 @@
220
    if (ferror(f))
223
    if (ferror(f))
221
       { BZ_SETERR(BZ_IO_ERROR); return NULL; };
224
       { BZ_SETERR(BZ_IO_ERROR); return NULL; };
222
 
225
 
223
-   bzf = malloc ( sizeof(bzFile) );
226
-   bzf = malloc ( sizeof(bzFile) );
224
+   bzf = (bzFile *) malloc ( sizeof(bzFile) );
227
+   bzf = (bzFile *) malloc ( sizeof(bzFile) );
225
    if (bzf == NULL) 
228
    if (bzf == NULL) 
226
       { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
229
       { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
227
 
230
 
228
@@ -1178,7 +1182,7 @@
231
@@ -1178,7 +1182,7 @@
229
       { BZ_SETERR(BZ_OK); return 0; };
232
       { BZ_SETERR(BZ_OK); return 0; };
230
 
233
 
231
    bzf->strm.avail_out = len;
234
    bzf->strm.avail_out = len;
232
-   bzf->strm.next_out = buf;
235
-   bzf->strm.next_out = buf;
233
+   bzf->strm.next_out = (char *) buf;
236
+   bzf->strm.next_out = (char *) buf;
234
 
237
 
235
    while (True) {
238
    while (True) {
236
 
239
 
237
@@ -1378,6 +1382,15 @@
240
@@ -1378,6 +1382,15 @@
238
 #else
241
 #else
239
 #   define SET_BINARY_MODE(file)
242
 #   define SET_BINARY_MODE(file)
240
 #endif
243
 #endif
241
+
244
+
242
+#if !defined(fdopen) && defined(HAVE_FDOPEN)
245
+#if !defined(fdopen) && defined(HAVE_FDOPEN)
243
+  FILE *fdopen(int fildes, const char *mode)
246
+  FILE *fdopen(int fildes, const char *mode)
244
+#ifdef __cplusplus
247
+#ifdef __cplusplus
245
+	throw ()
248
+	throw ()
246
+#endif
249
+#endif
247
+ ;
250
+ ;
248
+#endif
251
+#endif
249
+
252
+
250
 static
253
 static
251
 BZFILE * bzopen_or_bzdopen
254
 BZFILE * bzopen_or_bzdopen
252
                ( const char *path,   /* no use when bzdopen */
255
                ( const char *path,   /* no use when bzdopen */
253
@@ -1424,7 +1437,7 @@
256
@@ -1424,7 +1437,7 @@
254
         fp = fopen(path,mode2);
257
         fp = fopen(path,mode2);
255
       }
258
       }
256
    } else {
259
    } else {
257
-#ifdef BZ_STRICT_ANSI
260
-#ifdef BZ_STRICT_ANSI
258
+#ifndef HAVE_FDOPEN
261
+#ifndef HAVE_FDOPEN
259
       fp = NULL;
262
       fp = NULL;
260
 #else
263
 #else
261
       fp = fdopen(fd,mode2);
264
       fp = fdopen(fd,mode2);
262
@@ -1513,10 +1526,9 @@
265
@@ -1513,10 +1526,9 @@
263
 void BZ_API(BZ2_bzclose) (BZFILE* b)
266
 void BZ_API(BZ2_bzclose) (BZFILE* b)
264
 {
267
 {
265
    int bzerr;
268
    int bzerr;
266
-   FILE *fp;
269
-   FILE *fp;
267
+   FILE *fp = ((bzFile *)b)->handle;
270
+   FILE *fp = ((bzFile *)b)->handle;
268
    
271
    
269
    if (b==NULL) {return;}
272
    if (b==NULL) {return;}
270
-   fp = ((bzFile *)b)->handle;
273
-   fp = ((bzFile *)b)->handle;
271
    if(((bzFile*)b)->writing){
274
    if(((bzFile*)b)->writing){
272
       BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
275
       BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
273
       if(bzerr != BZ_OK){
276
       if(bzerr != BZ_OK){
274
diff -u bzip2-1.0.4/bzlib_private.h bzip2/bzlib_private.h
277
diff -u bzip2-1.0.4/bzlib_private.h bzip2/bzlib_private.h
275
--- bzip2-1.0.4/bzlib_private.h	2007-01-03 02:00:55.000000000 +0000
278
--- bzip2-1.0.4/bzlib_private.h	2007-01-03 02:00:55.000000000 +0000
276
+++ bzip2/bzlib_private.h	2007-05-07 12:56:51.000000000 +0100
279
+++ bzip2/bzlib_private.h	2007-05-07 12:56:51.000000000 +0100
277
@@ -22,6 +22,7 @@
280
@@ -22,6 +22,7 @@
278
 #ifndef _BZLIB_PRIVATE_H
281
 #ifndef _BZLIB_PRIVATE_H
279
 #define _BZLIB_PRIVATE_H
282
 #define _BZLIB_PRIVATE_H
280
 
283
 
281
+#include <config.h> /* for R_INLINE */
284
+#include <config.h> /* for R_INLINE */
282
 #include <stdlib.h>
285
 #include <stdlib.h>
283
 
286
 
284
 #ifndef BZ_NO_STDIO
287
 #ifndef BZ_NO_STDIO
285
diff -u bzip2-1.0.4/compress.c bzip2/compress.c
288
diff -u bzip2-1.0.4/compress.c bzip2/compress.c
286
--- bzip2-1.0.4/compress.c	2007-01-03 02:00:55.000000000 +0000
289
--- bzip2-1.0.4/compress.c	2007-01-03 02:00:55.000000000 +0000
287
+++ bzip2/compress.c	2007-05-07 12:56:50.000000000 +0100
290
+++ bzip2/compress.c	2007-05-07 12:56:50.000000000 +0100
288
@@ -69,7 +69,7 @@
291
@@ -69,7 +69,7 @@
289
 
292
 
290
 /*---------------------------------------------------*/
293
 /*---------------------------------------------------*/
291
 static
294
 static
292
-__inline__
295
-__inline__
293
+R_INLINE
296
+R_INLINE
294
 void bsW ( EState* s, Int32 n, UInt32 v )
297
 void bsW ( EState* s, Int32 n, UInt32 v )
295
 {
298
 {
296
    bsNEEDW ( n );
299
    bsNEEDW ( n );
297
diff -u bzip2-1.0.4/decompress.c bzip2/decompress.c
300
diff -u bzip2-1.0.4/decompress.c bzip2/decompress.c
298
--- bzip2-1.0.4/decompress.c	2007-01-03 02:00:55.000000000 +0000
301
--- bzip2-1.0.4/decompress.c	2007-01-03 02:00:55.000000000 +0000
299
+++ bzip2/decompress.c	2007-05-07 12:56:50.000000000 +0100
302
+++ bzip2/decompress.c	2007-05-07 12:56:50.000000000 +0100
300
@@ -209,13 +209,13 @@
303
@@ -209,13 +209,13 @@
301
       s->blockSize100k -= BZ_HDR_0;
304
       s->blockSize100k -= BZ_HDR_0;
302
 
305
 
303
       if (s->smallDecompress) {
306
       if (s->smallDecompress) {
304
-         s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
307
-         s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
305
-         s->ll4  = BZALLOC( 
308
-         s->ll4  = BZALLOC( 
306
-                      ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) 
309
-                      ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) 
307
-                   );
310
-                   );
308
+         s->ll16 = (UInt16*) BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
311
+         s->ll16 = (UInt16*) BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
309
+         s->ll4  = (UChar *) BZALLOC( 
312
+         s->ll4  = (UChar *) BZALLOC( 
310
+		               ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) 
313
+		               ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) 
311
+		             );
314
+		             );
312
          if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
315
          if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
313
       } else {
316
       } else {
314
-         s->tt  = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
317
-         s->tt  = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
315
+         s->tt  = (UInt32 *) BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
318
+         s->tt  = (UInt32 *) BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
316
          if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
319
          if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
317
       }
320
       }
318
 
321