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.27 by ayin, Sun Nov 25 16:06:18 2007 UTC vs.
Revision 1.28 by root, Fri Nov 30 10:34:26 2007 UTC

157 /* match found at *ref++ */ 157 /* match found at *ref++ */
158 unsigned int len = 2; 158 unsigned int len = 2;
159 unsigned int maxlen = in_end - ip - len; 159 unsigned int maxlen = in_end - ip - len;
160 maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; 160 maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
161 161
162 if (maxlen > 8) maxlen = 8;//D
163
162 op [- lit - 1] = lit - 1; /* stop run */ 164 op [- lit - 1] = lit - 1; /* stop run */
163 op -= !lit; /* undo run if length is zero */ 165 op -= !lit; /* undo run if length is zero */
164 166
165 if (expect_false (op + 3 + 1 >= out_end)) 167 if (expect_false (op + 3 + 1 >= out_end))
166 return 0; 168 return 0;
260 return 0; 262 return 0;
261 263
262 while (ip < in_end) 264 while (ip < in_end)
263 { 265 {
264 lit++; *op++ = *ip++; 266 lit++; *op++ = *ip++;
267
268 if (expect_false (lit == MAX_LIT))
269 {
270 op [- lit - 1] = lit - 1; /* stop run */
271 lit = 0; op++; /* start run */
272 }
265 } 273 }
266 274
267 op [- lit - 1] = lit - 1; /* end run */ 275 op [- lit - 1] = lit - 1; /* end run */
268 op -= !lit; /* undo run if length is zero */ 276 op -= !lit; /* undo run if length is zero */
269 277

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines