Commit bacbee23 authored by Gaël Bonithon's avatar Gaël Bonithon
Browse files

Fix compilation warnings

parent cfa34a99
Pipeline #6307 passed with stages
in 1 minute and 19 seconds
......@@ -29,10 +29,6 @@ struct _RsttoAppMenuItemPrivate
static GtkWidgetClass *parent_class = NULL;
static void
rstto_app_menu_item_init (RsttoAppMenuItem *);
static void
rstto_app_menu_item_class_init (RsttoAppMenuItemClass *);
static void
rstto_app_menu_item_finalize (GObject *object);
......
......@@ -20,7 +20,7 @@
#include <gio/gio.h>
#include <string.h>
#if HAVE_MAGIC_H
#ifdef HAVE_MAGIC_H
#include <magic.h>
#endif
......@@ -48,9 +48,13 @@ static gint
rstto_file_signals[RSTTO_FILE_SIGNAL_COUNT];
static void
rstto_file_init (GObject *);
rstto_file_init (
GTypeInstance *instance,
gpointer g_class);
static void
rstto_file_class_init (GObjectClass *);
rstto_file_class_init (
gpointer g_class,
gpointer class_data);
static void
rstto_file_dispose (GObject *object);
......@@ -89,14 +93,14 @@ rstto_file_get_type (void)
static const GTypeInfo rstto_file_info =
{
sizeof (RsttoFileClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_file_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_file_class_init,
NULL,
NULL,
sizeof (RsttoFile),
0,
(GInstanceInitFunc) rstto_file_init,
rstto_file_init,
NULL
};
......@@ -129,20 +133,24 @@ struct _RsttoFilePriv
static void
rstto_file_init (GObject *object)
rstto_file_init (
GTypeInstance *instance,
gpointer g_class)
{
RsttoFile *r_file = RSTTO_FILE (object);
RsttoFile *r_file = RSTTO_FILE (instance);
r_file->priv = g_new0 (RsttoFilePriv, 1);
}
static void
rstto_file_class_init (GObjectClass *object_class)
rstto_file_class_init (
gpointer g_class,
gpointer class_data)
{
RsttoFileClass *file_class = RSTTO_FILE_CLASS (object_class);
GObjectClass *object_class = g_class;
parent_class = g_type_class_peek_parent (file_class);
parent_class = g_type_class_peek_parent (g_class);
object_class->dispose = rstto_file_dispose;
object_class->finalize = rstto_file_finalize;
......@@ -400,15 +408,15 @@ rstto_file_get_collate_key ( RsttoFile *r_file )
const gchar *
rstto_file_get_content_type ( RsttoFile *r_file )
{
const gchar *file_path, *content_type = NULL;
const gchar *content_type = NULL;
if ( NULL == r_file->priv->content_type )
{
#if HAVE_MAGIC_H
#ifdef HAVE_MAGIC_H
magic_t magic = magic_open (MAGIC_MIME_TYPE | MAGIC_SYMLINK);
if ( NULL != magic )
{
file_path = rstto_file_get_path (r_file);
const gchar *file_path = rstto_file_get_path (r_file);
if ( NULL != file_path && magic_load (magic, NULL) == 0 )
{
content_type = magic_file (magic, file_path);
......
......@@ -44,9 +44,13 @@ enum ColorStyle
static void
rstto_gnome_wallpaper_manager_init (GObject *);
rstto_gnome_wallpaper_manager_init (
GTypeInstance *instance,
gpointer g_class);
static void
rstto_gnome_wallpaper_manager_class_init (GObjectClass *);
rstto_gnome_wallpaper_manager_class_init (
gpointer g_class,
gpointer class_data);
static void
rstto_gnome_wallpaper_manager_dispose (GObject *object);
......@@ -165,8 +169,12 @@ rstto_gnome_wallpaper_manager_set (
}
static void
rstto_gnome_wallpaper_manager_iface_init (RsttoWallpaperManagerIface *iface)
rstto_gnome_wallpaper_manager_iface_init (
gpointer g_iface,
gpointer iface_data)
{
RsttoWallpaperManagerIface *iface = g_iface;
iface->configure_dialog_run = rstto_gnome_wallpaper_manager_configure_dialog_run;
iface->check_running = rstto_gnome_wallpaper_manager_check_running;
iface->set = rstto_gnome_wallpaper_manager_set;
......@@ -182,14 +190,14 @@ rstto_gnome_wallpaper_manager_get_type (void)
static const GTypeInfo rstto_gnome_wallpaper_manager_info =
{
sizeof (RsttoGnomeWallpaperManagerClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_gnome_wallpaper_manager_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_gnome_wallpaper_manager_class_init,
NULL,
NULL,
sizeof (RsttoGnomeWallpaperManager),
0,
(GInstanceInitFunc) rstto_gnome_wallpaper_manager_init,
rstto_gnome_wallpaper_manager_init,
NULL
};
......@@ -209,9 +217,11 @@ rstto_gnome_wallpaper_manager_get_type (void)
static void
rstto_gnome_wallpaper_manager_init (GObject *object)
rstto_gnome_wallpaper_manager_init (
GTypeInstance *instance,
gpointer g_class)
{
RsttoGnomeWallpaperManager *manager = RSTTO_GNOME_WALLPAPER_MANAGER (object);
RsttoGnomeWallpaperManager *manager = RSTTO_GNOME_WALLPAPER_MANAGER (instance);
GtkWidget *image_prop_grid = gtk_grid_new ();
GtkWidget *style_label = gtk_label_new (_("Style:"));
GtkWidget *vbox;
......@@ -310,9 +320,12 @@ rstto_gnome_wallpaper_manager_init (GObject *object)
static void
rstto_gnome_wallpaper_manager_class_init (GObjectClass *object_class)
rstto_gnome_wallpaper_manager_class_init (
gpointer g_class,
gpointer class_data)
{
RsttoGnomeWallpaperManagerClass *gnome_wallpaper_manager_class = RSTTO_GNOME_WALLPAPER_MANAGER_CLASS (object_class);
GObjectClass *object_class = g_class;
RsttoGnomeWallpaperManagerClass *gnome_wallpaper_manager_class = g_class;
parent_class = g_type_class_peek_parent (gnome_wallpaper_manager_class);
......
......@@ -873,7 +873,6 @@ rstto_icon_bar_draw (
cairo_t *cr)
{
RsttoIconBarItem *item;
GdkRectangle area;
RsttoIconBar *icon_bar = RSTTO_ICON_BAR (widget);
GList *lp;
/*RsttoFile *file;
......@@ -891,6 +890,8 @@ rstto_icon_bar_draw (
{
item = lp->data;
// TODO: fix me
/*GdkRectangle area;
if (icon_bar->priv->orientation == GTK_ORIENTATION_VERTICAL)
{
area.x = 0;
......@@ -905,8 +906,7 @@ rstto_icon_bar_draw (
area.width = icon_bar->priv->item_width;
area.height = icon_bar->priv->item_height;
// TODO: fix me
/*if (gdk_region_rect_in (expose->region, &area) != GDK_OVERLAP_RECTANGLE_OUT)
if (gdk_region_rect_in (expose->region, &area) != GDK_OVERLAP_RECTANGLE_OUT)
{
rstto_icon_bar_paint_item (icon_bar, item, &expose->area);*/
rstto_icon_bar_paint_item (icon_bar, item, cr);
......
......@@ -28,14 +28,22 @@
#include "settings.h"
static void
rstto_image_list_tree_model_init (GtkTreeModelIface *iface);
rstto_image_list_tree_model_init (
gpointer g_iface,
gpointer iface_data);
static void
rstto_image_list_tree_sortable_init(GtkTreeSortableIface *iface);
rstto_image_list_tree_sortable_init(
gpointer g_iface,
gpointer iface_data);
static void
rstto_image_list_init(RsttoImageList *);
rstto_image_list_init(
GTypeInstance *instance,
gpointer g_class);
static void
rstto_image_list_class_init(RsttoImageListClass *);
rstto_image_list_class_init(
gpointer g_class,
gpointer class_data);
static void
rstto_image_list_dispose(GObject *object);
......@@ -48,9 +56,13 @@ cb_file_monitor_changed (
gpointer user_data );
static void
rstto_image_list_iter_init(RsttoImageListIter *);
rstto_image_list_iter_init(
GTypeInstance *instance,
gpointer g_class);
static void
rstto_image_list_iter_class_init(RsttoImageListIterClass *);
rstto_image_list_iter_class_init(
gpointer g_class,
gpointer class_data);
static void
rstto_image_list_iter_dispose(GObject *object);
static RsttoImageListIter *
......@@ -241,13 +253,13 @@ rstto_image_list_get_type (void)
{
static const GInterfaceInfo tree_model_info =
{
(GInterfaceInitFunc) rstto_image_list_tree_model_init,
rstto_image_list_tree_model_init,
NULL,
NULL
};
static const GInterfaceInfo tree_sort_info =
{
(GInterfaceInitFunc) rstto_image_list_tree_sortable_init,
rstto_image_list_tree_sortable_init,
NULL,
NULL
};
......@@ -258,14 +270,14 @@ rstto_image_list_get_type (void)
static const GTypeInfo rstto_image_list_info =
{
sizeof (RsttoImageListClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_image_list_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_image_list_class_init,
NULL,
NULL,
sizeof (RsttoImageList),
0,
(GInstanceInitFunc) rstto_image_list_init,
rstto_image_list_init,
NULL
};
......@@ -281,8 +293,12 @@ rstto_image_list_get_type (void)
}
static void
rstto_image_list_tree_model_init (GtkTreeModelIface *iface)
rstto_image_list_tree_model_init (
gpointer g_iface,
gpointer iface_data)
{
GtkTreeModelIface *iface = g_iface;
iface->get_flags = image_list_model_get_flags;
iface->get_n_columns = image_list_model_get_n_columns;
iface->get_column_type = image_list_model_get_column_type;
......@@ -298,20 +314,27 @@ rstto_image_list_tree_model_init (GtkTreeModelIface *iface)
}
static void
rstto_image_list_tree_sortable_init(GtkTreeSortableIface *iface)
rstto_image_list_tree_sortable_init(
gpointer g_iface,
gpointer iface_data)
{
#if 0
#if 0
GtkTreeSortableIface *iface = g_iface;
iface->get_sort_column_id = sq_archive_store_get_sort_column_id;
iface->set_sort_column_id = sq_archive_store_set_sort_column_id;
iface->set_sort_func = sq_archive_store_set_sort_func; /*NOT SUPPORTED*/
iface->set_default_sort_func = sq_archive_store_set_default_sort_func; /*NOT SUPPORTED*/
iface->has_default_sort_func = sq_archive_store_has_default_sort_func;
#endif
#endif
}
static void
rstto_image_list_init(RsttoImageList *image_list)
rstto_image_list_init(
GTypeInstance *instance,
gpointer g_class)
{
RsttoImageList *image_list = RSTTO_IMAGE_LIST (instance);
image_list->priv = g_new0 (RsttoImageListPriv, 1);
image_list->priv->stamp = g_random_int();
......@@ -344,16 +367,18 @@ rstto_image_list_init(RsttoImageList *image_list)
}
static void
rstto_image_list_class_init(RsttoImageListClass *nav_class)
rstto_image_list_class_init(
gpointer g_class,
gpointer class_data)
{
GObjectClass *object_class = G_OBJECT_CLASS(nav_class);
GObjectClass *object_class = g_class;
parent_class = g_type_class_peek_parent(nav_class);
parent_class = g_type_class_peek_parent(g_class);
object_class->dispose = rstto_image_list_dispose;
rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_REMOVE_IMAGE] = g_signal_new("remove-image",
G_TYPE_FROM_CLASS(nav_class),
G_TYPE_FROM_CLASS(g_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0,
NULL,
......@@ -365,7 +390,7 @@ rstto_image_list_class_init(RsttoImageListClass *nav_class)
NULL);
rstto_image_list_signals[RSTTO_IMAGE_LIST_SIGNAL_REMOVE_ALL] = g_signal_new("remove-all",
G_TYPE_FROM_CLASS(nav_class),
G_TYPE_FROM_CLASS(g_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0,
NULL,
......@@ -942,14 +967,14 @@ rstto_image_list_iter_get_type (void)
static const GTypeInfo rstto_image_list_iter_info =
{
sizeof (RsttoImageListIterClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_image_list_iter_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_image_list_iter_class_init,
NULL,
NULL,
sizeof (RsttoImageListIter),
0,
(GInstanceInitFunc) rstto_image_list_iter_init,
rstto_image_list_iter_init,
NULL
};
......@@ -959,22 +984,26 @@ rstto_image_list_iter_get_type (void)
}
static void
rstto_image_list_iter_init (RsttoImageListIter *iter)
rstto_image_list_iter_init (
GTypeInstance *instance,
gpointer g_class)
{
iter->priv = g_new0 (RsttoImageListIterPriv, 1);
RSTTO_IMAGE_LIST_ITER (instance)->priv = g_new0 (RsttoImageListIterPriv, 1);
}
static void
rstto_image_list_iter_class_init(RsttoImageListIterClass *iter_class)
rstto_image_list_iter_class_init(
gpointer g_class,
gpointer class_data)
{
GObjectClass *object_class = G_OBJECT_CLASS(iter_class);
GObjectClass *object_class = g_class;
iter_parent_class = g_type_class_peek_parent(iter_class);
iter_parent_class = g_type_class_peek_parent(g_class);
object_class->dispose = rstto_image_list_iter_dispose;
rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE] = g_signal_new("prepare-change",
G_TYPE_FROM_CLASS(iter_class),
G_TYPE_FROM_CLASS(g_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0,
NULL,
......@@ -985,7 +1014,7 @@ rstto_image_list_iter_class_init(RsttoImageListIterClass *iter_class)
NULL);
rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED] = g_signal_new("changed",
G_TYPE_FROM_CLASS(iter_class),
G_TYPE_FROM_CLASS(g_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0,
NULL,
......
......@@ -168,10 +168,6 @@ paint_background_icon (
cairo_t *ctx );
static void
rstto_image_viewer_init (RsttoImageViewer *viewer);
static void
rstto_image_viewer_class_init(RsttoImageViewerClass *);
static void
rstto_image_viewer_dispose (GObject *object);
......@@ -2294,6 +2290,9 @@ rstto_scroll_event (GtkWidget *widget, GdkEventScroll *event)
case GDK_SCROLL_RIGHT:
scale = (invert_zoom_direction) ? viewer->priv->scale * 1.1 : viewer->priv->scale / 1.1;
break;
case GDK_SCROLL_SMOOTH:
/* TODO */
break;
}
/*
......@@ -2463,7 +2462,6 @@ rstto_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
if (viewer->priv->motion.x != viewer->priv->motion.current_x)
{
adjustment = viewer->hadjustment;
gint val = gtk_adjustment_get_value (adjustment);
gtk_adjustment_set_value (adjustment,
viewer->priv->motion.h_val + (viewer->priv->motion.x - viewer->priv->motion.current_x));
if ((gtk_adjustment_get_value (adjustment) + gtk_adjustment_get_page_size (adjustment)) >
......@@ -2482,7 +2480,6 @@ rstto_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
if (viewer->priv->motion.y != viewer->priv->motion.current_y)
{
adjustment = viewer->vadjustment;
gint val = gtk_adjustment_get_value (adjustment);
gtk_adjustment_set_value (adjustment,
viewer->priv->motion.v_val + (viewer->priv->motion.y - viewer->priv->motion.current_y));
if ((gtk_adjustment_get_value (adjustment) + gtk_adjustment_get_page_size (adjustment)) >
......
......@@ -135,9 +135,9 @@ enum
};
static void
rstto_main_window_init (RsttoMainWindow *);
rstto_main_window_init (GTypeInstance *instance, gpointer g_class);
static void
rstto_main_window_class_init(RsttoMainWindowClass *);
rstto_main_window_class_init(gpointer g_class, gpointer class_data);
static void
rstto_main_window_dispose(GObject *object);
......@@ -795,14 +795,14 @@ rstto_main_window_get_type (void)
static const GTypeInfo rstto_main_window_info =
{
sizeof (RsttoMainWindowClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_main_window_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_main_window_class_init,
NULL,
NULL,
sizeof (RsttoMainWindow),
0,
(GInstanceInitFunc) rstto_main_window_init,
rstto_main_window_init,
NULL
};
......@@ -816,8 +816,10 @@ rstto_main_window_get_type (void)
}
static void
rstto_main_window_init (RsttoMainWindow *window)
rstto_main_window_init (GTypeInstance *instance, gpointer g_class)
{
RsttoMainWindow *window = RSTTO_MAIN_WINDOW (instance);
GtkAccelGroup *accel_group;
GtkWidget *separator;
GtkWidget *main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
......@@ -1262,12 +1264,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
rstto_main_window_class_init(RsttoMainWindowClass *window_class)
rstto_main_window_class_init(gpointer g_class, gpointer class_data)
{
GObjectClass *object_class = (GObjectClass*)window_class;
GtkWidgetClass *widget_class = (GtkWidgetClass *)window_class;
GObjectClass *object_class = g_class;
GtkWidgetClass *widget_class = g_class;
parent_class = g_type_class_peek_parent(window_class);
parent_class = g_type_class_peek_parent(g_class);
object_class->dispose = rstto_main_window_dispose;
......@@ -2621,6 +2623,9 @@ cb_rstto_main_window_image_viewer_scroll_event (GtkWidget *widget, GdkEventScrol
case GDK_SCROLL_RIGHT:
rstto_image_list_iter_next (window->priv->iter);
break;
case GDK_SCROLL_SMOOTH:
/* TODO */
break;
}
ret = TRUE; /* don't call other callbacks */
}
......@@ -3700,6 +3705,7 @@ rstto_confirm_deletion(
const gchar *file_basename = rstto_file_get_display_name(file);
GtkWidget *dialog;
GtkWidget* dont_ask_checkbox = NULL;
gint response;
if ( to_trash )
{
......@@ -3729,7 +3735,7 @@ rstto_confirm_deletion(
gtk_widget_grab_focus(gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL));
}
int response = gtk_dialog_run( GTK_DIALOG( dialog ) );
response = gtk_dialog_run( GTK_DIALOG( dialog ) );
if ( to_trash && (response == GTK_RESPONSE_OK) )
{
dont_ask_trash = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(dont_ask_checkbox) );
......@@ -3761,6 +3767,7 @@ cb_rstto_main_window_delete (
gboolean success = FALSE;
gchar *prompt = NULL;
GError *error = NULL;
gint response;
if (file == NULL)
{
......@@ -3777,7 +3784,7 @@ cb_rstto_main_window_delete (
}
}
int response = rstto_confirm_deletion( window, file, !delete_file );
response = rstto_confirm_deletion( window, file, !delete_file );
if ( response == GTK_RESPONSE_OK )
{
g_object_ref (file);
......
......@@ -25,9 +25,13 @@
#include "mime_db.h"
static void
rstto_mime_db_init (GObject *);
rstto_mime_db_init (
GTypeInstance *instance,
gpointer g_class);
static void
rstto_mime_db_class_init (GObjectClass *);
rstto_mime_db_class_init (
gpointer g_class,
gpointer class_data);
static void
rstto_mime_db_dispose (GObject *object);
......@@ -66,14 +70,14 @@ rstto_mime_db_get_type (void)
static const GTypeInfo rstto_mime_db_info =
{
sizeof (RsttoMimeDBClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) rstto_mime_db_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
rstto_mime_db_class_init,
NULL,
NULL,
sizeof (RsttoMimeDB),
0,
(GInstanceInitFunc) rstto_mime_db_init,
rstto_mime_db_init,
NULL
};
......@@ -89,19 +93,23 @@ struct _RsttoMimeDBPriv
};
static void
rstto_mime_db_init (GObject *object)
rstto_mime_db_init (
GTypeInstance *instance,
gpointer g_class)
{
RsttoMimeDB *mime_db = RSTTO_MIME_DB (object);
RsttoMimeDB *mime_db = RSTTO_MIME_DB (instance);
mime_db->priv = g_new0 (RsttoMimeDBPriv, 1);
}
static void
rstto_mime_db_class_init (GObjectClass *object_class)
rstto_mime_db_class_init (
gpointer g_class,
gpointer class_data)
{
RsttoMimeDBClass *mime_db_class = RSTTO_MIME_DB_CLASS (object_class);
GObjectClass *object_class = g_class;
parent_class = g_type_class_peek_parent (mime_db_class);
parent_class = g_type_class_peek_parent (g_class);
object_class->dispose = rstto_mime_db_dispose;
object_class->finalize = rstto_mime_db_finalize;
......
......@@ -49,10 +49,10 @@ struct _RsttoMonitorChooserPriv
static GtkWidgetClass *parent_class = NULL;
static void
rstto_monitor_chooser_init(RsttoMonitorChooser *);
rstto_monitor_chooser_init(GTypeInstance *instance, gpointer g_class);
static void
rstto_monitor_chooser_class_init(RsttoMonitorChooserClass *);
rstto_monitor_chooser_class_init(gpointer g_class, gpointer class_data);