Skip to content

Commit 22c89b7

Browse files
committedMay 29, 2020
qtermwidget: silence false positive cppcheck warning about assert with side effect
1 parent 439d5f5 commit 22c89b7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/plugins/grass/qtermwidget/Screen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ void Screen::updateEffectiveRendition()
403403

404404
void Screen::copyFromHistory(Character* dest, int startLine, int count) const
405405
{
406+
// cppcheck-suppress assertWithSideEffect
406407
Q_ASSERT( startLine >= 0 && count > 0 && startLine + count <= history->getLines() );
407408

408409
for (int line = startLine; line < startLine + count; line++)
@@ -456,6 +457,7 @@ void Screen::copyFromScreen(Character* dest , int startLine , int count) const
456457
void Screen::getImage( Character* dest, int size, int startLine, int endLine ) const
457458
{
458459
Q_ASSERT( startLine >= 0 );
460+
// cppcheck-suppress assertWithSideEffect
459461
Q_ASSERT( endLine >= startLine && endLine < history->getLines() + lines );
460462

461463
const int mergedLines = endLine - startLine + 1;
@@ -492,6 +494,7 @@ void Screen::getImage( Character* dest, int size, int startLine, int endLine ) c
492494
QVector<LineProperty> Screen::getLineProperties( int startLine , int endLine ) const
493495
{
494496
Q_ASSERT( startLine >= 0 );
497+
// cppcheck-suppress assertWithSideEffect
495498
Q_ASSERT( endLine >= startLine && endLine < history->getLines() + lines );
496499

497500
const int mergedLines = endLine-startLine+1;
@@ -1204,6 +1207,7 @@ int Screen::copyLineToStream(int line ,
12041207
// safety checks
12051208
assert( start >= 0 );
12061209
assert( count >= 0 );
1210+
// cppcheck-suppress assertWithSideEffect
12071211
assert( (start+count) <= history->getLineLen(line) );
12081212

12091213
history->getCells(line,start,count,characterBuffer);

0 commit comments

Comments
 (0)
Please sign in to comment.