erlang: Fix several compilation warnings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990999 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/src/thrift_binary_protocol.erl b/lib/erl/src/thrift_binary_protocol.erl
index 9216e47..800fd8e 100644
--- a/lib/erl/src/thrift_binary_protocol.erl
+++ b/lib/erl/src/thrift_binary_protocol.erl
@@ -187,7 +187,7 @@
%% there's a version number but it's unexpected
{This1, {error, {bad_binary_protocol_version, Sz}}};
- {ok, Sz} when This1#binary_protocol.strict_read =:= true ->
+ {ok, _Sz} when This1#binary_protocol.strict_read =:= true ->
%% strict_read is true and there's no version header; that's an error
{This1, {error, no_binary_protocol_version}};
diff --git a/lib/erl/src/thrift_disk_log_transport.erl b/lib/erl/src/thrift_disk_log_transport.erl
index aceec7f..892d30c 100644
--- a/lib/erl/src/thrift_disk_log_transport.erl
+++ b/lib/erl/src/thrift_disk_log_transport.erl
@@ -68,7 +68,7 @@
%%%% TRANSPORT IMPLENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% disk_log_transport is write-only
-read(State, Len) ->
+read(State, _Len) ->
{State, {error, no_read_from_disk_log}}.
write(This = #dl_transport{log = Log}, Data) ->
diff --git a/lib/erl/src/thrift_processor.erl b/lib/erl/src/thrift_processor.erl
index 9924a2c..4315505 100644
--- a/lib/erl/src/thrift_processor.erl
+++ b/lib/erl/src/thrift_processor.erl
@@ -26,7 +26,7 @@
-record(thrift_processor, {handler, protocol, service}).
-init({Server, ProtoGen, Service, Handler}) when is_function(ProtoGen, 0) ->
+init({_Server, ProtoGen, Service, Handler}) when is_function(ProtoGen, 0) ->
{ok, Proto} = ProtoGen(),
loop(#thrift_processor{protocol = Proto,
service = Service,
diff --git a/lib/erl/src/thrift_protocol.erl b/lib/erl/src/thrift_protocol.erl
index 067a5a1..db7d223 100644
--- a/lib/erl/src/thrift_protocol.erl
+++ b/lib/erl/src/thrift_protocol.erl
@@ -183,7 +183,7 @@
{Proto#protocol{data = NewData}, Result}.
read_struct_loop(IProto0, SDict, RTuple) ->
- {IProto1, #protocol_field_begin{type = FType, id = Fid, name = Name}} =
+ {IProto1, #protocol_field_begin{type = FType, id = Fid}} =
thrift_protocol:read(IProto0, field_begin),
case {FType, Fid} of
{?tType_STOP, _} ->
@@ -323,7 +323,6 @@
when is_atom(Module),
is_atom(StructureName),
element(1, Data) =:= StructureName ->
- StructType = Module:struct_info(StructureName),
write(Proto, {Module:struct_info(StructureName), Data});
write(Proto0, {{list, Type}, Data})
diff --git a/lib/erl/src/thrift_server.erl b/lib/erl/src/thrift_server.erl
index 80a1388..5012e16 100644
--- a/lib/erl/src/thrift_server.erl
+++ b/lib/erl/src/thrift_server.erl
@@ -126,7 +126,7 @@
{stop, Reason, State}
end;
-handle_info({inet_async, ListenSocket, Ref, Error}, State) ->
+handle_info({inet_async, _ListenSocket, _Ref, Error}, State) ->
error_logger:error_msg("Error in acceptor: ~p~n", [Error]),
{stop, Error, State};
diff --git a/lib/erl/src/thrift_socket_server.erl b/lib/erl/src/thrift_socket_server.erl
index 44894b0..f7c7a02 100644
--- a/lib/erl/src/thrift_socket_server.erl
+++ b/lib/erl/src/thrift_socket_server.erl
@@ -166,13 +166,12 @@
new_acceptor(State=#thrift_socket_server{max=0}) ->
error_logger:error_msg("Not accepting new connections"),
State#thrift_socket_server{acceptor=null};
-new_acceptor(State=#thrift_socket_server{acceptor=OldPid, listen=Listen,
+new_acceptor(State=#thrift_socket_server{listen=Listen,
service=Service, handler=Handler,
socket_opts=Opts, framed=Framed
}) ->
Pid = proc_lib:spawn_link(?MODULE, acceptor_loop,
[{self(), Listen, Service, Handler, Opts, Framed}]),
-%% error_logger:info_msg("Spawning new acceptor: ~p => ~p", [OldPid, Pid]),
State#thrift_socket_server{acceptor=Pid}.
acceptor_loop({Server, Listen, Service, Handler, SocketOpts, Framed})