[m-rev.] for review: native types in table_builtin.m

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Nov 8 18:38:00 AEDT 2002


For review by anyone.

Zoltan.

library/table_builtin.m:
	Represent trie nodes and answer lists with the right C types.
	Remove the casts that this change renders unnecessary.

	Supply dummy definitions for the .NET and Java backends, which
	do not yet have the runtime support for tabling anyway.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/table_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/table_builtin.m,v
retrieving revision 1.24
diff -u -r1.24 table_builtin.m
--- library/table_builtin.m	20 Oct 2002 11:47:38 -0000	1.24
+++ library/table_builtin.m	6 Nov 2002 02:56:21 -0000
@@ -117,15 +117,17 @@
 :- type ml_answer_table_node == ml_table.
 :- type ml_answer_slot == ml_table.
 :- type ml_answer_block == ml_table.
-:- type ml_table == c_pointer.
-
-	% N.B. interface continued below
+:- type ml_table.
 
 :- implementation.
 
-% This equivalence should be private. However, polymorphism gets an
-% internal error when compiling tests/tabling/boyer.m if it is.
-% :- type ml_table == c_pointer.
+:- type ml_table --->	ml_table(c_pointer).
+:- pragma foreign_type("C", ml_table, "MR_TrieNode").
+:- pragma foreign_type(il,  ml_table, "class [mscorlib]System.Object").
+
+:- type ml_answer_list --->	ml_answer_list(c_pointer).
+:- pragma foreign_type("C", ml_answer_list, "MR_AnswerList").
+:- pragma foreign_type(il,  ml_answer_list, "class [mscorlib]System.Object").
 
 %-----------------------------------------------------------------------------%
 
@@ -185,7 +187,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -205,7 +207,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -224,7 +226,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -243,7 +245,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -262,7 +264,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -281,7 +283,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -297,7 +299,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -313,7 +315,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -329,7 +331,7 @@
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -526,7 +528,7 @@
 		if (MR_io_tabling_start < MR_io_tabling_counter 
 			&& MR_io_tabling_counter <= MR_io_tabling_end)
 		{
-			T = (MR_Word) &MR_io_tabling_pointer;
+			T = &MR_io_tabling_pointer;
 			Counter = (MR_Word) old_counter;
 			Start = MR_io_tabling_start;
 			if (MR_io_tabling_counter > MR_io_tabling_counter_hwm)
@@ -556,12 +558,13 @@
 	}
 ").
 
-:- pragma foreign_proc("C", table_io_has_occurred(T::in),
+:- pragma foreign_proc("C",
+	table_io_has_occurred(T::in),
 	[will_not_call_mercury],
 "
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -654,7 +657,7 @@
 	% Mark a table as being active.
 :- impure pred table_nondet_mark_as_active(ml_subgoal_table_node::in) is det.
 
-	% Return the table of answers already return to the given nondet
+	% Return the table of answers already returned to the given nondet
 	% table.
 :- impure pred table_nondet_get_ans_table(ml_subgoal_table_node::in,
 	ml_table::out) is det.
@@ -690,11 +693,14 @@
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #else
 #ifdef	MR_THREAD_SAFE
-#error ""Sorry, not yet implemented: mixing minimal model tabling and threads""
+#error ""Sorry, not yet implemented: minimal model tabling with threads""
+#endif
+#ifdef	MR_HIGHLEVEL_CODE
+#error ""Sorry, not yet implemented: minimal model tabling with high level code""
 #endif
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T0;
+	table = T0;
 
 	/*
 	** Initialize the subgoal if this is the first time we see it.
@@ -724,8 +730,10 @@
 
 #ifdef	MR_TABLE_DEBUG
 		if (MR_tabledebug) {
-			printf(""setting up table %p -> %p, answer slot %p\\n"",
-				table, subgoal, subgoal->answer_list_tail);
+			printf(""setting up table %p -> %p, "",
+				table, subgoal);
+			printf(""answer slot %p\\n"",
+				subgoal->answer_list_tail);
 		}
 
 		if (MR_maxfr != MR_curfr) {
@@ -759,7 +767,7 @@
 
 /*
 
-XXX :- external stops us from using this
+XXX :- external stops us from using these two definitions
 
 :- pragma foreign_proc("MC++",
 	table_nondet_suspend(_A::in, _B::out), [will_not_call_mercury, promise_pure],
@@ -784,9 +792,10 @@
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
-	SUCCESS_INDICATOR = (table->MR_subgoal->status == MR_SUBGOAL_COMPLETE);
+	SUCCESS_INDICATOR =
+		(table->MR_subgoal->status == MR_SUBGOAL_COMPLETE);
 #else
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #endif
@@ -799,9 +808,10 @@
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
-	SUCCESS_INDICATOR = (table->MR_subgoal->status == MR_SUBGOAL_ACTIVE);
+	SUCCESS_INDICATOR =
+		(table->MR_subgoal->status == MR_SUBGOAL_ACTIVE);
 #else
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #endif
@@ -814,7 +824,7 @@
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 	MR_push_generator(MR_curfr, table);
 	MR_register_generator_ptr(table);
@@ -831,9 +841,9 @@
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
-	AT = (MR_Word) &(table->MR_subgoal->answer_table);
+	AT = (MR_TrieNode) &(table->MR_subgoal->answer_table);
 #else
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #endif
@@ -849,7 +859,7 @@
 	MR_TrieNode	table;
 	MR_bool		is_new_answer;
 
-	table = (MR_TrieNode) T;
+	table = T;
 
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
@@ -875,7 +885,7 @@
 	MR_Subgoal		*subgoal;
 	MR_AnswerListNode	*answer_node;
 
-	table = (MR_TrieNode) T;
+	table = T;
 	subgoal = table->MR_subgoal;
 	subgoal->num_ans++;
 
@@ -923,7 +933,7 @@
 		error("table_multi_return_all_ans: no first answer")
 	).
 
-:- semipure pred table_nondet_return_all_ans_2(c_pointer::in,
+:- semipure pred table_nondet_return_all_ans_2(ml_answer_list::in,
 	ml_answer_block::out) is nondet.
 
 table_nondet_return_all_ans_2(CurNode0, Answer) :-
@@ -934,45 +944,47 @@
 		semipure table_nondet_return_all_ans_2(CurNode1, Answer)
 	).
 
-:- semipure pred pickup_answer_list(ml_subgoal_table_node::in, c_pointer::out)
-	is det.
+:- semipure pred pickup_answer_list(ml_subgoal_table_node::in,
+	ml_answer_list::out) is det.
 
-:- pragma foreign_proc("C", pickup_answer_list(T::in, CurNode::out),
-	[will_not_call_mercury], "
+:- pragma foreign_proc("C",
+	pickup_answer_list(T::in, CurNode::out),
+	[will_not_call_mercury],
+"
 #ifdef MR_USE_MINIMAL_MODEL
-		MR_TrieNode	table;
+	MR_TrieNode	table;
 
-		table = (MR_TrieNode) T;
-	CurNode = (MR_Word) table->MR_subgoal->answer_list;
+	table = T;
+	CurNode = table->MR_subgoal->answer_list;
 
   #ifdef MR_TABLE_DEBUG
-		if (MR_tabledebug) {
-			printf(""restoring all answers in %p -> %p\\n"",
-				table, table->MR_subgoal);
-		}
+	if (MR_tabledebug) {
+		printf(""restoring all answers in %p -> %p\\n"",
+			table, table->MR_subgoal);
+	}
   #endif
+#else
+	MR_fatal_error(""minimal model code entered when not enabled"");
 #endif
 ").
 
-:- semipure pred return_next_answer(c_pointer::in, ml_answer_block::out,
-	c_pointer::out) is semidet.
+:- semipure pred return_next_answer(ml_answer_list::in, ml_answer_block::out,
+	ml_answer_list::out) is semidet.
 
 :- pragma foreign_proc("C",
 	return_next_answer(CurNode0::in, AnswerBlock::out, CurNode::out),
-	[will_not_call_mercury], "
+	[will_not_call_mercury],
+"
 #ifdef MR_USE_MINIMAL_MODEL
-	MR_AnswerList	cur_node0;
-
-	cur_node0 = (MR_AnswerList *) CurNode0;
-	if (cur_node0 == NULL) {
+	if (CurNode0 == NULL) {
 		SUCCESS_INDICATOR = MR_FALSE;
-		} else {
-		AnswerBlock = (MR_Word) &cur_node0->answer_data;
-		CurNode = (MR_Word) cur_node0->next_answer;
+	} else {
+		AnswerBlock = &CurNode0->answer_data;
+		CurNode = CurNode0->next_answer;
 		SUCCESS_INDICATOR = MR_TRUE;
-		}
+	}
 #else
-		MR_fatal_error(""minimal model code entered when not enabled"");
+	MR_fatal_error(""minimal model code entered when not enabled"");
 #endif
 ").
 
@@ -1159,102 +1171,68 @@
 
 ").
 
-:- pragma foreign_proc("C", table_lookup_insert_int(T0::in, I::in, T::out),
+:- pragma foreign_proc("C",
+	table_lookup_insert_int(T0::in, I::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_INT(table, table0, (MR_Integer) I);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_INT(T, T0, (MR_Integer) I);
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_start_int(T0::in, S::in, I::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_START_INT(table, table0,
+	MR_DEBUG_NEW_TABLE_START_INT(T, T0,
 		(MR_Integer) S, (MR_Integer) I);
-	T = (MR_Word) table;
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_char(T0::in, C::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_CHAR(table, table0, (MR_Integer) C);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_CHAR(T, T0, (MR_Integer) C);
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_string(T0::in, S::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_STRING(table, table0, (MR_String) S);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_STRING(T, T0, (MR_String) S);
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_float(T0::in, F::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_FLOAT(table, table0, F);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_FLOAT(T, T0, F);
 ").
 
 :- pragma foreign_proc("C", 
 	table_lookup_insert_enum(T0::in, R::in, V::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_ENUM(table, table0, R, V);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_ENUM(T, T0, R, V);
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_user(T0::in, V::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_ANY(table, table0, (MR_TypeInfo) TypeInfo_for_T, V);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_ANY(T, T0, (MR_TypeInfo) TypeInfo_for_T, V);
 ").
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_poly(T0::in, V::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0, table;
-
-	table0 = (MR_TrieNode) T0;
-	MR_DEBUG_NEW_TABLE_ANY(table, table0, (MR_TypeInfo) TypeInfo_for_T, V);
-	T = (MR_Word) table;
+	MR_DEBUG_NEW_TABLE_ANY(T, T0, (MR_TypeInfo) TypeInfo_for_T, V);
 ").
 
 :- pragma foreign_proc("C",
 	table_save_int_ans(T::in, Offset::in, I::in),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, I,
+	MR_TABLE_SAVE_ANSWER(T, Offset, I,
 		&MR_TYPE_CTOR_INFO_NAME(builtin, int, 0));
 ").
 
@@ -1262,10 +1240,7 @@
 	table_save_char_ans(T::in, Offset::in, C::in),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, C,
+	MR_TABLE_SAVE_ANSWER(T, Offset, C,
 		&MR_TYPE_CTOR_INFO_NAME(builtin, character, 0));
 ").
 
@@ -1273,10 +1248,7 @@
 	table_save_string_ans(T::in, Offset::in, S::in),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, (MR_Word) S,
+	MR_TABLE_SAVE_ANSWER(T, Offset, (MR_Word) S,
 		&MR_TYPE_CTOR_INFO_NAME(builtin, string, 0));
 ").
 
@@ -1284,14 +1256,11 @@
 	table_save_float_ans(T::in, Offset::in, F::in),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
 #ifdef MR_HIGHLEVEL_CODE
-	MR_TABLE_SAVE_ANSWER(table, Offset, (MR_Word) MR_box_float(F),
+	MR_TABLE_SAVE_ANSWER(T, Offset, (MR_Word) MR_box_float(F),
 		&MR_TYPE_CTOR_INFO_NAME(builtin, float, 0));
 #else
-	MR_TABLE_SAVE_ANSWER(table, Offset, MR_float_to_word(F),
+	MR_TABLE_SAVE_ANSWER(T, Offset, MR_float_to_word(F),
 		&MR_TYPE_CTOR_INFO_NAME(builtin, float, 0));
 #endif
 ").
@@ -1300,10 +1269,7 @@
 	table_save_io_state_ans(T::in, Offset::in, S::ui),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, (MR_Word) S,
+	MR_TABLE_SAVE_ANSWER(T, Offset, (MR_Word) S,
 		&MR_TYPE_CTOR_INFO_NAME(io, state, 0));
 ").
 
@@ -1311,53 +1277,38 @@
 	table_save_any_ans(T::in, Offset::in, V::in),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, V, TypeInfo_for_T);
+	MR_TABLE_SAVE_ANSWER(T, Offset, V, TypeInfo_for_T);
 ").
 
 :- pragma foreign_proc("C",
 	table_restore_int_ans(T::in, Offset::in, I::out),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	I = (MR_Integer) MR_TABLE_GET_ANSWER(table, Offset);
+	I = (MR_Integer) MR_TABLE_GET_ANSWER(T, Offset);
 ").
 
 :- pragma foreign_proc("C",
 	table_restore_char_ans(T::in, Offset::in, C::out),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	C = (MR_Char) MR_TABLE_GET_ANSWER(table, Offset);
+	C = (MR_Char) MR_TABLE_GET_ANSWER(T, Offset);
 ").
 
 :- pragma foreign_proc("C",
 	table_restore_string_ans(T::in, Offset::in, S::out),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	S = (MR_String) MR_TABLE_GET_ANSWER(table, Offset);
+	S = (MR_String) MR_TABLE_GET_ANSWER(T, Offset);
 ").
 
 :- pragma foreign_proc("C",
 	table_restore_float_ans(T::in, Offset::in, F::out),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
 #ifdef MR_HIGHLEVEL_CODE
-	F = MR_unbox_float(MR_TABLE_GET_ANSWER(table, Offset));
+	F = MR_unbox_float(MR_TABLE_GET_ANSWER(T, Offset));
 #else
-	F = MR_word_to_float(MR_TABLE_GET_ANSWER(table, Offset));
+	F = MR_word_to_float(MR_TABLE_GET_ANSWER(T, Offset));
 #endif
 ").
 
@@ -1365,30 +1316,21 @@
 	table_restore_io_state_ans(T::in, Offset::in, V::uo),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	V = (MR_Word) MR_TABLE_GET_ANSWER(table, Offset);
+	V = (MR_Word) MR_TABLE_GET_ANSWER(T, Offset);
 ").
 
 :- pragma foreign_proc("C",
 	table_restore_any_ans(T::in, Offset::in, V::out),
 	[will_not_call_mercury, promise_semipure],
 "
-	MR_TrieNode	table;
-
-	table = (MR_TrieNode) T;
-	V = (MR_Word) MR_TABLE_GET_ANSWER(table, Offset);
+	V = (MR_Word) MR_TABLE_GET_ANSWER(T, Offset);
 ").
 
 :- pragma foreign_proc("C",
 	table_create_ans_block(T0::in, Size::in, T::out),
 	[will_not_call_mercury],
 "
-	MR_TrieNode	table0;
-
-	table0 = (MR_TrieNode) T0;
-	MR_TABLE_CREATE_ANSWER_BLOCK(table0, Size);
+	MR_TABLE_CREATE_ANSWER_BLOCK(T0, Size);
 	T = T0;
 ").
 
@@ -1399,7 +1341,6 @@
 	table_report_statistics, [will_not_call_mercury], "
 	MR_table_report_statistics(stderr);
 ").
-
 
 table_lookup_insert_int(_, _, _) :-
 	% This version is only used for back-ends for which there is no
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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