From c9d06adc5f8252eb3d2a90570d65afd0fd4c891b Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 17 Dec 2011 21:43:37 +0100 Subject: some static code analysis stuff (cppcheck warnings) (bzr r10779) --- src/display/canvas-axonomgrid.cpp | 2 +- src/display/gnome-canvas-acetate.cpp | 4 ---- src/extension/dxf2svg/blocks.cpp | 5 ----- src/extension/effect.h | 6 +----- src/extension/implementation/script.cpp | 2 +- src/extension/internal/latex-text-renderer.cpp | 4 ++-- 6 files changed, 5 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index b5fa9e10a..bdc323f8d 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -690,7 +690,7 @@ CanvasAxonomGridSnapper::_getSnapLines(Geom::Point const &p) const { inters = Geom::intersection(line_x, line_z); } - catch (Geom::InfiniteSolutions e) + catch (Geom::InfiniteSolutions &e) { // We're probably dealing with parallel lines; this is useless! return s; diff --git a/src/display/gnome-canvas-acetate.cpp b/src/display/gnome-canvas-acetate.cpp index 544efe61f..d6ebfa175 100644 --- a/src/display/gnome-canvas-acetate.cpp +++ b/src/display/gnome-canvas-acetate.cpp @@ -67,13 +67,9 @@ static void sp_canvas_acetate_init (SPCanvasAcetate */*acetate*/) static void sp_canvas_acetate_destroy (GtkObject *object) { - SPCanvasAcetate *acetate; - g_return_if_fail (object != NULL); g_return_if_fail (GNOME_IS_CANVAS_ACETATE (object)); - acetate = SP_CANVAS_ACETATE (object); - if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } diff --git a/src/extension/dxf2svg/blocks.cpp b/src/extension/dxf2svg/blocks.cpp index 75f348bde..36f2b9e7e 100644 --- a/src/extension/dxf2svg/blocks.cpp +++ b/src/extension/dxf2svg/blocks.cpp @@ -39,13 +39,8 @@ void block::block_info( std::vector< dxfpair > info){ } - - - - blocks::blocks(std::vector< std::vector< dxfpair > > sections){ // Read the main information about the entities section and then put it in the enetites class - int value; char string[10000]; std::vector< dxfpair > single_line; std::vector< std::vector< dxfpair > > ents; diff --git a/src/extension/effect.h b/src/extension/effect.h index 61a826ad4..83b5cc036 100644 --- a/src/extension/effect.h +++ b/src/extension/effect.h @@ -24,11 +24,7 @@ struct SPDocument; namespace Inkscape { -namespace UI { -namespace View { -typedef View View; -}; -}; + namespace Extension { diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 08624aff0..0a0282284 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -971,7 +971,7 @@ int Script::execute (const std::list &in_command, NULL, // STDIN &stdout_pipe, // STDOUT &stderr_pipe); // STDERR - } catch (Glib::Error e) { + } catch (Glib::Error &e) { printf("Can't Spawn!!! spawn returns: %s\n", e.what().data()); return 0; } diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp index 6244512a4..0134ea895 100644 --- a/src/extension/internal/latex-text-renderer.cpp +++ b/src/extension/internal/latex-text-renderer.cpp @@ -266,7 +266,7 @@ LaTeXTextRenderer::sp_text_render(SPItem *item) SPText *textobj = SP_TEXT (item); SPStyle *style = item->style; - gchar *strtext = sp_te_get_string_multiline(item); + /*gchar *strtext = sp_te_get_string_multiline(item); if (!strtext) { return; } @@ -274,7 +274,7 @@ LaTeXTextRenderer::sp_text_render(SPItem *item) gchar ** splitstr = g_strsplit(strtext, "\n", -1); gchar *str = g_strjoinv("\\\\ ", splitstr); g_free(strtext); - g_strfreev(splitstr); + g_strfreev(splitstr);*/ // get position and alignment // Align vertically on the baseline of the font (retreived from the anchor point) -- cgit v1.2.3