From 5ed313d998c3a5dc43c4bc9a22d2db57162bd28e Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 30 Aug 2010 22:05:57 +0000 Subject: [PATCH] erlang: Fix several compilation warnings git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990999 13f79535-47bb-0310-9956-ffa450edef68 --- lib/erl/src/thrift_binary_protocol.erl | 2 +- lib/erl/src/thrift_disk_log_transport.erl | 2 +- lib/erl/src/thrift_processor.erl | 2 +- lib/erl/src/thrift_protocol.erl | 3 +-- lib/erl/src/thrift_server.erl | 2 +- lib/erl/src/thrift_socket_server.erl | 3 +-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/erl/src/thrift_binary_protocol.erl b/lib/erl/src/thrift_binary_protocol.erl index 9216e474..800fd8ea 100644 --- a/lib/erl/src/thrift_binary_protocol.erl +++ b/lib/erl/src/thrift_binary_protocol.erl @@ -187,7 +187,7 @@ read(This0, message_begin) -> %% 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 aceec7f9..892d30ce 100644 --- a/lib/erl/src/thrift_disk_log_transport.erl +++ b/lib/erl/src/thrift_disk_log_transport.erl @@ -68,7 +68,7 @@ parse_opts([{sync_every, Int} | Rest], State) when is_integer(Int), Int > 0 -> %%%% 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 9924a2c0..43155050 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 067a5a14..db7d2236 100644 --- a/lib/erl/src/thrift_protocol.erl +++ b/lib/erl/src/thrift_protocol.erl @@ -183,7 +183,7 @@ read_specific(Proto = #protocol{module = Module, {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 @@ write(Proto, {{struct, {Module, StructureName}}, Data}) 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 80a1388e..5012e168 100644 --- a/lib/erl/src/thrift_server.erl +++ b/lib/erl/src/thrift_server.erl @@ -126,7 +126,7 @@ handle_info({inet_async, ListenSocket, Ref, {ok, ClientSocket}}, {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 44894b05..f7c7a028 100644 --- a/lib/erl/src/thrift_socket_server.erl +++ b/lib/erl/src/thrift_socket_server.erl @@ -166,13 +166,12 @@ gen_tcp_listen(Port, Opts, State) -> 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}) -- 2.17.1