From acefad32e4d1c4e8f824007ea530b37ff7e70eca Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 15 Jan 2010 16:32:05 +0000 Subject: [PATCH] Kill warning and avoid double arithmetic. Vincent, I hope I did not break something... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33048 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Compare.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Compare.cpp b/src/Compare.cpp index 06730e1b59..aabbed7e3c 100644 --- a/src/Compare.cpp +++ b/src/Compare.cpp @@ -22,8 +22,6 @@ #include -#include - 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; -- 2.39.2