Skip to content

Commit

Permalink
Eliminated compiler warnings in R13B.
Browse files Browse the repository at this point in the history
Replaced old type tests (e.g. list/1) with modern type tests
(e.g. is_list/1).

Signed-off-by: Christian <chsu79@gmail.com>
  • Loading branch information
bjorng authored and noss committed Apr 26, 2009
1 parent 86b6b0c commit c895be9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/gettext.erl
Expand Up @@ -64,10 +64,10 @@ recreate_db(Server) ->

%%--------------------------------------------------------------------

store_pofile(Lang, File) when binary(File) ->
store_pofile(Lang, File) when is_binary(File) ->
store_pofile(?DEFAULT_SERVER, Lang, File).

store_pofile(Server, Lang, File) when binary(File) ->
store_pofile(Server, Lang, File) when is_binary(File) ->
gen_server:call(Server, {store_pofile, Lang, File}, infinity).

%%--------------------------------------------------------------------
Expand Down Expand Up @@ -153,10 +153,10 @@ eat_more([$"|T], Acc) -> eat_string(T, Acc);
eat_more(T, Acc) -> {lists:reverse(Acc), T}.


to_list(A) when atom(A) -> atom_to_list(A);
to_list(I) when integer(I) -> integer_to_list(I);
to_list(B) when binary(B) -> binary_to_list(B);
to_list(L) when list(L) -> L.
to_list(A) when is_atom(A) -> atom_to_list(A);
to_list(I) when is_integer(I) -> integer_to_list(I);
to_list(B) when is_binary(B) -> binary_to_list(B);
to_list(L) when is_list(L) -> L.


%%% --------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions src/gettext_compile.erl
Expand Up @@ -201,7 +201,7 @@ pt(Form, Opts) ->
put(fname, ""),
pt(Form, Opts, undefined).

pt([H|T],Opts,Func) when list(H) ->
pt([H|T],Opts,Func) when is_list(H) ->
?debug( "--- 1 --- ~p~n",[H]),
F = fun (X) -> pt(X,Opts,Func) end,
[lists:map(F,H)|pt(T,Opts,Func)];
Expand Down Expand Up @@ -237,15 +237,15 @@ pt([{block,N,B}|T], Opts, Func) ->
Block = {block,N,pt(B,Opts,Func)},
[Block|pt(T, Opts, Func)];
%%%
pt([H|T], Opts, Func) when tuple(H) ->
pt([H|T], Opts, Func) when is_tuple(H) ->
?debug( "--- 3 --- ~p~n",[H]),
[while(size(H), H, Opts, Func) | pt(T, Opts, Func)];
%%%
pt([H|T], Opts, Func) ->
?debug( "--- 4 --- ~p~n",[H]),
[H | pt(T, Opts, Func)];
%%%
pt(T, Opts, Func) when tuple(T) ->
pt(T, Opts, Func) when is_tuple(T) ->
?debug( "--- 5 --- ~p~n",[T]),
while(size(T), T, Opts, Func);
%%%
Expand Down Expand Up @@ -305,10 +305,10 @@ open_po_file(Gettext_App_Name, GtxtDir, DefLang) ->
close_file() ->
file:close(get(fd)).

to_list(A) when atom(A) -> atom_to_list(A);
to_list(I) when integer(I) -> integer_to_list(I);
to_list(B) when binary(B) -> binary_to_list(B);
to_list(L) when list(L) -> L.
to_list(A) when is_atom(A) -> atom_to_list(A);
to_list(I) when is_integer(I) -> integer_to_list(I);
to_list(B) when is_binary(B) -> binary_to_list(B);
to_list(L) when is_list(L) -> L.



Expand Down
2 changes: 1 addition & 1 deletion src/gettext_server.erl
Expand Up @@ -120,7 +120,7 @@ get_gettext_dir(CallBackMod) ->
case os:getenv("GETTEXT_DIR") of
false ->
case catch CallBackMod:gettext_dir() of
Dir when list(Dir) -> Dir;
Dir when is_list(Dir) -> Dir;
_ -> code:priv_dir(gettext) % fallback
end;
Dir -> Dir
Expand Down

0 comments on commit c895be9

Please sign in to comment.