git-svn: trunk@1472
Trog authored on 2005/04/12 17:57:04... | ... |
@@ -1309,8 +1309,7 @@ static int rar_unpack(int fd, int method, int solid, unpack_data_t *unpack_data) |
1309 | 1309 |
int retval; |
1310 | 1310 |
switch(method) { |
1311 | 1311 |
case 15: |
1312 |
- /* retval = rar_unpack15(fd, solid, unpack_data); */ |
|
1313 |
- printf("WARNING: UNRAR1 (Method 15) not yet implemented.\n"); |
|
1312 |
+ retval = rar_unpack15(fd, solid, unpack_data); |
|
1314 | 1313 |
break; |
1315 | 1314 |
case 20: |
1316 | 1315 |
case 26: |
... | ... |
@@ -67,14 +67,14 @@ static void corr_huff(unpack_data_t *unpack_data, unsigned int *char_set, |
67 | 67 |
} |
68 | 68 |
} |
69 | 69 |
memset(num_to_place, 0, sizeof(unpack_data->ntopl)); |
70 |
- for (i=6 ; i >= 0 ; i++) { |
|
71 |
- num_to_place[i] = (7-i) *32; |
|
70 |
+ for (i=6 ; i >= 0 ; i--) { |
|
71 |
+ num_to_place[i] = (7-i) * 32; |
|
72 | 72 |
} |
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
static void init_huff(unpack_data_t *unpack_data) |
76 | 76 |
{ |
77 |
- int i; |
|
77 |
+ unsigned int i; |
|
78 | 78 |
|
79 | 79 |
for (i=0 ; i<256 ; i++) { |
80 | 80 |
unpack_data->place[i] = unpack_data->placea[i] = unpack_data->placeb[i] = i; |
... | ... |
@@ -105,7 +105,7 @@ static unsigned int decode_num(unpack_data_t *unpack_data, int num, unsigned int |
105 | 105 |
{ |
106 | 106 |
int i; |
107 | 107 |
|
108 |
- for (num&=0xff00, i=0 ; dec_tab[i] <= num ; i++) { |
|
108 |
+ for (num&=0xfff0, i=0 ; dec_tab[i] <= num ; i++) { |
|
109 | 109 |
start_pos++; |
110 | 110 |
} |
111 | 111 |
addbits(unpack_data, start_pos); |
... | ... |
@@ -166,7 +166,7 @@ static void huff_decode(unpack_data_t *unpack_data) |
166 | 166 |
unpack_data->nhfb += 16; |
167 | 167 |
if (unpack_data->nhfb > 0xff) { |
168 | 168 |
unpack_data->nhfb = 0x90; |
169 |
- unpack_data->nlzb >> 1; |
|
169 |
+ unpack_data->nlzb >>= 1; |
|
170 | 170 |
} |
171 | 171 |
|
172 | 172 |
unpack_data->window[unpack_data->unp_ptr++] = |
... | ... |
@@ -195,7 +195,7 @@ static void get_flag_buf(unpack_data_t *unpack_data) |
195 | 195 |
|
196 | 196 |
flags_place = decode_num(unpack_data, getbits(unpack_data), STARTHF2, |
197 | 197 |
dec_hf2, pos_hf2); |
198 |
- while (1) { |
|
198 |
+ for (;;) { |
|
199 | 199 |
flags = unpack_data->chsetc[flags_place]; |
200 | 200 |
unpack_data->flag_buf = flags >> 8; |
201 | 201 |
new_flags_place = unpack_data->ntoplc[flags++ & 0xff]++; |