From: joncruz Date: Sat, 1 Dec 2007 20:03:42 +0000 (+0000) Subject: Warning cleanup (including OFFSET_OF warning) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b9c9c042e0c25210afcc1068a3771dabe6d7b854;p=inkscape.git Warning cleanup (including OFFSET_OF warning) --- diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index bb710a021..f1a991434 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -83,7 +83,7 @@ sp_canvas_arena_class_init (SPCanvasArenaClass *klass) signals[ARENA_EVENT] = gtk_signal_new ("arena_event", GTK_RUN_LAST, GTK_CLASS_TYPE(object_class), - GTK_SIGNAL_OFFSET (SPCanvasArenaClass, arena_event), + ((glong)((guint8*)&(klass->arena_event) - (guint8*)klass)), sp_marshal_INT__POINTER_POINTER, GTK_TYPE_INT, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER); diff --git a/src/display/canvas-arena.h b/src/display/canvas-arena.h index f39ff1274..5e6188eee 100644 --- a/src/display/canvas-arena.h +++ b/src/display/canvas-arena.h @@ -1,5 +1,5 @@ -#ifndef __SP_CANVAS_ARENA_H__ -#define __SP_CANVAS_ARENA_H__ +#ifndef SEEN_SP_CANVAS_ARENA_H +#define SEEN_SP_CANVAS_ARENA_H /* * RGBA display list system for inkscape @@ -13,8 +13,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -struct SPCanvasArena; -struct SPCanvasArenaClass; +#include "../display/sp-canvas.h" +#include "nr-arena-item.h" + +G_BEGIN_DECLS #define SP_TYPE_CANVAS_ARENA (sp_canvas_arena_get_type ()) #define SP_CANVAS_ARENA(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVAS_ARENA, SPCanvasArena)) @@ -22,10 +24,10 @@ struct SPCanvasArenaClass; #define SP_IS_CANVAS_ARENA(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVAS_ARENA)) #define SP_IS_CANVAS_ARENA_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CANVAS_ARENA)) -#include "../display/sp-canvas.h" -#include "nr-arena-item.h" +typedef struct _SPCanvasArena SPCanvasArena; +typedef struct _SPCanvasArenaClass SPCanvasArenaClass; -struct SPCanvasArena { +struct _SPCanvasArena { SPCanvasItem item; guint cursor : 1; @@ -42,7 +44,7 @@ struct SPCanvasArena { gdouble delta; }; -struct SPCanvasArenaClass { +struct _SPCanvasArenaClass { SPCanvasItemClass parent_class; gint (* arena_event) (SPCanvasArena *carena, NRArenaItem *item, GdkEvent *event); @@ -55,4 +57,6 @@ void sp_canvas_arena_set_sticky (SPCanvasArena *ca, gboolean sticky); void sp_canvas_arena_render_pixblock (SPCanvasArena *ca, NRPixBlock *pb); -#endif +G_END_DECLS + +#endif // SEEN_SP_CANVAS_ARENA_H diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 3d291f42a..a2443ca17 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -158,7 +158,7 @@ grid_canvasitem_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i }; CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc, GridType type) - : namelabel("", Gtk::ALIGN_CENTER), gridtype(type), visible(true), snap_enabled(true) + : namelabel("", Gtk::ALIGN_CENTER), visible(true), snap_enabled(true), gridtype(type) { repr = in_repr; doc = in_doc; diff --git a/src/display/display-forward.h b/src/display/display-forward.h index 2af6f2c44..a28b7d03a 100644 --- a/src/display/display-forward.h +++ b/src/display/display-forward.h @@ -6,7 +6,7 @@ struct SPCanvas; struct SPCanvasClass; struct SPCanvasItem; -struct SPCanvasItemClass; +typedef struct _SPCanvasItemClass SPCanvasItemClass; struct SPCanvasGroup; struct SPCanvasGroupClass; struct SPCurve; diff --git a/src/display/nr-arena.h b/src/display/nr-arena.h index 89cb58f39..b6d5a4539 100644 --- a/src/display/nr-arena.h +++ b/src/display/nr-arena.h @@ -13,6 +13,14 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + +G_BEGIN_DECLS + +typedef struct _SPCanvasArena SPCanvasArena; + +G_END_DECLS + #define NR_TYPE_ARENA (nr_arena_get_type ()) #define NR_ARENA(o) (NR_CHECK_INSTANCE_CAST ((o), NR_TYPE_ARENA, NRArena)) #define NR_IS_ARENA(o) (NR_CHECK_INSTANCE_TYPE ((o), NR_TYPE_ARENA)) @@ -36,8 +44,6 @@ enum { RENDERMODE_OUTLINE }; -struct SPCanvasArena; - struct NRArena : public NRActiveObject { static NRArena *create() { return reinterpret_cast(nr_object_new(NR_TYPE_ARENA)); diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 2af12b6c3..efc4fd112 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -147,7 +147,7 @@ sp_canvas_item_class_init (SPCanvasItemClass *klass) item_signals[ITEM_EVENT] = g_signal_new ("event", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (SPCanvasItemClass, event), + ((glong)((guint8*)&(klass->event) - (guint8*)klass)), NULL, NULL, sp_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index 4b6d7b3b8..d8cc3157d 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -1,5 +1,5 @@ -#ifndef __SP_CANVAS_H__ -#define __SP_CANVAS_H__ +#ifndef SEEN_SP_CANVAS_H +#define SEEN_SP_CANVAS_H /** \file * SPCanvas, SPCanvasBuf, and SPCanvasItem. @@ -39,8 +39,11 @@ #include #include +G_BEGIN_DECLS + struct SPCanvas; struct SPCanvasGroup; +typedef struct _SPCanvasItemClass SPCanvasItemClass; enum { SP_CANVAS_UPDATE_REQUESTED = 1 << 0, @@ -77,7 +80,7 @@ struct SPCanvasItem : public GtkObject { /** * The vtable of an SPCanvasItem. */ -struct SPCanvasItemClass : public GtkObjectClass { +struct _SPCanvasItemClass : public GtkObjectClass { void (* update) (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags); void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); @@ -88,6 +91,8 @@ struct SPCanvasItemClass : public GtkObjectClass { SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...); +G_END_DECLS + #define sp_canvas_item_set gtk_object_set void sp_canvas_item_affine_absolute(SPCanvasItem *item, NR::Matrix const &aff); @@ -198,15 +203,15 @@ void sp_canvas_request_redraw(SPCanvas *canvas, int x1, int y1, int x2, int y2); void sp_canvas_force_full_redraw_after_interruptions(SPCanvas *canvas, unsigned int count); void sp_canvas_end_forced_full_redraws(SPCanvas *canvas); +bool sp_canvas_world_pt_inside_window(SPCanvas const *canvas, NR::Point const &world); + void sp_canvas_window_to_world(SPCanvas const *canvas, double winx, double winy, double *worldx, double *worldy); void sp_canvas_world_to_window(SPCanvas const *canvas, double worldx, double worldy, double *winx, double *winy); NR::Point sp_canvas_window_to_world(SPCanvas const *canvas, NR::Point const win); NR::Point sp_canvas_world_to_window(SPCanvas const *canvas, NR::Point const world); -bool sp_canvas_world_pt_inside_window(SPCanvas const *canvas, NR::Point const &world); - -#endif +#endif // SEEN_SP_CANVAS_H /* Local Variables: diff --git a/src/extension/internal/ps-out.cpp b/src/extension/internal/ps-out.cpp index 3bb6a6ff3..dc60af4dd 100644 --- a/src/extension/internal/ps-out.cpp +++ b/src/extension/internal/ps-out.cpp @@ -24,12 +24,12 @@ namespace Extension { namespace Internal { bool -PsOutput::check (Inkscape::Extension::Extension * module) +PsOutput::check( Inkscape::Extension::Extension * /*module*/ ) { - if (NULL == Inkscape::Extension::db.get(SP_MODULE_KEY_PRINT_PS)) - return FALSE; + if (NULL == Inkscape::Extension::db.get(SP_MODULE_KEY_PRINT_PS)) + return FALSE; - return TRUE; + return TRUE; } /** diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index 35464b374..fedde86a2 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -628,7 +628,7 @@ PrintPS::finish(Inkscape::Extension::Print *mod) } unsigned int -PrintPS::bind(Inkscape::Extension::Print *mod, NRMatrix const *transform, float opacity) +PrintPS::bind(Inkscape::Extension::Print */*mod*/, NRMatrix const *transform, float /*opacity*/) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. if (_bitmap) return 0; @@ -645,7 +645,7 @@ PrintPS::bind(Inkscape::Extension::Print *mod, NRMatrix const *transform, float } unsigned int -PrintPS::release(Inkscape::Extension::Print *mod) +PrintPS::release(Inkscape::Extension::Print */*mod*/) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. if (_bitmap) return 0; @@ -654,7 +654,7 @@ PrintPS::release(Inkscape::Extension::Print *mod) } unsigned int -PrintPS::comment(Inkscape::Extension::Print *mod, char const *comment) +PrintPS::comment(Inkscape::Extension::Print */*mod*/, char const *comment) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. if (_bitmap) return 0; diff --git a/src/extension/parambool.cpp b/src/extension/parambool.cpp index 2aa480688..72e32ff25 100644 --- a/src/extension/parambool.cpp +++ b/src/extension/parambool.cpp @@ -52,7 +52,7 @@ ParamBool::ParamBool (const gchar * name, const gchar * guitext, const gchar * d and \c pref_name() are used. */ bool -ParamBool::set (bool in, SPDocument * doc, Inkscape::XML::Node * node) +ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; diff --git a/src/extension/parambool.h b/src/extension/parambool.h index 56edc70a7..a6d0c1b7b 100644 --- a/src/extension/parambool.h +++ b/src/extension/parambool.h @@ -23,7 +23,7 @@ private: public: ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - bool get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; } + bool get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } bool set (bool in, SPDocument * doc, Inkscape::XML::Node * node); Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); Glib::ustring * string (void); diff --git a/src/extension/paramcolor.cpp b/src/extension/paramcolor.cpp index d31dc907c..2a32086a8 100644 --- a/src/extension/paramcolor.cpp +++ b/src/extension/paramcolor.cpp @@ -29,18 +29,18 @@ namespace Inkscape { namespace Extension { - + void sp_color_param_changed(SPColorSelector *csel, GObject *cp); - + /** \brief Free the allocated data. */ ParamColor::~ParamColor(void) { - + } - -guint32 -ParamColor::set (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) + +guint32 +ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -65,7 +65,7 @@ ParamColor::ParamColor (const gchar * name, const gchar * guitext, const gchar * if (paramval != NULL) defaulthex = paramval; - + _value = atoi(defaulthex); return; @@ -77,17 +77,17 @@ ParamColor::string (void) { char str[16]; sprintf(str, "%i", _value); - + return new Glib::ustring(str); } Gtk::Widget * -ParamColor::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamColor::get_widget( SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) { _changeSignal = new sigc::signal(*changeSignal); Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); SPColorSelector* spColorSelector = (SPColorSelector*)sp_color_selector_new(SP_TYPE_COLOR_NOTEBOOK); - + ColorSelector* colorSelector = spColorSelector->base; if (_value < 1) { _value = 0xFF000000; @@ -101,7 +101,7 @@ ParamColor::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::sign gtk_widget_show(GTK_WIDGET(spColorSelector)); hbox->show(); - + return dynamic_cast(hbox); } @@ -113,7 +113,7 @@ sp_color_param_changed(SPColorSelector *csel, GObject *obj) ParamColor* ptr = (ParamColor*)obj; ptr->set(color.toRGBA32( alpha ), NULL, NULL); - + ptr->_changeSignal->emit(); } diff --git a/src/extension/paramcolor.h b/src/extension/paramcolor.h index b30c3be7a..2d5f3e2e4 100644 --- a/src/extension/paramcolor.h +++ b/src/extension/paramcolor.h @@ -23,7 +23,7 @@ public: ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamColor(void); /** \brief Returns \c _value, with a \i const to protect it. */ - guint32 get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; } + guint32 get( const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } guint32 set (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); Glib::ustring * string (void); diff --git a/src/io/sys.cpp b/src/io/sys.cpp index 89afe9fb4..a1e693a24 100644 --- a/src/io/sys.cpp +++ b/src/io/sys.cpp @@ -96,6 +96,9 @@ void Inkscape::IO::dump_fopen_call( char const *utf8name, char const *id ) } } g_message( "fopen call %s for [%s]", id, str.data() ); +#else + (void)utf8name; + (void)id; #endif } diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 1e868191d..cad344e63 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -39,7 +39,7 @@ static const int PANEL_SETTING_NEXTFREE = 3; * Construct a Panel */ -Panel::Panel(Glib::ustring const &label, gchar const *prefs_path, +Panel::Panel(Glib::ustring const &label, gchar const *prefs_path, int verb_num, Glib::ustring const &apply_label, bool menu_desired) : _prefs_path(prefs_path), @@ -395,7 +395,7 @@ void Panel::_regItem(Gtk::MenuItem* item, int group, int id) item->show(); } -void Panel::_handleAction(int set_id, int item_id) +void Panel::_handleAction(int /*set_id*/, int /*item_id*/) { // for subclasses to override } @@ -406,7 +406,7 @@ Panel::_apply() g_warning("Apply button clicked for panel [Panel::_apply()]"); } -Gtk::Button * +Gtk::Button * Panel::addResponseButton(const Glib::ustring &button_text, int response_id) { Gtk::Button *button = new Gtk::Button(button_text);