Skip to content

Commit d5d6564

Browse files
committed
Merge pull request atomvm#529 from fadushin/fix-erlc-warnings
Fix erlc compiler warnings This PR fixes some annoying Erlang compiler warnings. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 727c7f6 + e738a61 commit d5d6564

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

libs/alisp/src/sexp_parser.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ parse([{'(', _Line} | T], Acc) ->
3232
parse(NewTail, [L | Acc]);
3333
parse([{')', _Line} | T], Acc) ->
3434
{T, reverse(Acc)};
35-
parse([{symbol_prefix, _Line, SymPrefix}, {symbol, _Line, Sym} | T], Acc) ->
35+
parse([{symbol_prefix, _Line1, SymPrefix}, {symbol, _Line2, Sym} | T], Acc) ->
3636
parse(T, [[symbol_pair, erlang:list_to_atom(SymPrefix), erlang:list_to_atom(Sym)] | Acc]);
3737
parse([{symbol, _Line, Sym} | T], Acc) ->
3838
parse(T, [erlang:list_to_atom(Sym) | Acc]);

libs/estdlib/src/gen_event.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ handle_call(_Request, _From, State) ->
116116
{reply, {error, unimplemented}, State}.
117117

118118
%% @hidden
119-
handle_info(Msg, State) ->
119+
handle_info(_Msg, State) ->
120120
{noreply, State}.
121121

122122
%% @hidden

libs/etest/src/etest.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ check_results([]) ->
150150
ok;
151151
check_results([{_Test, ok} | T]) ->
152152
check_results(T);
153-
check_results([Failure | T]) ->
153+
check_results([Failure | _T]) ->
154154
{fail, Failure}.
155155

156156
id(X) -> X.

tests/erlang_tests/test_types_ordering.erl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,3 @@ check(T) when T == [1, foo, {}, {1}, {1, 2}, [], [1, 2], <<"bar">>] ->
4949
1;
5050
check(_T) ->
5151
0.
52-
53-
bool_to_n(true) ->
54-
1;
55-
bool_to_n(false) ->
56-
0.

tests/libs/estdlib/test_io_lib.erl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ test() ->
6363
),
6464
?ASSERT_MATCH(?FLT(io_lib:format("escape ~~p~n", [])), "escape ~p\n"),
6565

66-
?ASSERT_FAILURE(io_lib:format("no pattern", [foo]), badarg),
67-
?ASSERT_FAILURE(io_lib:format("too ~p many ~p patterns", [foo]), badarg),
68-
?ASSERT_FAILURE(io_lib:format("not enough ~p patterns", [foo, bar]), badarg),
66+
?ASSERT_FAILURE(io_lib:format("no pattern", id([foo])), badarg),
67+
?ASSERT_FAILURE(io_lib:format("too ~p many ~p patterns", id([foo])), badarg),
68+
?ASSERT_FAILURE(io_lib:format("not enough ~p patterns", id([foo, bar])), badarg),
6969

7070
ok.
71+
72+
id(X) ->
73+
X.

0 commit comments

Comments
 (0)