[m-dev.] Trivial change to bitmap.m

Ralph Becket rbeck at microsoft.com
Fri Feb 9 04:18:03 AEDT 2001


Estimated hours taken: 0.1

Trivial changes.

library/bitmap.m:
	Added (in, in) = out mode to get/2.
	Added unsafe_get/2.

Index: bitmap.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/bitmap.m,v
retrieving revision 1.1
diff -u -r1.1 bitmap.m
--- bitmap.m	2001/02/07 17:31:03	1.1
+++ bitmap.m	2001/02/08 17:15:29
@@ -98,7 +98,15 @@
     %
 :- func get(bitmap, int) = bool.
 :- mode get(bitmap_ui, in) = out is det.
+:- mode get(in, in) = out is det.
 
+    % Unsafe versions of the above: if the index is out of range
+    % then behaviour is undefined and bad things are likely to happen.
+    %
+:- func unsafe_get(bitmap, int) = bool.
+:- mode unsafe_get(bitmap_ui, in) = out is det.
+:- mode unsafe_get(in, in) = out is det.
+
     % Create a new copy of a bitmap.
     %
 :- func copy(bitmap) = bitmap.
@@ -269,6 +277,10 @@
 %
----------------------------------------------------------------------------
%
 
 get(BM, I) = ( if is_clear(BM, I) then no else yes ).
+
+%--------------------------------------------------------------------------
----%
+
+unsafe_get(BM, I) = ( if unsafe_is_clear(BM, I) then no else yes ).
 
 %
----------------------------------------------------------------------------
%
 

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 
--------------------------------------------------------------------------
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