[m-rev.] for review: fix samples/c_interface/cplusplus_calls_mercury

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Apr 20 17:47:44 AEST 2005


On Wed, Apr 20, 2005 at 04:56:24PM +1000, Ian MacLarty wrote:
> On Wed, Apr 20, 2005 at 04:46:34PM +1000, Ian MacLarty wrote:
> > On Tue, Apr 19, 2005 at 02:03:32PM +1000, Ian MacLarty wrote:
> > > I'm not sure at all if this is the right fix, but the compiler passes a
> > > bootcheck and all the tests with the following two lines in
> > > runtime/mercury_types.h removed.
> > > 
> > 
> > Apparently that wasn't the right fix.  Here's a new fix:
> > 

Here's a version of the diff with the -b option.

Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.57
diff -u -b -r1.57 rtti.m
--- compiler/rtti.m	22 Mar 2005 06:40:24 -0000	1.57
+++ compiler/rtti.m	20 Apr 2005 04:49:31 -0000
@@ -1837,9 +1837,9 @@
 :- pred tc_rtti_name_type(tc_rtti_name::in, string::out, bool::out) is det.
 
 tc_rtti_name_type(base_typeclass_info(_, _),    "BaseTypeclassInfo", yes).
-tc_rtti_name_type(type_class_id,		"TypeClassId", no).
+tc_rtti_name_type(type_class_id,		"TypeClassIdStruct", no).
 tc_rtti_name_type(type_class_id_var_names,	"ConstString", yes).
-tc_rtti_name_type(type_class_id_method_ids,	"TypeClassMethod", yes).
+tc_rtti_name_type(type_class_id_method_ids,	"TypeClassMethodStruct", yes).
 tc_rtti_name_type(type_class_decl,		"TypeClassDeclStruct", no).
 tc_rtti_name_type(type_class_decl_super(_, N), TypeName, no) :-
 	TypeName = tc_constraint_type_name(N).
Index: runtime/mercury_type_tables.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_tables.c,v
retrieving revision 1.10
diff -u -b -r1.10 mercury_type_tables.c
--- runtime/mercury_type_tables.c	24 Feb 2004 08:49:55 -0000	1.10
+++ runtime/mercury_type_tables.c	19 Apr 2005 05:35:38 -0000
@@ -111,9 +111,9 @@
 	MR_Dlist		*element_ptr;
 	MR_TypeClassDeclInfo	*cur_type_class_decl_info;
 	MR_TypeClassDecl	cur_type_class_decl;
-	const MR_TypeClassId	*cur_type_class_id;
+	MR_TypeClassId		cur_type_class_id;
 	MR_TypeClassDeclInfo	*type_class_decl_info;
-	const MR_TypeClassId	*type_class_id;
+	MR_TypeClassId		type_class_id;
 
 	MR_assert(type_class_decl != NULL);
 	type_class_id = type_class_decl->MR_tc_decl_id;
@@ -214,7 +214,7 @@
 	MR_Dlist		*element_ptr;
 	MR_TypeClassDeclInfo	*cur_type_class_decl_info;
 	MR_TypeClassDecl	cur_type_class_decl;
-	const MR_TypeClassId	*cur_type_class_id;
+	MR_TypeClassId		cur_type_class_id;
 
 	slot = MR_string_hash_lookup_or_add(&MR_type_class_decl_info_table,
 			class_name);
Index: runtime/mercury_typeclass_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_typeclass_info.h,v
retrieving revision 1.4
diff -u -b -r1.4 mercury_typeclass_info.h
--- runtime/mercury_typeclass_info.h	3 Feb 2004 05:40:05 -0000	1.4
+++ runtime/mercury_typeclass_info.h	20 Apr 2005 05:10:48 -0000
@@ -109,11 +109,11 @@
 ** of a given type class.
 */
 
-typedef struct {
+struct MR_TypeClassMethod_Struct {
     MR_ConstString              MR_tc_method_name;
     const MR_int_least8_t       MR_tc_method_arity;
     const MR_PredFunc           MR_tc_method_pred_func;
-} MR_TypeClassMethod;
+};
 
 /*
 ** MR_TypeClassId structures are intended to provide a printable representation
@@ -139,15 +139,15 @@
 ** to method descriptors, one for each method.
 */
 
-typedef struct {
+struct MR_TypeClassId_Struct {
     MR_ConstString              MR_tc_id_module_name;
     MR_ConstString              MR_tc_id_name;
     const MR_int_least8_t       MR_tc_id_arity;
     const MR_int_least8_t       MR_tc_id_num_type_vars;
     const MR_int_least16_t      MR_tc_id_num_methods;
     const MR_ConstString        *MR_tc_id_type_var_names;
-    const MR_TypeClassMethod    *MR_tc_id_methods;
-} MR_TypeClassId;
+    MR_TypeClassMethod          MR_tc_id_methods;
+};
 
 /*
 ** We generate one static MR_TypeClassDecl structure for each typeclass
@@ -173,7 +173,7 @@
 */
 
 struct MR_TypeClassDecl_Struct {
-    const MR_TypeClassId            *MR_tc_decl_id;
+    MR_TypeClassId                  MR_tc_decl_id;
     const MR_int_least8_t           MR_tc_decl_version_number;
     const MR_int_least8_t           MR_tc_decl_num_supers;
     const MR_TypeClassConstraint    *MR_tc_decl_supers;
@@ -281,12 +281,12 @@
 ** of this design at runtime, just as we do for type_ctor_infos.
 */
 
-typedef struct {
+struct MR_ClassDict_Struct {
     MR_Integer              MR_class_dict_version_number;
     MR_TypeClassDecl        MR_class_dict_class;
     MR_TypeInfo             *MR_class_dict_type_binding;
     MR_Code                 *MR_class_dict_methods;
-} MR_ClassDict;
+};
 
 /*
 ** A MR_Dictionary_Struct structure corresponds to a fully solved type class
@@ -307,10 +307,10 @@
 ** (The +1 is because array numbering starts at 0.)
 */
 
-typedef struct {
+struct MR_Dictionary_Struct {
     MR_Instance             *MR_dict_top_instance;
-    MR_ClassDict            *MR_dict_class_methods;
-    MR_ClassDict            **MR_dict_superclass_dicts;
-} MR_Dictionary_Struct;
+    MR_ClassDictStruct      *MR_dict_class_methods;
+    MR_ClassDictStruct      **MR_dict_superclass_dicts;
+};
 
 #endif /* not MERCURY_TYPECLASS_INFO_H */
Index: runtime/mercury_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.40
diff -u -b -r1.40 mercury_types.h
--- runtime/mercury_types.h	14 Dec 2004 01:07:25 -0000	1.40
+++ runtime/mercury_types.h	20 Apr 2005 06:40:35 -0000
@@ -196,6 +196,12 @@
 typedef const struct MR_DictId_Struct                   *MR_DictId;
 typedef       struct MR_Dictionary_Struct               MR_DictionaryStruct;
 typedef const struct MR_Dictionary_Struct               *MR_Dictionary;
+typedef       struct MR_TypeClassId_Struct          MR_TypeClassIdStruct;
+typedef const struct MR_TypeClassId_Struct          *MR_TypeClassId;
+typedef       struct MR_TypeClassMethod_Struct      MR_TypeClassMethodStruct;
+typedef const struct MR_TypeClassMethod_Struct      *MR_TypeClassMethod;
+typedef       struct MR_ClassDict_Struct            MR_ClassDictStruct;
+typedef const struct MR_ClassDict_Struct            *MR_ClassDict;
 
 typedef struct MR_TrailEntry_Struct             MR_TrailEntry;
 typedef struct MR_TrailEntry_Struct             *MR_TrailEntryPtr;
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list