[Goodies-commits] r1765 - in xfce4-weather-plugin/trunk: . panel-plugin

Nick Schermer nick at xfce.org
Thu Jul 13 22:16:39 CEST 2006


Author: nick
Date: 2006-07-13 20:16:38 +0000 (Thu, 13 Jul 2006)
New Revision: 1765

Modified:
   xfce4-weather-plugin/trunk/configure.in.in
   xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c
   xfce4-weather-plugin/trunk/panel-plugin/get_data.c
   xfce4-weather-plugin/trunk/panel-plugin/plugin.c
   xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c
Log:
* Fix compiler warnings and plug small leak


Modified: xfce4-weather-plugin/trunk/configure.in.in
===================================================================
--- xfce4-weather-plugin/trunk/configure.in.in	2006-07-13 19:38:48 UTC (rev 1764)
+++ xfce4-weather-plugin/trunk/configure.in.in	2006-07-13 20:16:38 UTC (rev 1765)
@@ -29,7 +29,7 @@
 AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h fcntl.h errno.h sys/socket.h netdb.h \
                   netinet/in.h sys/types.h time.h unistd.h stdio.h \
-		  sys/stat.h])
+		  sys/stat.h stddef.h])
 
 dnl required
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])

Modified: xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c	2006-07-13 19:38:48 UTC (rev 1764)
+++ xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c	2006-07-13 20:16:38 UTC (rev 1765)
@@ -140,7 +140,7 @@
     gint         history = 0;
     gboolean     hasiter = FALSE;
     GtkTreeIter  iter;
-    gchar       *value;
+    gchar       *text;
 
     xfceweather_data *data = (xfceweather_data *) dialog->wd;
     
@@ -191,24 +191,26 @@
     else /* use provided proxy settings */
     {
         data->proxy_fromenv = FALSE;
-        value = (gchar *)gtk_entry_get_text (GTK_ENTRY(dialog->txt_proxy_host));
+        text = g_strdup (gtk_entry_get_text (GTK_ENTRY(dialog->txt_proxy_host)));
 
-        if (strlen (value) == 0)
+        if (strlen (text) == 0)
         {
             xfce_err(_("Please enter proxy settings"));
             gtk_widget_grab_focus (dialog->txt_proxy_host);
             return;
         }
 
-        data->proxy_host = g_strdup(value);
+        data->proxy_host = g_strdup(text);
         data->proxy_port = gtk_spin_button_get_value (
                 GTK_SPIN_BUTTON (dialog->txt_proxy_port));
 
         if (data->saved_proxy_host)
             g_free (data->saved_proxy_host);
         
-        data->saved_proxy_host = g_strdup(value);
+        data->saved_proxy_host = g_strdup(text);
         data->saved_proxy_port = data->proxy_port;
+	
+	g_free (text);
     }       
 
     if (cb)

Modified: xfce4-weather-plugin/trunk/panel-plugin/get_data.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/get_data.c	2006-07-13 19:38:48 UTC (rev 1764)
+++ xfce4-weather-plugin/trunk/panel-plugin/get_data.c	2006-07-13 20:16:38 UTC (rev 1765)
@@ -35,7 +35,7 @@
 gchar *kill_ring[KILL_RING_S] = {NULL, };
 
 #define debug_print printf
-gchar *
+static gchar *
 copy_buffer (gchar *str)
 {
     static gint p = 0;

Modified: xfce4-weather-plugin/trunk/panel-plugin/plugin.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/plugin.c	2006-07-13 19:38:48 UTC (rev 1764)
+++ xfce4-weather-plugin/trunk/panel-plugin/plugin.c	2006-07-13 20:16:38 UTC (rev 1765)
@@ -345,7 +345,7 @@
     return array;
 }
 
-void
+static void
 xfceweather_read_config (XfcePanelPlugin  *plugin,
                          xfceweather_data *data)
 {

Modified: xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c	2006-07-13 19:38:48 UTC (rev 1764)
+++ xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c	2006-07-13 20:16:38 UTC (rev 1765)
@@ -19,6 +19,8 @@
 #include <config.h>
 #endif
 
+#include <stddef.h>
+
 #include <glib.h>
 #include <gtk/gtk.h>
 
@@ -103,7 +105,7 @@
 {
     gint          width, height;
     struct label *lbl;
-    static gint   i = 0;
+    static size_t i = 0;
 
     if (self->labels->len == 0)
         return;
@@ -299,7 +301,7 @@
                             GValue       *value,
                             GParamSpec   *pspec)
 {
-    g_assert(FALSE);
+    return;
 }
 
 static void
@@ -399,7 +401,7 @@
 gtk_scrollbox_enablecb (GtkScrollbox *self,
                         gboolean      enable)
 {
-    GValue val = {0,};
+    GValue val = {0, };
 
     g_value_init (&val, G_TYPE_BOOLEAN);
     g_value_set_boolean (&val, enable);
@@ -446,17 +448,18 @@
     static GType type = 0;
 
     if (type == 0) {
-
-        static const GTypeInfo info = {
+	
+	static const GTypeInfo info = {
             sizeof (GtkScrollboxClass),
-            NULL,   /* base_init */
-            NULL,   /* base_finalize */
-            gtk_scrollbox_class_init,   /* class_init */
-            NULL,   /* class_finalize */
-            NULL,   /* class_data */
+            NULL,                          /* base_init      */
+            NULL,                          /* base_finalize  */
+            gtk_scrollbox_class_init,      /* class_init     */
+            NULL,                          /* class_finalize */
+            NULL,                          /* class_data     */
             sizeof (GtkScrollbox),
-            0,      /* n_preallocs */
-            gtk_scrollbox_instance_init    /* instance_init */
+            0,                             /* n_preallocs    */
+            gtk_scrollbox_instance_init,   /* instance_init  */
+	    NULL
         };
 
         type = g_type_register_static (GTK_TYPE_DRAWING_AREA,




More information about the Goodies-commits mailing list