diff options
author | Dan Gudmundsson <[email protected]> | 2012-03-21 10:29:21 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2012-03-21 10:29:21 +0100 |
commit | 66b09026bfbb1385e17d4cd60c543858e5b5b98e (patch) | |
tree | 4ff883c2efe01e1f46ad19ab4b6e3161c3d08ca4 /lib/wx/api_gen/wx_gen_cpp.erl | |
parent | 5dc35dc142de8875bf81fb2bbf6f6bfc8c731438 (diff) | |
parent | 6763de4ffecfeb56a69c5f763d221ba20d1eef7d (diff) | |
download | otp-66b09026bfbb1385e17d4cd60c543858e5b5b98e.tar.gz otp-66b09026bfbb1385e17d4cd60c543858e5b5b98e.tar.bz2 otp-66b09026bfbb1385e17d4cd60c543858e5b5b98e.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/wx/api_gen/wx_gen_cpp.erl')
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 69e7510a95..2209e4a53b 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -350,8 +350,12 @@ declare_type(N,false,_,#type{name="wxDateTime"}) -> w(" wxDateTime ~s;~n", [N]); declare_type(N,false,_,#type{name="wxColour"}) -> w(" wxColour ~s;~n", [N]); +declare_type(N,false,_,#type{name=Type, base=int, ref=reference}) -> + w(" ~s ~s;~n", [Type,N]); declare_type(N,false,_,#type{name=Type, base=int64, ref=reference}) -> w(" ~s ~s;~n", [Type,N]); +declare_type(N,false,_,#type{base={comp,_,_},single=true,name=Type,ref=reference}) -> + w(" ~s ~s;~n", [Type,N]); declare_type(N,true,Def,#type{base=Base,single=true,name=Type,by_val=true}) when Base =:= int; Base =:= long; Base =:= float; Base =:= double; Base =:= bool -> w(" ~s ~s=~s;~n", [Type,N,Def]); @@ -812,6 +816,7 @@ call_arg(#param{name=N,in=false,type=#type{by_val=false, single=true}}) -> "&" + call_arg(#param{name=N,def=Def,type=#type{base={comp,_,_},ref={pointer,1},single=true}}) when Def =:= none -> "&" ++N; +call_arg(#param{name=N,type=#type{base=int, ref=reference, single=true}}) -> "*" ++ N; call_arg(#param{name=N,type=#type{by_val=false}}) -> N; call_arg(#param{name=N,type={merged,_,#type{base={class,_},single=true, by_val=ByVal, @@ -888,7 +893,7 @@ build_return_vals(Type,Ps) -> build_ret_types(void,Ps) -> Calc = fun(#param{name=N,in=False,type=T}, Free) when False =/= true -> - case build_ret(N, False, T) of + case build_ret(N, {arg, False}, T) of ok -> Free; Other -> [Other|Free] end; @@ -896,12 +901,12 @@ build_ret_types(void,Ps) -> end, lists:foldl(Calc, [], Ps); build_ret_types(Type,Ps) -> - Free = case build_ret("Result", out, Type) of + Free = case build_ret("Result", {ret, out}, Type) of ok -> []; FreeStr -> [FreeStr] end, Calc = fun(#param{name=N,in=False,type=T}, FreeAcc) when False =/= true -> - case build_ret(N, False, T) of + case build_ret(N, {arg, False}, T) of ok -> FreeAcc; FreeMe -> [FreeMe|FreeAcc] end; @@ -927,13 +932,13 @@ build_ret(Name,_,#type{base={enum,_Type},single=true}) -> w(" rt.addInt(~s);~n",[Name]); build_ret(Name,_,#type{base={comp,_,{record, _}},single=true}) -> w(" rt.add(~s);~n", [Name]); -build_ret(Name,_,#type{base={comp,_,_},single=true, ref=reference}) -> +build_ret(Name,{ret,_},#type{base={comp,_,_},single=true, ref=reference}) -> w(" rt.add((*~s));~n",[Name]); build_ret(Name,_,#type{base={comp,_,_},single=true}) -> w(" rt.add(~s);~n",[Name]); build_ret(Name,_,#type{base=bool,single=true,by_val=true}) -> w(" rt.addBool(~s);~n",[Name]); -build_ret(Name,both,#type{base=int,single=true,mod=M}) -> +build_ret(Name,{arg, both},#type{base=int,single=true,mod=M}) -> case lists:member(unsigned, M) of true -> w(" rt.addUint(*~s);~n",[Name]); false -> w(" rt.addInt(*~s);~n",[Name]) |