Re: [Okular-devel] Review Request 118950: Use correct #include for abs(int)
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/ --- (Updated Июль 10, 2014, 2:12 п.п.) Review request for Okular, Jon Mease, Luigi Toscano, and Tingnan Zhang. Changes --- Switch to qAbs(); this way neither cstdlib or cmath are needed. Repository: okular Description --- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(selectedOutput-edid()-height()*10) - szMM.height()) 10) This patch changes include to cstdlib. Diffs (updated) - 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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 118950: Use correct #include for abs(int)
On Июль 10, 2014, 12:35 д.п., Kai Uwe Broulik wrote: Same as with Review 119133: What about just using qAbs instead of std::abs? Good idea. I've updated a patch. Still works here. - Vadim --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/#review62017 --- On Июль 10, 2014, 2:12 п.п., Vadim Zhukov wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/ --- (Updated Июль 10, 2014, 2:12 п.п.) Review request for Okular, Jon Mease, Luigi Toscano, and Tingnan Zhang. Repository: okular Description --- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 118950: Use correct #include for abs(int)
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/ --- (Updated July 10, 2014, 8:37 p.m.) Status -- This change has been marked as submitted. Review request for Okular, Jon Mease, Luigi Toscano, and Tingnan Zhang. Repository: okular Description --- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 118950: Use correct #include for abs(int)
--- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
Re: [Okular-devel] Review Request 118950: Use correct #include for abs(int)
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/#review62017 --- Same as with Review 119133: What about just using qAbs instead of std::abs? - Kai Uwe Broulik On Juli 9, 2014, 3:57 nachm., Vadim Zhukov wrote: --- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/ --- (Updated Juli 9, 2014, 3:57 nachm.) Review request for Okular, Jon Mease, Luigi Toscano, and Tingnan Zhang. Repository: okular Description --- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Review Request 118950: Use correct #include for abs(int)
--- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118950/ --- Review request for Okular. Repository: okular Description --- 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_castint(selectedOutput-edid()-width()*10) - szMM.width()) 10 std::abs(static_castint(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 ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel