Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
ec170136
Commit
ec170136
authored
Mar 20, 2021
by
Carlos Alves
Browse files
Fix comparing different types
Warns while comparing int and size_t
parent
3b0a81fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/history/compact/CompactHistoryScroll.cpp
View file @
ec170136
...
...
@@ -53,7 +53,7 @@ void CompactHistoryScroll::addLine(bool previousWrapped)
int
CompactHistoryScroll
::
getLines
()
{
return
_lines
.
size
();
return
static_cast
<
int
>
(
_lines
.
size
()
)
;
}
int
CompactHistoryScroll
::
getMaxLines
()
...
...
@@ -63,7 +63,7 @@ int CompactHistoryScroll::getMaxLines()
int
CompactHistoryScroll
::
getLineLen
(
int
lineNumber
)
{
if
((
lineNumber
<
0
)
||
(
(
size_t
)
lineNumber
>=
_lines
.
size
()))
{
if
((
lineNumber
<
0
)
||
(
static_cast
<
size_t
>
(
lineNumber
)
>=
_lines
.
size
()))
{
//qDebug() << "requested line invalid: 0 < " << lineNumber << " < " <<_lines.size();
//Q_ASSERT(lineNumber >= 0 && lineNumber < _lines.size());
return
0
;
...
...
@@ -78,7 +78,7 @@ void CompactHistoryScroll::getCells(int lineNumber, int startColumn, int count,
if
(
count
==
0
)
{
return
;
}
Q_ASSERT
(
lineNumber
<
_lines
.
size
());
Q_ASSERT
(
static_cast
<
size_t
>
(
lineNumber
)
<
_lines
.
size
());
auto
line
=
_lines
[
lineNumber
].
get
();
Q_ASSERT
(
startColumn
>=
0
);
Q_ASSERT
(
static_cast
<
unsigned
int
>
(
startColumn
)
<=
line
->
getLength
()
-
count
);
...
...
@@ -139,7 +139,7 @@ void CompactHistoryScroll::setLineAt(int position, bool previousWrapped)
bool
CompactHistoryScroll
::
isWrappedLine
(
int
lineNumber
)
{
Q_ASSERT
(
lineNumber
<
_lines
.
size
());
Q_ASSERT
(
static_cast
<
size_t
>
(
lineNumber
)
<
_lines
.
size
());
return
_lines
[
lineNumber
]
->
isWrapped
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment