From a9c98dff5d5bcfee7adbc0785e8fbd889eced09b Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 4 Aug 2022 10:06:04 +0100 Subject: [PATCH 1/2] Fix deprecation warning (libtiff) /usr/include/x86_64-linux-gnu/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED; --- include/mapnik/tiff_io.hpp | 4 ++-- src/tiff_reader.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mapnik/tiff_io.hpp b/include/mapnik/tiff_io.hpp index 6e818f34f..1d09f84ed 100644 --- a/include/mapnik/tiff_io.hpp +++ b/include/mapnik/tiff_io.hpp @@ -207,12 +207,12 @@ struct tag_setter TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 4); if (data.get_premultiplied()) { - uint16 extras[] = {EXTRASAMPLE_ASSOCALPHA}; + std::uint16_t extras[] = {EXTRASAMPLE_ASSOCALPHA}; TIFFSetField(output_, TIFFTAG_EXTRASAMPLES, 1, extras); } else { - uint16 extras[] = {EXTRASAMPLE_UNASSALPHA}; + std::uint16_t extras[] = {EXTRASAMPLE_UNASSALPHA}; TIFFSetField(output_, TIFFTAG_EXTRASAMPLES, 1, extras); } if (config_.compression == COMPRESSION_DEFLATE || config_.compression == COMPRESSION_ADOBE_DEFLATE || diff --git a/src/tiff_reader.hpp b/src/tiff_reader.hpp index edf9124d8..08fe2df92 100644 --- a/src/tiff_reader.hpp +++ b/src/tiff_reader.hpp @@ -253,8 +253,8 @@ void tiff_reader::init() read_method_ = stripped; } // TIFFTAG_EXTRASAMPLES - uint16 extrasamples = 0; - uint16* sampleinfo = nullptr; + std::uint16_t extrasamples = 0; + std::uint16_t* sampleinfo = nullptr; if (TIFFGetField(tif, TIFFTAG_EXTRASAMPLES, &extrasamples, &sampleinfo)) { has_alpha_ = true; @@ -265,7 +265,7 @@ void tiff_reader::init() } // Try extracting bounding box from geoTIFF tags { - uint16 count = 0; + std::uint16_t count = 0; double* pixelscale; double* tilepoint; if (TIFFGetField(tif, 33550, &count, &pixelscale) == 1 && count == 3 && From 9627432723dc847e15c45065af1ce43791d91575 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 4 Aug 2022 11:25:35 +0100 Subject: [PATCH 2/2] Fix `-Wdeprecated-enum-enum-conversion` warnings (AGG) --- deps/agg/include/agg_basics.h | 2 +- deps/agg/include/agg_color_gray.h | 11 +- deps/agg/include/agg_color_rgba.h | 16 +- deps/agg/include/agg_conv_adaptor_vpgen.h | 23 +- deps/agg/include/agg_image_filters.h | 38 +-- deps/agg/include/agg_line_aa_basics.h | 8 +- deps/agg/include/agg_path_storage.h | 273 +++++++++++---------- deps/agg/include/agg_pixfmt_base.h | 22 +- deps/agg/include/agg_rasterizer_sl_clip.h | 54 ++-- deps/agg/include/agg_renderer_outline_aa.h | 2 +- deps/agg/src/agg_arrowhead.cpp | 8 +- deps/agg/src/agg_line_profile_aa.cpp | 17 +- deps/agg/src/agg_rounded_rect.cpp | 5 +- deps/agg/src/agg_vcgen_contour.cpp | 4 +- deps/agg/src/agg_vcgen_stroke.cpp | 8 +- include/mapnik/svg/svg_renderer_agg.hpp | 8 +- 16 files changed, 258 insertions(+), 241 deletions(-) diff --git a/deps/agg/include/agg_basics.h b/deps/agg/include/agg_basics.h index a617cf253..8a37c8c4e 100644 --- a/deps/agg/include/agg_basics.h +++ b/deps/agg/include/agg_basics.h @@ -365,7 +365,7 @@ namespace agg inline bool is_close(unsigned c) { return (c & ~(path_flags_cw | path_flags_ccw)) == - (path_cmd_end_poly | path_flags_close); + (path_cmd_end_poly | static_cast(path_flags_close)); } //------------------------------------------------------------is_next_poly diff --git a/deps/agg/include/agg_color_gray.h b/deps/agg/include/agg_color_gray.h index bf300b8f1..fbe4b560b 100644 --- a/deps/agg/include/agg_color_gray.h +++ b/deps/agg/include/agg_color_gray.h @@ -436,7 +436,8 @@ struct gray16 static value_type luminance(const rgba& c) { // Calculate grayscale value as per ITU-R BT.709. - return value_type(uround((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b) * base_mask)); + return value_type(uround((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b) + * static_cast(base_mask))); } static value_type luminance(const rgba16& c) @@ -537,13 +538,13 @@ struct gray16 //-------------------------------------------------------------------- static AGG_INLINE double to_double(value_type a) { - return double(a) / base_mask; + return static_cast(a) / static_cast(base_mask); } //-------------------------------------------------------------------- static AGG_INLINE value_type from_double(double a) { - return value_type(uround(a * base_mask)); + return value_type(uround(a * static_cast(base_mask))); } //-------------------------------------------------------------------- @@ -698,7 +699,7 @@ struct gray16 self_type gradient(self_type c, double k) const { self_type ret; - calc_type ik = uround(k * base_scale); + calc_type ik = uround(k * static_cast(base_scale)); ret.v = lerp(v, c.v, ik); ret.a = lerp(a, c.a, ik); return ret; @@ -949,7 +950,7 @@ struct gray32 //-------------------------------------------------------------------- static AGG_INLINE value_type mult_cover(value_type a, cover_type b) { - return value_type(a * b / cover_mask); + return value_type(a * b / static_cast(cover_mask)); } //-------------------------------------------------------------------- diff --git a/deps/agg/include/agg_color_rgba.h b/deps/agg/include/agg_color_rgba.h index b4e3f76d8..c9bb88e60 100644 --- a/deps/agg/include/agg_color_rgba.h +++ b/deps/agg/include/agg_color_rgba.h @@ -281,10 +281,10 @@ struct rgba8T static void convert(rgba8T& dst, const rgba& src) { - dst.r = value_type(uround(src.r * base_mask)); - dst.g = value_type(uround(src.g * base_mask)); - dst.b = value_type(uround(src.b * base_mask)); - dst.a = value_type(uround(src.a * base_mask)); + dst.r = value_type(uround(src.r * static_cast(base_mask))); + dst.g = value_type(uround(src.g * static_cast(base_mask))); + dst.b = value_type(uround(src.b * static_cast(base_mask))); + dst.a = value_type(uround(src.a * static_cast(base_mask))); } static void convert(rgba8T& dst, const rgba& src) @@ -761,13 +761,13 @@ struct rgba16 //-------------------------------------------------------------------- static AGG_INLINE double to_double(value_type a) { - return double(a) / base_mask; + return static_cast(a) / static_cast(base_mask); } //-------------------------------------------------------------------- static AGG_INLINE value_type from_double(double a) { - return value_type(uround(a * base_mask)); + return value_type(uround(a * static_cast(base_mask))); } //-------------------------------------------------------------------- @@ -955,7 +955,7 @@ struct rgba16 AGG_INLINE self_type gradient(const self_type& c, double k) const { self_type ret; - calc_type ik = uround(k * base_mask); + calc_type ik = uround(k * static_cast(base_mask)); ret.r = lerp(r, c.r, ik); ret.g = lerp(g, c.g, ik); ret.b = lerp(b, c.b, ik); @@ -1194,7 +1194,7 @@ struct rgba32 //-------------------------------------------------------------------- static AGG_INLINE value_type mult_cover(value_type a, cover_type b) { - return value_type(a * b / cover_mask); + return value_type(a * b / static_cast(cover_mask)); } //-------------------------------------------------------------------- diff --git a/deps/agg/include/agg_conv_adaptor_vpgen.h b/deps/agg/include/agg_conv_adaptor_vpgen.h index ae8d59320..b5c246a5b 100644 --- a/deps/agg/include/agg_conv_adaptor_vpgen.h +++ b/deps/agg/include/agg_conv_adaptor_vpgen.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -37,7 +37,7 @@ namespace agg private: conv_adaptor_vpgen(const conv_adaptor_vpgen&); - const conv_adaptor_vpgen& + const conv_adaptor_vpgen& operator = (const conv_adaptor_vpgen&); VertexSource* m_source; @@ -52,8 +52,8 @@ namespace agg //------------------------------------------------------------------------ template - void conv_adaptor_vpgen::rewind(unsigned path_id) - { + void conv_adaptor_vpgen::rewind(unsigned path_id) + { m_source->rewind(path_id); m_vpgen.reset(); m_start_x = 0; @@ -84,7 +84,7 @@ namespace agg if(m_vertices < 0) { - if(m_vertices < -1) + if(m_vertices < -1) { m_vertices = 0; return path_cmd_stop; @@ -98,12 +98,13 @@ namespace agg cmd = m_source->vertex(&tx, &ty); if(is_vertex(cmd)) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { if(m_vpgen.auto_close() && m_vertices > 2) { m_vpgen.line_to(m_start_x, m_start_y); - m_poly_flags = path_cmd_end_poly | path_flags_close; + m_poly_flags = path_cmd_end_poly + | static_cast(path_flags_close); m_start_x = tx; m_start_y = ty; m_vertices = -1; @@ -114,7 +115,7 @@ namespace agg m_start_y = ty; m_vertices = 1; } - else + else { m_vpgen.line_to(tx, ty); ++m_vertices; @@ -141,7 +142,8 @@ namespace agg if(m_vpgen.auto_close() && m_vertices > 2) { m_vpgen.line_to(m_start_x, m_start_y); - m_poly_flags = path_cmd_end_poly | path_flags_close; + m_poly_flags = path_cmd_end_poly + | static_cast(path_flags_close); m_vertices = -2; continue; } @@ -157,4 +159,3 @@ namespace agg #endif - diff --git a/deps/agg/include/agg_image_filters.h b/deps/agg/include/agg_image_filters.h index 2b84ddeb9..e5013f0e8 100644 --- a/deps/agg/include/agg_image_filters.h +++ b/deps/agg/include/agg_image_filters.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -22,24 +22,25 @@ #include "agg_array.h" #include "agg_math.h" +#include namespace agg { - // See Implementation agg_image_filters.cpp + // See Implementation agg_image_filters.cpp enum image_filter_scale_e { image_filter_shift = 14, //----image_filter_shift - image_filter_scale = 1 << image_filter_shift, //----image_filter_scale - image_filter_mask = image_filter_scale - 1 //----image_filter_mask + image_filter_scale = 1 << image_filter_shift, //----image_filter_scale + image_filter_mask = image_filter_scale - 1 //----image_filter_mask }; enum image_subpixel_scale_e { image_subpixel_shift = 8, //----image_subpixel_shift - image_subpixel_scale = 1 << image_subpixel_shift, //----image_subpixel_scale - image_subpixel_mask = image_subpixel_scale - 1 //----image_subpixel_mask + image_subpixel_scale = 1 << image_subpixel_shift, //----image_subpixel_scale + image_subpixel_mask = image_subpixel_scale - 1 //----image_subpixel_mask }; @@ -58,12 +59,13 @@ namespace agg { double x = double(i) / double(image_subpixel_scale); double y = filter.calc_weight(x); - m_weight_array[pivot + i] = - m_weight_array[pivot - i] = (int16)iround(y * image_filter_scale); + m_weight_array[pivot + i] = + m_weight_array[pivot - i] = + static_cast(iround(y * static_cast(image_filter_scale))); } unsigned end = (diameter() << image_subpixel_shift) - 1; m_weight_array[0] = m_weight_array[end]; - if(normalization) + if(normalization) { normalize(); } @@ -71,7 +73,7 @@ namespace agg image_filter_lut() : m_radius(0), m_diameter(0), m_start(0) {} - template image_filter_lut(const FilterF& filter, + template image_filter_lut(const FilterF& filter, bool normalization=true) { calculate(filter, normalization); @@ -80,7 +82,7 @@ namespace agg double radius() const { return m_radius; } unsigned diameter() const { return m_diameter; } int start() const { return m_start; } - const int16* weight_array() const { return &m_weight_array[0]; } + std::int16_t const* weight_array() const { return &m_weight_array[0]; } void normalize(); private: @@ -91,7 +93,7 @@ namespace agg double m_radius; unsigned m_diameter; int m_start; - pod_array m_weight_array; + pod_array m_weight_array; }; @@ -150,7 +152,7 @@ namespace agg return (2.0 * x - 3.0) * x * x + 1.0; } }; - + //------------------------------------------------image_filter_quadric struct image_filter_quadric { @@ -177,7 +179,7 @@ namespace agg static double calc_weight(double x) { return - (1.0/6.0) * + (1.0/6.0) * (pow3(x + 2) - 4 * pow3(x + 1) + 6 * pow3(x) - 4 * pow3(x - 1)); } }; @@ -211,7 +213,7 @@ namespace agg sum = 1.; y = x * x / 4.; t = y; - + for(i = 2; t > epsilon; i++) { sum += t; @@ -298,7 +300,7 @@ namespace agg struct image_filter_gaussian { static double radius() { return 2.0; } - static double calc_weight(double x) + static double calc_weight(double x) { return exp(-2.0 * x * x) * sqrt(2.0 / pi); } @@ -308,7 +310,7 @@ namespace agg //------------------------------------------------image_filter_bessel struct image_filter_bessel { - static double radius() { return 3.2383; } + static double radius() { return 3.2383; } static double calc_weight(double x) { return (x == 0.0) ? pi / 4.0 : besj(pi * x, 1) / (2.0 * x); diff --git a/deps/agg/include/agg_line_aa_basics.h b/deps/agg/include/agg_line_aa_basics.h index d22711d8c..66dc8fe06 100644 --- a/deps/agg/include/agg_line_aa_basics.h +++ b/deps/agg/include/agg_line_aa_basics.h @@ -44,13 +44,13 @@ namespace agg //------------------------------------------------------------------line_mr AGG_INLINE int line_mr(int x) { - return x >> (line_subpixel_shift - line_mr_subpixel_shift); + return x >> (line_subpixel_shift - static_cast(line_mr_subpixel_shift)); } //-------------------------------------------------------------------line_hr AGG_INLINE int line_hr(int x) { - return x << (line_subpixel_shift - line_mr_subpixel_shift); + return x << (line_subpixel_shift - static_cast(line_mr_subpixel_shift)); } //---------------------------------------------------------------line_dbl_hr @@ -64,7 +64,7 @@ namespace agg { AGG_INLINE static int conv(double x) { - return iround(x * line_subpixel_scale); + return iround(x * static_cast(line_subpixel_scale)); } }; @@ -73,7 +73,7 @@ namespace agg { AGG_INLINE static int conv(double x) { - return saturation::iround(x * line_subpixel_scale); + return saturation::iround(x * static_cast(line_subpixel_scale)); } }; diff --git a/deps/agg/include/agg_path_storage.h b/deps/agg/include/agg_path_storage.h index 3be5aa86c..338fbd513 100644 --- a/deps/agg/include/agg_path_storage.h +++ b/deps/agg/include/agg_path_storage.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -92,7 +92,7 @@ namespace agg { pod_allocator::deallocate( *coord_blk, - block_size * 2 + + block_size * 2 + block_size / (sizeof(T) / sizeof(unsigned char))); --coord_blk; } @@ -137,7 +137,7 @@ namespace agg //------------------------------------------------------------------------ template - const vertex_block_storage& + const vertex_block_storage& vertex_block_storage::operator = (const vertex_block_storage& v) { remove_all(); @@ -160,7 +160,7 @@ namespace agg //------------------------------------------------------------------------ template - inline void vertex_block_storage::add_vertex(double x, double y, + inline void vertex_block_storage::add_vertex(double x, double y, unsigned cmd) { T* coord_ptr = 0; @@ -172,7 +172,7 @@ namespace agg //------------------------------------------------------------------------ template - inline void vertex_block_storage::modify_vertex(unsigned idx, + inline void vertex_block_storage::modify_vertex(unsigned idx, double x, double y) { T* pv = m_coord_blocks[idx >> block_shift] + ((idx & block_mask) << 1); @@ -182,8 +182,8 @@ namespace agg //------------------------------------------------------------------------ template - inline void vertex_block_storage::modify_vertex(unsigned idx, - double x, double y, + inline void vertex_block_storage::modify_vertex(unsigned idx, + double x, double y, unsigned cmd) { unsigned block = idx >> block_shift; @@ -196,7 +196,7 @@ namespace agg //------------------------------------------------------------------------ template - inline void vertex_block_storage::modify_command(unsigned idx, + inline void vertex_block_storage::modify_command(unsigned idx, unsigned cmd) { m_cmd_blocks[idx >> block_shift][idx & block_mask] = (int8u)cmd; @@ -277,7 +277,7 @@ namespace agg //------------------------------------------------------------------------ template - inline unsigned vertex_block_storage::vertex(unsigned idx, + inline unsigned vertex_block_storage::vertex(unsigned idx, double* x, double* y) const { unsigned nb = idx >> block_shift; @@ -298,22 +298,22 @@ namespace agg template void vertex_block_storage::allocate_block(unsigned nb) { - if(nb >= m_max_blocks) + if(nb >= m_max_blocks) { - T** new_coords = + T** new_coords = pod_allocator::allocate((m_max_blocks + block_pool) * 2); - unsigned char** new_cmds = + unsigned char** new_cmds = (unsigned char**)(new_coords + m_max_blocks + block_pool); if(m_coord_blocks) { - memcpy(new_coords, - m_coord_blocks, + memcpy(new_coords, + m_coord_blocks, m_max_blocks * sizeof(T*)); - memcpy(new_cmds, - m_cmd_blocks, + memcpy(new_cmds, + m_cmd_blocks, m_max_blocks * sizeof(unsigned char*)); pod_allocator::deallocate(m_coord_blocks, m_max_blocks * 2); @@ -322,11 +322,11 @@ namespace agg m_cmd_blocks = new_cmds; m_max_blocks += block_pool; } - m_coord_blocks[nb] = - pod_allocator::allocate(block_size * 2 + + m_coord_blocks[nb] = + pod_allocator::allocate(block_size * 2 + block_size / (sizeof(T) / sizeof(unsigned char))); - m_cmd_blocks[nb] = + m_cmd_blocks[nb] = (unsigned char*)(m_coord_blocks[nb] + block_size * 2); m_total_blocks++; @@ -354,8 +354,8 @@ namespace agg public: typedef T value_type; - poly_plain_adaptor() : - m_data(0), + poly_plain_adaptor() : + m_data(0), m_ptr(0), m_end(0), m_closed(false), @@ -363,7 +363,7 @@ namespace agg {} poly_plain_adaptor(const T* data, unsigned num_points, bool closed) : - m_data(data), + m_data(data), m_ptr(data), m_end(data + num_points * 2), m_closed(closed), @@ -398,7 +398,8 @@ namespace agg if(m_closed && !m_stop) { m_stop = true; - return path_cmd_end_poly | path_flags_close; + return path_cmd_end_poly + | static_cast(path_flags_close); } return path_cmd_stop; } @@ -421,15 +422,15 @@ namespace agg public: typedef typename Container::value_type vertex_type; - poly_container_adaptor() : - m_container(0), + poly_container_adaptor() : + m_container(0), m_index(0), m_closed(false), m_stop(false) {} poly_container_adaptor(const Container& data, bool closed) : - m_container(&data), + m_container(&data), m_index(0), m_closed(closed), m_stop(false) @@ -463,7 +464,8 @@ namespace agg if(m_closed && !m_stop) { m_stop = true; - return path_cmd_end_poly | path_flags_close; + return path_cmd_end_poly + | static_cast(path_flags_close); } return path_cmd_stop; } @@ -483,15 +485,15 @@ namespace agg public: typedef typename Container::value_type vertex_type; - poly_container_reverse_adaptor() : - m_container(0), + poly_container_reverse_adaptor() : + m_container(0), m_index(-1), m_closed(false), m_stop(false) {} poly_container_reverse_adaptor(const Container& data, bool closed) : - m_container(&data), + m_container(&data), m_index(-1), m_closed(closed), m_stop(false) @@ -525,7 +527,8 @@ namespace agg if(m_closed && !m_stop) { m_stop = true; - return path_cmd_end_poly | path_flags_close; + return path_cmd_end_poly + | static_cast(path_flags_close); } return path_cmd_stop; } @@ -556,7 +559,7 @@ namespace agg m_coord[2] = x2; m_coord[3] = y2; } - + void init(double x1, double y1, double x2, double y2) { m_coord[0] = x1; @@ -594,10 +597,10 @@ namespace agg //---------------------------------------------------------------path_base - // A container to store vertices with their flags. - // A path consists of a number of contours separated with "move_to" + // A container to store vertices with their flags. + // A path consists of a number of contours separated with "move_to" // commands. The path storage can keep and maintain more than one - // path. + // path. // To navigate to the beginning of a particular path, use rewind(path_id); // Where path_id is what start_new_path() returns. So, when you call // start_new_path() you need to store its return value somewhere else @@ -644,28 +647,28 @@ namespace agg bool sweep_flag, double dx, double dy); - void curve3(double x_ctrl, double y_ctrl, + void curve3(double x_ctrl, double y_ctrl, double x_to, double y_to); - void curve3_rel(double dx_ctrl, double dy_ctrl, + void curve3_rel(double dx_ctrl, double dy_ctrl, double dx_to, double dy_to); void curve3(double x_to, double y_to); void curve3_rel(double dx_to, double dy_to); - void curve4(double x_ctrl1, double y_ctrl1, - double x_ctrl2, double y_ctrl2, + void curve4(double x_ctrl1, double y_ctrl1, + double x_ctrl2, double y_ctrl2, double x_to, double y_to); - void curve4_rel(double dx_ctrl1, double dy_ctrl1, - double dx_ctrl2, double dy_ctrl2, + void curve4_rel(double dx_ctrl1, double dy_ctrl1, + double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to); - void curve4(double x_ctrl2, double y_ctrl2, + void curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to); - void curve4_rel(double x_ctrl2, double y_ctrl2, + void curve4_rel(double x_ctrl2, double y_ctrl2, double x_to, double y_to); @@ -674,8 +677,8 @@ namespace agg // Accessors //-------------------------------------------------------------------- - const container_type& vertices() const { return m_vertices; } - container_type& vertices() { return m_vertices; } + const container_type& vertices() const { return m_vertices; } + container_type& vertices() { return m_vertices; } unsigned total_vertices() const; @@ -699,9 +702,9 @@ namespace agg void rewind(unsigned path_id); unsigned vertex(double* x, double* y); - // Arrange the orientation of a polygon, all polygons in a path, - // or in all paths. After calling arrange_orientations() or - // arrange_orientations_all_paths(), all the polygons will have + // Arrange the orientation of a polygon, all polygons in a path, + // or in all paths. After calling arrange_orientations() or + // arrange_orientations_all_paths(), all the polygons will have // the same orientation, i.e. path_flags_cw or path_flags_ccw //-------------------------------------------------------------------- unsigned arrange_polygon_orientation(unsigned start, path_flags_e orientation); @@ -709,7 +712,7 @@ namespace agg void arrange_orientations_all_paths(path_flags_e orientation); void invert_polygon(unsigned start); - // Flip all vertices horizontally or vertically, + // Flip all vertices horizontally or vertically, // between x1 and x2, or between y1 and y2 respectively //-------------------------------------------------------------------- void flip_x(double x1, double x2); @@ -717,7 +720,7 @@ namespace agg // Concatenate path. The path is added as is. //-------------------------------------------------------------------- - template + template void concat_path(VertexSource& vs, unsigned path_id = 0) { double x=0; @@ -731,9 +734,9 @@ namespace agg } //-------------------------------------------------------------------- - // Join path. The path is joined with the existing one, that is, + // Join path. The path is joined with the existing one, that is, // it behaves as if the pen of a plotter was always down (drawing) - template + template void join_path(VertexSource& vs, unsigned path_id = 0) { double x=0.0, y=0.0; @@ -769,16 +772,16 @@ namespace agg } while(!is_stop(cmd = vs.vertex(&x, &y))) { - m_vertices.add_vertex(x, y, is_move_to(cmd) ? - unsigned(path_cmd_line_to) : + m_vertices.add_vertex(x, y, is_move_to(cmd) ? + unsigned(path_cmd_line_to) : cmd); } } } - // Concatenate polygon/polyline. + // Concatenate polygon/polyline. //-------------------------------------------------------------------- - template void concat_poly(const T* data, + template void concat_poly(const T* data, unsigned num_points, bool closed) { @@ -788,7 +791,7 @@ namespace agg // Join polygon/polyline continuously. //-------------------------------------------------------------------- - template void join_poly(const T* data, + template void join_poly(const T* data, unsigned num_points, bool closed) { @@ -846,7 +849,7 @@ namespace agg }; //------------------------------------------------------------------------ - template + template unsigned path_base::start_new_path() { if(!is_stop(m_vertices.last_command())) @@ -858,7 +861,7 @@ namespace agg //------------------------------------------------------------------------ - template + template inline void path_base::rel_to_abs(double* x, double* y) const { if(m_vertices.total_vertices()) @@ -870,7 +873,7 @@ namespace agg *x += x2; *y += y2; } - else if (!is_stop(m_vertices.last_command()) && + else if (!is_stop(m_vertices.last_command()) && is_vertex(m_vertices.prev_vertex(&x2, &y2))) { *x += x2; @@ -880,14 +883,14 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::move_to(double x, double y) { m_vertices.add_vertex(x, y, path_cmd_move_to); } //------------------------------------------------------------------------ - template + template inline void path_base::move_rel(double dx, double dy) { rel_to_abs(&dx, &dy); @@ -895,14 +898,14 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::line_to(double x, double y) { m_vertices.add_vertex(x, y, path_cmd_line_to); } //------------------------------------------------------------------------ - template + template inline void path_base::line_rel(double dx, double dy) { rel_to_abs(&dx, &dy); @@ -910,14 +913,14 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::hline_to(double x) { m_vertices.add_vertex(x, last_y(), path_cmd_line_to); } //------------------------------------------------------------------------ - template + template inline void path_base::hline_rel(double dx) { double dy = 0; @@ -926,14 +929,14 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::vline_to(double y) { m_vertices.add_vertex(last_x(), y, path_cmd_line_to); } //------------------------------------------------------------------------ - template + template inline void path_base::vline_rel(double dy) { double dx = 0; @@ -942,7 +945,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::arc_to(double rx, double ry, double angle, bool large_arc_flag, @@ -961,7 +964,7 @@ namespace agg // Ensure radii are valid //------------------------- - if(rx < epsilon || ry < epsilon) + if(rx < epsilon || ry < epsilon) { line_to(x, y); return; @@ -990,7 +993,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::arc_rel(double rx, double ry, double angle, bool large_arc_flag, @@ -1002,8 +1005,8 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve3(double x_ctrl, double y_ctrl, + template + void path_base::curve3(double x_ctrl, double y_ctrl, double x_to, double y_to) { m_vertices.add_vertex(x_ctrl, y_ctrl, path_cmd_curve3); @@ -1011,8 +1014,8 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve3_rel(double dx_ctrl, double dy_ctrl, + template + void path_base::curve3_rel(double dx_ctrl, double dy_ctrl, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl, &dy_ctrl); @@ -1022,7 +1025,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::curve3(double x_to, double y_to) { double x0; @@ -1030,7 +1033,7 @@ namespace agg if(is_vertex(m_vertices.last_vertex(&x0, &y0))) { double x_ctrl; - double y_ctrl; + double y_ctrl; unsigned cmd = m_vertices.prev_vertex(&x_ctrl, &y_ctrl); if(is_curve(cmd)) { @@ -1047,7 +1050,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::curve3_rel(double dx_to, double dy_to) { rel_to_abs(&dx_to, &dy_to); @@ -1055,9 +1058,9 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve4(double x_ctrl1, double y_ctrl1, - double x_ctrl2, double y_ctrl2, + template + void path_base::curve4(double x_ctrl1, double y_ctrl1, + double x_ctrl2, double y_ctrl2, double x_to, double y_to) { m_vertices.add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4); @@ -1066,9 +1069,9 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve4_rel(double dx_ctrl1, double dy_ctrl1, - double dx_ctrl2, double dy_ctrl2, + template + void path_base::curve4_rel(double dx_ctrl1, double dy_ctrl1, + double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl1, &dy_ctrl1); @@ -1080,8 +1083,8 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve4(double x_ctrl2, double y_ctrl2, + template + void path_base::curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to) { double x0; @@ -1089,7 +1092,7 @@ namespace agg if(is_vertex(last_vertex(&x0, &y0))) { double x_ctrl1; - double y_ctrl1; + double y_ctrl1; unsigned cmd = prev_vertex(&x_ctrl1, &y_ctrl1); if(is_curve(cmd)) { @@ -1106,8 +1109,8 @@ namespace agg } //------------------------------------------------------------------------ - template - void path_base::curve4_rel(double dx_ctrl2, double dy_ctrl2, + template + void path_base::curve4_rel(double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl2, &dy_ctrl2); @@ -1116,7 +1119,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::end_poly(unsigned flags) { if(is_vertex(m_vertices.last_command())) @@ -1126,91 +1129,91 @@ namespace agg } //------------------------------------------------------------------------ - template + template inline void path_base::close_polygon(unsigned flags) { end_poly(path_flags_close | flags); } //------------------------------------------------------------------------ - template + template inline unsigned path_base::total_vertices() const { return m_vertices.total_vertices(); } //------------------------------------------------------------------------ - template + template inline unsigned path_base::last_vertex(double* x, double* y) const { return m_vertices.last_vertex(x, y); } //------------------------------------------------------------------------ - template + template inline unsigned path_base::prev_vertex(double* x, double* y) const { return m_vertices.prev_vertex(x, y); } //------------------------------------------------------------------------ - template + template inline double path_base::last_x() const { return m_vertices.last_x(); } //------------------------------------------------------------------------ - template + template inline double path_base::last_y() const { return m_vertices.last_y(); } //------------------------------------------------------------------------ - template + template inline unsigned path_base::vertex(unsigned idx, double* x, double* y) const { return m_vertices.vertex(idx, x, y); } - + //------------------------------------------------------------------------ - template + template inline unsigned path_base::command(unsigned idx) const { return m_vertices.command(idx); } //------------------------------------------------------------------------ - template + template void path_base::modify_vertex(unsigned idx, double x, double y) { m_vertices.modify_vertex(idx, x, y); } //------------------------------------------------------------------------ - template + template void path_base::modify_vertex(unsigned idx, double x, double y, unsigned cmd) { m_vertices.modify_vertex(idx, x, y, cmd); } //------------------------------------------------------------------------ - template + template void path_base::modify_command(unsigned idx, unsigned cmd) { m_vertices.modify_command(idx, cmd); } //------------------------------------------------------------------------ - template + template inline void path_base::rewind(unsigned path_id) { m_iterator = path_id; } //------------------------------------------------------------------------ - template + template inline unsigned path_base::vertex(double* x, double* y) { if(m_iterator >= m_vertices.total_vertices()) return path_cmd_stop; @@ -1218,7 +1221,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template unsigned path_base::perceive_polygon_orientation(unsigned start, unsigned end) { @@ -1238,12 +1241,12 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::invert_polygon(unsigned start, unsigned end) { unsigned i; unsigned tmp_cmd = m_vertices.command(start); - + --end; // Make "end" inclusive // Shift all commands to one position @@ -1263,45 +1266,45 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::invert_polygon(unsigned start) { // Skip all non-vertices at the beginning - while(start < m_vertices.total_vertices() && + while(start < m_vertices.total_vertices() && !is_vertex(m_vertices.command(start))) ++start; // Skip all insignificant move_to - while(start+1 < m_vertices.total_vertices() && + while(start+1 < m_vertices.total_vertices() && is_move_to(m_vertices.command(start)) && is_move_to(m_vertices.command(start+1))) ++start; // Find the last vertex unsigned end = start + 1; - while(end < m_vertices.total_vertices() && + while(end < m_vertices.total_vertices() && !is_next_poly(m_vertices.command(end))) ++end; invert_polygon(start, end); } //------------------------------------------------------------------------ - template - unsigned path_base::arrange_polygon_orientation(unsigned start, + template + unsigned path_base::arrange_polygon_orientation(unsigned start, path_flags_e orientation) { if(orientation == path_flags_none) return start; - + // Skip all non-vertices at the beginning - while(start < m_vertices.total_vertices() && + while(start < m_vertices.total_vertices() && !is_vertex(m_vertices.command(start))) ++start; // Skip all insignificant move_to - while(start+1 < m_vertices.total_vertices() && + while(start+1 < m_vertices.total_vertices() && is_move_to(m_vertices.command(start)) && is_move_to(m_vertices.command(start+1))) ++start; // Find the last vertex unsigned end = start + 1; - while(end < m_vertices.total_vertices() && + while(end < m_vertices.total_vertices() && !is_next_poly(m_vertices.command(end))) ++end; if(end - start > 2) @@ -1311,7 +1314,7 @@ namespace agg // Invert polygon, set orientation flag, and skip all end_poly invert_polygon(start, end); unsigned cmd; - while(end < m_vertices.total_vertices() && + while(end < m_vertices.total_vertices() && is_end_poly(cmd = m_vertices.command(end))) { m_vertices.modify_command(end++, set_orientation(cmd, orientation)); @@ -1322,8 +1325,8 @@ namespace agg } //------------------------------------------------------------------------ - template - unsigned path_base::arrange_orientations(unsigned start, + template + unsigned path_base::arrange_orientations(unsigned start, path_flags_e orientation) { if(orientation != path_flags_none) @@ -1342,7 +1345,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::arrange_orientations_all_paths(path_flags_e orientation) { if(orientation != path_flags_none) @@ -1356,7 +1359,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::flip_x(double x1, double x2) { unsigned i; @@ -1372,7 +1375,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::flip_y(double y1, double y2) { unsigned i; @@ -1388,7 +1391,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::translate(double dx, double dy, unsigned path_id) { unsigned num_ver = m_vertices.total_vertices(); @@ -1407,7 +1410,7 @@ namespace agg } //------------------------------------------------------------------------ - template + template void path_base::translate_all_paths(double dx, double dy) { unsigned idx; @@ -1440,8 +1443,8 @@ namespace agg void add_vertex(double x, double y, unsigned cmd) { - m_vertices.push_back(vertex_type(value_type(x), - value_type(y), + m_vertices.push_back(vertex_type(value_type(x), + value_type(y), int8u(cmd))); } @@ -1474,8 +1477,8 @@ namespace agg unsigned last_command() const { - return m_vertices.size() ? - m_vertices[m_vertices.size() - 1].cmd : + return m_vertices.size() ? + m_vertices[m_vertices.size() - 1].cmd : path_cmd_stop; } @@ -1545,11 +1548,11 @@ namespace agg // Example of declarations path_storage with std::vector as a container //--------------------------------------------------------------------------- -//#include -//namespace agg -//{ -// typedef path_base > > path_storage; -//} +//#include +//namespace agg +//{ +// typedef path_base > > path_storage; +//} #endif diff --git a/deps/agg/include/agg_pixfmt_base.h b/deps/agg/include/agg_pixfmt_base.h index 57ae19cfe..b3e98ad1a 100644 --- a/deps/agg/include/agg_pixfmt_base.h +++ b/deps/agg/include/agg_pixfmt_base.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -35,7 +35,7 @@ namespace agg }; //--------------------------------------------------------------blender_base - template + template struct blender_base { typedef ColorT color_type; @@ -47,14 +47,14 @@ namespace agg if (cover > cover_none) { rgba c( - color_type::to_double(r), - color_type::to_double(g), - color_type::to_double(b), + color_type::to_double(r), + color_type::to_double(g), + color_type::to_double(b), color_type::to_double(a)); if (cover < cover_full) { - double x = double(cover) / cover_full; + double x = static_cast(cover) / static_cast(cover_full); c.r *= x; c.g *= x; c.b *= x; @@ -69,10 +69,10 @@ namespace agg static rgba get(const value_type* p, cover_type cover = cover_full) { return get( - p[order_type::R], - p[order_type::G], - p[order_type::B], - p[order_type::A], + p[order_type::R], + p[order_type::G], + p[order_type::B], + p[order_type::A], cover); } diff --git a/deps/agg/include/agg_rasterizer_sl_clip.h b/deps/agg/include/agg_rasterizer_sl_clip.h index a3c5867fb..64a0a468b 100644 --- a/deps/agg/include/agg_rasterizer_sl_clip.h +++ b/deps/agg/include/agg_rasterizer_sl_clip.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -24,7 +24,7 @@ namespace agg { poly_max_coord = (1 << 30) - 1 //----poly_max_coord }; - + //------------------------------------------------------------ras_conv_int struct ras_conv_int { @@ -35,7 +35,7 @@ namespace agg } static int xi(int v) { return v; } static int yi(int v) { return v; } - static int upscale(double v) { return iround(v * poly_subpixel_scale); } + static int upscale(double v) { return iround(v * static_cast(poly_subpixel_scale)); } static int downscale(int v) { return v; } }; @@ -49,9 +49,9 @@ namespace agg } static int xi(int v) { return v; } static int yi(int v) { return v; } - static int upscale(double v) - { - return saturation::iround(v * poly_subpixel_scale); + static int upscale(double v) + { + return saturation::iround(v * static_cast(poly_subpixel_scale)); } static int downscale(int v) { return v; } }; @@ -66,7 +66,7 @@ namespace agg } static int xi(int v) { return v * 3; } static int yi(int v) { return v; } - static int upscale(double v) { return iround(v * poly_subpixel_scale); } + static int upscale(double v) { return iround(v * static_cast(poly_subpixel_scale)); } static int downscale(int v) { return v; } }; @@ -78,10 +78,10 @@ namespace agg { return a * b / c; } - static int xi(double v) { return iround(v * poly_subpixel_scale); } - static int yi(double v) { return iround(v * poly_subpixel_scale); } + static int xi(double v) { return iround(v * static_cast(poly_subpixel_scale)); } + static int yi(double v) { return iround(v * static_cast(poly_subpixel_scale)); } static double upscale(double v) { return v; } - static double downscale(int v) { return v / double(poly_subpixel_scale); } + static double downscale(int v) { return v / static_cast(poly_subpixel_scale); } }; //--------------------------------------------------------ras_conv_dbl_3x @@ -92,10 +92,10 @@ namespace agg { return a * b / c; } - static int xi(double v) { return iround(v * poly_subpixel_scale * 3); } - static int yi(double v) { return iround(v * poly_subpixel_scale); } + static int xi(double v) { return iround(v * static_cast(poly_subpixel_scale) * 3); } + static int yi(double v) { return iround(v * static_cast(poly_subpixel_scale)); } static double upscale(double v) { return v; } - static double downscale(int v) { return v / double(poly_subpixel_scale); } + static double downscale(int v) { return v / static_cast(poly_subpixel_scale); } }; @@ -111,12 +111,12 @@ namespace agg typedef rect_base rect_type; //-------------------------------------------------------------------- - rasterizer_sl_clip() : + rasterizer_sl_clip() : m_clip_box(0,0,0,0), m_x1(0), m_y1(0), m_f1(0), - m_clipping(false) + m_clipping(false) {} //-------------------------------------------------------------------- @@ -145,8 +145,8 @@ namespace agg //------------------------------------------------------------------------ template AGG_INLINE void line_clip_y(Rasterizer& ras, - coord_type x1, coord_type y1, - coord_type x2, coord_type y2, + coord_type x1, coord_type y1, + coord_type x2, coord_type y2, unsigned f1, unsigned f2) const { f1 &= 10; @@ -154,7 +154,7 @@ namespace agg if((f1 | f2) == 0) { // Fully visible - ras.line(Conv::xi(x1), Conv::yi(y1), Conv::xi(x2), Conv::yi(y2)); + ras.line(Conv::xi(x1), Conv::yi(y1), Conv::xi(x2), Conv::yi(y2)); } else { @@ -192,8 +192,8 @@ namespace agg tx2 = x1 + Conv::mul_div(m_clip_box.y2-y1, x2-x1, y2-y1); ty2 = m_clip_box.y2; } - ras.line(Conv::xi(tx1), Conv::yi(ty1), - Conv::xi(tx2), Conv::yi(ty2)); + ras.line(Conv::xi(tx1), Conv::yi(ty1), + Conv::xi(tx2), Conv::yi(ty2)); } } @@ -288,8 +288,8 @@ namespace agg } else { - ras.line(Conv::xi(m_x1), Conv::yi(m_y1), - Conv::xi(x2), Conv::yi(y2)); + ras.line(Conv::xi(m_x1), Conv::yi(m_y1), + Conv::xi(x2), Conv::yi(y2)); } m_x1 = x2; m_y1 = y2; @@ -321,10 +321,10 @@ namespace agg void move_to(coord_type x1, coord_type y1) { m_x1 = x1; m_y1 = y1; } template - void line_to(Rasterizer& ras, coord_type x2, coord_type y2) - { - ras.line(m_x1, m_y1, x2, y2); - m_x1 = x2; + void line_to(Rasterizer& ras, coord_type x2, coord_type y2) + { + ras.line(m_x1, m_y1, x2, y2); + m_x1 = x2; m_y1 = y2; } diff --git a/deps/agg/include/agg_renderer_outline_aa.h b/deps/agg/include/agg_renderer_outline_aa.h index b2d3dd42b..6af6d5720 100644 --- a/deps/agg/include/agg_renderer_outline_aa.h +++ b/deps/agg/include/agg_renderer_outline_aa.h @@ -1305,7 +1305,7 @@ namespace agg for(i = 0; i < aa_scale; i++) { m_gamma[i] = value_type( - uround(gamma_function(double(i) / aa_mask) * aa_mask)); + uround(gamma_function(static_cast(i) / static_cast(aa_mask)) * aa_mask)); } } diff --git a/deps/agg/src/agg_arrowhead.cpp b/deps/agg/src/agg_arrowhead.cpp index bbcfbba71..44c284cf2 100644 --- a/deps/agg/src/agg_arrowhead.cpp +++ b/deps/agg/src/agg_arrowhead.cpp @@ -66,7 +66,9 @@ void arrowhead::rewind(unsigned path_id) m_cmd[3] = path_cmd_line_to; m_cmd[4] = path_cmd_line_to; m_cmd[5] = path_cmd_line_to; - m_cmd[7] = path_cmd_end_poly | path_flags_close | path_flags_ccw; + m_cmd[7] = path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_ccw); m_cmd[6] = path_cmd_stop; return; } @@ -87,7 +89,9 @@ void arrowhead::rewind(unsigned path_id) m_cmd[1] = path_cmd_line_to; m_cmd[2] = path_cmd_line_to; m_cmd[3] = path_cmd_line_to; - m_cmd[4] = path_cmd_end_poly | path_flags_close | path_flags_ccw; + m_cmd[4] = path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_ccw); m_cmd[5] = path_cmd_stop; return; } diff --git a/deps/agg/src/agg_line_profile_aa.cpp b/deps/agg/src/agg_line_profile_aa.cpp index cb4ceb7cd..543fb6951 100644 --- a/deps/agg/src/agg_line_profile_aa.cpp +++ b/deps/agg/src/agg_line_profile_aa.cpp @@ -42,7 +42,7 @@ void line_profile_aa::width(double w) //--------------------------------------------------------------------- line_profile_aa::value_type* line_profile_aa::profile(double w) { - m_subpixel_width = uround(w * subpixel_scale); + m_subpixel_width = uround(w * static_cast(subpixel_scale)); unsigned size = m_subpixel_width + subpixel_scale * 6; if(size > m_profile.size()) { @@ -56,8 +56,8 @@ line_profile_aa::value_type* line_profile_aa::profile(double w) void line_profile_aa::set(double center_width, double smoother_width) { double base_val = 1.0; - if(center_width == 0.0) center_width = 1.0 / subpixel_scale; - if(smoother_width == 0.0) smoother_width = 1.0 / subpixel_scale; + if(center_width == 0.0) center_width = 1.0 / static_cast(subpixel_scale); + if(smoother_width == 0.0) smoother_width = 1.0 / static_cast(subpixel_scale); double width = center_width + smoother_width; if(width < m_min_width) @@ -70,15 +70,15 @@ void line_profile_aa::set(double center_width, double smoother_width) value_type* ch = profile(center_width + smoother_width); - unsigned subpixel_center_width = unsigned(center_width * subpixel_scale); - unsigned subpixel_smoother_width = unsigned(smoother_width * subpixel_scale); + unsigned subpixel_center_width = unsigned(center_width * static_cast(subpixel_scale)); + unsigned subpixel_smoother_width = unsigned(smoother_width * static_cast(subpixel_scale)); - value_type* ch_center = ch + subpixel_scale*2; + value_type* ch_center = ch + subpixel_scale * 2; value_type* ch_smoother = ch_center + subpixel_center_width; unsigned i; - unsigned val = m_gamma[unsigned(base_val * aa_mask)]; + unsigned val = m_gamma[unsigned(base_val * static_cast(aa_mask))]; ch = ch_center; for(i = 0; i < subpixel_center_width; i++) { @@ -90,7 +90,7 @@ void line_profile_aa::set(double center_width, double smoother_width) *ch_smoother++ = m_gamma[unsigned((base_val - base_val * - (double(i) / subpixel_smoother_width)) * aa_mask)]; + (double(i) / subpixel_smoother_width)) * static_cast(aa_mask))]; } unsigned n_smoother = profile_size() - @@ -113,4 +113,3 @@ void line_profile_aa::set(double center_width, double smoother_width) } - diff --git a/deps/agg/src/agg_rounded_rect.cpp b/deps/agg/src/agg_rounded_rect.cpp index 6307d60d9..17c1852f4 100644 --- a/deps/agg/src/agg_rounded_rect.cpp +++ b/deps/agg/src/agg_rounded_rect.cpp @@ -152,7 +152,9 @@ unsigned rounded_rect::vertex(double* x, double* y) else return path_cmd_line_to; case 8: - cmd = path_cmd_end_poly | path_flags_close | path_flags_ccw; + cmd = path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_ccw); m_status++; break; } @@ -161,4 +163,3 @@ unsigned rounded_rect::vertex(double* x, double* y) } - diff --git a/deps/agg/src/agg_vcgen_contour.cpp b/deps/agg/src/agg_vcgen_contour.cpp index cb3829e6e..398dc755b 100644 --- a/deps/agg/src/agg_vcgen_contour.cpp +++ b/deps/agg/src/agg_vcgen_contour.cpp @@ -153,7 +153,9 @@ unsigned vcgen_contour::vertex(double* x, double* y) case end_poly: if(!m_closed) return path_cmd_stop; m_status = stop; - return path_cmd_end_poly | path_flags_close | path_flags_ccw; + return path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_ccw); case stop: return path_cmd_stop; diff --git a/deps/agg/src/agg_vcgen_stroke.cpp b/deps/agg/src/agg_vcgen_stroke.cpp index 3ee336f03..ac0bd6d01 100644 --- a/deps/agg/src/agg_vcgen_stroke.cpp +++ b/deps/agg/src/agg_vcgen_stroke.cpp @@ -196,11 +196,15 @@ unsigned vcgen_stroke::vertex(double* x, double* y) case end_poly1: m_status = m_prev_status; - return path_cmd_end_poly | path_flags_close | path_flags_ccw; + return path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_ccw); case end_poly2: m_status = m_prev_status; - return path_cmd_end_poly | path_flags_close | path_flags_cw; + return path_cmd_end_poly + | static_cast(path_flags_close) + | static_cast(path_flags_cw); case stop: cmd = path_cmd_stop; diff --git a/include/mapnik/svg/svg_renderer_agg.hpp b/include/mapnik/svg/svg_renderer_agg.hpp index 671d11bb9..af68ed5f5 100644 --- a/include/mapnik/svg/svg_renderer_agg.hpp +++ b/include/mapnik/svg/svg_renderer_agg.hpp @@ -73,10 +73,10 @@ class linear_gradient_from_segment { public: linear_gradient_from_segment(double x1, double y1, double x2, double y2) - : x1_(x1 * agg::gradient_subpixel_scale) - , y1_(y1 * agg::gradient_subpixel_scale) - , x2_(x2 * agg::gradient_subpixel_scale) - , y2_(y2 * agg::gradient_subpixel_scale) + : x1_(x1 * static_cast(agg::gradient_subpixel_scale)) + , y1_(y1 * static_cast(agg::gradient_subpixel_scale)) + , x2_(x2 * static_cast(agg::gradient_subpixel_scale)) + , y2_(y2 * static_cast(agg::gradient_subpixel_scale)) { double dx = x2_ - x1_; double dy = y2_ - y1_;