Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned total_size_;
- double source_size_in_kb =
- static_cast<double>(source_size_) / 1024;
- void HStatistics::Print() {
- ....
- double normalized_size_in_kb = source_size_in_kb > 0
- ? total_size_ / 1024 / source_size_in_kb
- : 0;
- PrintF("%32s %8.3f ms %7.3f kB allocated\n",
- "Average per kB source",
- normalized_time, normalized_size_in_kb);
- }
- This suspicious code was found in V8 project by PVS-Studio static code analyzer.
- Warning message is:
- V636 The 'total_size_ / 1024' expression was implicitly casted from 'int' type to 'double' type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) / Y;. hydrogen.cc 11023
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement