aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/rand.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-10-01 15:36:46 +0200
committerRaimo Niskanen <[email protected]>2018-10-05 11:12:49 +0200
commit0fdcbc7b3e0028412ebc317f17627f960d2b247c (patch)
treeba003a707db39fbecf0589634ebed1fea9546135 /lib/stdlib/src/rand.erl
parenta2e9b5a19d874c590b1227f6cd725627345e1214 (diff)
downloadotp-0fdcbc7b3e0028412ebc317f17627f960d2b247c.tar.gz
otp-0fdcbc7b3e0028412ebc317f17627f960d2b247c.tar.bz2
otp-0fdcbc7b3e0028412ebc317f17627f960d2b247c.zip
Suppress Dialyzer improper list warnings
Diffstat (limited to 'lib/stdlib/src/rand.erl')
-rw-r--r--lib/stdlib/src/rand.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdlib/src/rand.erl b/lib/stdlib/src/rand.erl
index d3eda5e144..3a9a1e007b 100644
--- a/lib/stdlib/src/rand.erl
+++ b/lib/stdlib/src/rand.erl
@@ -732,6 +732,8 @@ exsplus_seed({A1, A2, A3}) ->
tl(R1)]),
R2.
+-dialyzer({no_improper_lists, exsss_seed/1}).
+
exsss_seed(L) when is_list(L) ->
[S0,S1] = seed58_nz(2, L),
[S0|S1];
@@ -746,8 +748,6 @@ exsss_seed({A1, A2, A3}) ->
{S1, _} = seed58(?MASK(64, A3) bxor X1),
[S0|S1].
--dialyzer({no_improper_lists, exsplus_next/1}).
-
%% Advance Xorshift116 state one step
-define(
exs_next(S0, S1, S1_b),
@@ -767,6 +767,8 @@ exsss_seed({A1, A2, A3}) ->
?MASK(58, V_b + ?BSL(58, V_b, 3)) % V_b * 9
end).
+-dialyzer({no_improper_lists, exsplus_next/1}).
+
%% Advance state and generate 58bit unsigned integer
-spec exsplus_next(exsplus_state()) -> {uint58(), exsplus_state()}.
exsplus_next([S1|S0]) ->
@@ -778,6 +780,8 @@ exsplus_next([S1|S0]) ->
%% S12 = S11 bxor S0 bxor (S11 bsr 11) bxor (S0 bsr 41),
%% {?MASK(58, S0 + S12), [S0|S12]}.
+-dialyzer({no_improper_lists, exsss_next/1}).
+
-spec exsss_next(exsplus_state()) -> {uint58(), exsplus_state()}.
exsss_next([S1|S0]) ->
%% Note: members s0 and s1 are swapped here