summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-03-23 17:45:35 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-03-23 17:45:35 +0000
commitec3232de2273e8d3e1efc0b89b30c770dd6a9a71 (patch)
treee084165557d264e0d7641647af1bdd9f9765897b /src
parentFixed bug continuing cusp nodes (diff)
parentfix Windows build for newer gcc/libs (diff)
downloadinkscape-ec3232de2273e8d3e1efc0b89b30c770dd6a9a71.tar.gz
inkscape-ec3232de2273e8d3e1efc0b89b30c770dd6a9a71.zip
update to trunk
(bzr r11950.1.311)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/generic-interval.h10
-rw-r--r--src/extension/internal/cairo-render-context.cpp2
-rw-r--r--src/extension/internal/emf-print.cpp24
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp8
-rw-r--r--src/gradient-drag.cpp2
-rw-r--r--src/inkscape.cpp5
-rw-r--r--src/libcroco/cr-om-parser.c26
-rw-r--r--src/libcroco/cr-parser.c18
-rw-r--r--src/libgdl/gdl-dock-item-button-image.c4
-rw-r--r--src/libgdl/gdl-dock-item-grip.c5
-rw-r--r--src/libgdl/gdl-dock-object.c2
-rw-r--r--src/libgdl/gdl-dock-paned.c8
-rw-r--r--src/libgdl/gdl-dock.c11
-rw-r--r--src/libgdl/gdl-switcher.c5
-rw-r--r--src/libnrtype/FontFactory.cpp6
-rw-r--r--src/libnrtype/FontInstance.cpp6
-rw-r--r--src/libnrtype/Layout-TNG-Input.cpp10
-rw-r--r--src/libuemf/uemf_endian.c7
-rw-r--r--src/libuemf/uemf_utf.c7
-rw-r--r--src/libuemf/uwmf_endian.c8
-rw-r--r--src/live_effects/lpe-powerstroke.cpp3
-rw-r--r--src/ui/tool/control-point-selection.cpp4
-rw-r--r--src/ui/tool/node.cpp4
-rw-r--r--src/winmain.cpp7
24 files changed, 117 insertions, 75 deletions
diff --git a/src/2geom/generic-interval.h b/src/2geom/generic-interval.h
index 41eaf59b0..f6d4718de 100644
--- a/src/2geom/generic-interval.h
+++ b/src/2geom/generic-interval.h
@@ -274,10 +274,12 @@ public:
/** @brief Union with another interval, gracefully handling empty ones. */
void unionWith(GenericOptInterval<C> const &a) {
- if (*this) { // check that we are not empty
- (*this)->unionWith(*a);
- } else if (a) {
- *this = *a;
+ if (a) {
+ if (*this) { // check that we are not empty
+ (*this)->unionWith(*a);
+ } else {
+ *this = *a;
+ }
}
}
void intersectWith(GenericOptInterval<C> const &o) {
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 4ec6ae1c8..c09b8e9c8 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -72,8 +72,8 @@
#include <cairo-ft.h>
#endif
#ifdef CAIRO_HAS_WIN32_FONT
-#include <cairo-win32.h>
#include <pango/pangowin32.h>
+#include <cairo-win32.h>
#endif
#include <pango/pangofc-fontmap.h>
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 4bb892821..ed25bf767 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -915,17 +915,13 @@ int PrintEmf::vector_rect_alignment(double angle, Geom::Point vtest){
are slightly displaced.
*/
Geom::Point PrintEmf::get_pathrect_corner(Geom::Path pathRect, double angle, int corner){
- Geom::Point v1 = Geom::Point(1,0) * Geom::Rotate(-angle); // unit horizontal side (sign change because Y increases DOWN)
- Geom::Point v2 = Geom::Point(0,1) * Geom::Rotate(-angle); // unit vertical side (sign change because Y increases DOWN)
- Geom::Point center, P1;
- int LR; // 1 if Left, 0 if Right
- int UL; // 1 if Lower, 0 if Upper (as viewed on screen, y coordinates increase downwards)
- center = Geom::Point(0,0);
- Geom::Path::const_iterator cit = pathRect.begin();
- for(; cit != pathRect.end_open();++cit) {
+ Geom::Point center(0,0);
+ for(Geom::Path::const_iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
center += cit->initialPoint()/4.0;
}
+ int LR; // 1 if Left, 0 if Right
+ int UL; // 1 if Lower, 0 if Upper (as viewed on screen, y coordinates increase downwards)
switch(corner){
case 1: //UR
LR = 0;
@@ -944,11 +940,15 @@ Geom::Point PrintEmf::get_pathrect_corner(Geom::Path pathRect, double angle, int
UL = 0;
break;
}
- cit = pathRect.begin();
- for(int i; cit != pathRect.end_open();++cit,i++) {
+
+ Geom::Point v1 = Geom::Point(1,0) * Geom::Rotate(-angle); // unit horizontal side (sign change because Y increases DOWN)
+ Geom::Point v2 = Geom::Point(0,1) * Geom::Rotate(-angle); // unit vertical side (sign change because Y increases DOWN)
+ Geom::Point P1;
+ for(Geom::Path::const_iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
P1 = cit->initialPoint();
- if((LR == (dot(P1 - center,v1)> 0 ? 0 : 1)) &&
- (UL == (dot(P1 - center,v2)> 0 ? 1 : 0)))break;
+
+ if ( ( LR == (dot(P1 - center,v1) > 0 ? 0 : 1) )
+ && ( UL == (dot(P1 - center,v2) > 0 ? 1 : 0) ) ) break;
}
return(P1);
}
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 30e120d26..b398486e6 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -76,10 +76,6 @@ extern "C" {
// Operator table
//------------------------------------------------------------------------
-#ifdef WIN32 // this works around a bug in the VC7 compiler
-# pragma optimize("",off)
-#endif
-
PdfOperator PdfParser::opTab[] = {
{"\"", 3, {tchkNum, tchkNum, tchkString},
&PdfParser::opMoveSetShowText},
@@ -249,10 +245,6 @@ PdfOperator PdfParser::opTab[] = {
&PdfParser::opCurveTo2}
};
-#ifdef WIN32 // this works around a bug in the VC7 compiler
-# pragma optimize("",on)
-#endif
-
#define numOps (sizeof(opTab) / sizeof(PdfOperator))
//------------------------------------------------------------------------
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 6773069de..8a0d7ee26 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -2387,7 +2387,7 @@ void GrDrag::selected_move(double x, double y, bool write_repr, bool scale_radia
gr_midpoint_limits(dragger, server, &begin, &end, &low_lim, &high_lim, &moving);
Geom::LineSegment ls(low_lim, high_lim);
- Geom::Point p = ls.pointAt(ls.nearestPoint(dragger->point + p));
+ Geom::Point p = ls.pointAt(ls.nearestPoint(dragger->point + Geom::Point(x,y)));
Geom::Point displacement = p - dragger->point;
for (GSList const* i = moving; i != NULL; i = i->next) {
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 8c4ba5695..54451aba4 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -32,7 +32,10 @@
# define HAS_PROC_SELF_EXE //to get path of executable
#else
-#define _WIN32_IE 0x0400
+#if !defined(_WIN32_IE) || (_WIN32_IE < 0x0400)
+# undef _WIN32_IE
+# define _WIN32_IE 0x0400
+#endif
//#define HAS_SHGetSpecialFolderPath
#define HAS_SHGetSpecialFolderLocation
#define HAS_GetModuleFileName
diff --git a/src/libcroco/cr-om-parser.c b/src/libcroco/cr-om-parser.c
index ea622e35c..c1acb855c 100644
--- a/src/libcroco/cr-om-parser.c
+++ b/src/libcroco/cr-om-parser.c
@@ -39,6 +39,9 @@ struct _CROMParserPriv {
#define PRIVATE(a_this) ((a_this)->priv)
+// Unfortunately, C does not allow unnamed function arguments, so use this macro instead...
+#define UNUSED(x) (void)(x)
+
/*
*Forward declaration of a type defined later
*in this file.
@@ -207,6 +210,8 @@ static void
start_font_face (CRDocHandler * a_this,
CRParsingLocation *a_location)
{
+ UNUSED(a_location);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -302,6 +307,8 @@ static void
charset (CRDocHandler * a_this, CRString * a_charset,
CRParsingLocation *a_location)
{
+ UNUSED(a_location);
+
enum CRStatus status = CR_OK;
CRStatement *stmt = NULL,
*stmt2 = NULL;
@@ -340,6 +347,8 @@ start_page (CRDocHandler * a_this,
CRString * a_pseudo,
CRParsingLocation *a_location)
{
+ UNUSED(a_location);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -381,6 +390,9 @@ end_page (CRDocHandler * a_this,
CRString * a_page,
CRString * a_pseudo_page)
{
+ UNUSED(a_page);
+ UNUSED(a_pseudo_page);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -407,8 +419,6 @@ end_page (CRDocHandler * a_this,
cr_statement_destroy (ctxt->cur_stmt);
ctxt->cur_stmt = NULL;
}
- a_page = NULL; /*keep compiler happy */
- a_pseudo_page = NULL; /*keep compiler happy */
}
static void
@@ -416,6 +426,8 @@ start_media (CRDocHandler * a_this,
GList * a_media_list,
CRParsingLocation *a_location)
{
+ UNUSED(a_location);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -444,6 +456,8 @@ start_media (CRDocHandler * a_this,
static void
end_media (CRDocHandler * a_this, GList * a_media_list)
{
+ UNUSED(a_media_list);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -470,7 +484,6 @@ end_media (CRDocHandler * a_this, GList * a_media_list)
ctxt->cur_stmt = NULL ;
ctxt->cur_media_stmt = NULL ;
- a_media_list = NULL;
}
static void
@@ -480,6 +493,9 @@ import_style (CRDocHandler * a_this,
CRString * a_uri_default_ns,
CRParsingLocation *a_location)
{
+ UNUSED(a_uri_default_ns);
+ UNUSED(a_location);
+
enum CRStatus status = CR_OK;
CRString *uri = NULL;
CRStatement *stmt = NULL,
@@ -530,7 +546,6 @@ import_style (CRDocHandler * a_this,
cr_statement_destroy (stmt);
stmt = NULL;
}
- a_uri_default_ns = NULL; /*keep compiler happy */
}
static void
@@ -557,6 +572,8 @@ start_selector (CRDocHandler * a_this, CRSelector * a_selector_list)
static void
end_selector (CRDocHandler * a_this, CRSelector * a_selector_list)
{
+ UNUSED(a_selector_list);
+
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
ParsingContext **ctxtptr = NULL;
@@ -604,7 +621,6 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list)
}
}
- a_selector_list = NULL; /*keep compiler happy */
}
static void
diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c
index 41d3eab5a..69b521496 100644
--- a/src/libcroco/cr-parser.c
+++ b/src/libcroco/cr-parser.c
@@ -78,7 +78,7 @@ typedef struct _CRParserError CRParserError;
*parsing routines.
*/
struct _CRParserError {
- guchar *msg;
+ gchar *msg;
enum CRStatus status;
glong line;
glong column;
@@ -374,11 +374,11 @@ static enum CRStatus cr_parser_parse_simple_selector (CRParser * a_this,
static enum CRStatus cr_parser_parse_simple_sels (CRParser * a_this,
CRSimpleSel ** a_sel);
-static CRParserError *cr_parser_error_new (const guchar * a_msg,
+static CRParserError *cr_parser_error_new (const gchar * a_msg,
enum CRStatus);
static void cr_parser_error_set_msg (CRParserError * a_this,
- const guchar * a_msg);
+ const gchar * a_msg);
static void cr_parser_error_dump (CRParserError * a_this);
@@ -392,7 +392,7 @@ static void
cr_parser_error_destroy (CRParserError * a_this);
static enum CRStatus cr_parser_push_error (CRParser * a_this,
- const guchar * a_msg,
+ const gchar * a_msg,
enum CRStatus a_status);
static enum CRStatus cr_parser_dump_err_stack (CRParser * a_this,
@@ -411,7 +411,7 @@ static enum CRStatus
*@return the newly built instance of #CRParserError.
*/
static CRParserError *
-cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status)
+cr_parser_error_new (const gchar * a_msg, enum CRStatus a_status)
{
CRParserError *result = NULL;
@@ -436,7 +436,7 @@ cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status)
*@param a_msg the new message.
*/
static void
-cr_parser_error_set_msg (CRParserError * a_this, const guchar * a_msg)
+cr_parser_error_set_msg (CRParserError * a_this, const gchar * a_msg)
{
g_return_if_fail (a_this);
@@ -515,7 +515,7 @@ cr_parser_error_destroy (CRParserError * a_this)
*/
static enum CRStatus
cr_parser_push_error (CRParser * a_this,
- const guchar * a_msg, enum CRStatus a_status)
+ const gchar * a_msg, enum CRStatus a_status)
{
enum CRStatus status = CR_OK;
@@ -2430,14 +2430,14 @@ cr_parser_parse_stylesheet (CRParser * a_this)
import_string,
NULL, &location) ;
- if ((PRIVATE (a_this)->sac_handler->resolve_import == TRUE)) {
+ if (PRIVATE (a_this)->sac_handler->resolve_import == TRUE) {
/*
*TODO: resolve the
*import rule.
*/
}
- if ((PRIVATE (a_this)->sac_handler->import_style_result)) {
+ if (PRIVATE (a_this)->sac_handler->import_style_result) {
PRIVATE (a_this)->sac_handler->import_style_result
(PRIVATE (a_this)->sac_handler,
media_list, import_string,
diff --git a/src/libgdl/gdl-dock-item-button-image.c b/src/libgdl/gdl-dock-item-button-image.c
index 31613a898..77cfe5d6c 100644
--- a/src/libgdl/gdl-dock-item-button-image.c
+++ b/src/libgdl/gdl-dock-item-button-image.c
@@ -135,8 +135,8 @@ static void
gdl_dock_item_button_image_class_init (
GdlDockItemButtonImageClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+ //GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ //GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
widget_class->expose_event =
diff --git a/src/libgdl/gdl-dock-item-grip.c b/src/libgdl/gdl-dock-item-grip.c
index 2c3ec061e..d23eb7f98 100644
--- a/src/libgdl/gdl-dock-item-grip.c
+++ b/src/libgdl/gdl-dock-item-grip.c
@@ -536,10 +536,9 @@ gdl_dock_item_grip_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GdlDockItemGrip *grip;
- GtkRequisition close_requisition = { 0, };
- GtkRequisition iconify_requisition = { 0, };
+ GtkRequisition close_requisition = { 0, 0 };
+ GtkRequisition iconify_requisition = { 0, 0 };
GtkAllocation child_allocation;
- GdkRectangle label_area;
guint border_width;
g_return_if_fail (GDL_IS_DOCK_ITEM_GRIP (widget));
diff --git a/src/libgdl/gdl-dock-object.c b/src/libgdl/gdl-dock-object.c
index a362d277a..4092ecc9f 100644
--- a/src/libgdl/gdl-dock-object.c
+++ b/src/libgdl/gdl-dock-object.c
@@ -869,7 +869,7 @@ gdl_dock_param_get_type (void)
static GType our_type = 0;
if (our_type == 0) {
- GTypeInfo tinfo = { 0, };
+ GTypeInfo tinfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
our_type = g_type_register_static (G_TYPE_STRING, "GdlDockParam", &tinfo, 0);
/* register known transform functions */
diff --git a/src/libgdl/gdl-dock-paned.c b/src/libgdl/gdl-dock-paned.c
index 42212d489..5b4561ef3 100644
--- a/src/libgdl/gdl-dock-paned.c
+++ b/src/libgdl/gdl-dock-paned.c
@@ -436,20 +436,20 @@ gdl_dock_paned_dock_request (GdlDockObject *object,
my_request.target = object;
/* See if it's in the border_width band. */
- if (rel_x < bw) {
+ if (rel_x < (gint)bw) {
my_request.position = GDL_DOCK_LEFT;
my_request.rect.width *= SPLIT_RATIO;
divider = other.width;
- } else if (rel_x > alloc.width - bw) {
+ } else if (rel_x > alloc.width - (gint)bw) {
my_request.position = GDL_DOCK_RIGHT;
my_request.rect.x += my_request.rect.width * (1 - SPLIT_RATIO);
my_request.rect.width *= SPLIT_RATIO;
divider = MAX (0, my.width - other.width);
- } else if (rel_y < bw) {
+ } else if (rel_y < (gint)bw) {
my_request.position = GDL_DOCK_TOP;
my_request.rect.height *= SPLIT_RATIO;
divider = other.height;
- } else if (rel_y > alloc.height - bw) {
+ } else if (rel_y > alloc.height - (gint)bw) {
my_request.position = GDL_DOCK_BOTTOM;
my_request.rect.y += my_request.rect.height * (1 - SPLIT_RATIO);
my_request.rect.height *= SPLIT_RATIO;
diff --git a/src/libgdl/gdl-dock.c b/src/libgdl/gdl-dock.c
index 6225864f0..c87468e5c 100644
--- a/src/libgdl/gdl-dock.c
+++ b/src/libgdl/gdl-dock.c
@@ -311,8 +311,6 @@ gdl_dock_constructor (GType type,
}
if (dock->_priv->floating) {
- GdlDockObject *controller;
-
/* create floating window for this dock */
dock->_priv->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_set_data (G_OBJECT (dock->_priv->window), "dock", dock);
@@ -832,17 +830,17 @@ gdl_dock_dock_request (GdlDockObject *object,
my_request.target = dock->root;
/* See if it's in the border_width band. */
- if (rel_x < bw) {
+ if (rel_x < (gint)bw) {
my_request.position = GDL_DOCK_LEFT;
my_request.rect.width *= SPLIT_RATIO;
- } else if (rel_x > alloc.width - bw) {
+ } else if (rel_x > alloc.width - (gint)bw) {
my_request.position = GDL_DOCK_RIGHT;
my_request.rect.x += my_request.rect.width * (1 - SPLIT_RATIO);
my_request.rect.width *= SPLIT_RATIO;
- } else if (rel_y < bw) {
+ } else if (rel_y < (gint)bw) {
my_request.position = GDL_DOCK_TOP;
my_request.rect.height *= SPLIT_RATIO;
- } else if (rel_y > alloc.height - bw) {
+ } else if (rel_y > alloc.height - (gint)bw) {
my_request.position = GDL_DOCK_BOTTOM;
my_request.rect.y += my_request.rect.height * (1 - SPLIT_RATIO);
my_request.rect.height *= SPLIT_RATIO;
@@ -1215,7 +1213,6 @@ gdl_dock_add_item (GdlDock *dock,
/* Non-floating item. */
if (dock->root) {
GdlDockPlacement local_placement;
- GtkRequisition preferred_size;
best_dock_item =
gdl_dock_find_best_placement_item (GDL_DOCK_ITEM (dock->root),
diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c
index 780438886..53a4b1989 100644
--- a/src/libgdl/gdl-switcher.c
+++ b/src/libgdl/gdl-switcher.c
@@ -255,12 +255,12 @@ button_toggled_callback (GtkToggleButton *toggle_button,
static int
layout_buttons (GdlSwitcher *switcher)
{
- GtkRequisition client_requisition = {0,};
+ GtkRequisition client_requisition = {0,0};
GtkAllocation allocation;
GdlSwitcherStyle switcher_style;
gboolean icons_only;
int num_btns = g_slist_length (switcher->priv->buttons);
- int btns_per_row;
+ unsigned int btns_per_row;
GSList **rows, *p;
Button *button;
int row_number;
@@ -790,7 +790,6 @@ gdl_switcher_add_button (GdlSwitcher *switcher, const gchar *label,
GdkPixbuf *pixbuf_icon,
gint switcher_id, GtkWidget* page)
{
- GtkWidget *event_box;
GtkWidget *button_widget;
GtkWidget *hbox;
GtkWidget *icon_widget;
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index f05b75aaa..7c0b4ffba 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -8,12 +8,14 @@
*
*/
-#define PANGO_ENABLE_ENGINE
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#ifndef PANGO_ENABLE_ENGINE
+#define PANGO_ENABLE_ENGINE
+#endif
+
#include <glibmm/i18n.h>
#include <pango/pangoft2.h>
#include "libnrtype/FontFactory.h"
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index a5b782344..20eca6740 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -8,12 +8,14 @@
*
*/
-#define PANGO_ENABLE_ENGINE
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#ifndef PANGO_ENABLE_ENGINE
+#define PANGO_ENABLE_ENGINE
+#endif
+
#include <ft2build.h>
#include FT_OUTLINE_H
#include FT_BBOX_H
diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp
index c7b0948e8..cb3e6f620 100644
--- a/src/libnrtype/Layout-TNG-Input.cpp
+++ b/src/libnrtype/Layout-TNG-Input.cpp
@@ -9,7 +9,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifndef PANGO_ENABLE_ENGINE
#define PANGO_ENABLE_ENGINE
+#endif
#include <gtk/gtk.h>
#include "Layout-TNG.h"
@@ -25,8 +31,10 @@ namespace Text {
void Layout::_clearInputObjects()
{
- for(std::vector<InputStreamItem*>::iterator it = _input_stream.begin() ; it != _input_stream.end() ; ++it)
+ for(std::vector<InputStreamItem*>::iterator it = _input_stream.begin() ; it != _input_stream.end() ; ++it) {
delete *it;
+ }
+
_input_stream.clear();
_input_wrap_shapes.clear();
}
diff --git a/src/libuemf/uemf_endian.c b/src/libuemf/uemf_endian.c
index f025416c3..f5dcf829a 100644
--- a/src/libuemf/uemf_endian.c
+++ b/src/libuemf/uemf_endian.c
@@ -36,6 +36,10 @@ extern "C" {
#include "uemf.h"
#include "uemf_endian.h"
+// Unfortunately, C does not allow unnamed function arguments, so use this macro instead...
+#define UNUSED(x) (void)(x)
+
+
// hide almost everuything in here from Doxygen
//! \cond
@@ -425,7 +429,8 @@ by end user code and to further that end prototypes are NOT provided and they ar
// all core*_swap call this, U_EMRSETMARGN_swap and some others all it directly
// numbered as core5 to be consistent with uemf.c, but must appear before the others as there is no prototype
void core5_swap(char *record, int torev){
- torev = torev; // shuts up compiler warnings about unused parameters
+ UNUSED(torev);
+
PU_ENHMETARECORD pEMR = (PU_ENHMETARECORD)(record);
U_swap4(pEMR,2); // iType nSize
}
diff --git a/src/libuemf/uemf_utf.c b/src/libuemf/uemf_utf.c
index bce60af4d..0c07148a4 100644
--- a/src/libuemf/uemf_utf.c
+++ b/src/libuemf/uemf_utf.c
@@ -49,11 +49,14 @@ void U_swap2(void *ul, unsigned int count);
on another funky system this code may need to be modified, or define ICONV_CAST
on the compile line(but it may be tricky).
*/
+#if _LIBICONV_VERSION == 0x0109
+# define ICONV_CAST (const char **)
+#endif // _LIBICONV_VERSION 0x0109
#ifdef SOL8
-#define ICONV_CAST (const char **)
+# define ICONV_CAST (const char **)
#endif //SOL8
#if !defined(ICONV_CAST)
-#define ICONV_CAST (char **)
+# define ICONV_CAST (char **)
#endif //ICONV_CAST
/** \endcond */
diff --git a/src/libuemf/uwmf_endian.c b/src/libuemf/uwmf_endian.c
index 6caa24d8f..5fbb450dc 100644
--- a/src/libuemf/uwmf_endian.c
+++ b/src/libuemf/uwmf_endian.c
@@ -24,6 +24,8 @@ extern "C" {
#include "uwmf.h"
#include "uwmf_endian.h"
+#define UNUSED(x) (void)(x)
+
// hide almost everything in this file from Doxygen
//! \cond
/* Prototypes for functions used here and defined in uemf_endian.c, but which are not supposed
@@ -282,7 +284,7 @@ by end user code and to further that end prototypes are NOT provided and they ar
/* Size16 EVERY record type should call this, directly or indirectly*/
void U_WMRCORE_SIZE16_swap(char *record, int torev){
- torev = torev; // shuts up compiler warnings about unused parameters
+ UNUSED(torev);
U_swap4(record, 1); /* Size16_4 is at offset 0 in U_METARECORD */
}
@@ -307,7 +309,7 @@ void U_WMRCORE_U16_N16_swap(char *record, int torev){
/* all records that specify palette objects */
void U_WMRCORE_PALETTE_swap(char *record, int torev){
- torev = torev; // shuts up compiler warnings about unused parameters
+ UNUSED(torev);
U_WMRCORE_SIZE16_swap(record, torev);
palette_swap(record + offsetof(U_WMRANIMATEPALETTE,Palette));
}
@@ -700,7 +702,7 @@ void U_WMRDIBCREATEPATTERNBRUSH_swap(char *record, int torev){
}
void U_WMRSTRETCHDIB_swap(char *record, int torev){
- torev = torev;
+ UNUSED(torev);
U_WMRCORE_U32_N16_swap(record,9,torev);
dibheader_swap(record + offsetof(U_WMRSTRETCHDIB,dib), torev);
}
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp
index acf8ab6a5..90b01aaa4 100644
--- a/src/live_effects/lpe-powerstroke.cpp
+++ b/src/live_effects/lpe-powerstroke.cpp
@@ -305,7 +305,6 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise<Geom::D2<Geom::
Geom::Piecewise<Geom::SBasis> const & y, // width path
LineJoinType jointype,
double miter_limit,
- bool /*forward_direction*/,
double tol=Geom::EPSILON)
{
/* per definition, each discontinuity should be fixed with a join-ending, as defined by linejoin_type
@@ -608,7 +607,7 @@ LPEPowerStroke::doEffect_path (std::vector<Geom::Path> const & path_in)
Piecewise<D2<SBasis> > pwd2_out = compose(pwd2_in,x) + y*compose(n,x);
Piecewise<D2<SBasis> > mirrorpath = reverse(compose(pwd2_in,x) - y*compose(n,x));
- Geom::Path fixed_path = path_from_piecewise_fix_cusps( pwd2_out, y, jointype, miter_limit, LPE_CONVERSION_TOLERANCE);
+ Geom::Path fixed_path = path_from_piecewise_fix_cusps( pwd2_out, y, jointype, miter_limit, LPE_CONVERSION_TOLERANCE);
Geom::Path fixed_mirrorpath = path_from_piecewise_fix_cusps( mirrorpath, reverse(y), jointype, miter_limit, LPE_CONVERSION_TOLERANCE);
if (path_in[0].closed()) {
diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp
index b5ee0a597..d10ed0f0d 100644
--- a/src/ui/tool/control-point-selection.cpp
+++ b/src/ui/tool/control-point-selection.cpp
@@ -194,6 +194,8 @@ void ControlPointSelection::align(Geom::Dim2 axis)
bound.unionWith(Geom::OptInterval((*i)->position()[d]));
}
+ if (!bound) { return; }
+
double new_coord = bound->middle();
for (iterator i = _points.begin(); i != _points.end(); ++i) {
Geom::Point pos = (*i)->position();
@@ -220,6 +222,8 @@ void ControlPointSelection::distribute(Geom::Dim2 d)
bound.unionWith(Geom::OptInterval(pos[d]));
}
+ if (!bound) { return; }
+
// now we iterate over the multimap and set aligned positions.
double step = size() == 1 ? 0 : bound->extent() / (size() - 1);
double start = bound->min();
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index 73460a313..4824e13fb 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -1351,6 +1351,7 @@ Handle *Node::handleToward(Node *to)
return back();
}
g_error("Node::handleToward(): second node is not adjacent!");
+ return NULL;
}
Node *Node::nodeToward(Handle *dir)
@@ -1362,6 +1363,7 @@ Node *Node::nodeToward(Handle *dir)
return _prev();
}
g_error("Node::nodeToward(): handle is not a child of this node!");
+ return NULL;
}
Handle *Node::handleAwayFrom(Node *to)
@@ -1373,6 +1375,7 @@ Handle *Node::handleAwayFrom(Node *to)
return front();
}
g_error("Node::handleAwayFrom(): second node is not adjacent!");
+ return NULL;
}
Node *Node::nodeAwayFrom(Handle *h)
@@ -1384,6 +1387,7 @@ Node *Node::nodeAwayFrom(Handle *h)
return _next();
}
g_error("Node::nodeAwayFrom(): handle is not a child of this node!");
+ return NULL;
}
Glib::ustring Node::_getTip(unsigned state) const
diff --git a/src/winmain.cpp b/src/winmain.cpp
index 607660740..5120e44e0 100644
--- a/src/winmain.cpp
+++ b/src/winmain.cpp
@@ -11,7 +11,12 @@
#include <stdio.h>
#include <io.h>
#include <conio.h>
-#define _WIN32_WINNT 0x0501
+
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501
+#endif
+
#include <windows.h>
extern int main (int argc, char **argv);