Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/vte/ChangeLog,v
retrieving revision 1.693
diff -u -p -r1.693 ChangeLog
--- ChangeLog	13 Sep 2006 21:58:26 -0000	1.693
+++ ChangeLog	18 Sep 2006 18:39:22 -0000
@@ -1,3 +1,17 @@
+2006-09-18  Ryan Lortie  <desrt@desrt.ca>
+
+	Bug 356602.
+
+	* src/matcher.h: Use const char * where appropriate.
+	* src/matcher.c: Use const char * where appropriate.  Cast g_strdup
+	to (GCacheDupFunc) to avoid a warning.
+
+	* src/vtetc.h: Use const char * where appropriate.
+	* src/vtetc.c: Use const char * where appropriate.  Cast g_strdup
+	to (GCacheDupFunc) to avoid a warning.
+
+	* src/vte.c: Use const char * where appropriate.
+
 2006-09-13  Behdad Esfahbod  <behdad@gnome.org>
 
 	Bug 354024 – Suppress multiple warnings for missing control sequence
Index: src/matcher.c
===================================================================
RCS file: /cvs/gnome/vte/src/matcher.c,v
retrieving revision 1.10
diff -u -p -r1.10 matcher.c
--- src/matcher.c	18 Apr 2006 22:50:29 -0000	1.10
+++ src/matcher.c	18 Sep 2006 18:39:22 -0000
@@ -59,7 +59,7 @@ _vte_matcher_add(struct _vte_matcher *ma
 
 /* Loads all sequences into matcher */
 static void
-_vte_matcher_init(struct _vte_matcher *matcher, char *emulation,
+_vte_matcher_init(struct _vte_matcher *matcher, const char *emulation,
 		  struct _vte_termcap *termcap)
 {
 	const char *code, *value;
@@ -194,7 +194,7 @@ _vte_matcher_destroy(gpointer value)
 
 /* Create and init matcher. */
 struct _vte_matcher *
-_vte_matcher_new(char *emulation, struct _vte_termcap *termcap)
+_vte_matcher_new(const char *emulation, struct _vte_termcap *termcap)
 {
 	struct _vte_matcher *ret = NULL;
 	g_static_mutex_lock(&_vte_matcher_mutex);
@@ -205,11 +205,12 @@ _vte_matcher_new(char *emulation, struct
 
 	if (_vte_matcher_cache == NULL) {
 		_vte_matcher_cache = g_cache_new(_vte_matcher_create,
-				_vte_matcher_destroy, g_strdup, g_free,
+				_vte_matcher_destroy,
+			       	(GCacheDupFunc) g_strdup, g_free,
 				g_str_hash, g_direct_hash, g_str_equal);
 	}
 
-	ret = g_cache_insert(_vte_matcher_cache, emulation);
+	ret = g_cache_insert(_vte_matcher_cache, (gpointer) emulation);
 
 	if (!ret->initialized) {
 		_vte_matcher_init(ret, emulation, termcap);
Index: src/matcher.h
===================================================================
RCS file: /cvs/gnome/vte/src/matcher.h,v
retrieving revision 1.7
diff -u -p -r1.7 matcher.h
--- src/matcher.h	18 Apr 2006 22:50:29 -0000	1.7
+++ src/matcher.h	18 Sep 2006 18:39:22 -0000
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 struct _vte_matcher;
 
 /* Create and init matcher. */
-struct _vte_matcher *_vte_matcher_new(char *emulation,
+struct _vte_matcher *_vte_matcher_new(const char *emulation,
 				      struct _vte_termcap *termcap);
 
 /* Free a matcher. */
Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.486
diff -u -p -r1.486 vte.c
--- src/vte.c	13 Sep 2006 21:58:26 -0000	1.486
+++ src/vte.c	18 Sep 2006 18:39:31 -0000
@@ -546,8 +546,9 @@ vte_terminal_emit_selection_changed(VteT
 
 /* Emit a "commit" signal. */
 static void
-vte_terminal_emit_commit(VteTerminal *terminal, gchar *text, guint length)
+vte_terminal_emit_commit(VteTerminal *terminal, const gchar *text, guint length)
 {
+	const char *result = NULL;
 	char *wrapped = NULL;
 #ifdef VTE_DEBUG
 	if (_vte_debug_on(VTE_DEBUG_SIGNALS)) {
@@ -556,15 +557,16 @@ vte_terminal_emit_commit(VteTerminal *te
 #endif
 	if (length == -1) {
 		length = strlen(text);
-		wrapped = text;
+		result = text;
 	} else {
-		wrapped = g_malloc0(length + 1);
+		result = wrapped = g_malloc0(length + 1);
 		memcpy(wrapped, text, length);
 	}
-	g_signal_emit_by_name(terminal, "commit", wrapped, length);
-	if (wrapped != text) {
+
+	g_signal_emit_by_name(terminal, "commit", result, length);
+
+	if (wrapped)
 		g_free(wrapped);
-	}
 }
 
 /* Emit an "emulation-changed" signal. */
Index: src/vtetc.c
===================================================================
RCS file: /cvs/gnome/vte/src/vtetc.c,v
retrieving revision 1.10
diff -u -p -r1.10 vtetc.c
--- src/vtetc.c	31 Aug 2006 20:03:12 -0000	1.10
+++ src/vtetc.c	18 Sep 2006 18:39:31 -0000
@@ -431,17 +431,18 @@ _vte_termcap_destroy(gpointer key)
 }
 
 TERMCAP_MAYBE_STATIC struct _vte_termcap *
-_vte_termcap_new(char *filename)
+_vte_termcap_new(const char *filename)
 {
 	struct _vte_termcap *ret = NULL;
 	g_static_mutex_lock(&_vte_termcap_mutex);
 
 	if (_vte_termcap_cache == NULL) {
 		_vte_termcap_cache = g_cache_new(_vte_termcap_create,
-				_vte_termcap_destroy, g_strdup, g_free,
+				_vte_termcap_destroy,
+				(GCacheDupFunc) g_strdup, g_free,
 				g_str_hash, g_direct_hash, g_str_equal);
 	}
-	ret = g_cache_insert(_vte_termcap_cache, filename);
+	ret = g_cache_insert(_vte_termcap_cache, (gpointer) filename);
 
 	g_static_mutex_unlock(&_vte_termcap_mutex);
 	return ret;
Index: src/vtetc.h
===================================================================
RCS file: /cvs/gnome/vte/src/vtetc.h,v
retrieving revision 1.3
diff -u -p -r1.3 vtetc.h
--- src/vtetc.h	18 Apr 2006 22:50:30 -0000	1.3
+++ src/vtetc.h	18 Sep 2006 18:39:31 -0000
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
 struct _vte_termcap;
 
 /* Create a new termcap structure. */
-struct _vte_termcap *_vte_termcap_new(char *filename);
+struct _vte_termcap *_vte_termcap_new(const char *filename);
 
 /* Free a termcap structure. */
 void _vte_termcap_free(struct _vte_termcap *termcap);
