[m-dev.] trivial diff: more -DMR_NO_BACKWARDS_COMPAT stuff
Zoltan Somogyi
zs at cs.mu.OZ.AU
Thu Nov 11 16:00:42 AEDT 1999
library/*.m:
Put MR_ prefixes on uses of string_const(), make_aligned_string()
variants, and COMPARE_EQUAL and friends, in order to allow bootstrap
with -DMR_NO_BACKWARDS_COMPAT.
Zoltan.
cvs diff: Diffing .
Index: array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.63
diff -u -b -r1.63 array.m
--- array.m 1999/10/20 07:03:09 1.63
+++ array.m 1999/11/11 04:55:50
@@ -290,8 +290,8 @@
MR_TYPECTOR_REP_ARRAY,
(Word *) &mercury_data_array__type_ctor_functors_array_1,
(Word *) &mercury_data_array__type_ctor_layout_array_1,
- string_const(""array"", 5),
- string_const(""array"", 5),
+ MR_string_const(""array"", 5),
+ MR_string_const(""array"", 5),
MR_RTTI_VERSION
};
Index: builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.24
diff -u -b -r1.24 builtin.m
--- builtin.m 1999/10/26 14:41:18 1.24
+++ builtin.m 1999/11/11 04:56:26
@@ -517,8 +517,8 @@
MR_TYPECTOR_REP_INT,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_int_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_int_0,
- string_const(""builtin"", 7),
- string_const(""int"", 3),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""int"", 3),
MR_RTTI_VERSION
};
@@ -536,8 +536,8 @@
MR_TYPECTOR_REP_CHAR,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_character_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_character_0,
- string_const(""builtin"", 7),
- string_const(""character"", 9),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""character"", 9),
MR_RTTI_VERSION
};
@@ -555,8 +555,8 @@
MR_TYPECTOR_REP_STRING,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_string_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_string_0,
- string_const(""builtin"", 7),
- string_const(""string"", 6),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""string"", 6),
MR_RTTI_VERSION
};
@@ -574,8 +574,8 @@
MR_TYPECTOR_REP_FLOAT,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_float_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_float_0,
- string_const(""builtin"", 7),
- string_const(""float"", 5),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""float"", 5),
MR_RTTI_VERSION
};
@@ -591,8 +591,8 @@
MR_TYPECTOR_REP_VOID,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_void_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_void_0,
- string_const(""builtin"", 7),
- string_const(""void"", 4),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""void"", 4),
MR_RTTI_VERSION
};
@@ -610,8 +610,8 @@
MR_TYPECTOR_REP_SUCCIP,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_succip_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_succip_0,
- string_const(""builtin"", 7),
- string_const(""succip"", 6),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""succip"", 6),
MR_RTTI_VERSION
};
@@ -627,8 +627,8 @@
MR_TYPECTOR_REP_HP,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_hp_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_hp_0,
- string_const(""builtin"", 7),
- string_const(""hp"", 2),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""hp"", 2),
MR_RTTI_VERSION
};
@@ -644,8 +644,8 @@
MR_TYPECTOR_REP_CURFR,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_curfr_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_curfr_0,
- string_const(""builtin"", 7),
- string_const(""curfr"", 5),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""curfr"", 5),
MR_RTTI_VERSION
};
@@ -661,8 +661,8 @@
MR_TYPECTOR_REP_MAXFR,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_maxfr_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_maxfr_0,
- string_const(""builtin"", 7),
- string_const(""maxfr"", 5),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""maxfr"", 5),
MR_RTTI_VERSION
};
@@ -678,8 +678,8 @@
MR_TYPECTOR_REP_REDOFR,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_redofr_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_redofr_0,
- string_const(""builtin"", 7),
- string_const(""redofr"", 6),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""redofr"", 6),
MR_RTTI_VERSION
};
@@ -695,8 +695,8 @@
MR_TYPECTOR_REP_REDOIP,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_redoip_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_redoip_0,
- string_const(""builtin"", 7),
- string_const(""redoip"", 6),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""redoip"", 6),
MR_RTTI_VERSION
};
@@ -714,8 +714,8 @@
MR_TYPECTOR_REP_TRAIL_PTR,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_trail_ptr_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_trail_ptr_0,
- string_const(""builtin"", 7),
- string_const(""trail_ptr"", 9),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""trail_ptr"", 9),
MR_RTTI_VERSION
};
@@ -731,8 +731,8 @@
MR_TYPECTOR_REP_TICKET,
(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_ticket_0,
(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_ticket_0,
- string_const(""builtin"", 7),
- string_const(""ticket"", 6),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""ticket"", 6),
MR_RTTI_VERSION
};
@@ -894,8 +894,8 @@
MR_TYPECTOR_REP_C_POINTER,
(MR_TypeCtorFunctors) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
(MR_TypeCtorLayout) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
- string_const(""builtin"", 7),
- string_const(""c_pointer"", 9),
+ MR_string_const(""builtin"", 7),
+ MR_string_const(""c_pointer"", 9),
MR_RTTI_VERSION
};
@@ -922,9 +922,9 @@
proceed();
Define_entry(mercury____Compare___builtin__c_pointer_0_0);
- r1 = (r1 == r2 ? COMPARE_EQUAL :
- r1 < r2 ? COMPARE_LESS :
- COMPARE_GREATER);
+ r1 = (r1 == r2 ? MR_COMPARE_EQUAL :
+ r1 < r2 ? MR_COMPARE_LESS :
+ MR_COMPARE_GREATER);
proceed();
END_MODULE
Index: io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.187
diff -u -b -r1.187 io.m
--- io.m 1999/10/21 03:58:43 1.187
+++ io.m 1999/11/11 04:54:39
@@ -2719,7 +2719,7 @@
/* copy the error message to a Mercury string */
restore_registers(); /* for MR_hp */
- make_aligned_string(message_as_mercury_string, message);
+ MR_make_aligned_string(message_as_mercury_string, message);
save_registers(); /* for MR_hp */
/* call some Mercury code to throw the exception */
@@ -3212,7 +3212,7 @@
it should be of type `ConstString' (const char *),
but fixing that requires a fair bit of work
on the compiler. */
- make_aligned_string(LVALUE_CAST(ConstString, PrognameOut),
+ MR_make_aligned_string(LVALUE_CAST(ConstString, PrognameOut),
progname);
} else {
PrognameOut = DefaultProgname;
Index: private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.31
diff -u -b -r1.31 private_builtin.m
--- private_builtin.m 1999/10/20 07:03:12 1.31
+++ private_builtin.m 1999/11/11 04:56:38
@@ -314,8 +314,8 @@
mercury_data_private_builtin__type_ctor_functors_type_info_1,
(MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_type_info_1,
- string_const(""private_builtin"", 15),
- string_const(""type_ctor_info"", 14),
+ MR_string_const(""private_builtin"", 15),
+ MR_string_const(""type_ctor_info"", 14),
MR_RTTI_VERSION
};
@@ -333,8 +333,8 @@
mercury_data_private_builtin__type_ctor_functors_type_info_1,
(MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_type_info_1,
- string_const(""private_builtin"", 15),
- string_const(""type_info"", 9),
+ MR_string_const(""private_builtin"", 15),
+ MR_string_const(""type_info"", 9),
MR_RTTI_VERSION
};
@@ -377,8 +377,8 @@
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
(MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
- string_const(""private_builtin"", 15),
- string_const(""base_typeclass_info"", 19),
+ MR_string_const(""private_builtin"", 15),
+ MR_string_const(""base_typeclass_info"", 19),
MR_RTTI_VERSION
};
@@ -396,8 +396,8 @@
mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
(MR_TypeCtorLayout) &
mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
- string_const(""private_builtin"", 15),
- string_const(""typeclass_info"", 14),
+ MR_string_const(""private_builtin"", 15),
+ MR_string_const(""typeclass_info"", 14),
MR_RTTI_VERSION
};
@@ -438,7 +438,7 @@
save_transient_registers();
comp = MR_compare_type_info(r1, r2);
restore_transient_registers();
- r1 = (comp == COMPARE_EQUAL);
+ r1 = (comp == MR_COMPARE_EQUAL);
proceed();
}
Index: std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.169
diff -u -b -r1.169 std_util.m
--- std_util.m 1999/10/28 06:22:49 1.169
+++ std_util.m 1999/11/11 04:56:45
@@ -979,7 +979,7 @@
save_transient_registers();
comp = MR_compare_type_info(univ_type_info, TypeInfo_for_T);
restore_transient_registers();
- if (comp == COMPARE_EQUAL) {
+ if (comp == MR_COMPARE_EQUAL) {
Type = MR_field(MR_mktag(0), Univ, UNIV_OFFSET_FOR_DATA);
SUCCESS_INDICATOR = TRUE;
} else {
@@ -1020,8 +1020,8 @@
MR_TYPECTOR_REP_UNIV,
(Word *) &mercury_data_std_util__type_ctor_functors_univ_0,
(Word *) &mercury_data_std_util__type_ctor_layout_univ_0,
- string_const(""std_util"", 8),
- string_const(""univ"", 4),
+ MR_string_const(""std_util"", 8),
+ MR_string_const(""univ"", 4),
MR_RTTI_VERSION
};
@@ -1103,7 +1103,7 @@
save_transient_registers();
comp = MR_compare_type_info(typeinfo1, typeinfo2);
restore_transient_registers();
- if (comp != COMPARE_EQUAL) {
+ if (comp != MR_COMPARE_EQUAL) {
r1 = FALSE;
proceed();
}
@@ -1148,7 +1148,7 @@
save_transient_registers();
comp = MR_compare_type_info(typeinfo1, typeinfo2);
restore_transient_registers();
- if (comp != COMPARE_EQUAL) {
+ if (comp != MR_COMPARE_EQUAL) {
r1 = comp;
proceed();
}
@@ -1181,7 +1181,7 @@
save_transient_registers();
comp = MR_compare_type_info(r1, r2);
restore_transient_registers();
- r1 = (comp == COMPARE_EQUAL);
+ r1 = (comp == MR_COMPARE_EQUAL);
proceed();
}
@@ -1565,7 +1565,7 @@
*/
if (success) {
- make_aligned_string(FunctorName, (String) (Word)
+ MR_make_aligned_string(FunctorName, (String) (Word)
info.functor_name);
Arity = info.arity;
save_transient_registers();
@@ -1830,7 +1830,7 @@
(Word *) type_info, (Word *) arg_vector[i]);
comp = MR_compare_type_info(list_arg_type_info, arg_type_info);
- if (comp != COMPARE_EQUAL) {
+ if (comp != MR_COMPARE_EQUAL) {
return FALSE;
}
arg_list = MR_list_tail(arg_list);
@@ -2227,7 +2227,7 @@
MR_TYPE_CTOR_LAYOUT_FUNCTOR_DESCRIPTOR_ARITY(functor_descriptor);
if (info->need_functor) {
- make_aligned_string(info->functor,
+ MR_make_aligned_string(info->functor,
MR_TYPE_CTOR_LAYOUT_FUNCTOR_DESCRIPTOR_FUNCTOR_NAME(
functor_descriptor));
}
@@ -2265,7 +2265,7 @@
functor_descriptor);
if (info->need_functor) {
- make_aligned_string(info->functor,
+ MR_make_aligned_string(info->functor,
MR_TYPE_CTOR_LAYOUT_FUNCTOR_DESCRIPTOR_FUNCTOR_NAME(
functor_descriptor));
}
@@ -2378,7 +2378,7 @@
case MR_TYPECTOR_REP_PRED:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<predicate>>"");
+ MR_make_aligned_string(info->functor, ""<<predicate>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2404,7 +2404,7 @@
case MR_TYPECTOR_REP_C_POINTER:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<c_pointer>>"");
+ MR_make_aligned_string(info->functor, ""<<c_pointer>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2413,7 +2413,7 @@
case MR_TYPECTOR_REP_TYPEINFO:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<typeinfo>>"");
+ MR_make_aligned_string(info->functor, ""<<typeinfo>>"");
}
/* XXX should we return the arguments here? */
info->argument_vector = NULL;
@@ -2423,7 +2423,7 @@
case MR_TYPECTOR_REP_TYPECLASSINFO:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<typeclassinfo>>"");
+ MR_make_aligned_string(info->functor, ""<<typeclassinfo>>"");
}
/* XXX should we return the arguments here? */
info->argument_vector = NULL;
@@ -2433,7 +2433,7 @@
case MR_TYPECTOR_REP_ARRAY:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<array>>"");
+ MR_make_aligned_string(info->functor, ""<<array>>"");
}
/* XXX should we return the arguments here? */
info->argument_vector = NULL;
@@ -2443,7 +2443,7 @@
case MR_TYPECTOR_REP_SUCCIP:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<succip>>"");
+ MR_make_aligned_string(info->functor, ""<<succip>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2452,7 +2452,7 @@
case MR_TYPECTOR_REP_HP:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<hp>>"");
+ MR_make_aligned_string(info->functor, ""<<hp>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2461,7 +2461,7 @@
case MR_TYPECTOR_REP_CURFR:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<curfr>>"");
+ MR_make_aligned_string(info->functor, ""<<curfr>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2470,7 +2470,7 @@
case MR_TYPECTOR_REP_MAXFR:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<maxfr>>"");
+ MR_make_aligned_string(info->functor, ""<<maxfr>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2479,7 +2479,7 @@
case MR_TYPECTOR_REP_REDOFR:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<redofr>>"");
+ MR_make_aligned_string(info->functor, ""<<redofr>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2488,7 +2488,7 @@
case MR_TYPECTOR_REP_REDOIP:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<redoip>>"");
+ MR_make_aligned_string(info->functor, ""<<redoip>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2497,7 +2497,7 @@
case MR_TYPECTOR_REP_TRAIL_PTR:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<trail_ptr>>"");
+ MR_make_aligned_string(info->functor, ""<<trail_ptr>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2506,7 +2506,7 @@
case MR_TYPECTOR_REP_TICKET:
if (info->need_functor) {
- make_aligned_string(info->functor, ""<<ticket>>"");
+ MR_make_aligned_string(info->functor, ""<<ticket>>"");
}
info->argument_vector = NULL;
info->type_info_vector = NULL;
@@ -2610,7 +2610,8 @@
}
/* Copy functor onto the heap */
- make_aligned_string(LVALUE_CAST(ConstString, Functor), info.functor);
+ MR_make_aligned_string(LVALUE_CAST(ConstString, Functor),
+ info.functor);
Arity = info.arity;
}").
@@ -2637,7 +2638,7 @@
/* compare the actual type with the expected type */
comparison_result =
MR_compare_type_info(arg_type_info, TypeInfo_for_ArgT);
- success = (comparison_result == COMPARE_EQUAL);
+ success = (comparison_result == MR_COMPARE_EQUAL);
if (success) {
Argument = *argument_ptr;
@@ -2730,7 +2731,8 @@
}
/* Get functor */
- make_aligned_string(LVALUE_CAST(ConstString, Functor), info.functor);
+ MR_make_aligned_string(LVALUE_CAST(ConstString, Functor),
+ info.functor);
/* Get arity */
Arity = info.arity;
Index: store.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/store.m,v
retrieving revision 1.16
diff -u -b -r1.16 store.m
--- store.m 1999/09/30 22:07:50 1.16
+++ store.m 1999/11/11 04:50:12
@@ -327,7 +327,7 @@
}
if (MR_compare_type_info(arg_type_info, TypeInfo_for_ArgT) !=
- COMPARE_EQUAL)
+ MR_COMPARE_EQUAL)
{
fatal_error(""store__arg_ref: argument has wrong type"");
}
@@ -353,7 +353,7 @@
}
if (MR_compare_type_info(arg_type_info, TypeInfo_for_ArgT) !=
- COMPARE_EQUAL)
+ MR_COMPARE_EQUAL)
{
fatal_error(""store__new_arg_ref: argument has wrong type"");
}
Index: string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.118
diff -u -b -r1.118 string.m
--- string.m 1999/11/03 04:14:26 1.118
+++ string.m 1999/11/11 04:54:56
@@ -1813,7 +1813,8 @@
Word tmp;
if (Start < 0) Start = 0;
if (Count <= 0) {
- make_aligned_string(LVALUE_CAST(ConstString, SubString), """");
+ MR_make_aligned_string(LVALUE_CAST(ConstString, SubString),
+ """");
} else {
len = strlen(Str);
if (Start > len) Start = len;
@@ -1862,7 +1863,7 @@
Integer len;
Word tmp;
if (Count <= 0) {
- make_aligned_string(LVALUE_CAST(ConstString, Left), """");
+ MR_make_aligned_string(LVALUE_CAST(ConstString, Left), """");
Right = Str;
} else {
len = strlen(Str);
--------------------------------------------------------------------------
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