]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make the heuristic dependent on USE_HEURISTIC and the variable 'heuristic'.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Dec 2006 12:47:30 +0000 (12:47 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:31 +0000 (12:14 +0200)
gnulib-local/ChangeLog
gnulib-local/lib/fstrcmp.c

index 09ff29ba27008f55066d9b52e2f0c8015c865ee1..d9e3c693ba5774339e483a07893d3fa5b25444ed 100644 (file)
@@ -1,5 +1,7 @@
 2006-10-07  Bruno Haible  <bruno@clisp.org>
 
+       * lib/fstrcmp.c: Rename macro MINUS_H_FLAG to USE_HEURISTIC. Use bool.
+
        * lib/fstrcmp.c: Update comments. Talk about vectors instead of
        strings, and about elements instead of characters.
 
index 310e7f21627dc2da9e416f5757e2f99c74563449..a5732ac92bff69228cb2a534f2ab29350c686930 100644 (file)
@@ -97,17 +97,6 @@ struct context
   }
   string[2];
 
-  #ifdef MINUS_H_FLAG
-
-  /* This corresponds to the diff -H flag.  With this heuristic, for
-     vectors with a constant small density of changes, the algorithm is
-     linear in the vectors size.  This is unlikely in typical uses of
-     fstrcmp, and so is usually compiled out.  Besides, there is no
-     interface to set it true.  */
-  int heuristic;
-
-  #endif
-
   /* Vector, indexed by diagonal, containing 1 + the X coordinate of the
      point furthest along the given diagonal in the forward search of the
      edit matrix.  */
@@ -118,6 +107,15 @@ struct context
      matrix.  */
   OFFSET *bdiag;
 
+  #ifdef USE_HEURISTIC
+  /* This corresponds to the diff -H flag.  With this heuristic, for
+     vectors with a constant small density of changes, the algorithm is
+     linear in the vectors size.  This is unlikely in typical uses of
+     fstrcmp, and so is usually compiled out.  Besides, there is no
+     interface to set it true.  */
+  bool heuristic;
+  #endif
+
   /* Edit scripts longer than this are too expensive to compute.  */
   OFFSET too_expensive;
 
@@ -298,7 +296,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
       if (find_minimal)
        continue;
 
-#ifdef MINUS_H_FLAG
+#ifdef USE_HEURISTIC
       /* Heuristic: check occasionally for a diagonal that has made lots
          of progress compared with the edit distance.  If we have any
          such, find the one that has made the most progress and return
@@ -395,7 +393,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
              return;
            }
        }
-#endif /* MINUS_H_FLAG */
+#endif /* USE_HEURISTIC */
 
       /* Heuristic: if we've gone well beyond the call of duty, give up
         and report halfway between our best results so far.  */