diff options
author | Björn Gustavsson <[email protected]> | 2013-02-21 13:15:43 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-05-31 14:52:12 +0200 |
commit | 988846bb26e652ad2272fac24a679259059bcf39 (patch) | |
tree | 55eba4234efcde03a4d62797efd1f89b299f0b6c /lib/asn1/src | |
parent | df4fe8fac6425a85c5366e540b588b6e084ca798 (diff) | |
download | otp-988846bb26e652ad2272fac24a679259059bcf39.tar.gz otp-988846bb26e652ad2272fac24a679259059bcf39.tar.bz2 otp-988846bb26e652ad2272fac24a679259059bcf39.zip |
asn1ct_name: Remove unused functions
asn1ct_name:delete/1 is used from asn1ct_gen_ber_bin_v2:add_removed_bytes/1,
but that function is not used.
Diffstat (limited to 'lib/asn1/src')
-rw-r--r-- | lib/asn1/src/asn1ct_gen_ber_bin_v2.erl | 14 | ||||
-rw-r--r-- | lib/asn1/src/asn1ct_name.erl | 51 |
2 files changed, 0 insertions, 65 deletions
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl index de0adef2b2..7de80f216f 100644 --- a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl +++ b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl @@ -26,7 +26,6 @@ -export([pgen/4]). -export([decode_class/1, decode_type/1]). --export([add_removed_bytes/0]). -export([gen_encode/2,gen_encode/3,gen_decode/2,gen_decode/3]). -export([gen_encode_prim/4]). -export([gen_dec_prim/7]). @@ -1615,19 +1614,6 @@ decode_type('BMPString') -> 30; decode_type('CHOICE') -> 'CHOICE'; % choice gets the tag from the actual alternative decode_type(Else) -> exit({error,{asn1,{unrecognized_type,Else}}}). -add_removed_bytes() -> - asn1ct_name:delete(rb), - add_removed_bytes(asn1ct_name:all(rb)). - -add_removed_bytes([H,T1|T]) -> - emit({{var,H},"+"}), - add_removed_bytes([T1|T]); -add_removed_bytes([H|T]) -> - emit({{var,H}}), - add_removed_bytes(T); -add_removed_bytes([]) -> - true. - mkfuncname(WhatKind,DecOrEnc) -> case WhatKind of #'Externaltypereference'{module=Mod,type=EType} -> diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl index 3ab6f7b0ed..24b28ade7e 100644 --- a/lib/asn1/src/asn1ct_name.erl +++ b/lib/asn1/src/asn1ct_name.erl @@ -22,11 +22,8 @@ %%-compile(export_all). -export([start/0, stop/0, - push/1, - pop/1, curr/1, clear/0, - delete/1, active/1, prev/1, next/1, @@ -56,15 +53,6 @@ name_server_loop({Ref, Parent} = Monitor,Vars) -> {From,{current,Variable}} -> From ! {?MODULE,get_curr(Vars,Variable)}, name_server_loop(Monitor,Vars); - {From,{pop,Variable}} -> - From ! {?MODULE,done}, - name_server_loop(Monitor,pop_var(Vars,Variable)); - {From,{push,Variable}} -> - From ! {?MODULE,done}, - name_server_loop(Monitor,push_var(Vars,Variable)); - {From,{delete,Variable}} -> - From ! {?MODULE,done}, - name_server_loop(Monitor,delete_var(Vars,Variable)); {From,{new,Variable}} -> From ! {?MODULE,done}, name_server_loop(Monitor,new_var(Vars,Variable)); @@ -94,12 +82,9 @@ req(Req) -> exit(name_server_timeout) end. -pop(V) -> req({pop,V}). -push(V) -> req({push,V}). clear() -> stop(), start(). curr(V) -> req({current,V}). new(V) -> req({new,V}). -delete(V) -> req({delete,V}). prev(V) -> case req({prev,V}) of none -> @@ -146,26 +131,6 @@ get_digs([H|T]) -> [] end. -push_var(Vars,Variable) -> - case lists:keysearch(Variable,1,Vars) of - false -> - [{Variable,[0]}|Vars]; - {value,{Variable,[Digit|Drest]}} -> - NewVars = lists:keydelete(Variable,1,Vars), - [{Variable,[Digit,Digit|Drest]}|NewVars] - end. - -pop_var(Vars,Variable) -> - case lists:keysearch(Variable,1,Vars) of - false -> - ok; - {value,{Variable,[_Dig]}} -> - lists:keydelete(Variable,1,Vars); - {value,{Variable,[_Dig|Digits]}} -> - NewVars = lists:keydelete(Variable,1,Vars), - [{Variable,Digits}|NewVars] - end. - get_curr([],Variable) -> Variable; get_curr([{Variable,[0|_Drest]}|_Tail],Variable) -> @@ -185,22 +150,6 @@ new_var(Vars,Variable) -> [{Variable,[Digit+1|Drest]}|NewVars] end. -delete_var(Vars,Variable) -> - case lists:keysearch(Variable,1,Vars) of - false -> - Vars; - {value,{Variable,[N]}} when N =< 1 -> - lists:keydelete(Variable,1,Vars); - {value,{Variable,[Digit|Drest]}} -> - case Digit of - 0 -> - Vars; - _ -> - NewVars = lists:keydelete(Variable,1,Vars), - [{Variable,[Digit-1|Drest]}|NewVars] - end - end. - get_prev(Vars,Variable) -> case lists:keysearch(Variable,1,Vars) of false -> |