Kaydet (Commit) bc9385c7 authored tarafından Jochen Nitschke's avatar Jochen Nitschke

cppcheck: variableScope and fix index types

Change-Id: I045b4d84e0ad07a98523b91fc7203bfd422b3529
Reviewed-on: https://gerrit.libreoffice.org/61541Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: 's avatarJochen Nitschke <j.nitschke+logerrit@ok.de>
üst 9ed8a1bf
...@@ -63,13 +63,13 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const ...@@ -63,13 +63,13 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const
{ {
if (pData) if (pData)
{ {
long nHi = static_cast<long>(nCount) - 1; assert(nCount > 0);
long i = 0; SCSIZE nHi = nCount - 1;
long nLo = 0; SCSIZE nLo = 0;
while ( nLo <= nHi ) while ( nLo <= nHi )
{ {
i = (nLo + nHi) / 2; SCSIZE i = (nLo + nHi) / 2;
if (pData[i].nRow < nRow) if (pData[i].nRow < nRow)
{ {
...@@ -84,7 +84,7 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const ...@@ -84,7 +84,7 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const
else else
{ {
// found // found
nIndex=static_cast<SCSIZE>(i); nIndex=i;
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment