Fix various compiler warnings (two serious)

Missing sentinels can cause crashes.  The others are just style.
This commit is contained in:
Colin Walters 2012-08-12 12:20:07 -04:00
parent 275bd91c24
commit 5dd7442bd5
3 changed files with 5 additions and 6 deletions

View File

@ -58,7 +58,7 @@ void zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
}
if (data->ok_label) {
g_object_get (G_OBJECT (dialog), "ok-button", &button);
g_object_get (G_OBJECT (dialog), "ok-button", &button, NULL);
gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON));
@ -66,7 +66,7 @@ void zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
}
if (data->cancel_label) {
g_object_get (G_OBJECT (dialog), "cancel-button", &button);
g_object_get (G_OBJECT (dialog), "cancel-button", &button, NULL);
gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));

View File

@ -34,9 +34,9 @@ static void zenity_forms_dialog_get_selected (GtkTreeModel *model, GtkTreePath *
{
gint n_columns = 0;
gint i = 0;
GValue value = {0, };
n_columns = gtk_tree_model_get_n_columns (model);
GValue value = {0, };
for (i = 0; i < n_columns; i++) {
gtk_tree_model_get_value (model, iter, i, &value);
selected = g_slist_append (selected, g_value_dup_string (&value));
@ -157,6 +157,7 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
gint number_of_widgets = g_slist_length (forms_data->list);
int list_count = 0;
int i = 0;
zen_data = data;
@ -203,8 +204,6 @@ void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
gtk_table_resize (GTK_TABLE (table), number_of_widgets, 2);
int i = 0;
for (tmp = forms_data->list; tmp; tmp = tmp->next) {
ZenityFormsValue *zenity_value = (ZenityFormsValue *) tmp->data;
GtkWidget *label;

View File

@ -54,7 +54,7 @@ zenity_progress_pulsate_progress_bar (gpointer user_data)
}
static void
zenity_progress_pulsate_stop ()
zenity_progress_pulsate_stop (void)
{
if (pulsate_timeout > 0) {
g_source_remove (pulsate_timeout);