aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-05-07 07:43:20 +0200
committerBjörn Gustavsson <[email protected]>2014-06-05 13:46:29 +0200
commit0db2668288bf399983e0f6daac85b00d68ab0360 (patch)
tree0b28dce2da12afe33ed3e6597837b0f22ebc02f1 /lib/asn1/src/asn1ct_gen.erl
parent6b74e6b29dba58b7d54e9e7c4d8f3e1ab28fa66d (diff)
downloadotp-0db2668288bf399983e0f6daac85b00d68ab0360.tar.gz
otp-0db2668288bf399983e0f6daac85b00d68ab0360.tar.bz2
otp-0db2668288bf399983e0f6daac85b00d68ab0360.zip
BER: Eliminate dialyzer warnings for specialized decode functions
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index c6561bcdb4..450d309688 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -937,9 +937,10 @@ gen_partial_inc_dispatcher() ->
ok;
{Data1,Data2} ->
% io:format("partial_incomplete_decode: ~p~ninc_type_pattern: ~p~n",[Data,Data2]),
- gen_partial_inc_dispatcher(Data1,Data2)
+ gen_partial_inc_dispatcher(Data1, Data2, "")
end.
-gen_partial_inc_dispatcher([{FuncName,TopType,_Pattern}|Rest],TypePattern) ->
+
+gen_partial_inc_dispatcher([{FuncName,TopType,_Pattern}|Rest], TypePattern, Sep) ->
TPattern =
case lists:keysearch(FuncName,1,TypePattern) of
{value,{_,TP}} -> TP;
@@ -953,13 +954,13 @@ gen_partial_inc_dispatcher([{FuncName,TopType,_Pattern}|Rest],TypePattern) ->
_ ->
atom_to_list(TopType)
end,
- emit(["decode_partial_inc_disp('",TopTypeName,"',Data) ->",nl,
+ emit([Sep,
+ "decode_partial_inc_disp('",TopTypeName,"',Data) ->",nl,
" ",{asis,list_to_atom(lists:concat(["dec-inc-",FuncName2]))},
- "(Data);",nl]),
- gen_partial_inc_dispatcher(Rest,TypePattern);
-gen_partial_inc_dispatcher([],_) ->
- emit(["decode_partial_inc_disp(Type,_Data) ->",nl,
- " exit({error,{asn1,{undefined_type,Type}}}).",nl]).
+ "(Data)"]),
+ gen_partial_inc_dispatcher(Rest, TypePattern, ";\n");
+gen_partial_inc_dispatcher([], _, _) ->
+ emit([".",nl]).
gen_dispatcher([F1,F2|T],FuncName,Prefix,ExtraArg) ->
emit([FuncName,"('",F1,"',Data) -> '",Prefix,F1,"'(Data",ExtraArg,")",";",nl]),