Skip to content

Commit

Permalink
fixing all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gleber committed Apr 17, 2012
1 parent c4e5edb commit 92878d7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 16 deletions.
19 changes: 16 additions & 3 deletions src/agent.erl
Expand Up @@ -30,10 +30,12 @@
-include("fipa_ontology.hrl").

-export([behave/2, get_acl_semantics/1, get_behaviour/1,
get_message/1, get_mind/1, get_property/2,
handle_call/3, handle_cast/2, init/1, join/1, kill/1,
get_message/1, get_mind/1, get_property/2, join/1, kill/1,
match_message/2, new/2, send_message/4, set_behaviour/2,
set_property/3, set_rational/3, stop/1, terminate/2]).
set_property/3, set_rational/3, stop/1]).

-export([init/1, code_change/3, handle_call/3, handle_cast/2,
handle_info/2, terminate/2]).

-define(AGENT_BEHAVIOURS, '__AGENT_BEHAVIOURS').

Expand Down Expand Up @@ -269,6 +271,12 @@ terminate(normal, State) ->
ams:de_register_agent(AgentName),
ok.

%%
%% Code Change
%%
code_change(_OldVsn, State, _Extra) ->
{ok, State}.

%%
%% Gets a property from agent
%%
Expand Down Expand Up @@ -360,6 +368,11 @@ handle_cast([match_message, Pattern, From],
%%
handle_cast(stop, State) -> {stop, normal, State}.

%%
%% Any message handler
%%
handle_info(Any, State) -> {stop, {unknown_info, Any}, State}.

%%
%% OTHER FUNCTIONS
%%
Expand Down
14 changes: 12 additions & 2 deletions src/eresye.erl
Expand Up @@ -43,8 +43,8 @@
%% Internal exports
%%====================================================================

-export([code_change/3, handle_call/3, init/1,
terminate/2]).
-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2,
init/1, terminate/2]).

%%====================================================================
%% External functions
Expand Down Expand Up @@ -336,6 +336,16 @@ handle_call({get_ontology}, _, State) ->
[_, _, _, _, Ontology] = State,
{reply, Ontology, State}.

%%====================================================================
%% Cast handler
%%====================================================================
handle_cast(Cast, State) -> {stop, {unknown_cast, Cast}, State}.

%%====================================================================
%% Any message handler
%%====================================================================
handle_info(Any, State) -> {stop, {unknown_info, Any}, State}.

%%====================================================================
%% Func: code_change/3
%%====================================================================
Expand Down
8 changes: 7 additions & 1 deletion src/eresye_agenda.erl
Expand Up @@ -37,7 +37,7 @@
%% Internal exports
%%====================================================================

-export([code_change/3, handle_call/3, handle_cast/2,
-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2,
init/1, terminate/2]).

-behaviour(gen_server).
Expand Down Expand Up @@ -295,6 +295,12 @@ handle_call_1({_, _, _, Id}) -> Id.
handle_cast({schedule}, Agenda) ->
{noreply, after_execution_schedule__(Agenda)}.

%%====================================================================
%% Function: handle_info/2
%%====================================================================
handle_info(Any, State) ->
{stop, {unknown_info, Any}, State}.

after_activation_schedule__(Agenda) ->
{Strategy, RuleList, ExecutorPid, ExecState, NextId} =
Agenda,
Expand Down
14 changes: 11 additions & 3 deletions src/logger.erl
Expand Up @@ -22,7 +22,9 @@
%%
-module(logger).

-behaviour(gen_event).%%====================================================================
-behaviour(gen_event).

%%====================================================================
%% Include files
%%====================================================================

Expand All @@ -36,8 +38,8 @@
%% Internal exports
%%====================================================================

-export([code_change/3, handle_event/2, init/1,
terminate/2]).
-export([code_change/3, handle_event/2, handle_call/2, handle_info/2,
init/1, terminate/2]).

%%====================================================================
%% External functions
Expand Down Expand Up @@ -87,6 +89,12 @@ handle_event(LogEvent, State) ->
end,
{ok, State}.

handle_call(Call, State) ->
{stop, {unknown_call, Call}, State}.

handle_info(Info, State) ->
{stop, {unknown_info, Info}, State}.

%%====================================================================
%% Func: terminate/2
%% Returns: ok
Expand Down
8 changes: 6 additions & 2 deletions src/ontology_service.erl
Expand Up @@ -33,7 +33,7 @@
%%====================================================================
-export([get_codec/1, register_codec/2]).

-export([code_change/3, handle_call/3, handle_info/2,
-export([code_change/3, handle_call/3, handle_info/2, handle_cast/2,
init/1, terminate/2]).

%%====================================================================
Expand Down Expand Up @@ -90,7 +90,11 @@ handle_call({get_codec, OntologyName}, _, Dict) ->
%%====================================================================
%% Function: handle_info/2
%%====================================================================
handle_info(_, State) -> {noreply, State}.
handle_info(Any, State) ->
{stop, {unknown_info, Any}, State}.

handle_cast(Call, State) ->
{stop, {unknown_cast, Call}, State}.

%%====================================================================
%% Function: terminate/2
Expand Down
12 changes: 7 additions & 5 deletions src/simple_agent.erl
Expand Up @@ -27,18 +27,20 @@

-include("fipa_ontology.hrl").

-export([code_change/3, get_acl_semantics/1, get_mind/1,
get_property/2, handle_call/3, handle_cast/2,
handle_info/2, init/1, join/1, kill/1, new/2, new/3,
set_property/3, set_rational/3, stop/1, terminate/2]).
-export([get_acl_semantics/1, get_mind/1, get_property/2, join/1,
kill/1, new/2, new/3, set_property/3, set_rational/3, stop/1
]).

-export([code_change/3, terminate/2, handle_call/3, handle_cast/2,
init/1, handle_info/2, behaviour_info/1]).

%% send_message/4,
%% get_message/1,
%% match_message/2,

-spec behaviour_info(atom()) -> 'undefined' | [{atom(), arity()}].
behaviour_info(callbacks) ->
[{init,1},{handle_call,3},{handle_cast,2},{handle_info,2},
[{init,2},{handle_call,3},{handle_cast,2},{handle_info,2},
{terminate,2},{code_change,3}];
behaviour_info(_Other) ->
undefined.
Expand Down

0 comments on commit 92878d7

Please sign in to comment.