Commit 5b360f21 authored by Emmanuele Bassi's avatar Emmanuele Bassi 👣

Merge branch '3-24-warn-fixes' into 'gtk-3-24'

Fix various compiler warnings

See merge request !561
parents df779651 43980583
Pipeline #56461 passed with stage
in 11 minutes and 2 seconds
......@@ -24,6 +24,7 @@
#include "config.h"
#define GDK_DISABLE_DEPRECATION_WARNINGS
#include "gtkcontainer.h"
#include "gtkcontainerprivate.h"
......
......@@ -5392,7 +5392,7 @@ gtk_menu_scroll_to (GtkMenu *menu,
if (!priv->upper_arrow_visible || !priv->lower_arrow_visible)
gtk_widget_queue_draw (GTK_WIDGET (menu));
if (!priv->upper_arrow_visible &
if (!priv->upper_arrow_visible &&
flags & GTK_MENU_SCROLL_FLAG_ADAPT)
should_offset_by_arrow = TRUE;
else
......
......@@ -1184,12 +1184,14 @@ gtk_popover_draw (GtkWidget *widget,
gap_end = final_y - rect_y;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* Now render the frame, without the gap for the arrow tip */
gtk_render_frame_gap (context, cr,
rect_x, rect_y,
rect_w, rect_h,
gap_side,
gap_start, gap_end);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
......
......@@ -2854,7 +2854,7 @@ gtk_scrolled_window_finalize (GObject *object)
g_clear_object (&priv->long_press_gesture);
g_clear_object (&priv->pan_gesture);
g_clear_object (&priv->gadget);
g_clear_pointer (&priv->scroll_history, (GDestroyNotify) g_array_unref);
g_clear_pointer (&priv->scroll_history, g_array_unref);
G_OBJECT_CLASS (gtk_scrolled_window_parent_class)->finalize (object);
}
......@@ -3690,7 +3690,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
gtk_adjustment_set_value (hadjustment, position);
}
else if (data->hscrolling)
g_clear_pointer (&data->hscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
g_clear_pointer (&data->hscrolling, gtk_kinetic_scrolling_free);
if (data->vscrolling &&
gtk_kinetic_scrolling_tick (data->vscrolling, elapsed, &position))
......@@ -3699,7 +3699,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
gtk_adjustment_set_value (vadjustment, position);
}
else if (data->vscrolling)
g_clear_pointer (&data->vscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
g_clear_pointer (&data->vscrolling, gtk_kinetic_scrolling_free);
if (!data->hscrolling && !data->vscrolling)
{
......
......@@ -5645,7 +5645,10 @@ cups_printer_get_options (GtkPrinter *printer,
ppd_name = gtk_paper_size_get_ppd_name (paper_size);
if (ppd_name)
strncpy (ppd_option->defchoice, ppd_name, PPD_MAX_NAME);
{
strncpy (ppd_option->defchoice, ppd_name, PPD_MAX_NAME - 1);
ppd_option->defchoice[PPD_MAX_NAME - 1] = '\0';
}
else
{
gchar *custom_name;
......@@ -5664,7 +5667,8 @@ cups_printer_get_options (GtkPrinter *printer,
* 230.4x142.9"
*/
custom_name = g_strdup_printf (_("Custom %s×%s"), width, height);
strncpy (ppd_option->defchoice, custom_name, PPD_MAX_NAME);
strncpy (ppd_option->defchoice, custom_name, PPD_MAX_NAME - 1);
ppd_option->defchoice[PPD_MAX_NAME - 1] = '\0';
g_free (custom_name);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment