From f4494ee3a9a4751e6537527bb7a46d2daba20bed Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 30 Aug 2010 22:06:03 +0000 Subject: [PATCH] erlang: Un-revert r988722 git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991003 13f79535-47bb-0310-9956-ffa450edef68 --- lib/erl/include/thrift_protocol_behaviour.hrl | 4 ++-- lib/erl/src/thrift_client.erl | 6 +++--- lib/erl/src/thrift_protocol.erl | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/erl/include/thrift_protocol_behaviour.hrl b/lib/erl/include/thrift_protocol_behaviour.hrl index b75bb4a4..abe300b1 100644 --- a/lib/erl/include/thrift_protocol_behaviour.hrl +++ b/lib/erl/include/thrift_protocol_behaviour.hrl @@ -25,13 +25,13 @@ -spec flush_transport(state()) -> {state(), ok | {error, _Reason}}. -spec close_transport(state()) -> {state(), ok | {error, _Reason}}. --spec write(state(), term()) -> {state(), ok | {error, _Reason}}. +-spec write(state(), any()) -> {state(), ok | {error, _Reason}}. %% NOTE: Keep this in sync with thrift_protocol:read and read_specific. -spec read (state(), tprot_empty_tag()) -> {state(), ok | {error, _Reason}}; (state(), tprot_header_tag()) -> {state(), tprot_header_val() | {error, _Reason}}; - (state(), tprot_data_tag()) -> {state(), {ok, term()} | {error, _Reason}}. + (state(), tprot_data_tag()) -> {state(), {ok, any()} | {error, _Reason}}. -endif. diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl index f7701b90..5c74adc7 100644 --- a/lib/erl/src/thrift_client.erl +++ b/lib/erl/src/thrift_client.erl @@ -34,7 +34,7 @@ new(Protocol, Service) service = Service, seqid = 0}}. --spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, term()} | {error, term()}}. +-spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, any()} | {error, any()}}. call(Client = #tclient{}, Function, Args) when is_atom(Function), is_list(Args) -> case send_function_call(Client, Function, Args) of @@ -61,7 +61,7 @@ close(#tclient{protocol=Protocol}) -> %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- --spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, term()}}. +-spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, any()}}. send_function_call(Client = #tclient{protocol = Proto0, service = Service, seqid = SeqId}, @@ -84,7 +84,7 @@ send_function_call(Client = #tclient{protocol = Proto0, {Client#tclient{protocol = Proto4}, ok} end. --spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, term()} | {error, term()}}. +-spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, any()} | {error, any()}}. receive_function_result(Client = #tclient{service = Service}, Function) -> ResultType = Service:function_info(Function, reply_type), read_result(Client, Function, ResultType). diff --git a/lib/erl/src/thrift_protocol.erl b/lib/erl/src/thrift_protocol.erl index bb499ce7..4c334128 100644 --- a/lib/erl/src/thrift_protocol.erl +++ b/lib/erl/src/thrift_protocol.erl @@ -120,10 +120,10 @@ read(IProto0, {struct, Structure}, Tag) %% NOTE: Keep this in sync with thrift_protocol_behaviour:read -spec read (#protocol{}, {struct, _Info}) -> {#protocol{}, {ok, tuple()} | {error, _Reason}}; - (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}; + (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}; (#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}}; (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}}; - (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}. + (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}. read(IProto, {struct, {Module, StructureName}}) when is_atom(Module), is_atom(StructureName) -> @@ -180,7 +180,7 @@ read(Protocol, ProtocolType) -> -spec read_specific (#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}}; (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}}; - (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}. + (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}. read_specific(Proto = #protocol{module = Module, data = ModuleData}, ProtocolType) -> {NewData, Result} = Module:read(ModuleData, ProtocolType), @@ -219,7 +219,7 @@ skip_field(FType, IProto0, SDict, RTuple) -> {IProto2, ok} = read(IProto1, field_end), read_struct_loop(IProto2, SDict, RTuple). --spec skip(#protocol{}, term()) -> {#protocol{}, ok}. +-spec skip(#protocol{}, any()) -> {#protocol{}, ok}. skip(Proto0, struct) -> {Proto1, ok} = read(Proto0, struct_begin), @@ -308,11 +308,11 @@ skip_list_loop(Proto0, Map = #protocol_list_begin{etype = Etype, %% | list() -- for list %% | dictionary() -- for map %% | set() -- for set -%% | term() -- for base types +%% | any() -- for base types %% %% Description: %%-------------------------------------------------------------------- --spec write(#protocol{}, term()) -> {#protocol{}, ok | {error, _Reason}}. +-spec write(#protocol{}, any()) -> {#protocol{}, ok | {error, _Reason}}. write(Proto0, {{struct, StructDef}, Data}) when is_list(StructDef), is_tuple(Data), length(StructDef) == size(Data) - 1 -> -- 2.17.1