When v->val is <= 0, v->k doesn't mean anything and isn't needed, so
avoid using it. This helps make valgrind happy.
Signed-off-by: NeilBrown <neilb@suse.de>
struct v {
int x,y; /* location of start of match */
int val; /* value of match from x,y to here */
- int k; /* diagonal of last match */
+ int k; /* diagonal of last match - if val > 0 */
int inmatch; /* 1 if last point was a match */
int c; /* chunk number */
};
v->val += 2+v->inmatch;
v->inmatch = 1;
v->k = k;
- } else {
+ } else if (v->val > 0) {
v->inmatch = 0;
if (dir * (v->k - k) > 0) {
/* other half of replacement */
}
}
}
+
static inline int best_val(struct v *v, int max)
{
if (v->val <= 0)