[goffice] Fix warnings in shapes-demo.c.



commit a645fe2d185810944ae8e422361945c4d03b7942
Author: Valek Filippov <frob gnome org>
Date:   Fri Apr 16 22:37:08 2010 -0400

    Fix warnings in shapes-demo.c.

 ChangeLog           |    4 ++++
 tests/shapes-demo.c |    8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bb91774..4fdbf24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-16  Valek Filippov  <frob gnome org>
+
+	* tests/shapes-demo.c: fix warnings.
+
 2010-04-16  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/tests/shapes-demo.c b/tests/shapes-demo.c
index efe30e3..d4bc6fd 100644
--- a/tests/shapes-demo.c
+++ b/tests/shapes-demo.c
@@ -118,6 +118,8 @@ parse_line (GocCanvas *canvas, gchar *entry)
 	GOArrow		*arr;
 	guint		i,j;
 	int		cmd = -1;
+	GocPoints *points;
+	GocIntArray *array;
 	
 	/* check for "comment" */
 	if (g_str_has_prefix (entry, "#"))
@@ -206,7 +208,7 @@ parse_line (GocCanvas *canvas, gchar *entry)
 	case 6: /* POLY */
 	case 7:
 		if (g_strv_length(v) > 2) {
-			GocPoints *points = goc_points_new ((g_strv_length(v) - 1) / 2);
+			points = goc_points_new ((g_strv_length(v) - 1) / 2);
 			for (i=0; i < g_strv_length (v) / 2; i++) {
 				points->points[i].x = atoi (v[i * 2 + 1]);
 				points->points[i].y = atoi (v[i * 2 + 2]);
@@ -221,11 +223,11 @@ parse_line (GocCanvas *canvas, gchar *entry)
 		if (g_strv_length(v) > 2)
 			if (atoi(v[1]) < 2)
 				break;
-			GocIntArray *array = goc_int_array_new (atoi(v[1]));
+			array = goc_int_array_new (atoi(v[1]));
 			for (j = 0; j < (guint) atoi(v[1]); j++)
 				array->vals[j] = atoi(v[j + 2]);
 			j = atoi(v[1]);
-			GocPoints *points = goc_points_new ((g_strv_length(v) - j - 2) / 2);
+			points = goc_points_new ((g_strv_length(v) - j - 2) / 2);
 			for (i=0; i < (g_strv_length (v) - j - 2) / 2; i++) {
 				points->points[i].x = atoi (v[i * 2 + 1 + j + 1]);
 				points->points[i].y = atoi (v[i * 2 + 2 + j + 1]);



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