Fixing number of warnings and buglets

This commit is contained in:
Dave Smith 2009-12-14 08:58:22 -05:00
parent 2b7971cc6b
commit d6600ab506
7 changed files with 13 additions and 18 deletions

View file

@ -49,11 +49,6 @@ run(Args) ->
%% command line arguments. What's left will be the commands to run.
Commands = filter_flags(Args, []),
% dbg:tracer(),
dbg:p(all, call),
dbg:tpl(rebar_core, []),
dbg:tpl(rebar_erlc_compiler, clean, []),
%% Pre-load the rebar app so that we get default configuration
ok = application:load(rebar),
@ -160,7 +155,7 @@ rel_dir(Dir) ->
apply_commands([], Modules, Config, ModuleFile) ->
apply_commands([], _Modules, _Config, _ModuleFile) ->
ok;
apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
case select_modules(Modules, Command, []) of
@ -207,7 +202,7 @@ expand_lib_dirs([], _Root, Acc) ->
expand_lib_dirs([Dir | Rest], Root, Acc) ->
Apps = filelib:wildcard(filename:join([Dir, '*', ebin])),
FqApps = [filename:join([Root, A]) || A <- Apps],
expand_lib_dirs(Rest, Root, Apps ++ FqApps).
expand_lib_dirs(Rest, Root, Acc ++ FqApps).

View file

@ -131,7 +131,7 @@ show_log(RawLog) ->
ok
end.
make_cmd(TestDir, Config) ->
make_cmd(TestDir, _Config) ->
{ok, Cwd} = file:get_cwd(),
LogDir = filename:join(Cwd, "logs"),
Ebin = filename:join(Cwd, "ebin"),

View file

@ -151,7 +151,7 @@ compile_queue(Pids, Targets, Config, CompileFn) ->
Pids2 = lists:delete({Pid, Mref}, Pids),
compile_queue(Pids2, Targets, Config, CompileFn);
{'DOWN', Mref, _, Pid, Info} ->
{'DOWN', _Mref, _, _Pid, Info} ->
?DEBUG("Worker failed: ~p\n", [Info]),
?FAIL
end.

View file

@ -45,7 +45,7 @@
%% Public API
%% ===================================================================
eunit(Config, File) ->
eunit(Config, _File) ->
%% Make sure ?EUNIT_DIR/ directory exists (tack on dummy module)
ok = filelib:ensure_dir(?EUNIT_DIR ++ "/foo"),
@ -105,7 +105,7 @@ eunit(Config, File) ->
true = code:set_path(InitCodePath),
ok.
clean(Config, File) ->
clean(_Config, _File) ->
rebar_file_utils:rm_rf(?EUNIT_DIR).
@ -148,7 +148,7 @@ is_quickcheck_avail() ->
IsAvail
end.
cover_init(Config) ->
cover_init(_Config) ->
%% Make sure any previous runs of cover don't unduly influence
cover:reset(),
@ -175,9 +175,9 @@ cover_init(Config) ->
end
end.
cover_analyze(Config, []) ->
cover_analyze(_Config, []) ->
ok;
cover_analyze(Config, Modules) ->
cover_analyze(_Config, Modules) ->
%% Generate coverage info for all the cover-compiled modules
Coverage = [cover_analyze_mod(M) || M <- Modules],
@ -203,7 +203,7 @@ cover_analyze_mod(Module) ->
cover_write_index(Coverage) ->
%% Calculate total coverage %
{Covered, NotCovered} = lists:foldl(fun({Mod, C, N}, {CAcc, NAcc}) ->
{Covered, NotCovered} = lists:foldl(fun({_Mod, C, N}, {CAcc, NAcc}) ->
{CAcc + C, NAcc + N}
end, {0, 0}, Coverage),
TotalCoverage = percentage(Covered, NotCovered),

View file

@ -56,7 +56,7 @@ ln_sf(Source, Dest) ->
false ->
ActualDest = Dest
end,
[] = os:cmd(?FMT("ln -sf ~s ~s", [Source, Dest])),
[] = os:cmd(?FMT("ln -sf ~s ~s", [Source, ActualDest])),
ok.
delete_each([]) ->

View file

@ -33,7 +33,7 @@
%% Public API
%% ===================================================================
compile(Config, File) ->
compile(_Config, File) ->
%% Load the app name and version from the .app file and construct
%% the app identifier
{ok, AppName, AppData} = rebar_app_utils:load_app_file(File),

View file

@ -150,7 +150,7 @@ run_cleanup_hook(Config) ->
end.
compile_each([], Config, Env, NewBins, ExistingBins) ->
compile_each([], _Config, _Env, NewBins, ExistingBins) ->
{lists:reverse(NewBins), lists:reverse(ExistingBins)};
compile_each([Source | Rest], Config, Env, NewBins, ExistingBins) ->
Ext = filename:extension(Source),