gnome-panel r10924 - trunk/applets/clock



Author: jensg
Date: Wed Mar  5 17:35:57 2008
New Revision: 10924
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10924&view=rev

Log:
2008-03-05  Jens Granseuer  <jensgr gmx net>

	* clock-face.c: (update_timeofday):
	* clock-location-tile.c: (clock_location_tile_fill):
	* clock-location.c: (guess_zone_from_tree):
	* clock-zonetable.c: (clock_zonetable_parse_location),
	(clock_zonetable_load_zonetab), (clock_zonetable_load_iso3166):
	* clock.c: (parse_gconf_cities), (run_prefs_edit_save),
	(run_find_location): fix build for compilers that don't like C99.
	Fixes bug #518895.


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/clock-face.c
   trunk/applets/clock/clock-location-tile.c
   trunk/applets/clock/clock-location.c
   trunk/applets/clock/clock-zonetable.c
   trunk/applets/clock/clock.c

Modified: trunk/applets/clock/clock-face.c
==============================================================================
--- trunk/applets/clock/clock-face.c	(original)
+++ trunk/applets/clock/clock-face.c	Wed Mar  5 17:35:57 2008
@@ -321,9 +321,10 @@
 		timeofday = CLOCK_FACE_NIGHT;
 
 	if (priv->timeofday != timeofday) {
-		priv->timeofday = timeofday;
 		gint width, height;
 
+		priv->timeofday = timeofday;
+
 		width = GTK_WIDGET (this)->requisition.width;
 		height = GTK_WIDGET (this)->requisition.height;
 

Modified: trunk/applets/clock/clock-location-tile.c
==============================================================================
--- trunk/applets/clock/clock-location-tile.c	(original)
+++ trunk/applets/clock/clock-location-tile.c	Wed Mar  5 17:35:57 2008
@@ -266,6 +266,9 @@
 	GtkWidget *align;
         GtkWidget *strut;
         GtkWidget *box;
+        GtkWidget *alignment;
+        GtkWidget *tile;
+        GtkWidget *head_section;
 	gint can_set;
 
         priv->box = gtk_event_box_new ();
@@ -278,11 +281,11 @@
         g_signal_connect (priv->box, "leave-notify-event",
                           G_CALLBACK (enter_or_leave_tile), this);
 
-        GtkWidget *alignment = gtk_alignment_new (0, 0, 1, 0);
+        alignment = gtk_alignment_new (0, 0, 1, 0);
         gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 3, 3, 3, 0);
 
-        GtkWidget *tile = gtk_hbox_new (FALSE, 6);
-        GtkWidget *head_section = gtk_vbox_new (FALSE, 0);
+        tile = gtk_hbox_new (FALSE, 6);
+        head_section = gtk_vbox_new (FALSE, 0);
 
         priv->city_label = gtk_label_new (NULL);
         gtk_misc_set_alignment (GTK_MISC (priv->city_label), 0, 0);

Modified: trunk/applets/clock/clock-location.c
==============================================================================
--- trunk/applets/clock/clock-location.c	(original)
+++ trunk/applets/clock/clock-location.c	Wed Mar  5 17:35:57 2008
@@ -199,7 +199,7 @@
         int i;
         struct stat s;
         struct stat dir_s;
-        char *ret = NULL;;
+        char *ret = NULL;
 
         char *localtime_data = NULL;
         gsize localtime_len = -1;

Modified: trunk/applets/clock/clock-zonetable.c
==============================================================================
--- trunk/applets/clock/clock-zonetable.c	(original)
+++ trunk/applets/clock/clock-zonetable.c	Wed Mar  5 17:35:57 2008
@@ -267,8 +267,8 @@
 {
         int i;
 
-        gchar *lat_str;
-        gchar *lon_str;
+        gchar *lat_str = NULL;
+        gchar *lon_str = NULL;
 
         for (i = 1; location[i] != '\0'; i++) {
                 if (location[i] == '+' || location[i] == '-') {
@@ -339,12 +339,13 @@
 clock_zonetable_load_zonetab (ClockZoneTable *this)
 {
         ClockZoneTablePrivate *priv = PRIVATE (this);
+        GIOChannel *channel;
         gchar *line;
 
         priv->table = g_hash_table_new (g_str_hash, g_str_equal);
         priv->l10n_table = g_hash_table_new (g_str_hash, g_str_equal);
 
-        GIOChannel *channel = g_io_channel_new_file (priv->zonetab, "r", NULL);
+        channel = g_io_channel_new_file (priv->zonetab, "r", NULL);
 
         g_assert (channel != NULL);
 
@@ -377,11 +378,12 @@
 clock_zonetable_load_iso3166 (ClockZoneTable *this)
 {
         ClockZoneTablePrivate *priv = PRIVATE (this);
+        GIOChannel *channel;
         gchar *line;
 
         priv->country_table = g_hash_table_new (g_str_hash, g_str_equal);
 
-        GIOChannel *channel = g_io_channel_new_file (priv->iso3166, "r", NULL);
+        channel = g_io_channel_new_file (priv->iso3166, "r", NULL);
 
         g_assert (channel != NULL);
 

Modified: trunk/applets/clock/clock.c
==============================================================================
--- trunk/applets/clock/clock.c	(original)
+++ trunk/applets/clock/clock.c	Wed Mar  5 17:35:57 2008
@@ -2517,11 +2517,12 @@
 {
         GSList *cur = values;
 	LocationParserData data;
+        GMarkupParseContext *context;
 
 	data.cities = NULL;
 	data.cd = cd;
 
-        GMarkupParseContext *context =
+        context =
                 g_markup_parse_context_new (&location_parser, 0, &data, NULL);
 
         while (cur) {
@@ -2974,14 +2975,16 @@
 
         ClockZoneInfo *info = clock_zonetable_get_l10n_zone (zones, timezone_l10n);
 
+        const gchar *name;
+        gfloat lat = 0;
+        gfloat lon = 0;
+
         if (!info) {
                 edit_hide (NULL, cd);
                 return;
         }
 
-        const gchar *name = gtk_entry_get_text (GTK_ENTRY (name_entry));
-        gfloat lat = 0;
-        gfloat lon = 0;
+        name = gtk_entry_get_text (GTK_ENTRY (name_entry));
 
         sscanf (gtk_entry_get_text (GTK_ENTRY (lat_entry)), "%f", &lat);
         sscanf (gtk_entry_get_text (GTK_ENTRY (lon_entry)), "%f", &lon);
@@ -3281,9 +3284,10 @@
 run_find_location (GtkButton *button, ClockData *cd)
 {
         GtkWidget *edit_window = glade_xml_get_widget (cd->glade_xml, "edit-location-window");
+        GtkWidget *window;
 
 	fill_location_tree (cd);
-        GtkWidget *window = glade_xml_get_widget (cd->glade_xml, "find-location-window");
+        window = glade_xml_get_widget (cd->glade_xml, "find-location-window");
 
 	gtk_tree_view_collapse_all (GTK_TREE_VIEW (cd->location_tree));
 	gtk_widget_grab_focus (cd->find_location_entry);



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