summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-04-18 07:02:24 +0000
committerJon A. Cruz <jon@joncruz.org>2012-04-18 07:02:24 +0000
commit36e3c5550b49949729f2f23ab1796afdc53d6487 (patch)
tree8e1dc72ecb79f130bf9c07576c7d97e44c9d0186 /src/extension
parentFix for 903676 : Replace GtkCList with GtkTreeView in XML Tree, fix assert on... (diff)
downloadinkscape-36e3c5550b49949729f2f23ab1796afdc53d6487.tar.gz
inkscape-36e3c5550b49949729f2f23ab1796afdc53d6487.zip
Warning cleanup
(bzr r11265)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp6
-rw-r--r--src/extension/internal/latex-pstricks-out.cpp26
-rw-r--r--src/extension/internal/latex-pstricks.cpp25
-rw-r--r--src/extension/internal/pdf-input-cairo.cpp4
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp9
-rw-r--r--src/extension/internal/pdfinput/svg-builder.cpp12
-rw-r--r--src/extension/internal/svg.cpp8
-rw-r--r--src/extension/internal/svgz.cpp12
8 files changed, 42 insertions, 60 deletions
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 4519befcf..80be2ecc2 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -54,7 +54,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
static std::set<Glib::ustring> lossy = create_lossy_set();
if (pb) { /* We are readable */
- bool is_lossy;
+ // TODO revisit: bool is_lossy;
Glib::ustring mime_type, ext;
Glib::ustring u = uri;
std::size_t dotpos = u.rfind('.');
@@ -64,10 +64,10 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
// HACK: replace with something better based on GIO
if (!ext.empty() && lossy.find(ext) != lossy.end()) {
- is_lossy = true;
+ // TODO revisit: is_lossy = true;
mime_type = "image/jpeg";
} else {
- is_lossy = false;
+ // TODO revisit: is_lossy = false;
mime_type = "image/png";
}
diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp
index decc42d94..3ce2c5531 100644
--- a/src/extension/internal/latex-pstricks-out.cpp
+++ b/src/extension/internal/latex-pstricks-out.cpp
@@ -49,8 +49,6 @@ bool LatexOutput::check(Inkscape::Extension::Extension * /*module*/)
void LatexOutput::save(Inkscape::Extension::Output * /*mod2*/, SPDocument *doc, gchar const *filename)
{
SPPrintContext context;
- unsigned int ret = 0;
-
doc->ensureUpToDate();
Inkscape::Extension::Print *mod = Inkscape::Extension::get_print(SP_MODULE_KEY_PRINT_LATEX);
@@ -58,28 +56,26 @@ void LatexOutput::save(Inkscape::Extension::Output * /*mod2*/, SPDocument *doc,
gchar * oldoutput = g_strdup(oldconst);
mod->set_param_string("destination", filename);
- /* Start */
+ // Start
context.module = mod;
- /* fixme: This has to go into module constructor somehow */
+ // fixme: This has to go into module constructor somehow
mod->base = doc->getRoot();
Inkscape::Drawing drawing;
- mod->dkey = SPItem::display_key_new (1);
- mod->root = (mod->base)->invoke_show (drawing, mod->dkey, SP_ITEM_SHOW_DISPLAY);
+ mod->dkey = SPItem::display_key_new(1);
+ mod->root = (mod->base)->invoke_show(drawing, mod->dkey, SP_ITEM_SHOW_DISPLAY);
drawing.setRoot(mod->root);
- /* Print document */
- ret = mod->begin (doc);
- (mod->base)->invoke_print (&context);
- ret = mod->finish ();
- /* Release things */
- (mod->base)->invoke_hide (mod->dkey);
+ // Print document
+ mod->begin(doc);
+ (mod->base)->invoke_print(&context);
+ mod->finish();
+ // Release things
+ (mod->base)->invoke_hide(mod->dkey);
mod->base = NULL;
mod->root = NULL; // should have been deleted by invoke_hide
- /* end */
+ // end
mod->set_param_string("destination", oldoutput);
g_free(oldoutput);
-
- return;
}
#include "clear-n_.h"
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index bdf95f941..c1eddf539 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -326,22 +326,17 @@ PrintLatex::textToPath(Inkscape::Extension::Print * ext)
#include "clear-n_.h"
-void
-PrintLatex::init (void)
+void PrintLatex::init(void)
{
- Inkscape::Extension::Extension * ext;
-
- /* SVG in */
- ext = Inkscape::Extension::build_from_mem(
- "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
- "<name>" N_("LaTeX Print") "</name>\n"
- "<id>" SP_MODULE_KEY_PRINT_LATEX "</id>\n"
- "<param name=\"destination\" type=\"string\"></param>\n"
- "<param name=\"textToPath\" type=\"boolean\">true</param>\n"
- "<print/>\n"
- "</inkscape-extension>", new PrintLatex());
-
- return;
+ /* SVG in */
+ Inkscape::Extension::build_from_mem(
+ "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
+ "<name>" N_("LaTeX Print") "</name>\n"
+ "<id>" SP_MODULE_KEY_PRINT_LATEX "</id>\n"
+ "<param name=\"destination\" type=\"string\"></param>\n"
+ "<param name=\"textToPath\" type=\"boolean\">true</param>\n"
+ "<print/>\n"
+ "</inkscape-extension>", new PrintLatex());
}
} /* namespace Internal */
diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp
index b1cf13db1..0a89c6661 100644
--- a/src/extension/internal/pdf-input-cairo.cpp
+++ b/src/extension/internal/pdf-input-cairo.cpp
@@ -631,9 +631,7 @@ static cairo_status_t
void
PdfInputCairo::init(void) {
- Inkscape::Extension::Extension * ext;
-
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>PDF Input</name>\n"
"<id>org.inkscape.input.cairo-pdf</id>\n"
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 35972c00e..8802ce2ba 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -735,12 +735,9 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
#include "../clear-n_.h"
-void
-PdfInput::init(void) {
- Inkscape::Extension::Extension * ext;
-
+void PdfInput::init(void) {
/* PDF in */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("PDF Input") "</name>\n"
"<id>org.inkscape.input.pdf</id>\n"
@@ -753,7 +750,7 @@ PdfInput::init(void) {
"</inkscape-extension>", new PdfInput());
/* AI in */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("AI Input") "</name>\n"
"<id>org.inkscape.input.ai</id>\n"
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index eefd66e12..6606e1846 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -910,10 +910,10 @@ void SvgBuilder::updateStyle(GfxState *state) {
that a space in sp may be removed or replaced by some other tokens
specified in the code. (Bug LP #179589)
*/
-static int MatchingChars(std::string s1, std::string sp)
+static size_t MatchingChars(std::string s1, std::string sp)
{
- unsigned int is = 0;
- unsigned int ip = 0;
+ size_t is = 0;
+ size_t ip = 0;
while(is < s1.length() && ip < sp.length()) {
if (s1[is] == sp[ip]) {
@@ -927,7 +927,7 @@ static int MatchingChars(std::string s1, std::string sp)
break;
}
}
- return(ip);
+ return ip;
}
/*
@@ -944,12 +944,12 @@ std::string SvgBuilder::_BestMatchingFont(std::string PDFname)
std::string fontname = _availableFontNames[i];
// At least the first word of the font name should match.
- guint minMatch = fontname.find(" ");
+ size_t minMatch = fontname.find(" ");
if (minMatch == std::string::npos) {
minMatch = fontname.length();
}
- int Match = MatchingChars(PDFname, fontname);
+ size_t Match = MatchingChars(PDFname, fontname);
if (Match >= minMatch) {
double relMatch = (float)Match / (fontname.length() + PDFname.length());
if (relMatch > bestMatch) {
diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp
index d054e4427..7d0b8299c 100644
--- a/src/extension/internal/svg.cpp
+++ b/src/extension/internal/svg.cpp
@@ -83,10 +83,8 @@ void pruneExtendedAttributes( Inkscape::XML::Node *repr )
void
Svg::init(void)
{
- Inkscape::Extension::Extension * ext;
-
/* SVG in */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVG Input") "</name>\n"
"<id>" SP_MODULE_KEY_INPUT_SVG "</id>\n"
@@ -100,7 +98,7 @@ Svg::init(void)
"</inkscape-extension>", new Svg());
/* SVG out Inkscape */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVG Output Inkscape") "</name>\n"
"<id>" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "</id>\n"
@@ -114,7 +112,7 @@ Svg::init(void)
"</inkscape-extension>", new Svg());
/* SVG out */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVG Output") "</name>\n"
"<id>" SP_MODULE_KEY_OUTPUT_SVG "</id>\n"
diff --git a/src/extension/internal/svgz.cpp b/src/extension/internal/svgz.cpp
index fceafd3ee..be9440980 100644
--- a/src/extension/internal/svgz.cpp
+++ b/src/extension/internal/svgz.cpp
@@ -40,10 +40,8 @@ namespace Internal {
void
Svgz::init(void)
{
- Inkscape::Extension::Extension * ext;
-
/* SVGZ in */
- ext = Inkscape::Extension::build_from_mem(
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVGZ Input") "</name>\n"
"<id>" SP_MODULE_KEY_INPUT_SVGZ "</id>\n"
@@ -57,8 +55,8 @@ Svgz::init(void)
"</input>\n"
"</inkscape-extension>", new Svgz());
- /* SVGZ out Inkscape */
- ext = Inkscape::Extension::build_from_mem(
+ /* SVGZ out Inkscape */
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVGZ Output") "</name>\n"
"<id>" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "</id>\n"
@@ -71,8 +69,8 @@ Svgz::init(void)
"</output>\n"
"</inkscape-extension>", new Svgz());
- /* SVGZ out */
- ext = Inkscape::Extension::build_from_mem(
+ /* SVGZ out */
+ Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("SVGZ Output") "</name>\n"
"<id>" SP_MODULE_KEY_OUTPUT_SVGZ "</id>\n"