Merge branch 'pvs-fixes' into 'master'

Pvs fixes

See merge request GNOME/gtk!3155
This commit is contained in:
Matthias Clasen 2021-02-04 12:20:24 +00:00
commit 5c532104e4
11 changed files with 11 additions and 23 deletions

View File

@ -173,7 +173,7 @@ stash_desktop_startup_notification_id (void)
if (!g_utf8_validate (desktop_startup_id, -1, NULL))
g_warning ("DESKTOP_STARTUP_ID contains invalid UTF-8");
else
startup_notification_id = g_strdup (desktop_startup_id ? desktop_startup_id : "");
startup_notification_id = g_strdup (desktop_startup_id);
}
/* Clear the environment variable so it won't be inherited by

View File

@ -1383,7 +1383,7 @@ gdk_x11_keymap_translate_keyboard_state (GdkKeymap *keymap,
tmp_keyval = translate_keysym (keymap_x11, hardware_keycode,
group, state,
level, effective_group);
effective_group, level);
}
if (consumed_modifiers)

View File

@ -718,7 +718,7 @@ gsk_vulkan_image_upload_regions (GskVulkanImage *self,
}
else
{
for (gsize r = 0; r < regions[i].height; i++)
for (gsize r = 0; r < regions[i].height; r++)
memcpy (m + r * regions[i].width * 4, regions[i].data + r * regions[i].stride, regions[i].width * 4);
}

View File

@ -68,10 +68,8 @@ action_handle_method (GtkAtSpiContext *self,
g_variant_get (parameters, "(i)", &idx);
const Action *action = &actions[idx];
if (idx >= 0 && idx < n_actions)
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", action->name));
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", actions[idx].name));
else
g_dbus_method_invocation_return_error (invocation,
G_IO_ERROR,
@ -129,10 +127,8 @@ action_handle_method (GtkAtSpiContext *self,
g_variant_get (parameters, "(i)", &idx);
const Action *action = &actions[idx];
if (idx >= 0 && idx < n_actions)
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", action->keybinding));
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", actions[idx].keybinding));
else
g_dbus_method_invocation_return_error (invocation,
G_IO_ERROR,

View File

@ -1038,7 +1038,7 @@ gtk_compose_table_compact_check (const GtkComposeTableCompact *table,
if (!seq_index)
return FALSE;
if (seq_index && n_compose == 1)
if (n_compose == 1)
return TRUE;
seq = NULL;

View File

@ -218,7 +218,7 @@ _gtk_css_border_value_parse (GtkCssParser *parser,
}
result->is_computed = TRUE;
for (; i < 4; i++)
for (i = 0; i < 4; i++)
if (result->values[i] && !gtk_css_value_is_computed (result->values[i]))
{
result->is_computed = FALSE;

View File

@ -1073,11 +1073,8 @@ parse_n_plus_b (GtkCssParser *parser,
*a = 0;
return TRUE;
}
gtk_css_parser_error_syntax (parser, "Not a valid an+b type");
return FALSE;
}
static gboolean
parse_a_n_plus_b (GtkCssParser *parser,
int seen_sign,

View File

@ -1147,7 +1147,7 @@ gtk_list_base_class_init (GtkListBaseClass *klass)
P_("The orientation of the orientable"),
GTK_TYPE_ORIENTATION,
GTK_ORIENTATION_VERTICAL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_EXPLICIT_NOTIFY);
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, properties);

View File

@ -454,8 +454,6 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
GtkSettings *settings;
gboolean use_caret;
priv->has_primary_markup = FALSE;
priv->has_secondary_text = FALSE;
priv->has_primary_markup = FALSE;
priv->has_secondary_text = FALSE;
priv->message_type = GTK_MESSAGE_OTHER;

View File

@ -257,8 +257,8 @@ static void gtk_text_btree_rebalance (GtkTextBTree
static GtkTextLine * get_last_line (GtkTextBTree *tree);
static void post_insert_fixup (GtkTextBTree *tree,
GtkTextLine *insert_line,
int char_count_delta,
int line_count_delta);
int line_count_delta,
int char_count_delta);
static void gtk_text_btree_node_adjust_toggle_count (GtkTextBTreeNode *node,
GtkTextTagInfo *info,
int adjust);

View File

@ -3285,9 +3285,6 @@ gtk_tree_model_filter_iter_children (GtkTreeModel *model,
return TRUE;
}
iter->stamp = 0;
return FALSE;
}
static gboolean