Permalink
Browse files

Eliminated compiler warnings in R13B.

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...
1 parent 86b6b0c commit c895be9dcc6fc699b2e1e8bd731ccee4f78b1cdc @bjorng bjorng committed with Apr 26, 2009
Showing with 14 additions and 14 deletions.
  1. +6 −6 src/gettext.erl
  2. +7 −7 src/gettext_compile.erl
  3. +1 −1 src/gettext_server.erl
View
@@ -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).
%%--------------------------------------------------------------------
@@ -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.
%%% --------------------------------------------------------------------
@@ -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)];
@@ -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);
%%%
@@ -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.
@@ -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

0 comments on commit c895be9

Please sign in to comment.