[m-dev.] diff: fix type errors in extras/trailed_update/tr_store.m

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Mar 26 17:21:48 AEST 2000


Estimated hours taken: 0.25

extras/trailed_update/tr_store.m:
	Fix some type errors caused by Zoltan's recent MR_TypeInfo
	changes.

library/std_util.m:
	Add a comment mentioning that tr_store.m uses ML_arg().

Workspace: /home/mercury0/fjh/mercury
Index: extras/trailed_update/tr_store.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/trailed_update/tr_store.m,v
retrieving revision 1.5
diff -u -d -r1.5 tr_store.m
--- extras/trailed_update/tr_store.m	1999/12/15 17:21:52	1.5
+++ extras/trailed_update/tr_store.m	2000/03/26 07:10:35
@@ -203,27 +203,26 @@
 
 :- pragma c_header_code("
 	/* ML_arg() is defined in std_util.m */
-	bool ML_arg(Word term_type_info, Word *term, Word argument_index,
-			Word *arg_type_info, Word **argument_ptr);
-
+extern  bool    ML_arg(MR_TypeInfo type_info, Word *term, int arg_index,
+		    MR_TypeInfo *arg_type_info_ptr, Word **argument_ptr);
 ").
 
 :- pragma c_code(arg_ref(Ref::in, ArgNum::in, ArgRef::out, S0::mdi, S::muo),
 		will_not_call_mercury,
 "{
-	Word arg_type_info;
+	MR_TypeInfo arg_type_info;
 	Word* arg_ref;
 
 	save_transient_registers();
 
-	if (!ML_arg(TypeInfo_for_T, (Word *) Ref, ArgNum,
+	if (!ML_arg((MR_TypeInfo) TypeInfo_for_T, (Word *) Ref, ArgNum,
 			&arg_type_info, &arg_ref))
 	{
 		fatal_error(""tr_store__arg_ref: argument number out of range"");
 	}
 
-	if (MR_compare_type_info(arg_type_info, TypeInfo_for_ArgT) !=
-		COMPARE_EQUAL)
+	if (MR_compare_type_info(arg_type_info,
+		(MR_TypeInfo) TypeInfo_for_ArgT) != COMPARE_EQUAL)
 	{
 		fatal_error(""tr_store__arg_ref: argument has wrong type"");
 	}
@@ -237,19 +236,19 @@
 :- pragma c_code(new_arg_ref(Val::mdi, ArgNum::in, ArgRef::out, S0::mdi, S::muo),
 		will_not_call_mercury,
 "{
-	Word arg_type_info;
+	MR_TypeInfo arg_type_info;
 	Word* arg_ref;
 
 	save_transient_registers();
 
-	if (!ML_arg(TypeInfo_for_T, (Word *) &Val, ArgNum,
+	if (!ML_arg((MR_TypeInfo) TypeInfo_for_T, (Word *) &Val, ArgNum,
 			&arg_type_info, &arg_ref))
 	{
 	      fatal_error(""tr_store__new_arg_ref: argument number out of range"");
 	}
 
-	if (MR_compare_type_info(arg_type_info, TypeInfo_for_ArgT) !=
-		COMPARE_EQUAL)
+	if (MR_compare_type_info(arg_type_info,
+		(MR_TypeInfo) TypeInfo_for_ArgT) != COMPARE_EQUAL)
 	{
 	      fatal_error(""tr_store__new_arg_ref: argument has wrong type"");
 	}
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.185
diff -u -d -r1.185 std_util.m
--- library/std_util.m	2000/03/24 10:27:40	1.185
+++ library/std_util.m	2000/03/26 07:18:33
@@ -2378,7 +2378,10 @@
 extern  void    ML_expand(MR_TypeInfo type_info, Word *data_word_ptr,
                     ML_Expand_Info *expand_info);
 
-    /* NB. ML_arg() is also used by store__arg_ref in store.m */
+    /*
+    ** NB. ML_arg() is also used by arg_ref and new_arg_ref
+    ** in store.m and in extras/trailed_update/tr_store.m.
+    */
 extern  bool    ML_arg(MR_TypeInfo type_info, Word *term, int arg_index,
                     MR_TypeInfo *arg_type_info_ptr, Word **argument_ptr);
 

-- 
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