diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-10-27 11:46:53 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-10-27 11:46:53 +0000 |
| commit | 5ed9dbd895fa15fa3bb03e8751e834cfa33aa16b (patch) | |
| tree | 5ad7c37524519180fc193b9eb476079a7e6a2a0f /src | |
| parent | Fix build error due to bad internal handling of deprecated GTK+ symbols in gt... (diff) | |
| download | inkscape-5ed9dbd895fa15fa3bb03e8751e834cfa33aa16b.tar.gz inkscape-5ed9dbd895fa15fa3bb03e8751e834cfa33aa16b.zip | |
Fix C++11 narrowing conversion errors
(bzr r11834)
Diffstat (limited to 'src')
| -rw-r--r-- | src/color-profile.cpp | 6 | ||||
| -rw-r--r-- | src/dom/svgimpl.cpp | 2 | ||||
| -rw-r--r-- | src/sp-conn-end.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/eek-preview.cpp | 11 | ||||
| -rw-r--r-- | src/widgets/sp-color-icc-selector.cpp | 6 |
5 files changed, 16 insertions, 11 deletions
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<guchar>(SP_RGBA32_R_U(val)), + static_cast<guchar>(SP_RGBA32_G_U(val)), + static_cast<guchar>(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<int>(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<double>(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<guint16>(preview->_r), + static_cast<guint16>(preview->_g), + static_cast<guint16>(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<guchar>(SP_RGBA32_R_U(val)), + static_cast<guchar>(SP_RGBA32_G_U(val)), + static_cast<guchar>(SP_RGBA32_B_U(val)), 255}; #ifdef DEBUG_LCMS g_message("Shoving in [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); |
