From 9bc3895b191ef357c33c04306250e4fee5015225 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 29 Dec 2019 23:16:12 +0100 Subject: Avoid -Werror,-Wdeprecated-enum-float-conversion ...with recent Clang 10 trunk: > slideshow/source/engine/shapes/viewshape.cxx:813:81: error: arithmetic between enumeration type 'cppcanvas::Canvas::(anonymous enum at include/cppcanvas/canvas.hxx:57:9)' and floating-point type 'double' is deprecated [-Werror,-Wdeprecated-enum-float-conversion] > const double nXBorder( ::cppcanvas::Canvas::ANTIALIASING_EXTRA_SIZE / rViewTransform.get(0,0) ); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I30b8457250545a9a16b2e29f94e0623175f43ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85968 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/cppcanvas/canvas.hxx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/cppcanvas/canvas.hxx b/include/cppcanvas/canvas.hxx index 441986cd03b6..ec34af5e0caa 100644 --- a/include/cppcanvas/canvas.hxx +++ b/include/cppcanvas/canvas.hxx @@ -54,18 +54,15 @@ namespace cppcanvas class Canvas { public: - enum - { - /** Extra pixel used when canvas anti-aliases. - - Enlarge the bounding box of drawing primitives by this - amount in both dimensions, and on both sides of the - bounds, to account for extra pixel touched outside the - actual primitive bounding box, when the canvas - performs anti-aliasing. - */ - ANTIALIASING_EXTRA_SIZE=2 - }; + /** Extra pixel used when canvas anti-aliases. + + Enlarge the bounding box of drawing primitives by this + amount in both dimensions, and on both sides of the + bounds, to account for extra pixel touched outside the + actual primitive bounding box, when the canvas + performs anti-aliasing. + */ + static constexpr auto ANTIALIASING_EXTRA_SIZE=2; Canvas() = default; Canvas(Canvas const &) = default; -- cgit