Skip to content

Commit

Permalink
Fix minor compilation problems in extras and benchmarks.
Browse files Browse the repository at this point in the history
These are due to:

- differences between module and file names.
- redundant imports
- the recent change from math.domain_error -> exception.domain_error.

benchmarks/*/*.m:
extras/*/*.m:
    As above.
  • Loading branch information
juliensf committed May 15, 2020
1 parent f36c88b commit 84e2536
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion benchmarks/progs/fibonacci/fib_par_plain.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

:- module fib_plain_par.
:- module fib_par_plain.

:- interface.

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/progs/icfp2000/eval_util.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

:- implementation.

:- import_module int, list, exception, map, string, gml.
:- import_module int, list, exception, map, string.
:- import_module pprint.

write_nice_exception(E) -->
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/progs/icfp2000/renderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:- import_module transform_object, gml, op.
:- import_module precompute_lights.
:- import_module map, array, exception, require, math.
:- import_module int, float, list, std_util, string.
:- import_module int, float, std_util, string.

render(Params1) -->
{ Wid = Params1 ^ wid },
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/progs/icfp2000/trans.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@

:- implementation.

:- import_module exception, string, math, list, std_util.
:- import_module exception, string, math, std_util.

% NOTE 1: points and vectors are represented using the point/3 type
% defined in eval.m. For the purposes, a point (x, y, z) is
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/progs/icfp2001/input.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

:- implementation.

:- import_module int, list, char, exception, string, bool.
:- import_module int, exception, string, bool.
:- import_module maybe.
:- import_module pair.

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/progs/ray/gfx.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

:- implementation.

:- import_module require, string.
:- import_module require.

colour(R1, G1, B1) + colour(R2, G2, B2) = colour(R1 + R2, G1 + G2, B1 + B2).

Expand Down
1 change: 0 additions & 1 deletion extras/base64/base64.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
:- import_module exception.
:- import_module float.
:- import_module int.
:- import_module list.
:- import_module map.
:- import_module require.
:- import_module std_util.
Expand Down
13 changes: 6 additions & 7 deletions extras/gmp_int/gmp_int.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
:- func invmod(gmp_int, gmp_int) = gmp_int.

% Exponentiation.
% Throws exception `math.domain_error` if Y is negative.
% Throws exception `exception.domain_error` if Y is negative.
%
:- func pow(gmp_int, gmp_int) = gmp_int.

Expand Down Expand Up @@ -296,7 +296,6 @@

:- import_module exception.
:- import_module int.
:- import_module math.
:- import_module require.

%---------------------------------------------------------------------------%
Expand Down Expand Up @@ -523,7 +522,7 @@
( to_int(A, Res0) ->
Res0 = Res
;
throw(math.domain_error("gmp_int.det_to_int: not in int range"))
throw(domain_error("gmp_int.det_to_int: not in int range"))
).

:- pred fits_in_long(gmp_int::in) is semidet.
Expand Down Expand Up @@ -556,7 +555,7 @@
( ( R >= 2, R =< 62 ) ->
S = gmp_to_base_string(A, R)
;
throw(math.domain_error("gmp_int.to_base_string: base must be between 2 and 62"))
throw(domain_error("gmp_int.to_base_string: base must be between 2 and 62"))
).

:- func gmp_to_base_string(gmp_int, int) = string.
Expand Down Expand Up @@ -785,7 +784,7 @@
( sqrt(A, Root) ->
Res = Root
;
throw(math.domain_error("gmp_int.det_sqrt: number must be non-negative"))
throw(domain_error("gmp_int.det_sqrt: number must be non-negative"))
).

:- pred gmp_sqrt(gmp_int::in, gmp_int::out) is det.
Expand All @@ -809,7 +808,7 @@
( nthroot(A, N, Root) ->
Res = Root
;
throw(math.domain_error("gmp_int.det_sqrt: number must be non-negative"))
throw(domain_error("gmp_int.det_sqrt: number must be non-negative"))
).

:- pred gmp_nthroot(gmp_int::in, int::in, gmp_int::out) is det.
Expand All @@ -835,7 +834,7 @@

pow(A, N) = Res :-
( is_negative(N) ->
throw(math.domain_error("gmp_int.pow: cannot handle negative exponent"))
throw(domain_error("gmp_int.pow: cannot handle negative exponent"))
;
Res = pow2(A, N)
).
Expand Down
1 change: 0 additions & 1 deletion extras/graphics/easyx/easyx.m
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@
:- import_module exception.
:- import_module float.
:- import_module int.
:- import_module list.
:- import_module math.
:- import_module store.
:- import_module string.
Expand Down
3 changes: 1 addition & 2 deletions extras/lex/lex.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
:- import_module char.
:- import_module io.
:- import_module list.
:- import_module maybe.
:- import_module pair.
:- import_module string.
:- import_module sparse_bitset.
Expand Down Expand Up @@ -270,11 +269,11 @@ func re(T) = regexp

:- import_module array.
:- import_module bool.
:- import_module char.
:- import_module exception.
:- import_module require.
:- import_module int.
:- import_module map.
:- import_module maybe.

:- import_module lex.automata.
:- import_module lex.buf.
Expand Down
1 change: 0 additions & 1 deletion extras/net/types.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ pred to_string(A::in, string::uo) is det
:- implementation.

:- import_module bool.
:- import_module int.
:- import_module require.

:- import_module net.errno.
Expand Down

0 comments on commit 84e2536

Please sign in to comment.