[Okular-devel] Review Request 118950: Use correct #include for abs(int)
Vadim Zhukov
persgray at gmail.com
Wed Jul 9 15:57:21 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118950/
-----------------------------------------------------------
(Updated Июль 9, 2014, 7:57 п.п.)
Review request for Okular, Jon Mease, Luigi Toscano, and Tingnan Zhang.
Changes
-------
ReviewBoard misquoted "description" field after previous edit - fixed.
Repository: okular
Description (updated)
-------
Both C and C++ have abs() function. C one is abs(int), declared in <stdlib.h>; and C++ has std::abs(int), std::abs(long) and std::abs(long long) in <cstdlib.h>. But C++ has even more overloaded abs() versions in <cmath>, that do operate on floating point values.
core/utils.cpp incorrectly includes <cmath> while std::abs() calls near line 140 use integer versions really:
&& std::abs(static_cast<int>(selectedOutput->edid()->width()*10) - szMM.width()) < 10
&& std::abs(static_cast<int>(selectedOutput->edid()->height()*10) - szMM.height()) < 10)
This patch changes include to <cstdlib>.
Diffs
-----
core/utils.cpp 71442f0
Diff: https://git.reviewboard.kde.org/r/118950/diff/
Testing
-------
Tested on OpenBSD/i386. Without this patch, build fails.
Thanks,
Vadim Zhukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20140709/12611abc/attachment.html>
More information about the Okular-devel
mailing list