[m-dev.] diff: fix const warning in trace/mercury_trace_spy.[hc]

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Sep 19 18:14:05 AEDT 2000


Estimated hours taken: 0.25

trace/mercury_trace_spy.h:
trace/mercury_trace_spy.c:
	Fix a gcc warning about passing a pointer to const to MR_free().

Workspace: /home/pgrad/fjh/ws/hg
Index: trace/mercury_trace_spy.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_spy.c,v
retrieving revision 1.12
diff -u -d -r1.12 mercury_trace_spy.c
--- trace/mercury_trace_spy.c	2000/09/01 00:50:29	1.12
+++ trace/mercury_trace_spy.c	2000/09/19 07:08:37
@@ -339,18 +339,19 @@
 
 int
 MR_add_line_spy_point(MR_Spy_Action action,
-	const char *filename, int linenumber)
+	const char *orig_filename, int linenumber)
 {
 	MR_Spy_Point	*point;
 	int		point_slot;
 	int		old_size, new_size;
+	char 		*filename;
 
 	/*
 	** The original filename string may have come from a buffer
 	** or other volatile storage.
 	*/
 
-	filename = MR_copy_string(filename);
+	filename = MR_copy_string(orig_filename);
 
 	point_slot = MR_spy_point_next;
 
Index: trace/mercury_trace_spy.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_spy.h,v
retrieving revision 1.4
diff -u -d -r1.4 mercury_trace_spy.h
--- trace/mercury_trace_spy.h	2000/09/01 00:50:29	1.4
+++ trace/mercury_trace_spy.h	2000/09/19 07:08:57
@@ -41,7 +41,7 @@
 	MR_Spy_Action			spy_action;
 	const MR_Stack_Layout_Entry	*spy_proc;      /* if not LINENO */
 	const MR_Stack_Layout_Label	*spy_label;	/* if SPECIFIC */
-	const char			*spy_filename;  /* if LINENO */
+	char				*spy_filename;  /* if LINENO */
 	int				spy_linenumber; /* if LINENO */
 	MR_Spy_Point			*spy_next;	/* if not LINENO */
 };

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list