diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-01-22 08:31:43 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-01-22 08:31:43 +0000 |
| commit | 72b020d7ff034523ffd1e192647e568dfc835453 (patch) | |
| tree | 819aa3827ac70db60ca65b92fd812275025d66b8 | |
| parent | allow use of comma delimiter in filter table values array (Bug 511140) (diff) | |
| download | inkscape-72b020d7ff034523ffd1e192647e568dfc835453.tar.gz inkscape-72b020d7ff034523ffd1e192647e568dfc835453.zip | |
memleak / header stuff / unused variable.
(bzr r10917)
| -rw-r--r-- | src/extension/internal/latex-pstricks.cpp | 15 | ||||
| -rw-r--r-- | src/sp-root.cpp | 34 | ||||
| -rw-r--r-- | src/util/units.cpp | 1 |
3 files changed, 19 insertions, 31 deletions
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 4b8d926f9..72eeaed50 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -65,19 +65,14 @@ unsigned int PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc { Inkscape::SVGOStringStream os; int res; - FILE *osf, *osp; - const gchar * fn; - - os.setf(std::ios::fixed); - - fn = mod->get_param_string("destination"); - - osf = NULL; - osp = NULL; - + FILE *osf = NULL; + const gchar * fn = NULL; gsize bytesRead = 0; gsize bytesWritten = 0; GError* error = NULL; + + os.setf(std::ios::fixed); + fn = mod->get_param_string("destination"); gchar* local_fn = g_filename_from_utf8( fn, -1, &bytesRead, &bytesWritten, &error); fn = local_fn; diff --git a/src/sp-root.cpp b/src/sp-root.cpp index f405141bf..393c70895 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -17,20 +17,19 @@ # include "config.h" #endif -#include <cstring> #include <string> #include <2geom/transforms.h> -#include "svg/svg.h" -#include "display/drawing-group.h" #include "attributes.h" #include "print.h" #include "document.h" +#include "inkscape-version.h" #include "sp-defs.h" #include "sp-root.h" -#include <xml/repr.h> +#include "display/drawing-group.h" #include "svg/stringstream.h" -#include "inkscape-version.h" +#include "svg/svg.h" +#include "xml/repr.h" class SPDesktop; @@ -54,8 +53,7 @@ static SPGroupClass *parent_class; /** * Returns the type info of sp_root, including its class sizes and initialization routines. */ -GType -sp_root_get_type(void) +GType sp_root_get_type(void) { static GType type = 0; if (!type) { @@ -101,8 +99,7 @@ static void sp_root_class_init(SPRootClass *klass) /** * Initializes an SPRoot object by setting its default parameter values. */ -static void -sp_root_init(SPRoot *root) +static void sp_root_init(SPRoot *root) { static Inkscape::Version const zero_version(0, 0); @@ -129,8 +126,7 @@ sp_root_init(SPRoot *root) * It fills in data such as version, x, y, width, height, etc. * It then calls the object's parent class object's build function. */ -static void -sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) +static void sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPGroup *group = (SPGroup *) object; SPRoot *root = (SPRoot *) object; @@ -170,8 +166,7 @@ sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) * This is a destructor routine for SPRoot objects. It de-references any \<def\> items and calls * the parent class destructor. */ -static void -sp_root_release(SPObject *object) +static void sp_root_release(SPObject *object) { SPRoot *root = (SPRoot *) object; root->defs = NULL; @@ -183,8 +178,7 @@ sp_root_release(SPObject *object) /** * Sets the attribute given by key for SPRoot objects to the value specified by value. */ -static void -sp_root_set(SPObject *object, unsigned int key, gchar const *value) +static void sp_root_set(SPObject *object, unsigned int key, gchar const *value) { SPRoot *root = SP_ROOT(object); @@ -529,8 +523,7 @@ static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags) * Also, if the viewport has been modified, it sets the document size to the new * height and width. */ -static void -sp_root_modified(SPObject *object, guint flags) +static void sp_root_modified(SPObject *object, guint flags) { SPRoot *root = SP_ROOT(object); @@ -560,7 +553,9 @@ sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML: } if ( !repr->attribute("version") ) { - repr->setAttribute("version", sp_version_to_string(root->version.svg)); + gchar* myversion = sp_version_to_string(root->version.svg); + repr->setAttribute("version", myversion); + g_free(myversion); } if (fabs(root->x.computed) > 1e-9) @@ -612,8 +607,7 @@ sp_root_show(SPItem *item, Inkscape::Drawing &drawing, unsigned int key, unsigne /** * Virtual print callback. */ -static void -sp_root_print(SPItem *item, SPPrintContext *ctx) +static void sp_root_print(SPItem *item, SPPrintContext *ctx) { SPRoot *root = SP_ROOT(item); diff --git a/src/util/units.cpp b/src/util/units.cpp index b79bbc9cc..a8ce69b0f 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -3,7 +3,6 @@ #endif #include <cmath> -#include <cerrno> #include <glib.h> #include "io/simple-sax.h" |
