erlang: Fix several compilation warnings
authorDavid Reiss <dreiss@apache.org>
Mon, 30 Aug 2010 22:05:57 +0000 (22:05 +0000)
committerDavid Reiss <dreiss@apache.org>
Mon, 30 Aug 2010 22:05:57 +0000 (22:05 +0000)
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
lib/erl/src/thrift_disk_log_transport.erl
lib/erl/src/thrift_processor.erl
lib/erl/src/thrift_protocol.erl
lib/erl/src/thrift_server.erl
lib/erl/src/thrift_socket_server.erl

index 9216e47..800fd8e 100644 (file)
@@ -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}};
 
index aceec7f..892d30c 100644 (file)
@@ -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) ->
index 9924a2c..4315505 100644 (file)
@@ -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,
index 067a5a1..db7d223 100644 (file)
@@ -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})
index 80a1388..5012e16 100644 (file)
@@ -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};
 
index 44894b0..f7c7a02 100644 (file)
@@ -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})