Browse Source

erl 20.0 - fix warnings

221V 3 years ago
parent
commit
ec9e03a698

+ 3 - 1
rebar.config

@@ -4,5 +4,7 @@
  %  {nitro,  ".*", {git, "git://github.com/synrc/nitro.git",  {tag,"0.9"}}},
  %  {jsone,  ".*", {git, "git://github.com/sile/jsone.git",   {tag,"v0.3.3"}}},
  %  {gproc,  ".*", {git, "git://github.com/uwiger/gproc.git", {tag,"0.3"}}},
-    {cowboy, ".*", {git, "git://github.com/extend/cowboy",    {tag,"1.0.1"}}}
+ % move this to app config
+ 
+ %   {cowboy, ".*", {git, "git://github.com/extend/cowboy",    {tag,"1.0.1"}}}
 ]}.

+ 13 - 11
samples/rebar.config

@@ -2,17 +2,19 @@
 {lib_dirs,["apps","deps"]}.
 {deps_dir,"deps"}.
 {deps, [
-    {gproc,  ".*", {git, "git://github.com/uwiger/gproc",       {tag, "0.6.1"}}},
-    {rest,   ".*", {git, "git://github.com/synrc/rest",         {tag, "2.9"}    }},
-    {erlydtl,".*", {git, "git://github.com/evanmiller/erlydtl", {tag, "0.8.0"}  }},
-    {nitro,  ".*", {git, "git://github.com/synrc/nitro",        {tag, "2.4"} }},
-    {mad,    ".*", {git, "git://github.com/synrc/mad",          {tag, "1.9"} }},
-    {fs,     ".*", {git, "git://github.com/synrc/fs",           {tag, "1.9"}    }},
-    {sh,     ".*", {git, "git://github.com/synrc/sh",           {tag, "1.9"}    }},
-    {active, ".*", {git, "git://github.com/synrc/active",       {tag, "1.9"}    }},
-    {avz,    ".*", {git, "git://github.com/synrc/avz",          {tag, "4.4"} }},
-    {n2o,    ".*", {git, "git://github.com/synrc/n2o",          {tag, "4.4"} }},
-    {kvs,    ".*", {git, "git://github.com/synrc/kvs",          {tag, "3.9.1"}}}
+    {gproc, ".*",  {git, "git://github.com/221V/gproc_0.6.1",   {tag, "master"} }},
+    %{syn,    ".*", {git, "git://github.com/221V/syn_1.1.0",     {tag, "master"} }},
+    {rest,   ".*", {git, "git://github.com/221V/rest_2.9",      {tag, "master"} }},
+    {erlydtl,".*", {git, "git://github.com/221V/erlydtl_0.8.0", {tag, "master"} }},
+    {nitro,  ".*", {git, "git://github.com/221V/nitro_2.4",     {tag, "master"} }},
+    {mad,    ".*", {git, "git://github.com/221V/mad_1.9",       {tag, "master"} }},
+    {fs,     ".*", {git, "git://github.com/221V/fs",            {tag, "1.9"}    }},
+    {sh,     ".*", {git, "git://github.com/221V/sh_1.9",        {tag, "master"} }},
+    {active, ".*", {git, "git://github.com/221V/active_1.9",    {tag, "master"} }},
+    {avz,    ".*", {git, "git://github.com/221V/avz",           {tag, "4.4"}    }},
+    {cowboy, ".*", {git, "git://github.com/221V/cowboy_1.0.1",  {tag, "master"} }},
+    {n2o,    ".*", {git, "git://github.com/221V/n2o_4.4",       {tag, "master"} }},
+    {kvs,    ".*", {git, "git://github.com/221V/kvs",           {tag, "3.9.1"}  }}
 ]}.
 {fetch_speed,fast_master}.
 {verbose,1}.

+ 1 - 1
src/endpoints/cowboy/n2o_cowboy.erl

@@ -4,7 +4,7 @@
 -behaviour(cowboy_http_handler).
 -include_lib("n2o/include/wf.hrl").
 -export([init/3, handle/2, terminate/3]).
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -record(state, {headers, body}).
 
 % Cowboy HTTP Handler

+ 8 - 8
src/endpoints/cowboy/n2o_multipart.erl

@@ -1,6 +1,6 @@
 -module(n2o_multipart).
 -export([init/3,handle/2,terminate/3]).
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -define(MAX_FILE_SIZE_LIMIT, 900*1000*1000). % 300Kb
 -define(TMP_PATH,".").
 
@@ -11,7 +11,7 @@ init(_Type, Req, []) ->
 	{ok, Req, undefined}.
 
 handle(Req, State) ->
-    {Method, Req2} = cowboy_req:method(Req),
+    {_Method, Req2} = cowboy_req:method(Req),
     {B, ReqU} = case multipart(Req2, ?MODULE) of
                 {ok, ReqM} -> {<<"<h1>This is a response for POST</h1>">>, ReqM};
                 {rejected, file_size_limit, ReqM} -> {<<"POST: File Size Limit">>, ReqM} end,
@@ -68,12 +68,12 @@ stream_file(Req, IoDevice, FileSize, MaxFileSizeLimit) ->
 temp_filename() ->
     list_to_binary(filename:join([?TMP_PATH, atom_to_list(?MODULE) ++ integer_to_list(erlang:phash2(make_ref()))])).
 
-data_payload(FieldName, Body) ->
-    % error_logger:info_msg("DATA PAYLOAD {FieldName, Body} = {~p,~p}", [FieldName, Body]),
+data_payload(_FieldName, _Body) ->
+    % error_logger:info_msg("DATA PAYLOAD {FieldName, Body} = {~p,~p}", [_FieldName, _Body]),
     ok.
 
-file_payload(FieldName, Filename, TempFilename, FileSize) ->
+file_payload(_FieldName, _Filename, TempFilename, _FileSize) ->
     NewFileName = <<"/tmp/upload.jpg">>,
-    % error_logger:info_msg("FILE PAYLOAD: {~p, ~p, ~p}", [FieldName, Filename, TempFilename]),
-    {ok, BytesCopied} = file:copy(TempFilename, NewFileName),
-    ok.
+    % error_logger:info_msg("FILE PAYLOAD: {~p, ~p, ~p}", [_FieldName, _Filename, TempFilename]),
+    {ok, _BytesCopied} = file:copy(TempFilename, NewFileName),
+    ok.

+ 1 - 1
src/endpoints/cowboy/n2o_static.erl

@@ -1,7 +1,7 @@
 -module(n2o_static).
 -description('N2O Static Bridge to files in LING image, MAD bundle or OS').
 -author('Maxim Sokhatsky').
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -include_lib("kernel/include/file.hrl").
 
 init(_, _, _) -> {upgrade, protocol, cowboy_rest}.

+ 3 - 3
src/endpoints/cowboy/n2o_stream.erl

@@ -8,7 +8,7 @@
 % XHR
 
 init(T,R,O)                        -> upgrade(cowboy_req:header(<<"upgrade">>,R),{T,R,O}).
-websocket(R,<<"websocket">>)       -> {upgrade, protocol, cowboy_websocket};
+websocket(_R,<<"websocket">>)       -> {upgrade, protocol, cowboy_websocket};
 websocket(R,_)                     -> down(reply([],R,501)).
 upgrade({undefined,R},{T,R,O})     -> initialize(T,R,O);
 upgrade({B,R},_) when is_binary(B) -> websocket(R,cowboy_bstr:to_lower(B)).
@@ -34,8 +34,8 @@ xhr({reply,D,R,S})           -> {ok,reply(D,R,200),S}.
 % WebSocket
 
 websocket_info(I,R,S)        -> ws(n2o_proto:info(I,R,S)).
-websocket_handle(D,R,S)      -> ws(n2o_proto:stream(D,R,S));
-websocket_handle(_,R,S)      -> {ok,R,S,hibernate}.
+websocket_handle(D,R,S)      -> ws(n2o_proto:stream(D,R,S)).
+%websocket_handle(_,R,S)      -> {ok,R,S,hibernate}.
 websocket_init(T,R,O)        -> ws(n2o_proto:init(T,R,[{formatter,bert}|O],ws)).
 websocket_terminate(_,R,S)   -> n2o_proto:terminate(R,S).
 

+ 1 - 1
src/endpoints/n2o_document.erl

@@ -2,7 +2,7 @@
 -description('N2O Server Pages HTTP endpoint handler').
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
--compile (export_all).
+-compile([export_all, nowarn_export_all]).
 
 transition(Actions) ->
     receive

+ 1 - 1
src/endpoints/n2o_proto.erl

@@ -2,7 +2,7 @@
 -description('N2O Protocol WebSocket endpoint handler').
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 formatter(O)-> case lists:keyfind(formatter,1,O) of {formatter,F} -> F; X -> X end.
 upack(D)    -> binary_to_term(D,[safe]).

+ 1 - 1
src/endpoints/n2o_relay.erl

@@ -1,6 +1,6 @@
 -module(n2o_relay).
 -description('N2O TCP relay endpoint handler').
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 connect(IP, PortNo) ->
     {ok, Socket} = gen_tcp:connect(IP, PortNo, [{active, false}, {packet, 2}]),

+ 1 - 1
src/formatters/wf_convert.erl

@@ -1,6 +1,6 @@
 -module (wf_convert).
 -author('Maxim Sokhatsky').
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -include_lib("n2o/include/wf.hrl").
 
 % WF to_atom to_list to_binary

+ 2 - 2
src/formatters/wf_utils.erl

@@ -1,7 +1,7 @@
 -module(wf_utils).
 -author('Rusty Klophaus').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 f(S) -> f(S, []).
 f(S, Args) -> lists:flatten(io_lib:format(S, Args)).
@@ -14,7 +14,7 @@ replace(String, S1, S2) when is_list(String), is_list(S1), is_list(S2) ->
         _ -> [hd(String)|replace(tl(String), S1, S2)]
     end.
 
-coalesce({X,Y}) -> Y;
+coalesce({_X,Y}) -> Y;
 coalesce(false) -> undefined;
 coalesce([]) -> undefined;
 coalesce([H]) -> H;

+ 4 - 4
src/handlers/n2o_async.erl

@@ -4,7 +4,7 @@
 -behaviour(gen_server).
 -export([start_link/1]).
 -export([init/1,handle_call/3,handle_cast/2,handle_info/2,terminate/2,code_change/3]).
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 % n2o_async API
 
@@ -57,7 +57,7 @@ init_context(Req) ->
 % Generic Async Server
 
 init(#handler{module=Mod,class=Class,name=Name}=Handler) -> wf:cache({Class,Name},self(),infinity), Mod:proc(init,Handler).
-handle_call({get},_,#handler{module=Mod}=Async)   -> {reply,Async,Async};
+handle_call({get},_,#handler{module= _Mod}=Async)   -> {reply,Async,Async};
 handle_call(Message,_,#handler{module=Mod}=Async) -> Mod:proc(Message,Async).
 handle_cast(Message,  #handler{module=Mod}=Async) -> Mod:proc(Message,Async).
 handle_info(timeout,  #handler{module=Mod}=Async) -> Mod:proc(timeout,Async);
@@ -70,6 +70,6 @@ terminate(_Reason, #handler{name=Name,group=Group,class=Class}) ->
 
 % wf:async page workers
 
-proc(init,#handler{class=Class,name=Name,config={F,Req},state=Parent}=Async) -> put(parent,Parent), try F(init) catch _:_ -> skip end, init_context(Req), {ok,Async};
+proc(init,#handler{class= _Class,name= _Name,config={F, Req},state=Parent}=Async) -> put(parent,Parent), try F(init) catch _:_ -> skip end, init_context(Req), {ok,Async};
 proc({parent,Parent},Async) -> {reply,put(parent,Parent),Async#handler{state=Parent}};
-proc(Message,#handler{config={F,Req}}=Async) -> {reply,F(Message),Async}.
+proc(Message,#handler{config={F, _Req}}=Async) -> {reply,F(Message),Async}.

+ 1 - 1
src/handlers/n2o_error.erl

@@ -1,6 +1,6 @@
 -module(n2o_error).
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -export(?FAULTER_API).
 
 % Plain Text Error Page Render

+ 2 - 2
src/handlers/n2o_secret.erl

@@ -1,13 +1,13 @@
 -module(n2o_secret).
 -author('Oleksandr Nikitin').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 -export(?PICKLES_API).
 
 pickle(Data) ->
     Message = term_to_binary({Data,os:timestamp()}),
     Padding = size(Message) rem 16,
-    Bits = (16-Padding)*8, Key = secret(), IV = crypto:rand_bytes(16),
+    Bits = (16-Padding)*8, Key = secret(), IV = crypto:strong_rand_bytes(16),
     Cipher = crypto:block_encrypt(aes_cbc128,Key,IV,<<Message/binary,0:Bits>>),
     Signature = crypto:hmac(sha256,Key,<<Cipher/binary,IV/binary>>),
     base64:encode(<<IV/binary,Signature/binary,Cipher/binary>>).

+ 1 - 1
src/handlers/n2o_session.erl

@@ -2,7 +2,7 @@
 -author('Dmitry Krapivnoy').
 -include_lib("n2o/include/wf.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 finish(State,Ctx) -> {ok,State,Ctx}.
 init(State,Ctx) -> case wf:config(n2o,auto_session) of

+ 1 - 1
src/handlers/n2o_syn.erl

@@ -4,7 +4,7 @@
 
 send(Pool, Message) -> syn:publish(term_to_binary(Pool),Message).
 reg(Pool) -> reg(Pool,undefined).
-reg(Pool, Value) ->
+reg(Pool, _Value) ->
     case get({pool,Pool}) of
          undefined -> syn:join(term_to_binary(Pool),self()),
                       put({pool,Pool},Pool);

+ 1 - 1
src/n2o_cx.erl

@@ -2,7 +2,7 @@
 -description('N2O Process Context').
 -author('Rusty Klophaus').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 actions() -> get(actions).
 actions(Ac) -> put(actions,Ac).

+ 1 - 1
src/protocols/n2o_client.erl

@@ -1,7 +1,7 @@
 -module(n2o_client).
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 info({client,Message}, Req, State) ->
     wf:info(?MODULE,"Client Message: ~p",[Message]),

+ 8 - 8
src/protocols/n2o_file.erl

@@ -2,7 +2,7 @@
 -author('Andrii Zadorozhnii').
 -include_lib("n2o/include/wf.hrl").
 -include_lib("kernel/include/file.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 -define(ROOT, wf:config(n2o,upload,code:priv_dir(n2o))).
 -define(NEXT, 256*1024). % 256K chunks for best 25MB/s speed
@@ -21,7 +21,7 @@ info(#ftp{status={event,_}}=FTP, Req, State) ->
           catch E:R -> Error=wf:stack(E,R), wf:error(?MODULE,"Catch: ~p:~p~n~p",Error), Error end,
     {reply,wf:format({io,n2o_nitrogen:render_actions(wf:actions()),Reply}),Req,State};
 
-info(#ftp{id=Link,sid=Sid,filename=FileName,status= <<"init">>,block=Block,offset=Offset,size=TotalSize}=FTP,Req,State) ->
+info(#ftp{id=Link,sid= _Sid,filename= _FileName,status= <<"init">>,block=Block,offset=Offset,size= _TotalSize}=FTP,Req,State) ->
     Root=?ROOT,
     RelPath=(wf:config(n2o,filename,n2o_file)):filename(FTP),
     FilePath=filename:join(Root,RelPath),
@@ -40,10 +40,10 @@ info(#ftp{id=Link,sid=Sid,filename=FileName,status= <<"init">>,block=Block,offse
 
     {reply,wf:format(FTP2),Req,State};
 
-info(#ftp{id=Link,sid=Sid,filename=FileName,status= <<"send">>}=FTP,Req,State) ->
+info(#ftp{id=Link,sid= _Sid,filename= _FileName,status= <<"send">>}=FTP,Req,State) ->
     wf:info(?MODULE,"Info Send: ~p",[FTP#ftp{data= <<>>}]),
     Reply=try gen_server:call(n2o_async:pid({file,Link}),FTP)
-        catch E:R -> wf:error(?MODULE,"Info Error call the sync: ~p~n",[FTP#ftp{data= <<>>}]),
+        catch _E:_R -> wf:error(?MODULE,"Info Error call the sync: ~p~n",[FTP#ftp{data= <<>>}]),
             FTP#ftp{data= <<>>,block=?STOP} end,
     wf:info(?MODULE,"reply ~p",[Reply#ftp{data= <<>>}]),
     {reply,wf:format(Reply),Req,State};
@@ -62,8 +62,8 @@ proc(init,#handler{state=#ftp{sid=Sid}=FTP}=Async) ->
     wf:send(Sid,FTP#ftp{data= <<>>,status={event,init}}),
     {ok,Async};
 
-proc(#ftp{id=Link,sid=Sid,data=Data,filename=FileName,status= <<"send">>,block=Block}=FTP,
-     #handler{state=#ftp{data=State,size=TotalSize,offset=Offset,filename=RelPath}}=Async) when Offset+Block >= TotalSize ->
+proc(#ftp{id=Link,sid=Sid,data=Data,filename= _FileName,status= <<"send">>,block=Block}=FTP,
+     #handler{state=#ftp{data= _State,size=TotalSize,offset=Offset,filename=RelPath}}=Async) when Offset+Block >= TotalSize ->
 	wf:info(?MODULE,"Proc Stop ~p, last piece size: ~p", [FTP#ftp{data= <<>>},byte_size(Data)]),
 	case file:write_file(filename:join(?ROOT,RelPath),<<Data/binary>>,[append,raw]) of
 		{error,Reason} -> {reply,{error,Reason},Async};
@@ -73,8 +73,8 @@ proc(#ftp{id=Link,sid=Sid,data=Data,filename=FileName,status= <<"send">>,block=B
 			spawn(fun() -> n2o_async:stop(file,Link) end),
 			{stop,normal,FTP2,Async#handler{state=FTP2}} end;
 
-proc(#ftp{sid=Sid,data=Data,block=Block}=FTP,
-     #handler{state=#ftp{data=State,offset=Offset,filename=RelPath}}=Async) ->
+proc(#ftp{sid= _Sid,data=Data,block=Block}=FTP,
+     #handler{state=#ftp{data= _State,offset=Offset,filename=RelPath}}=Async) ->
     FTP2=FTP#ftp{status= <<"send">>,offset=Offset+Block },
     wf:info(?MODULE,"Proc Process ~p",[FTP2#ftp{data= <<>>}]),
     case file:write_file(filename:join(?ROOT,RelPath),<<Data/binary>>,[append,raw]) of

+ 17 - 17
src/protocols/n2o_heart.erl

@@ -1,7 +1,7 @@
 -module(n2o_heart).
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 info({text,<<"PING">> = _Ping}=Message, Req, State) ->
     wf:info(?MODULE,"PING: ~p",[Message]),
@@ -20,24 +20,24 @@ info({session,Operation,Key,Value},Req,State) -> {reply, case Operation of
                                                               set -> wf:session(Key,Value) end, Req, State};
 
 % MQ protocol
-info({pub,Topic,Message}=Message,Req,State) -> {reply, <<"OK">>, Req, State};
-info({sub,Topic,Args}=Message,Req,State)    -> {reply, <<"OK">>, Req, State};
-info({unsub,Topic}=Message,Req,State)       -> {reply, <<"OK">>, Req, State};
+info({pub, _Topic, _Message} = _Message, Req, State) -> {reply, <<"OK">>, Req, State};
+info({sub, _Topic, _Args} = _Message, Req, State)    -> {reply, <<"OK">>, Req, State};
+info({unsub, _Topic} = _Message, Req, State)         -> {reply, <<"OK">>, Req, State};
 
 % WF protocol
-info({q,Operation,Key}=Message,Req,State)                -> {reply, <<"OK">>, Req, State};
-info({qc,Operation,Key}=Message,Req,State)               -> {reply, <<"OK">>, Req, State};
-info({cookie,Operation,Key,Value}=Message,Req,State)     -> {reply, <<"OK">>, Req, State};
-info({wire,Parameter}=Message,Req,State)                 -> {reply, <<"OK">>, Req, State};
-info({update,Target,Elements}=Message,Req,State)         -> {reply, <<"OK">>, Req, State};
-info({insert_top,Target,Elements}=Message,Req,State)     -> {reply, <<"OK">>, Req, State};
-info({insert_bottom,Target,Elements}=Message,Req,State)  -> {reply, <<"OK">>, Req, State};
+info({q, _Operation, _Key} = _Message, Req, State)                 -> {reply, <<"OK">>, Req, State};
+info({qc, _Operation, _Key} = _Message, Req, State)                -> {reply, <<"OK">>, Req, State};
+info({cookie, _Operation, _Key, _Value} = _Message, Req, State)    -> {reply, <<"OK">>, Req, State};
+info({wire, _Parameter} = _Message, Req, State)                    -> {reply, <<"OK">>, Req, State};
+info({update, _Target, _Elements} = _Message, Req, State)          -> {reply, <<"OK">>, Req, State};
+info({insert_top, _Target, _Elements} = _Message, Req, State)      -> {reply, <<"OK">>, Req, State};
+info({insert_bottom, _Target, _Elements} = _Message, Req, State) -> {reply, <<"OK">>, Req, State};
 
 % ASYNC protocol
-info({start,Handler}=Message,Req,State)          -> {reply, <<"OK">>, Req, State};
-info({stop,Name}=Message,Req,State)              -> {reply, <<"OK">>, Req, State};
-info({restart,Name}=Message,Req,State)           -> {reply, <<"OK">>, Req, State};
-info({async,Name,Function}=Message,Req,State)    -> {reply, <<"OK">>, Req, State};
-info({flush}=Message,Req,State)                  -> {reply, <<"OK">>, Req, State};
+info({start, _Handler} = _Message, Req, State)          -> {reply, <<"OK">>, Req, State};
+info({stop, _Name} = _Message, Req, State)              -> {reply, <<"OK">>, Req, State};
+info({restart, _Name} = _Message, Req, State)           -> {reply, <<"OK">>, Req, State};
+info({async, _Name, _Function} = _Message, Req, State)  -> {reply, <<"OK">>, Req, State};
+info({flush} = _Message, Req, State)                    -> {reply, <<"OK">>, Req, State};
 
-info(Message, Req, State) -> {unknown,Message, Req, State}.
+info(Message, Req, State) -> {unknown, Message, Req, State}.

+ 1 - 1
src/protocols/n2o_http.erl

@@ -1,6 +1,6 @@
 -module(n2o_http).
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 %% ws.send(enc(tuple(atom('http'), bin(url), bin(method), bin(body), [])));
 

+ 2 - 2
src/protocols/n2o_nitrogen.erl

@@ -1,7 +1,7 @@
 -module(n2o_nitrogen).
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 % Nitrogen pickle handler
 
@@ -69,7 +69,7 @@ render_actions(Actions) ->
 html_events({pickle,Source,Pickled,Linked}=Pickle, State) ->
     wf:info(?MODULE,"Pickle: ~tp",[Pickle]),
     Ev = wf:depickle(Pickled),
-    Result = case Ev of
+    _Result = case Ev of
          #ev{} -> render_ev(Ev,Source,Linked,State);
          CustomEnvelop -> wf:error("Only #ev{} events for now: ~p",[CustomEnvelop]) end,
     {io,render_actions(wf:actions()),<<>>}.

+ 1 - 1
src/protocols/n2o_text.erl

@@ -1,7 +1,7 @@
 -module(n2o_text).
 -author('Alexander Salnikov').
 -include_lib("n2o/include/wf.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 info({text,Text}=Message, Req, State) when is_binary(Text) ->
     wf:info(?MODULE,"TEXT Message: ~p",[Message]),

+ 3 - 3
src/wf.erl

@@ -3,7 +3,7 @@
 -author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
 -include_lib("n2o/include/api.hrl").
--compile (export_all).
+-compile([export_all, nowarn_export_all]).
 
 -define(ACTION_BASE(Module), ancestor=action, trigger, target, module=Module, actions, source=[]).
 -record(jq,      {?ACTION_BASE(action_jq), property, method, args=[], right, format="~s"}).
@@ -123,7 +123,7 @@ user() -> wf:session(<<"user">>).
 user(User) -> wf:session(<<"user">>,User).
 clear_user() -> wf:session(<<"user">>,undefined).
 logout() -> clear_user(), clear_session().
-invalidate_cache() -> ets:foldl(fun(X,A) -> wf:cache(element(1,X)) end, 0, caching).
+invalidate_cache() -> ets:foldl(fun(X, _A) -> wf:cache(element(1,X)) end, 0, caching).
 cache(Key, undefined) -> ets:delete(caching,Key);
 cache(Key, Value) -> ets:insert(caching,{Key,n2o_session:till(calendar:local_time(), n2o_session:ttl()),Value}), Value.
 cache(Key, Value, Till) -> ets:insert(caching,{Key,Till,Value}), Value.
@@ -248,7 +248,7 @@ format(Term)           -> wf_convert:format(Term).
 
 % These api are not really API
 
-unique_integer() -> try erlang:unique_integer() catch _:_ -> {MS,S,US} = erlang:now(), (MS*1000000+S)*1000000+US end.
+unique_integer() -> try erlang:unique_integer() catch _:_ -> {MS,S,US} = erlang:timestamp(), (MS*1000000+S)*1000000+US end.
 temp_id() -> "auto" ++ integer_to_list(unique_integer() rem 1000000).
 append(List, Key, Value) -> case Value of undefined -> List; _A -> [{Key, Value}|List] end.
 render(X) -> wf_render:render(X).