[m-rev.] for review: fix samples/c_interface/cplusplus_calls_mercury
Zoltan Somogyi
zs at cs.mu.OZ.AU
Wed Apr 20 17:59:22 AEST 2005
On 20-Apr-2005, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> --- 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;
The change to rtti.m and mercury_type_tables.c look like the introductions
of bugs; the correct code is the old code.
> 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;
> +};
That's fine.
> -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;
> +};
The change from the typedef to the struct def is fine; the change to
the type of the MR_tc_id_methods field should be undone.
> struct MR_TypeClassDecl_Struct {
> - const MR_TypeClassId *MR_tc_decl_id;
> + MR_TypeClassId MR_tc_decl_id;
This should be undone as well.
> - MR_ClassDict *MR_dict_class_methods;
> - MR_ClassDict **MR_dict_superclass_dicts;
> + MR_ClassDictStruct *MR_dict_class_methods;
> + MR_ClassDictStruct **MR_dict_superclass_dicts;
This should be undone as well.
Zoltan.
--------------------------------------------------------------------------
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