[glade/tintou/fixes: 20/22] Fix several compiler warnings



commit 09b3bfd57aaf5f58aa49bb9e9b6ee1ecd49f662c
Author: Corentin Noël <corentin noel collabora com>
Date:   Fri Apr 5 15:44:03 2019 +0200

    Fix several compiler warnings

 gladeui/glade-command.c         |  6 +++---
 gladeui/glade-editor-property.c | 12 +++++-------
 2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
index b3469d18..b92db245 100644
--- a/gladeui/glade-command.c
+++ b/gladeui/glade-command.c
@@ -926,7 +926,7 @@ glade_command_set_properties (GladeProperty *property,
       g_assert (G_IS_VALUE (nvalue));
 
       sdata = g_new (GCSetPropData, 1);
-      sdata->property = g_object_ref (G_OBJECT (prop));
+      sdata->property = g_object_ref (GLADE_PROPERTY (prop));
       sdata->old_value = g_new0 (GValue, 1);
       sdata->new_value = g_new0 (GValue, 1);
       g_value_init (sdata->old_value, G_VALUE_TYPE (ovalue));
@@ -1260,7 +1260,7 @@ glade_command_add (GList            *widgets,
       adaptor = glade_widget_get_adaptor (widget);
 
       /* Widget */
-      cdata->widget = g_object_ref (G_OBJECT (widget));
+      cdata->widget = g_object_ref (GLADE_WIDGET (widget));
 
       /* Parentless ref */
       if ((cdata->reffed =
@@ -1426,7 +1426,7 @@ glade_command_remove (GList *widgets)
       widget = list->data;
 
       cdata = g_new0 (CommandData, 1);
-      cdata->widget = g_object_ref (G_OBJECT (widget));
+      cdata->widget = g_object_ref (GLADE_WIDGET (widget));
       cdata->parent = glade_widget_get_parent (widget);
 
       if ((cdata->reffed =
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 40625f52..18e98c13 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -1628,9 +1628,9 @@ glade_eprop_named_icon_changed_common (GladeEditorProperty *eprop,
   /* Here we try not to modify the project state by not 
    * modifying a null value for an unchanged property.
    */
-  if (prop_text == NULL && text && text[0] == '\0')
+  if (prop_text == NULL && text && *text == '\0')
     g_value_set_string (val, NULL);
-  else if (text == NULL && prop_text && prop_text == '\0')
+  else if (text == NULL && prop_text && *prop_text == '\0')
     g_value_set_string (val, "");
   else
     g_value_set_string (val, text);
@@ -1808,7 +1808,7 @@ text_buffer_get_text (GtkTextBuffer *buffer)
   gtk_text_buffer_get_bounds (buffer, &start, &end);
   retval = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
 
-  if (retval && retval[0] == '\0')
+  if (retval && *retval == '\0')
     {
       g_free (retval);
       return NULL;
@@ -1951,9 +1951,9 @@ glade_eprop_text_changed_common (GladeEditorProperty *eprop,
       /* Here we try not to modify the project state by not 
        * modifying a null value for an unchanged property.
        */
-      if (prop_text == NULL && text && text[0] == '\0')
+      if (prop_text == NULL && text && *text == '\0')
         g_value_set_string (val, NULL);
-      else if (text == NULL && prop_text && prop_text == '\0')
+      else if (text == NULL && prop_text && *prop_text == '\0')
         g_value_set_string (val, "");
       else
         g_value_set_string (val, text);
@@ -3386,7 +3386,6 @@ glade_eprop_object_show_dialog (GladeEditorProperty *eprop)
           GValue *value;
           GObject *new_object, *old_object = NULL;
           GladeWidget *new_widget;
-          const gchar *current_name;
 
           glade_project_selection_set (project, 
                                        glade_widget_get_object (widget),
@@ -3438,7 +3437,6 @@ glade_eprop_object_show_dialog (GladeEditorProperty *eprop)
     }
   else if (res == GLADE_RESPONSE_CREATE)
     {
-      GValue *value;
       GladeWidget *new_widget;
 
       /* translators: Creating 'a widget' for 'a property' of 'a widget' */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]