diff --git a/src/otpbp_beam_lib.erl b/src/otpbp_beam_lib.erl index 3f06142..cf7f91c 100644 --- a/src/otpbp_beam_lib.erl +++ b/src/otpbp_beam_lib.erl @@ -55,7 +55,7 @@ strip_release(Root, AdditionalChunks) -> catch strip_rel(Root, AdditionalChunks) -define(NEED_error_1, true). -endif. --compile({inline, [strip_rel/2]}). +-compile({inline, strip_rel/2}). strip_rel(Root, AdditionalChunks) -> filelib:is_dir(Root) orelse error({not_a_directory, Root}), strip_fils(filelib:wildcard(filename:join([Root, "lib", "*", "ebin", "*.beam"])), AdditionalChunks). @@ -79,7 +79,7 @@ strip_file(File, AdditionalChunks) -> {ok, Stripped} = beam_lib:build_module(Chunks), strip_file(File, Mod, zlib:gzip(Stripped)). --compile({inline, [strip_file/3]}). +-compile({inline, strip_file/3}). strip_file(File, Mod, Stripped) when is_binary(File) -> {ok, {Mod, Stripped}}; strip_file(File, Mod, Stripped) -> FileName = filename:rootname(File, ".beam") ++ ".beam", @@ -92,7 +92,7 @@ strip_file(File, Mod, Stripped) -> Error -> file_error(FileName, Error) end. --compile({inline, [read_significant_chunks/2]}). +-compile({inline, read_significant_chunks/2}). read_significant_chunks(File, ChunkList) -> {ok, {Module, Chunks}} = beam_lib:chunks(File, ChunkList, [allow_missing_chunks]), {Module, lists:filter(fun({_, Data}) when is_binary(Data) -> true; @@ -100,7 +100,7 @@ read_significant_chunks(File, ChunkList) -> lists:member(Id, mandatory_chunks()) andalso error({missing_chunk, File, Id}) end, Chunks)}. --compile({inline, [mandatory_chunks/0]}). +-compile({inline, mandatory_chunks/0}). mandatory_chunks() -> ["Code", "ExpT", "ImpT", "StrT"]. file_error(FileName, {error, Reason}) -> error({file_error, FileName, Reason}). diff --git a/src/otpbp_code.erl b/src/otpbp_code.erl index 640d296..052b5b4 100644 --- a/src/otpbp_code.erl +++ b/src/otpbp_code.erl @@ -142,7 +142,7 @@ where_is_file(T, File, D, Files) -> _false -> where_is_file(T, File) end. --compile({inline, [module_changed_on_disk/2]}). +-compile({inline, module_changed_on_disk/2}). module_changed_on_disk(Module, Path) -> Arch = erlang:system_info(hipe_architecture), case Arch =/= undefined andalso code:is_module_native(Module) of diff --git a/src/otpbp_gen_event.erl b/src/otpbp_gen_event.erl index 302de6e..55f4028 100644 --- a/src/otpbp_gen_event.erl +++ b/src/otpbp_gen_event.erl @@ -39,7 +39,7 @@ start_monitor(Name, Options) -> Pid -> {error, {already_started, Pid}} end. --compile({inline, [where/1]}). +-compile({inline, where/1}). where({global, Name}) -> global:whereis_name(Name); where({via, Module, Name}) -> Module:whereis_name(Name); where({local, Name}) -> whereis(Name). diff --git a/src/otpbp_gen_server.erl b/src/otpbp_gen_server.erl index d218fea..ddae877 100644 --- a/src/otpbp_gen_server.erl +++ b/src/otpbp_gen_server.erl @@ -21,7 +21,7 @@ start_monitor(Name, Module, Args, Options) -> Pid -> {error, {already_started, Pid}} end. --compile({inline, [where/1]}). +-compile({inline, where/1}). where({global, Name}) -> global:whereis_name(Name); where({via, Module, Name}) -> Module:whereis_name(Name); where({local, Name}) -> whereis(Name). diff --git a/src/otpbp_httpd.erl b/src/otpbp_httpd.erl index 648e149..bf234ab 100644 --- a/src/otpbp_httpd.erl +++ b/src/otpbp_httpd.erl @@ -48,7 +48,7 @@ do_serve(#{help := true}) -> halt(0); do_serve(#{address := Address, port := Port, directory := Path}) -> do_serve(Address, Port, Path). --compile({inline, [do_serve/3]}). +-compile({inline, do_serve/3}). do_serve({_, _, _, _} = Address, Port, Path) -> do_serve(Address, Port, Path, inet); do_serve(Address, Port, Path) -> do_serve(Address, Port, Path, inet6). @@ -73,10 +73,10 @@ do_serve(Address, Port, Path, IpFamily) -> From ! done end. --compile({inline, [default_mime_types/0]}). +-compile({inline, default_mime_types/0}). default_mime_types() -> find_mime_types("/etc/mime.types"). --compile({inline, [find_mime_types/1]}). +-compile({inline, find_mime_types/1}). find_mime_types(Path) -> case filelib:is_file(Path) of true -> Path; diff --git a/src/otpbp_proc_lib.erl b/src/otpbp_proc_lib.erl index 694456f..e75686b 100644 --- a/src/otpbp_proc_lib.erl +++ b/src/otpbp_proc_lib.erl @@ -90,7 +90,7 @@ sync_start_monitor({Pid, Ref}, Timeout) -> {{error, timeout}, Ref} end. --compile({inline, [kill_flush/1]}). +-compile({inline, kill_flush/1}). kill_flush(Pid) -> unlink(Pid), exit(Pid, kill), diff --git a/src/otpbp_pt.erl b/src/otpbp_pt.erl index e5875d8..5e84486 100644 --- a/src/otpbp_pt.erl +++ b/src/otpbp_pt.erl @@ -295,7 +295,7 @@ parse_transform(Forms, Options) -> _ -> Forms end. --compile({inline, [get_funs/3]}). +-compile({inline, get_funs/3}). get_funs(AF, Options, TL) -> lists:foldl(fun({M, Fs}, IA) -> lists:foldl(fun(FA, IAM) -> @@ -308,7 +308,7 @@ get_funs(AF, Options, TL) -> maps:without(get_no_auto_import(AF, Options), TL), proplists:get_value(imports, AF, [])). --compile({inline, [get_no_auto_import/2]}). +-compile({inline, get_no_auto_import/2}). get_no_auto_import(AF, Options) -> lists:usort(proplists:append_values(no_auto_import, proplists:append_values(compile, @@ -321,7 +321,7 @@ transform(Tree, P) -> _ -> {Tree, P} end. --compile({inline, [transform_function/2]}). +-compile({inline, transform_function/2}). transform_function(Tree, P) -> case erl_syntax_lib:mapfold(fun(E, F) -> case function_transform(E, P) of @@ -333,7 +333,7 @@ transform_function(Tree, P) -> _ -> Tree end. --compile({inline, [transform_attribute/2]}). +-compile({inline, transform_attribute/2}). transform_attribute(Tree, P) -> case erl_syntax_lib:analyze_attribute(Tree) of {file, {F, _}} -> {Tree, P#param{file = F}}; @@ -353,7 +353,7 @@ transform_behaviour({_, _, _, B} = Tree, #param{behaviours = Bs}) -> end; transform_behaviour(Tree, _) -> Tree. --compile({inline, [check_behaviour/1]}). +-compile({inline, check_behaviour/1}). check_behaviour(B) -> try B:module_info(exports) of Exports -> lists:member({behaviour_info, 1}, Exports) @@ -386,7 +386,7 @@ store_func(F, {_, _} = MF, D) -> D#{F => MF}; store_func({_, {F, _}} = MFA, M, D) -> store_func(MFA, {M, F}, D); store_func({F, _} = FA, M, D) -> store_func(FA, {M, F}, D). --compile({inline, [transform_list/0]}). +-compile({inline, transform_list/0}). transform_list() -> lists:foldl(fun({F, D}, Acc) -> add_func(F, D, Acc) end, #{}, ?TRANSFORM_FUNCTIONS). function_transform(Node, #param{} = P) -> @@ -408,7 +408,7 @@ application_transform(Node, #param{funs = FL} = P) -> end end. --compile({inline, [application_transform/2]}). +-compile({inline, application_transform/2}). application_transform(Node, P, A, L) -> case L of #{A := {M, N}} -> @@ -422,7 +422,7 @@ application_transform(Node, P, A, L) -> #{} -> false end. --compile({inline, [apply_transform/3]}). +-compile({inline, apply_transform/3}). apply_transform(Node, #param{apply = AL} = P, A) -> lists:member(A, AL) andalso case erl_syntax:application_arguments(Node) of @@ -447,10 +447,10 @@ application(remote, O, As, M, N) -> application_(mqa(O), mqb(O), As, M, N). application_(O1, O2, As, M, N) -> application_(atom(O1, M), atom(O2, N), As). --compile({inline, [application_/3]}). +-compile({inline, application_/3}). application_(M, N, As) -> erl_syntax:application(cp(M, erl_syntax:module_qualifier(M, N)), As). --compile({inline, [implicit_fun_transform/2]}). +-compile({inline, implicit_fun_transform/2}). implicit_fun_transform(Node, #param{funs = L} = P) -> try erl_syntax_lib:analyze_implicit_fun(Node) of F -> case L of @@ -470,7 +470,7 @@ implicit_fun_transform(Node, #param{funs = L} = P) -> throw:syntax_error -> false end. --compile({inline, [try_expr_transform/1]}). +-compile({inline, try_expr_transform/1}). try_expr_transform(Node) -> case lists:mapfoldr(fun(H, A) -> case try_expr_handler_transform(H) of @@ -485,7 +485,7 @@ try_expr_transform(Node) -> Hs, erl_syntax:try_expr_after(Node))) end. --compile({inline, [try_expr_handler_transform/1]}). +-compile({inline, try_expr_handler_transform/1}). try_expr_handler_transform(Node) -> case type(Node) =:= clause andalso try_expr_clause_patterns_transform(erl_syntax:clause_patterns(Node)) of {P, {true, B}} -> @@ -493,7 +493,7 @@ try_expr_handler_transform(Node) -> _ -> false end. --compile({inline, [try_expr_clause_patterns_transform/1]}). +-compile({inline, try_expr_clause_patterns_transform/1}). try_expr_clause_patterns_transform(Ps) -> lists:mapfoldr(fun(P, {_, L} = A) -> case type(P) of @@ -562,29 +562,29 @@ match_expr_list(M, L) -> [cp(M, erl_syntax:match_expr(M, cp(M, application(local atom(P, A) when is_tuple(P), is_atom(A) -> cp(P, erl_syntax:atom(A)). --compile({inline, [otp_release/0]}). +-compile({inline, otp_release/0}). otp_release() -> list_to_integer(erlang:system_info(otp_release)). --compile({inline, [erts_version/0]}). +-compile({inline, erts_version/0}). erts_version() -> lists:map(fun list_to_integer/1, string:tokens(erlang:system_info(version), ".")). replace_message(_Node, #param{verbose = false}, _F, _NM, _NN) -> ok; replace_message(Node, #param{file = File}, F, NM, NN) -> replace_message_(erl_syntax:get_pos(Node), File, F, NM, NN). --compile({inline, [replace_message_/5]}). +-compile({inline, replace_message_/5}). replace_message_(P, F, {M, {N, A}}, NM, NN) -> replace_message_(P, F, lists:concat([M, ":", N]), NM, NN, A); replace_message_(P, F, {N, A}, NM, NN) -> replace_message_(P, F, N, NM, NN, A). replace_message_(P, F, N, NM, NN, A) -> io:fwrite("~ts:~p: replace ~ts/~B to ~s:~ts/~B~n", [F, P, N, A, NM, NN, A]). --compile({inline, [cp/2]}). +-compile({inline, cp/2}). cp(S, T) -> erl_syntax:copy_pos(S, T). --compile({inline, [type/1]}). +-compile({inline, type/1}). type(N) -> erl_syntax:type(N). --compile({inline, [mqa/1]}). +-compile({inline, mqa/1}). mqa(N) -> erl_syntax:module_qualifier_argument(N). --compile({inline, [mqb/1]}). +-compile({inline, mqb/1}). mqb(N) -> erl_syntax:module_qualifier_body(N). diff --git a/src/otpbp_pubkey_os_cacerts.erl b/src/otpbp_pubkey_os_cacerts.erl index 7c43f35..8744ad6 100644 --- a/src/otpbp_pubkey_os_cacerts.erl +++ b/src/otpbp_pubkey_os_cacerts.erl @@ -77,7 +77,7 @@ get() -> CaCerts -> CaCerts end. --compile({inline, [get1/0]}). +-compile({inline, get1/0}). -ifdef(HAVE_persistent_term__get_1). get1() -> persistent_term:get(pubkey_os_cacerts). -else. @@ -87,7 +87,7 @@ get1() -> Value. -endif. --compile({inline, [get2/0]}). +-compile({inline, get2/0}). -ifdef(HAVE_persistent_term__get_2). get2() -> persistent_term:get(pubkey_os_cacerts, undefined). -else. diff --git a/src/otpbp_rand.erl b/src/otpbp_rand.erl index 9d4cf44..819388d 100644 --- a/src/otpbp_rand.erl +++ b/src/otpbp_rand.erl @@ -100,7 +100,7 @@ bytes_s(N, {#{max := Mask, next := Next} = AlgHandler, R}) when is_integer(N), 0 %% giving 56 bits i.e precisely 7 bytes per generated number bytes_r(N, AlgHandler, Next, R, 58, 2). --compile({inline, [bytes_r/6]}). +-compile({inline, bytes_r/6}). bytes_r(N, AlgHandler, Next, R, Bits, WeakLowBits) -> %% We use whole bytes from each generator word, %% GoodBytes: that number of bytes @@ -140,7 +140,7 @@ uniform_real_s({#{next := Next} = Alg, R0}) -> {V1, R1} = Next(R0), uniform_real_s(Alg, V1, R1, Next). --compile({inline, [uniform_real_s/5]}). +-compile({inline, uniform_real_s/5}). uniform_real_s(#{bits := Bits} = Alg, V1, R1, Next) -> case V1 bsr (Bits - 56) of M1 when ?BIT(55) =< M1 -> %% We have 56 bits - waste 3