diff options
author | Michael Klishin <[email protected]> | 2021-03-17 19:35:14 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2021-03-18 10:14:50 +0100 |
commit | 53477343824e13a009c7140a45fbd4b25c1628a8 (patch) | |
tree | 925b5ca7e67e13a207f4b57f9f64d541cf611746 | |
parent | a56e8a97b83c40400ec633bc20cfc6c028b1c7b4 (diff) | |
download | ct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.tar.gz ct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.tar.bz2 ct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.zip |
Squash some warnings emitted on Erlang 24
-rw-r--r-- | src/ct_helper.erl | 12 | ||||
-rw-r--r-- | src/erl_make_certs.erl | 5 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl index 0c1247b..8e9d6d1 100644 --- a/src/ct_helper.erl +++ b/src/ct_helper.erl @@ -240,18 +240,10 @@ make_certs_in_ets() -> %% @doc Return the name of the calling function. %% -%% With a native VM we always return the current pid because -%% the stacktrace is not as well maintained and may not return -%% the correct function name, especially when there is a mix -%% of normal and native code. +%% DEPRECATED: Use ?FUNCTION_NAME instead. name() -> - case code:is_module_native(kernel) of - true -> - self(); - false -> - element(2, hd(tl(element(2, process_info(self(), current_stacktrace))))) - end. + element(2, hd(tl(element(2, process_info(self(), current_stacktrace))))). %% @doc Start and stop applications and their dependencies. diff --git a/src/erl_make_certs.erl b/src/erl_make_certs.erl index 8212ef7..dfa9955 100644 --- a/src/erl_make_certs.erl +++ b/src/erl_make_certs.erl @@ -178,7 +178,7 @@ make_tbs(SubjectKey, Opts) -> subject(proplists:get_value(subject, Opts),false) end, - {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1, + {#'OTPTBSCertificate'{serialNumber = trunc(rand:uniform()*100000000)*10000 + 1, signature = SignAlgo, issuer = Issuer, validity = validity(Opts), @@ -455,7 +455,8 @@ odd_rand(Size) -> odd_rand(Min, Max). odd_rand(Min,Max) -> - Rand = crypto:rand_uniform(Min,Max), + Delta = Max - Min, + Rand = Min + trunc(rand:uniform() * Delta), case Rand rem 2 of 0 -> Rand + 1; |