From: Georg Baum Date: Thu, 26 Jun 2014 19:05:40 +0000 (+0200) Subject: Work around MSVC warning X-Git-Tag: 2.1.3~14 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ebc325be3fd6143ab0f7a6a2a1f10bc32fb7b0c;p=features.git Work around MSVC warning The statement if (pos < from + lyxrc.completion_minlength) triggers a signed vs. unsigned warning. I don't know why this happens, it could be a MSVC bug, or related to LLP64 (windows) vs. LP64 (unix) programming model, or the C++ standard might be ambigous in the section defining the "usual arithmetic conversions". However, using a temporary variable is safe and works on all compilers. --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 81ca22574b..6ba12221ba 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3866,7 +3866,16 @@ void Paragraph::collectWords() continue; pos_type from = pos; locateWord(from, pos, WHOLE_WORD); - if (pos < from + lyxrc.completion_minlength) + // Work around MSVC warning: The statement + // if (pos < from + lyxrc.completion_minlength) + // triggers a signed vs. unsigned warning. + // I don't know why this happens, it could be a MSVC bug, or + // related to LLP64 (windows) vs. LP64 (unix) programming + // model, or the C++ standard might be ambigous in the section + // defining the "usual arithmetic conversions". However, using + // a temporary variable is safe and works on all compilers. + pos_type const endpos = from + lyxrc.completion_minlength; + if (pos < endpos) continue; FontList::const_iterator cit = d->fontlist_.fontIterator(from); if (cit == d->fontlist_.end()) diff --git a/status.21x b/status.21x index 3c6be0de05..3d6dcb334a 100644 --- a/status.21x +++ b/status.21x @@ -217,7 +217,7 @@ What's new * BUILD/INSTALLATION -- Fix a couple of compiler warnings. +- Fix some compiler warnings. - Fix a few minor issues in the RPM spec file template (bug 9349).