ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/liblzf/lzf_c.c
(Generate patch)

Comparing liblzf/lzf_c.c (file contents):
Revision 1.32 by root, Fri May 9 12:42:50 2008 UTC vs.
Revision 1.33 by root, Mon Aug 25 01:40:31 2008 UTC

1/* 1/*
2 * Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de> 2 * Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without modifica- 4 * Redistribution and use in source and binary forms, with or without modifica-
5 * tion, are permitted provided that the following conditions are met: 5 * tion, are permitted provided that the following conditions are met:
6 * 6 *
7 * 1. Redistributions of source code must retain the above copyright notice, 7 * 1. Redistributions of source code must retain the above copyright notice,
206 while (len < maxlen && ref[len] == ip[len]); 206 while (len < maxlen && ref[len] == ip[len]);
207 207
208 break; 208 break;
209 } 209 }
210 210
211 len -= 2; 211 len -= 2; /* len is now #octets - 1 */
212 ip++; 212 ip++;
213 213
214 if (len < 7) 214 if (len < 7)
215 { 215 {
216 *op++ = (off >> 8) + (len << 5); 216 *op++ = (off >> 8) + (len << 5);
221 *op++ = len - 7; 221 *op++ = len - 7;
222 } 222 }
223 223
224 *op++ = off; 224 *op++ = off;
225 225
226 if (expect_true (ip + len < in_end - 2))
227 {
226#if ULTRA_FAST || VERY_FAST 228#if ULTRA_FAST || VERY_FAST
227 ip += len; 229 ip += len;
228#if VERY_FAST && !ULTRA_FAST 230# if VERY_FAST && !ULTRA_FAST
229 --ip; 231 --ip;
230#endif 232# endif
231 hval = FRST (ip); 233 hval = FRST (ip);
232 234
233 hval = NEXT (hval, ip);
234 htab[IDX (hval)] = ip;
235 ip++;
236
237#if VERY_FAST && !ULTRA_FAST
238 hval = NEXT (hval, ip);
239 htab[IDX (hval)] = ip;
240 ip++;
241#endif
242#else
243 do
244 {
245 hval = NEXT (hval, ip); 235 hval = NEXT (hval, ip);
246 htab[IDX (hval)] = ip; 236 htab[IDX (hval)] = ip;
247 ip++; 237 ip++;
238
239# if VERY_FAST && !ULTRA_FAST
240 hval = NEXT (hval, ip);
241 htab[IDX (hval)] = ip;
248 } 242 ip++;
249 while (len--);
250#endif 243# endif
244#else
245 do
246 {
247 hval = NEXT (hval, ip);
248 htab[IDX (hval)] = ip;
249 ip++;
250 }
251 while (len--);
252#endif
253 }
251 254
252 lit = 0; op++; /* start run */ 255 lit = 0; op++; /* start run */
253 } 256 }
254 else 257 else
255 { 258 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines