~ubuntu-branches/ubuntu/lucid/erlang/lucid-proposed

« back to all changes in this revision

Viewing changes to lib/compiler/src/v3_core.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-06-11 12:18:07 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090611121807-ks7eb4xrt7dsysgx
Tags: 1:13.b.1-dfsg-1
* New upstream release.
* Removed unnecessary dependency of erlang-os-mon on erlang-observer and
  erlang-tools and added missing dependency of erlang-nox on erlang-os-mon
  (closes: #529512).
* Removed a patch to eunit application because the bug was fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
-export([module/2,format_error/1]).
75
75
 
76
76
-import(lists, [reverse/1,reverse/2,map/2,member/2,foldl/3,foldr/3,mapfoldl/3,
77
 
                splitwith/2,keysearch/3,sort/1,foreach/2]).
 
77
                splitwith/2,keyfind/3,sort/1,foreach/2]).
78
78
-import(ordsets, [add_element/2,del_element/2,is_element/2,
79
79
                  union/1,union/2,intersection/2,subtract/2]).
80
80
 
732
732
        true -> ok;
733
733
        false -> throw(error)                   %Native endian.
734
734
    end,
735
 
    {value,{unit,Unit}} = keysearch(unit, 1, Opts),
 
735
    {unit,Unit} = keyfind(unit, 1, Opts),
736
736
    case {SzTerm,Val} of
737
737
        {{atom,_,undefined},{char,_,_}} ->
738
738
            %% UTF-8/16/32.
1163
1163
    end.
1164
1164
 
1165
1165
bc_elem_size_1([{bin_element,_,_,{integer,_,N},Flags}|Es], Bits, Vars) ->
1166
 
    {value,{unit,U}} = keysearch(unit, 1, Flags),
 
1166
    {unit,U} = keyfind(unit, 1, Flags),
1167
1167
    bc_elem_size_1(Es, Bits+U*N, Vars);
1168
1168
bc_elem_size_1([{bin_element,_,_,{var,_,Var},Flags}|Es], Bits, Vars) ->
1169
 
    {value,{unit,U}} = keysearch(unit, 1, Flags),
 
1169
    {unit,U} = keyfind(unit, 1, Flags),
1170
1170
    bc_elem_size_1(Es, Bits, [{U,#c_var{name=Var}}|Vars]);
1171
1171
bc_elem_size_1([_|_], _, _) ->
1172
1172
    throw(impossible);
1275
1275
    bc_bin_size_1(Els, 0).
1276
1276
 
1277
1277
bc_bin_size_1([{bin_element,_,_,{integer,_,Sz},Flags}|Els], N) ->
1278
 
    {value,{unit,U}} = keysearch(unit, 1, Flags),
 
1278
    {unit,U} = keyfind(unit, 1, Flags),
1279
1279
    bc_bin_size_1(Els, N+U*Sz);
1280
1280
bc_bin_size_1([], N) -> N;
1281
1281
bc_bin_size_1(_, _) -> throw(impossible).