diff options
author | Dan Gudmundsson <[email protected]> | 2014-01-21 16:01:33 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-01-21 16:01:33 +0100 |
commit | f836096cb383c6a3c5c91956ded5bd4e2772bcd2 (patch) | |
tree | 293fd589d9bab7505ef7d4a6cb2dbb82c69b01e7 /lib/wx/api_gen | |
parent | df47401bc897afc1b3929fc32426fcb0d0c00d0a (diff) | |
parent | 31172443bfc849b879385d7ee0d2ea8019c32307 (diff) | |
download | otp-f836096cb383c6a3c5c91956ded5bd4e2772bcd2.tar.gz otp-f836096cb383c6a3c5c91956ded5bd4e2772bcd2.tar.bz2 otp-f836096cb383c6a3c5c91956ded5bd4e2772bcd2.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 7e35ebfa83..6eed0668f6 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -855,34 +855,24 @@ call_arg(#param{name=N,type={merged,_,_,_,_,_,_}}) -> N. to_string(Type) when is_atom(Type) -> atom_to_list(Type); to_string(Type) when is_list(Type) -> Type. -virtual_dest(#class{abstract=true, parent="root"}) -> false; -virtual_dest(#class{abstract=true, parent="object"}) -> true; virtual_dest(#class{abstract=true, parent=Parent}) -> - virtual_dest(get({class,Parent})); + virtual_dest(get_parent_class(Parent)); virtual_dest(#class{methods=Ms, parent=Parent}) -> case lists:keysearch(destructor,#method.method_type, lists:append(Ms)) of {value, #method{method_type=destructor, virtual=Virtual}} -> case Virtual of - undefined -> - case get({class,Parent}) of - undefined -> - case Parent of - "object" -> - true; - "root" -> - false; - _ -> - io:format("Error: ~p~n",[Parent]), - erlang:error(no_parent) - end; - PClass -> - virtual_dest(PClass) - end; - _ -> - Virtual + true -> true; + _ -> virtual_dest(get_parent_class(Parent)) end; - false -> - false + false -> virtual_dest(get_parent_class(Parent)) + end; +virtual_dest("root") -> false; +virtual_dest("object") -> true. + +get_parent_class(Parent) -> + case get({class, Parent}) of + undefined -> Parent; + Class -> Class end. debug(F,A) -> |