chiark / gitweb /
hostside: movpos: fix fundamental logic error in change_needed (!)
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 9 Jan 2011 01:30:55 +0000 (01:30 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 9 Jan 2011 01:30:55 +0000 (01:30 +0000)
hostside/movpos.c

index 224202c8fb1e3b74041c4e7e80fe011642be5e45..7f31f07c1a1059cb4a6a3534ae2ce80b88b57997 100644 (file)
@@ -752,7 +752,8 @@ static int change_needed(const MovFeatInfo *feati,
                         MovPosComb startpoint, MovPosComb target) {
   int r;
   r= !SOMEP(startpoint) ||
-    (target - startpoint) / feati->weight % feati->posns;
+    (target / feati->weight) % feati->posns -
+    (startpoint / feati->weight) % feati->posns;
   if (DEBUGP(movpos,eval))
     DPRINTFA(" { %s:%s(%d*%d) %d..%d => %d }",
             feature_method(feati)->pname, feati->pname,