int.m name changes
Fergus Henderson
fjh at kryten.cs.mu.OZ.AU
Wed Feb 19 06:53:15 AEDT 1997
Hi Tom,
Any problems with this one?
Estimated hours: 0.5
Use nicer names for some recently introduced library predicates.
library/int.m:
Rename int__int_min as int__min_int, int__int_max as
int__max_int, and int__int_bits as int__bits_per_int.
This change is for aesthetic reasons.
compiler/lookup_switch.m:
Change calls to int__int_bits to instead call int__bits_per_int.
Index: int.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/int.m,v
retrieving revision 1.40
diff -u -r1.40 int.m
--- 1.40 1997/01/20 06:40:02
+++ int.m 1997/02/18 05:53:35
@@ -132,6 +132,18 @@
:- mode is(uo, di) is det.
:- mode is(out, in) is det.
+ % int__max_int(Max) binds Max to the maximum value of an int
+ % on this machine.
+:- pred int__max_int(int::out) is det.
+
+ % int__min_int(Max) binds Min to the minimum value of an int
+ % on this machine.
+:- pred int__min_int(int::out) is det.
+
+ % int__bits_per_int(Bits) binds Bits to the number of bits in an int
+ % on this machine.
+:- pred int__bits_per_int(int::out) is det.
+
/* The following routines are builtins that the compiler knows about.
Don't use them; use the functions above.
These will go away in some future release.
@@ -177,18 +189,6 @@
:- pred builtin_bit_neg(int, int).
:- mode builtin_bit_neg(in, uo) is det.
- % int__int_max(Max) binds Max to the maximum value of an int
- % on this machine.
-:- pred int__int_max(int::out) is det.
-
- % int__int_min(Max) binds Min to the minimum value of an int
- % on this machine.
-:- pred int__int_min(int::out) is det.
-
- % int__int_bits(Bits) binds Bits to the number of bits in an int
- % on this machine.
-:- pred int__int_bits(int::out) is det.
-
:- implementation.
:- import_module require.
@@ -289,7 +289,7 @@
").
-:- pragma c_code(int__int_max(Max::out), "
+:- pragma c_code(int__max_int(Max::out), "
if (sizeof(Integer) == sizeof(int))
Max = INT_MAX;
else if (sizeof(Integer) == sizeof(long))
@@ -298,7 +298,7 @@
fatal_error(""Unable to figure out max integer size"");
").
-:- pragma c_code(int__int_min(Min::out), "
+:- pragma c_code(int__min_int(Min::out), "
if (sizeof(Integer) == sizeof(int))
Min = INT_MIN;
else if (sizeof(Integer) == sizeof(long))
@@ -307,7 +307,7 @@
fatal_error(""Unable to figure out min integer size"");
").
-:- pragma c_code(int__int_bits(Bits::out), "
+:- pragma c_code(int__bits_per_int(Bits::out), "
Bits = sizeof(Integer) * CHAR_BIT;
").
Index: lookup_switch.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/lookup_switch.m,v
retrieving revision 1.19
diff -u -r1.19 lookup_switch.m
--- 1.19 1997/01/20 06:39:48
+++ lookup_switch.m 1997/02/18 05:54:43
@@ -330,7 +330,7 @@
code_info__get_globals(Globals),
{ globals__get_options(Globals, Options) },
{ getopt__lookup_int_option(Options, bits_per_word, WordBits0) },
- { int__int_bits(MachineBits) },
+ { int__bits_per_int(MachineBits) },
% prevent cross-compilation errors by making sure that
% the bitvector uses a number of bits that will fit both
% on this machine (so that we can correctly generate it),
@@ -358,7 +358,7 @@
code_info__get_globals(Globals),
{ globals__get_options(Globals, Options) },
{ getopt__lookup_int_option(Options, bits_per_word, WordBits0) },
- { int__int_bits(MachineBits) },
+ { int__bits_per_int(MachineBits) },
% prevent cross-compilation errors by making sure that
% the bitvector uses a number of bits that will fit both
% on this machine (so that we can correctly generate it),
--
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