sc/source/core/data/markarr.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit bc9385c71e780f4dca5c54b8e817faae43c30d18 Author: Jochen Nitschke <j.nitschke+loger...@ok.de> AuthorDate: Mon Oct 8 18:02:30 2018 +0200 Commit: Jochen Nitschke <j.nitschke+loger...@ok.de> CommitDate: Mon Oct 8 20:45:08 2018 +0200 cppcheck: variableScope and fix index types Change-Id: I045b4d84e0ad07a98523b91fc7203bfd422b3529 Reviewed-on: https://gerrit.libreoffice.org/61541 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+loger...@ok.de> diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index f9c5fdc3299a..7bdff0fcf989 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -63,13 +63,13 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const { if (pData) { - long nHi = static_cast<long>(nCount) - 1; - long i = 0; - long nLo = 0; + assert(nCount > 0); + SCSIZE nHi = nCount - 1; + SCSIZE nLo = 0; while ( nLo <= nHi ) { - i = (nLo + nHi) / 2; + SCSIZE i = (nLo + nHi) / 2; if (pData[i].nRow < nRow) { @@ -84,7 +84,7 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const else { // found - nIndex=static_cast<SCSIZE>(i); + nIndex=i; return true; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits