From 5ed9dbd895fa15fa3bb03e8751e834cfa33aa16b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 27 Oct 2012 12:46:53 +0100 Subject: Fix C++11 narrowing conversion errors (bzr r11834) --- src/color-profile.cpp | 6 +++--- src/dom/svgimpl.cpp | 2 +- src/sp-conn-end.cpp | 2 +- src/widgets/eek-preview.cpp | 11 ++++++++--- src/widgets/sp-color-icc-selector.cpp | 6 +++--- 5 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index a1e9dd0f1..981d527f0 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -639,9 +639,9 @@ bool ColorProfile::GamutCheck(SPColor color) cmsUInt8Number outofgamut = 0; guchar check_color[4] = { - SP_RGBA32_R_U(val), - SP_RGBA32_G_U(val), - SP_RGBA32_B_U(val), + static_cast(SP_RGBA32_R_U(val)), + static_cast(SP_RGBA32_G_U(val)), + static_cast(SP_RGBA32_B_U(val)), 255}; cmsDoTransform(ColorProfile::getTransfGamutCheck(), &check_color, &outofgamut, 1); diff --git a/src/dom/svgimpl.cpp b/src/dom/svgimpl.cpp index cf28dfec5..87f43af81 100644 --- a/src/dom/svgimpl.cpp +++ b/src/dom/svgimpl.cpp @@ -119,7 +119,7 @@ SVGTableEntry interfaceTable[] = { "SVGUnitTypes", SVG_UNIT_TYPES }, { "SVGURIReference", SVG_URI_REFERENCE }, { "SVGViewSpec", SVG_VIEW_SPEC }, - { "SVGZoomAndPan", SVG_ZOOM_AND_PAN } + { "SVGZoomAndPan", static_cast(SVG_ZOOM_AND_PAN)} }; diff --git a/src/sp-conn-end.cpp b/src/sp-conn-end.cpp index f8d5694da..cabda82d3 100644 --- a/src/sp-conn-end.cpp +++ b/src/sp-conn-end.cpp @@ -152,7 +152,7 @@ sp_conn_get_route_and_redraw(SPPath *const path, // Set sensible values incase there the connector ends are not // attached to any shapes. Geom::PathVector conn_pv = path->_curve->get_pathvector(); - double endPos[2] = { 0, conn_pv[0].size() }; + double endPos[2] = { 0.0, static_cast(conn_pv[0].size()) }; SPConnEnd** _connEnd = path->connEndPair.getConnEnds(); for (unsigned h = 0; h < 2; ++h) { diff --git a/src/widgets/eek-preview.cpp b/src/widgets/eek-preview.cpp index 953beb69d..72db91373 100644 --- a/src/widgets/eek-preview.cpp +++ b/src/widgets/eek-preview.cpp @@ -229,9 +229,14 @@ static gboolean eek_preview_draw(GtkWidget* widget, cairo_t* cr) GtkAllocation allocation; gtk_widget_get_allocation(widget, &allocation); EekPreview* preview = EEK_PREVIEW(widget); - GdkColor fg = { 0, preview->_r, preview->_g, preview->_b }; - gint insetTop = 0, insetBottom = 0; - gint insetLeft = 0, insetRight = 0; + + GdkColor fg = { 0, + static_cast(preview->_r), + static_cast(preview->_g), + static_cast(preview->_b)}; + + gint insetTop = 0, insetBottom = 0; + gint insetLeft = 0, insetRight = 0; if (preview->_border == BORDER_SOLID) { insetTop = 1; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index d04f17a30..b021ac43d 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -510,9 +510,9 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) if ( trans ) { guint32 val = _color.toRGBA32(0); guchar pre[4] = { - SP_RGBA32_R_U(val), - SP_RGBA32_G_U(val), - SP_RGBA32_B_U(val), + static_cast(SP_RGBA32_R_U(val)), + static_cast(SP_RGBA32_G_U(val)), + static_cast(SP_RGBA32_B_U(val)), 255}; #ifdef DEBUG_LCMS g_message("Shoving in [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); -- cgit v1.2.3