mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
Avoid some clang compiler warnings
Avoid some compiler warnings from clang in deprecated code. Most of these are around our habit of using -1 as an 'unset' value for enumerations.
This commit is contained in:
parent
fbbb3d1816
commit
543eae0d76
@ -1111,7 +1111,7 @@ gtk_font_selection_size_activate (GtkWidget *w,
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->size_entry));
|
||||
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
new_size = (int) MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
|
||||
if (priv->size != new_size)
|
||||
gtk_font_selection_set_size (fontsel, new_size);
|
||||
@ -1130,7 +1130,7 @@ gtk_font_selection_size_focus_out (GtkWidget *w,
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (priv->size_entry));
|
||||
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
new_size = (int) MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
|
||||
|
||||
gtk_font_selection_set_size (fontsel, new_size);
|
||||
|
||||
|
@ -77,7 +77,7 @@ struct _GtkHandleBoxPrivate
|
||||
{
|
||||
/* Properties */
|
||||
GtkPositionType handle_position;
|
||||
GtkPositionType snap_edge;
|
||||
gint snap_edge;
|
||||
GtkShadowType shadow_type;
|
||||
gboolean child_detached;
|
||||
/* Properties */
|
||||
@ -1051,7 +1051,7 @@ gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), (GtkPositionType)-1);
|
||||
|
||||
return handle_box->priv->snap_edge;
|
||||
return (GtkPositionType)handle_box->priv->snap_edge;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2945,17 +2945,17 @@ gtk_icon_factory_buildable_custom_tag_end (GtkBuildable *buildable,
|
||||
}
|
||||
if (source_data->icon_name)
|
||||
gtk_icon_source_set_icon_name (icon_source, source_data->icon_name);
|
||||
if (source_data->size != -1)
|
||||
if ((gint)source_data->size != -1)
|
||||
{
|
||||
gtk_icon_source_set_size (icon_source, source_data->size);
|
||||
gtk_icon_source_set_size_wildcarded (icon_source, FALSE);
|
||||
}
|
||||
if (source_data->direction != -1)
|
||||
if ((gint)source_data->direction != -1)
|
||||
{
|
||||
gtk_icon_source_set_direction (icon_source, source_data->direction);
|
||||
gtk_icon_source_set_direction_wildcarded (icon_source, FALSE);
|
||||
}
|
||||
if (source_data->state != -1)
|
||||
if ((gint)source_data->state != -1)
|
||||
{
|
||||
gtk_icon_source_set_state (icon_source, source_data->state);
|
||||
gtk_icon_source_set_state_wildcarded (icon_source, FALSE);
|
||||
|
@ -95,7 +95,7 @@ real_add (const GtkStockItem *items,
|
||||
gpointer old_key, old_value;
|
||||
const GtkStockItem *item = &items[i];
|
||||
|
||||
if (replace_primary && item->modifier == PRIMARY_MODIFIER)
|
||||
if (replace_primary && (guint)item->modifier == PRIMARY_MODIFIER)
|
||||
{
|
||||
item = gtk_stock_item_copy (item);
|
||||
((GtkStockItem *)item)->modifier = (NON_STATIC_MASK |
|
||||
|
Loading…
Reference in New Issue
Block a user