Permalink
Browse files

fixing all warnings

  • Loading branch information...
gleber committed Apr 17, 2012
1 parent c4e5edb commit 92878d7464e4b44394b84d26fadc08d7408e48d1
Showing with 59 additions and 16 deletions.
  1. +16 −3 src/agent.erl
  2. +12 −2 src/eresye.erl
  3. +7 −1 src/eresye_agenda.erl
  4. +11 −3 src/logger.erl
  5. +6 −2 src/ontology_service.erl
  6. +7 −5 src/simple_agent.erl
View
@@ -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').
@@ -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
%%
@@ -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
%%
View
@@ -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
@@ -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
%%====================================================================
View
@@ -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).
@@ -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,
View
@@ -22,7 +22,9 @@
%%
-module(logger).
--behaviour(gen_event).%%====================================================================
+-behaviour(gen_event).
+
+%%====================================================================
%% Include files
%%====================================================================
@@ -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
@@ -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
View
@@ -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]).
%%====================================================================
@@ -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
View
@@ -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.

0 comments on commit 92878d7

Please sign in to comment.