QBenchmarkPerfEvents: help Coverity understand the code
Coverity thinks that r may be negative and not -1 and warns that the
cast to quint64 may overflow.
Change the check for `== -1` to `< 0` to help Coverity (and other
readers of the code) understand that this cannot happen.
Amends c63420a117.
Pick-to: 6.5 6.2 5.15
Coverity-Id: 474172
Change-Id: I7615e0ef152e1e6e9cbc6dec1b8ecd4f8879521c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 24a26ed3a3842398276ae54602e8e1936a2f2323)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 43722921365c8ee1a80205a6ac45527ae9966338)
bb10
parent
3c4bef981f
commit
767306cda3
|
|
@ -546,7 +546,7 @@ static quint64 rawReadValue(int fd)
|
|||
while (nread < sizeof results) {
|
||||
char *ptr = reinterpret_cast<char *>(&results);
|
||||
qint64 r = qt_safe_read(fd, ptr + nread, sizeof results - nread);
|
||||
if (r == -1) {
|
||||
if (r < 0) {
|
||||
perror("QBenchmarkPerfEventsMeasurer::readValue: reading the results");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue