]> git.lyx.org Git - features.git/commitdiff
Kill warning and avoid double arithmetic. Vincent, I hope I did not break something...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Jan 2010 16:32:05 +0000 (16:32 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Jan 2010 16:32:05 +0000 (16:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33048 a592a061-630c-0410-9148-cb99ea01b6c8

src/Compare.cpp

index 06730e1b59be6d127b36052a0b4d1ea67961859e..aabbed7e3cd6228f61f94f3639fa6dab928befb4 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <boost/next_prior.hpp>
 
-#include <cmath>
-
 using namespace std;
 using namespace lyx::support;
 
@@ -625,9 +623,10 @@ int Compare::Impl::findMiddleSnake(DocRangePair const & rp,
        ors.reset(DocIterator());
        nrs.reset(DocIterator());
 
+       // In the formula below, the "+ 1" ensures we round like ceil()
+       int const D_max = (M_ + N_ + 1)/2;
        // D is the number of horizontal and vertical steps, i.e.
        // different characters in the old and new chunk.
-       int const D_max = ceil(((double)M_ + N_)/2);
        for (int D = 0; D <= D_max; ++D) {
                // to be used in the status messages
                D_ = D;