trivial diff: library/*.m C code changes

Fergus Henderson fjh at cs.mu.oz.au
Fri Nov 21 17:48:44 AEDT 1997


library/benchmarking.m:
library/float.m:
library/int.m:
library/io.m:
library/mercury_builtin.m:
library/std_util.m:
	Use "mercury_foo.h" instead of "foo.h".
	Use `pragma c_code(...)' instead of the obsolete syntax
	`pragma(c_code, ...)' (I only changed some of the occurrences
	of this).

cvs diff: Diffing .
Index: benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.2
diff -u -u -r1.2 benchmarking.m
--- benchmarking.m	1997/08/05 04:10:00	1.2
+++ benchmarking.m	1997/11/21 06:42:45
@@ -49,14 +49,14 @@
 
 :- implementation.
 
-:- pragma(c_header_code, "
+:- pragma c_header_code("
 
 #include <stdio.h>
-#include ""timing.h""
+#include ""mercury_timing.h""
 
 ").
 
-:- pragma(c_code, report_stats, "
+:- pragma c_code(report_stats, will_not_call_mercury, "
 	int	time_at_prev_stat;
 
 	time_at_prev_stat = time_at_last_stat;
@@ -89,7 +89,7 @@
 :- external(benchmark_det/5).
 :- external(benchmark_nondet/5).
 
-:- pragma(c_code, "
+:- pragma c_code("
 
 /*
 INIT mercury_benchmarking_init_benchmark
Index: float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/float.m,v
retrieving revision 1.23
diff -u -u -r1.23 float.m
--- float.m	1997/07/27 15:06:44	1.23
+++ float.m	1997/11/21 06:42:54
@@ -269,7 +269,7 @@
 % Header files of mathematical significance.
 %
 
-:- pragma(c_header_code, "
+:- pragma c_header_code("
 
 	#include <float.h>
 	#include <math.h>
@@ -406,7 +406,7 @@
 % The floating-point system constants are derived from <float.h> and
 % implemented using the C interface.
 
-:- pragma(c_header_code, "
+:- pragma c_header_code("
 
 	#if defined USE_SINGLE_PREC_FLOAT
 		#define	MERCURY_FLOAT_MAX	FLT_MAX
Index: int.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/int.m,v
retrieving revision 1.46
diff -u -u -r1.46 int.m
--- int.m	1997/07/27 15:06:48	1.46
+++ int.m	1997/11/21 06:44:54
@@ -290,11 +290,11 @@
 % is/2 is replaced with `=' in the parser, but the following is useful
 % in case you should take the address of `is' or something weird like that.
 
-% we use pragma(c_code) to avoid complaints about redefinition of is/2
+% we use `pragma c_code' to avoid complaints about redefinition of is/2
 % from the Prolog compilers.
 
-:- pragma(c_code, is(X::uo, Y::di),  "X = Y;").
-:- pragma(c_code, is(X::out, Y::in), "X = Y;").
+:- pragma c_code(is(X::uo, Y::di),  will_not_call_mercury, "X = Y;").
+:- pragma c_code(is(X::out, Y::in), will_not_call_mercury, "X = Y;").
 
 %-----------------------------------------------------------------------------%
 
@@ -302,7 +302,9 @@
 :- pred int__to_float(int, float) is det.
 :- mode int__to_float(in, out) is det.
 */
-:- pragma(c_code, int__to_float(IntVal::in, FloatVal::out), "
+:- pragma c_code(int__to_float(IntVal::in, FloatVal::out),
+		will_not_call_mercury,
+"
 	FloatVal = IntVal;
 ").
 
@@ -313,7 +315,7 @@
 ").
 
 
-:- pragma c_code(int__max_int(Max::out), "
+:- pragma c_code(int__max_int(Max::out), will_not_call_mercury, "
 	if (sizeof(Integer) == sizeof(int))
 		Max = INT_MAX;
 	else if (sizeof(Integer) == sizeof(long))
@@ -322,7 +324,7 @@
 		fatal_error(""Unable to figure out max integer size"");
 ").
 
-:- pragma c_code(int__min_int(Min::out), "
+:- pragma c_code(int__min_int(Min::out), will_not_call_mercury, "
 	if (sizeof(Integer) == sizeof(int))
 		Min = INT_MIN;
 	else if (sizeof(Integer) == sizeof(long))
@@ -331,7 +333,7 @@
 		fatal_error(""Unable to figure out min integer size"");
 ").
 
-:- pragma c_code(int__bits_per_int(Bits::out), "
+:- pragma c_code(int__bits_per_int(Bits::out), will_not_call_mercury, "
 	Bits = sizeof(Integer) * CHAR_BIT;
 ").
 
Index: io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.143
diff -u -u -r1.143 io.m
--- io.m	1997/10/26 10:38:44	1.143
+++ io.m	1997/11/21 06:36:59
@@ -1998,9 +1998,9 @@
 
 :- pragma(c_header_code, "
 
-#include ""init.h""
-#include ""wrapper.h""
-#include ""type_info.h""
+#include ""mercury_init.h""
+#include ""mercury_wrapper.h""
+#include ""mercury_type_info.h""
 
 #include <stdio.h>
 #include <stdlib.h>
Index: mercury_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/mercury_builtin.m,v
retrieving revision 1.84
diff -u -u -r1.84 mercury_builtin.m
--- mercury_builtin.m	1997/10/14 09:27:19	1.84
+++ mercury_builtin.m	1997/11/21 06:38:38
@@ -325,7 +325,8 @@
 :- pred builtin_strcmp(int, string, string).
 :- mode builtin_strcmp(out, in, in) is det.
 
-:- pragma(c_code, builtin_strcmp(Res::out, S1::in, S2::in),
+:- pragma c_code(builtin_strcmp(Res::out, S1::in, S2::in),
+	will_not_call_mercury,
 	"Res = strcmp(S1, S2);").
 
 builtin_index_non_canonical_type(_, -1).
@@ -356,9 +357,9 @@
 		true
 	).
 
-:- pragma(c_header_code, "#include ""type_info.h""").
+:- pragma c_header_code("#include ""mercury_type_info.h""").
 
-:- pragma(c_code, "
+:- pragma c_code("
 
 
 #ifdef  USE_TYPE_LAYOUT
@@ -653,11 +654,12 @@
 */
 
 /* This doesn't work, due to the lack of support for aliasing.
-:- pragma(c_code, unsafe_promise_unique(X::in, Y::uo), "Y = X;").
+:- pragma c_code(unsafe_promise_unique(X::in, Y::uo), will_not_call_mercury,
+		"Y = X;").
 */
 
 :- external(unsafe_promise_unique/2).
-:- pragma(c_code, "
+:- pragma c_code("
 Define_extern_entry(mercury__unsafe_promise_unique_2_0);
 
 BEGIN_MODULE(unsafe_promise_unique_module)
@@ -712,9 +714,9 @@
 
 :- external(copy/2).
 
-:- pragma(c_header_code, "#include ""deep_copy.h""").
+:- pragma c_header_code("#include ""mercury_deep_copy.h""").
 
-:- pragma(c_code, "
+:- pragma c_code("
 Define_extern_entry(mercury__copy_2_0);
 Define_extern_entry(mercury__copy_2_1);
 
@@ -769,7 +771,7 @@
 
 % The type c_pointer can be used by predicates which use the C interface.
 
-:- pragma(c_code, "
+:- pragma c_code("
 
 /*
  * c_pointer has a special value reserved for its layout, since it needs to
Index: std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.109
diff -u -u -r1.109 std_util.m
--- std_util.m	1997/11/11 05:28:11	1.109
+++ std_util.m	1997/11/21 06:39:29
@@ -468,8 +468,8 @@
 ** user wishes.  This is basically a generalization of solutions/2.
 */
  
-#include ""imp.h""
-#include ""deep_copy.h""
+#include ""mercury_imp.h""
+#include ""mercury_deep_copy.h""
 
 Declare_entry(do_call_nondet_closure);
 Declare_entry(do_call_det_closure);
@@ -933,7 +933,7 @@
 
 :- pragma c_header_code("
 
-#include ""type_info.h""
+#include ""mercury_type_info.h""
 
 int	ML_compare_type_info(Word type_info_1, Word type_info_2);
 
@@ -1065,7 +1065,7 @@
 **	are defined in runtime/type_info.h.
 */
 
-#include ""type_info.h""
+#include ""mercury_type_info.h""
 
 
 ").
-- 
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.



More information about the developers mailing list