diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-09-24 22:17:24 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-09-24 22:17:24 +0000 |
| commit | bcca22a25ae98f70c36fff6292f0a8fe4e578d89 (patch) | |
| tree | a18d382d32f471b7119b9b7b2782cec04d6da43f /src/xml | |
| parent | Refactored SPUse. (diff) | |
| parent | Fix my email address through codebase (diff) | |
| download | inkscape-bcca22a25ae98f70c36fff6292f0a8fe4e578d89.tar.gz inkscape-bcca22a25ae98f70c36fff6292f0a8fe4e578d89.zip | |
Merged from trunk (r12588).
(bzr r11608.1.129)
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/quote-test.h | 5 | ||||
| -rw-r--r-- | src/xml/quote.cpp | 12 | ||||
| -rw-r--r-- | src/xml/quote.h | 3 | ||||
| -rw-r--r-- | src/xml/repr-util.cpp | 4 |
4 files changed, 11 insertions, 13 deletions
diff --git a/src/xml/quote-test.h b/src/xml/quote-test.h index bd5c1f54c..bc01ec4e9 100644 --- a/src/xml/quote-test.h +++ b/src/xml/quote-test.h @@ -7,10 +7,7 @@ #include <cstring> #include <functional> -/* mental disclaims all responsibility for this evil idea for testing - static functions. The main disadvantages are that we retain any - #define's and `using' directives of the included file. */ -#include "quote.cpp" +#include "quote.h" class XmlQuoteTest : public CxxTest::TestSuite { diff --git a/src/xml/quote.cpp b/src/xml/quote.cpp index 030a6c764..c9e001d05 100644 --- a/src/xml/quote.cpp +++ b/src/xml/quote.cpp @@ -19,7 +19,7 @@ /** \return strlen(xml_quote_strdup(\a val)) (without doing the malloc). * \pre val != NULL */ -static size_t +size_t xml_quoted_strlen(char const *val) { size_t ret = 0; @@ -43,11 +43,11 @@ xml_quoted_strlen(char const *val) static void xml_quote(char *dest, char const *src) { -#define COPY_LIT(_lit) do { \ - size_t cpylen = sizeof(_lit "") - 1; \ - memcpy(dest, _lit, cpylen); \ - dest += cpylen; \ - } while(0) +#define COPY_LIT(_lit) do { \ + size_t cpylen = sizeof(_lit "") - 1; \ + memcpy(dest, _lit, cpylen); \ + dest += cpylen; \ + } while(0) for (; *src != '\0'; ++src) { switch (*src) { diff --git a/src/xml/quote.h b/src/xml/quote.h index 597272cd3..8e3bca0eb 100644 --- a/src/xml/quote.h +++ b/src/xml/quote.h @@ -1,6 +1,9 @@ #ifndef SEEN_XML_QUOTE_H #define SEEN_XML_QUOTE_H +#include <stddef.h> + +size_t xml_quoted_strlen(char const *val); char *xml_quote_strdup(char const *src); diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 8c8425de0..12280ea5a 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -432,13 +432,11 @@ unsigned int sp_repr_get_int(Inkscape::XML::Node *repr, gchar const *key, int *v unsigned int sp_repr_get_double(Inkscape::XML::Node *repr, gchar const *key, double *val) { - gchar const *v; - g_return_val_if_fail(repr != NULL, FALSE); g_return_val_if_fail(key != NULL, FALSE); g_return_val_if_fail(val != NULL, FALSE); - v = repr->attribute(key); + gchar const *v = repr->attribute(key); if (v != NULL) { *val = g_ascii_strtod(v, NULL); |
