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 c63420a117fe67107466d806890e901d091cb1d5. Pick-to: 6.9 6.8 6.5 6.2 5.15 Coverity-Id: 474172 Change-Id: I7615e0ef152e1e6e9cbc6dec1b8ecd4f8879521c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
01fc6aeaff
commit
24a26ed3a3
@ -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…
x
Reference in New Issue
Block a user