Skip to content

Commit

Permalink
Fixing some dialyzer warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah Warren committed Jun 9, 2010
1 parent 1e54407 commit 0c71233
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 72 deletions.
4 changes: 2 additions & 2 deletions include/agent.hrl
Expand Up @@ -39,7 +39,7 @@
id :: 'undefined' | string(),
skills = [english, '_agent', '_node'] :: [atom(), ...],
connection :: pid(),
profile = "Default" :: string(),
profile = "Default" :: string() | 'error',
password = "" :: string(),
state = released :: 'idle' | 'ringing' | 'precall' | 'oncall' | 'outgoing' | 'released' | 'warmtransfer' | 'wrapup',
oldstate = released :: 'idle' | 'ringing' | 'precall' | 'oncall' | 'outgoing' | 'released' | 'warmtransfer' | 'wrapup',
Expand Down Expand Up @@ -95,7 +95,7 @@
{'graphed', boolean()}).

-record(agent_profile, {
name = erlang:error({undefined, name}) :: string(),
name = erlang:error({undefined, name}) :: string() | 'error',
id :: 'undefined' | string(), %erlang:error({undefined, id}) :: string(),
order = 1 :: pos_integer(),
options = [] :: [profile_option()],
Expand Down
116 changes: 58 additions & 58 deletions src/agent.erl

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/agent_auth.erl
Expand Up @@ -253,7 +253,7 @@ get_profiles() ->
sort_profiles(Profiles).

%% @doc Update the agent `string() Oldlogin' without changing the password.
-spec(set_agent/5 :: (Id :: string(), Newlogin :: string(), Newskills :: [atom()], NewSecurity :: security_level(), Newprofile :: string()) -> {'atomic', 'ok'}).
-spec(set_agent/5 :: (Id :: string(), Newlogin :: string(), Newskills :: [atom()], NewSecurity :: security_level(), Newprofile :: string()) -> {'atomic', 'ok'} | {'aborted', any()}).
set_agent(Id, Newlogin, Newskills, NewSecurity, Newprofile) ->
Props = [
{login, Newlogin},
Expand All @@ -265,7 +265,7 @@ set_agent(Id, Newlogin, Newskills, NewSecurity, Newprofile) ->

%% @doc Sets the agent `string() Oldlogin' with new data in `proplist Props';
%% does not change data that is not in the proplist.
-spec(set_agent/2 :: (Oldlogin :: string(), Props :: [{atom(), any()}]) -> {'atomic', 'ok'}).
-spec(set_agent/2 :: (Oldlogin :: string(), Props :: [{atom(), any()}]) -> {'atomic', 'ok'} | {'aborted', any()}).
set_agent(Id, Props) ->
F = fun() ->
QH = qlc:q([X || X <- mnesia:table(agent_auth), X#agent_auth.id =:= Id]),
Expand Down
2 changes: 1 addition & 1 deletion src/agent_dialplan_connection.erl
Expand Up @@ -82,7 +82,7 @@ init([AgentRec, Security]) ->
handle_call(logout, {From, _Ref}, #state{listener = From} = State) ->
{stop, normal, ok, State};
handle_call(go_released, {From, _Ref}, #state{listener = From} = State) ->
Res = agent:set_state(State#state.agent_fsm, {released, default}),
Res = agent:set_state(State#state.agent_fsm, released, default),
{reply, Res, State};
handle_call(go_available, {From, _Ref}, #state{listener = From} = State) ->
Res = agent:set_state(State#state.agent_fsm, idle),
Expand Down
2 changes: 1 addition & 1 deletion src/cook.erl
Expand Up @@ -128,7 +128,7 @@ init([Call, InRecipe, Queue, Qpid, {_Priority, {MSec, Sec, _MsSec}} = Key]) ->
Tref = erlang:send_after(?TICK_LENGTH, self(), do_tick),
OptRecipe = optimize_recipe(InRecipe),
Now = util:now(),
Recipe = case Now - (MSec * 1000000 + Sec) of
Recipe = case round(Now - (MSec * 1000000 + Sec)) of
Ticked when Ticked > 1 ->
fast_forward(OptRecipe, Ticked / (?TICK_LENGTH / 1000), Qpid, Call);
_Else ->
Expand Down
2 changes: 1 addition & 1 deletion src/cpx_monitor_passive.erl
Expand Up @@ -203,7 +203,7 @@ stop() ->

%% @doc Attempts to remove from the dets table any medias that no longer
%% exist.
-spec(prune_dets/0 :: () -> 'ok').
-spec(prune_dets/0 :: () -> 'prune_dets').
prune_dets() ->
?MODULE ! prune_dets.

Expand Down
2 changes: 1 addition & 1 deletion src/dispatcher.erl
Expand Up @@ -191,7 +191,7 @@ code_change(_OldVsn, State, _Extra) ->

%% @doc queries the agent_manager for available agents with an appropriate skill-list.
%% @see agent_manager:find_avail_agents_by_skill/1
-spec(get_agents/1 :: (Pid :: pid()) -> [{string, pid(), #agent{}}]).
-spec(get_agents/1 :: (Pid :: pid()) -> {non_neg_integer(), [{string, pid(), #agent{}}]}).
get_agents(Pid) ->
gen_server:call(Pid, get_agents).

Expand Down
8 changes: 4 additions & 4 deletions src/dummy_media.erl
Expand Up @@ -539,16 +539,16 @@ handle_warm_transfer_cancel(_Callrec, #state{fail = Fail} = State) ->
case check_fail(warm_transfer_cancel, Fail) of
{success, Newfail} ->
{ok, State#state{fail = Newfail}};
{Fail, Newfail} ->
{error, Fail, State#state{fail = Newfail}}
{DidFail, Newfail} ->
{error, DidFail, State#state{fail = Newfail}}
end.

handle_warm_transfer_complete(_Callrec, #state{fail = Fail} = State) ->
case check_fail(warm_transfer_complete, Fail) of
{success, Newfail} ->
{ok, State#state{fail = Newfail}};
{Fail, Newfail} ->
{error, Fail, State#state{fail = Newfail}}
{DidFail, Newfail} ->
{error, DidFail, State#state{fail = Newfail}}
end.

-spec(handle_spy/3 :: (Spy :: pid(), Callrec :: #call{}, State :: #state{}) -> {'ok', #state{}} | {'invalid', #state{}} | {'error', 'fail_once', #state{}}).
Expand Down
2 changes: 1 addition & 1 deletion src/gen_media.erl
Expand Up @@ -371,7 +371,7 @@ behaviour_info(_Other) ->

%% @doc Make the `pid() Genmedia' ring to `pid() Agent' based off of
%% `#queued_call{} Qcall' with a ringout of `pos_integer() Timeout' miliseconds.
-spec(ring/4 :: (Genmedia :: pid(), Agent :: pid() | string() | {string(), pid()}, Qcall :: #queued_call{}, Timeout :: pos_integer()) -> 'ok' | 'invalid').
-spec(ring/4 :: (Genmedia :: pid(), Agent :: pid() | string() | {string(), pid()}, Qcall :: #queued_call{}, Timeout :: pos_integer()) -> 'ok' | 'invalid' | 'deferred').
ring(Genmedia, {_Agent, Apid} = A, Qcall, Timeout) when is_pid(Apid) ->
gen_server:call(Genmedia, {'$gen_media_ring', A, Qcall, Timeout});
ring(Genmedia, Apid, Qcall, Timeout) when is_pid(Apid) ->
Expand Down
2 changes: 1 addition & 1 deletion src/spicecsm_integration.erl
Expand Up @@ -128,7 +128,7 @@ combine_id(Tenantid, Brandid) ->

%% @doc Imports some data into the mnesia data to enable the spicecsm_integration
%% to start much more quickly.
-spec(import/1 :: (Options :: [option() | 'addconf']) -> 'ok' | {'ok', pid()}).
-spec(import/1 :: (Options :: [option() | 'add_conf']) -> 'ok' | {'ok', pid()}).
import(Options) ->
{ok, Pid} = gen_server:start_link(?MODULE, Options, []),
Reslist = gen_server:call(Pid, {raw_request, <<"companyList">>, []}),
Expand Down

0 comments on commit 0c71233

Please sign in to comment.