diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-11-20 09:27:20 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-11-21 09:01:50 +0000 |
| commit | 70a005ee969dbdd0a859a295abd94f979ff9402f (patch) | |
| tree | 195c9d53342d937f22ddbbf3c444a72ba961fc79 | |
| parent | Small update to src/io/README. (diff) | |
| download | inkscape-70a005ee969dbdd0a859a295abd94f979ff9402f.tar.gz inkscape-70a005ee969dbdd0a859a295abd94f979ff9402f.zip | |
-Werror=format -Werror=format-security
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-measure-segments.cpp | 6 | ||||
| -rw-r--r-- | src/live_effects/lpe-measure-segments.h | 1 |
3 files changed, 5 insertions, 5 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index a8230fea7..c4b90b493 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -18,6 +18,9 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR} # as replaced with CMAKE_CXX_STANDARD in main CMakeLists.txt list(APPEND INKSCAPE_CXX_FLAGS "-std=c++11") +# Errors for common mistakes +list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format") # e.g.: printf("%s", std::string("foo")) +list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format-security") # e.g.: printf(variable); # Define the flags for profiling if desired: if(WITH_PROFILING) diff --git a/src/live_effects/lpe-measure-segments.cpp b/src/live_effects/lpe-measure-segments.cpp index fccce1fc6..827f4b5ac 100644 --- a/src/live_effects/lpe-measure-segments.cpp +++ b/src/live_effects/lpe-measure-segments.cpp @@ -424,7 +424,7 @@ LPEMeasureSegments::createTextLabel(Geom::Point pos, size_t counter, double leng font_size << fontsize << "pt"; setlocale (LC_NUMERIC, locale_base); gchar c[32]; - sprintf(c, "#%06x", rgb24); + sprintf(c, "#%06x", rgb32 >> 8); sp_repr_css_set_property (css, "fill",c); Inkscape::SVGOStringStream os; os << SP_RGBA32_A_F(coloropacity.get_value()); @@ -622,7 +622,7 @@ LPEMeasureSegments::createLine(Geom::Point start,Geom::Point end, Glib::ustring style += "stroke-width:"; style += stroke_w.str(); gchar c[32]; - sprintf(c, "#%06x", rgb24); + sprintf(c, "#%06x", rgb32 >> 8); style += ";stroke:"; style += Glib::ustring(c); Inkscape::SVGOStringStream os; @@ -922,13 +922,11 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem) } else { doc_scale = 1.0; } - unsigned long const color = coloropacity.get_value() >> 8; guint32 color32 = coloropacity.get_value(); bool colorchanged = false; if (color32 != rgb32) { colorchanged = true; } - rgb24 = color; rgb32 = color32; SPCurve * c = nullptr; gchar * fontbutton_str = fontbutton.param_getSVGValue(); diff --git a/src/live_effects/lpe-measure-segments.h b/src/live_effects/lpe-measure-segments.h index 4aa62dacc..ce97302cb 100644 --- a/src/live_effects/lpe-measure-segments.h +++ b/src/live_effects/lpe-measure-segments.h @@ -88,7 +88,6 @@ private: double fontsize; double anotation_width; double previous_size; - unsigned long rgb24; guint32 rgb32; double arrow_gap; guint pagenumber; |
