diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:33:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 13:17:08 +0300 |
commit | f68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch) | |
tree | 2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/io/gpencil/intern/gpencil_io_import_svg.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/io/gpencil/intern/gpencil_io_import_svg.cc')
-rw-r--r-- | source/blender/io/gpencil/intern/gpencil_io_import_svg.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc index ebad236bada..23c80900659 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc @@ -93,8 +93,8 @@ bool GpencilImporterSVG::read() /* Check frame. */ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, cfra_, GP_GETFRAME_ADD_NEW); /* Create materials. */ - bool is_stroke = (bool)shape->stroke.type; - bool is_fill = (bool)shape->fill.type; + bool is_stroke = bool(shape->stroke.type); + bool is_fill = bool(shape->fill.type); if ((!is_stroke) && (!is_fill)) { is_stroke = true; } @@ -148,11 +148,11 @@ void GpencilImporterSVG::create_stroke(bGPdata *gpd, const int32_t mat_index, const float matrix[4][4]) { - const bool is_stroke = (bool)shape->stroke.type; - const bool is_fill = (bool)shape->fill.type; + const bool is_stroke = bool(shape->stroke.type); + const bool is_fill = bool(shape->fill.type); const int edges = params_.resolution; - const float step = 1.0f / (float)(edges - 1); + const float step = 1.0f / float(edges - 1); const int totpoints = (path->npts / 3) * params_.resolution; @@ -221,10 +221,10 @@ static void unpack_nano_color(const uint pack, float r_col[4]) rgb_u[2] = ((pack) >> 16) & 0xFF; rgb_u[3] = ((pack) >> 24) & 0xFF; - r_col[0] = (float)rgb_u[0] / 255.0f; - r_col[1] = (float)rgb_u[1] / 255.0f; - r_col[2] = (float)rgb_u[2] / 255.0f; - r_col[3] = (float)rgb_u[3] / 255.0f; + r_col[0] = float(rgb_u[0]) / 255.0f; + r_col[1] = float(rgb_u[1]) / 255.0f; + r_col[2] = float(rgb_u[2]) / 255.0f; + r_col[3] = float(rgb_u[3]) / 255.0f; } void GpencilImporterSVG::convert_color(const int32_t color, float r_linear_rgba[4]) |