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.34 by root, Sat Aug 30 06:32:20 2008 UTC vs.
Revision 1.36 by root, Fri May 1 00:30:53 2009 UTC

168 /* match found at *ref++ */ 168 /* match found at *ref++ */
169 unsigned int len = 2; 169 unsigned int len = 2;
170 unsigned int maxlen = in_end - ip - len; 170 unsigned int maxlen = in_end - ip - len;
171 maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; 171 maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
172 172
173 if (expect_false (op + 3 + 1 >= out_end)) /* first a faster conservative test */
174 if (op - !lit + 3 + 1 >= out_end) /* second the exact but rare test */
175 return 0;
176
173 op [- lit - 1] = lit - 1; /* stop run */ 177 op [- lit - 1] = lit - 1; /* stop run */
174 op -= !lit; /* undo run if length is zero */ 178 op -= !lit; /* undo run if length is zero */
175
176 if (expect_false (op + 3 + 1 >= out_end))
177 return 0;
178 179
179 for (;;) 180 for (;;)
180 { 181 {
181 if (expect_true (maxlen > 16)) 182 if (expect_true (maxlen > 16))
182 { 183 {
224 *op++ = off; 225 *op++ = off;
225 lit = 0; op++; /* start run */ 226 lit = 0; op++; /* start run */
226 227
227 ip += len + 1; 228 ip += len + 1;
228 229
229 if (expect_false (ip > in_end - 2)) 230 if (expect_false (ip >= in_end - 2))
230 break; 231 break;
231 232
232#if ULTRA_FAST || VERY_FAST 233#if ULTRA_FAST || VERY_FAST
233 --ip; 234 --ip;
234# if VERY_FAST && !ULTRA_FAST 235# if VERY_FAST && !ULTRA_FAST

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines