gtkhtml r8947 - trunk/gtkhtml



Author: mbarnes
Date: Mon Sep  1 13:22:09 2008
New Revision: 8947
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8947&view=rev

Log:
2008-09-01  Matthew Barnes  <mbarnes redhat com>

	* gtkhtml/testgtkhtml.c (goto_url), (test_cb):
	Use g_get_current_dir() instead of getcwd().

	* gtkhtml/htmlpainter.c (html_painter_calc_entries_size):
	Initialize font_size and font_style, to make compiler happy.



Modified:
   trunk/gtkhtml/ChangeLog
   trunk/gtkhtml/htmlpainter.c
   trunk/gtkhtml/testgtkhtml.c

Modified: trunk/gtkhtml/htmlpainter.c
==============================================================================
--- trunk/gtkhtml/htmlpainter.c	(original)
+++ trunk/gtkhtml/htmlpainter.c	Mon Sep  1 13:22:09 2008
@@ -432,8 +432,8 @@
 				HTMLTextPangoInfo *pi, GList *glyphs, gint *line_offset,
 				gint *width, gint *asc, gint *dsc)
 {
-	HTMLFontFace    *font_face;
-	GtkHTMLFontStyle font_style;
+	HTMLFontFace *font_face = NULL;
+	GtkHTMLFontStyle font_style = GTK_HTML_FONT_STYLE_DEFAULT;
 	HTMLFont *font;
 
 	g_return_if_fail (painter != NULL);

Modified: trunk/gtkhtml/testgtkhtml.c
==============================================================================
--- trunk/gtkhtml/testgtkhtml.c	(original)
+++ trunk/gtkhtml/testgtkhtml.c	Mon Sep  1 13:22:09 2008
@@ -947,29 +947,30 @@
 static void
 bug_cb (GtkWidget *widget, gpointer data)
 {
-	gchar cwd[PATH_MAX], *filename, *url;
+	gchar *cwd, *filename, *url;
 
-	getcwd(cwd, sizeof (cwd));
+	cwd = g_get_current_dir ();
 	filename = g_strdup_printf("%s/bugs.html", cwd);
 	url = g_filename_to_uri(filename, NULL, NULL);
 	goto_url(url, 0);
 	g_free(url);
 	g_free(filename);
+	g_free(cwd);
 }
 
 static void
 test_cb (GtkWidget *widget, gpointer data)
 {
-	gchar cwd[PATH_MAX], *filename, *url;
+	gchar *cwd, *filename, *url;
 
-	getcwd(cwd, sizeof (cwd));
+	cwd = g_get_current_dir ();
 	filename = g_strdup_printf ("%s/tests/test%d.html", cwd,
 				    GPOINTER_TO_INT (data));
 	url = g_filename_to_uri (filename, NULL, NULL);
-
 	goto_url(url, 0);
 	g_free(url);
 	g_free(filename);
+	g_free(cwd);
 }
 
 static void



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