[m-rev.] diff: fix stdlib compilation problems in non-C grades

Julien Fischer juliensf at csse.unimelb.edu.au
Mon May 9 16:08:24 AEST 2011


Branches: main

Fix compilation problems in non-C grades.

library/array.m:
 	Conform to recent argument ordering changes in C#, Java and Erlang
 	foreign procs.


library/io.m:
 	Conform to the argument order change for array.resize/4.

Julien.

Index: library/array.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.183
diff -u -r1.183 array.m
--- library/array.m	6 May 2011 15:19:33 -0000	1.183
+++ library/array.m	9 May 2011 06:06:31 -0000
@@ -1326,7 +1326,7 @@
  ").

  :- pragma foreign_proc("C#",
-    array.unsafe_set(Array0::array_di, Index::in, Item::in, Array::array_uo),
+    array.unsafe_set(Index::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "{
      Array0.SetValue(Item, Index);   /* destructive update! */
@@ -1342,7 +1342,7 @@
  }").

  :- pragma foreign_proc("Erlang",
-    array.unsafe_set(Array0::array_di, Index::in, Item::in, Array::array_uo),
+    array.unsafe_set(Index::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      Array = setelement(Index + 1, Array0, Item)
@@ -1356,7 +1356,7 @@
  ").

  :- pragma foreign_proc("Java",
-    array.unsafe_set(Array0::array_di, Index::in, Item::in, Array::array_uo),
+    array.unsafe_set(Index::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      if (Array0 instanceof int[]) {
@@ -1465,14 +1465,14 @@
  ").

  :- pragma foreign_proc("C#",
-    array.resize(Array0::array_di, Size::in, Item::in, Array::array_uo),
+    array.resize(Size::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      Array = array.ML_array_resize(Array0, Size, Item);
  ").

  :- pragma foreign_proc("Erlang",
-    array.resize(Array0::array_di, Size::in, Item::in, Array::array_uo),
+    array.resize(Size::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      InitialSize = size(Array0),
@@ -1489,7 +1489,7 @@
  ").

  :- pragma foreign_proc("Java",
-    array.resize(Array0::array_di, Size::in, Item::in, Array::array_uo),
+    array.resize(Size::in, Item::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      Array = jmercury.array.ML_array_resize(Array0, Size, Item);
@@ -1560,21 +1560,21 @@
  ").

  :- pragma foreign_proc("C#",
-    array.shrink_2(Array0::array_di, Size::in, Array::array_uo),
+    array.shrink_2(Size::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      Array = array.ML_shrink_array(Array0, Size);
  ").

  :- pragma foreign_proc("Erlang",
-    array.shrink_2(Array0::array_di, Size::in, Array::array_uo),
+    array.shrink_2(Size::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      Array = list_to_tuple(lists:sublist(tuple_to_list(Array0), Size))
  ").

  :- pragma foreign_proc("Java",
-    array.shrink_2(Array0::array_di, Size::in, Array::array_uo),
+    array.shrink_2(Size::in, Array0::array_di, Array::array_uo),
      [will_not_call_mercury, promise_pure, thread_safe],
  "
      if (Array0 == null) {
Index: library/io.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.460
diff -u -r1.460 io.m
--- library/io.m	8 May 2011 16:02:22 -0000	1.460
+++ library/io.m	9 May 2011 06:06:31 -0000
@@ -4083,7 +4083,7 @@

  io.resize_buffer(_OldSize, NewSize, buffer(Array0), buffer(Array)) :-
      char.det_from_int(0, Char),
-    array.resize(Array0, NewSize, Char, Array).
+    array.resize(NewSize, Char, Array0, Array).

  :- pred io.buffer_to_string(buffer::buffer_di, int::in, string::uo) is semidet.


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list