diff options
author | Dan Gudmundsson <[email protected]> | 2012-12-13 12:51:51 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2013-01-09 11:44:28 +0100 |
commit | b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32 (patch) | |
tree | 791621c4f18d2a9c38554e4be8e2de3cf9cf5f13 /lib/wx/api_gen | |
parent | c8b4d62cf92b3e0662adfb9e6a5d80d516413cde (diff) | |
download | otp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.tar.gz otp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.tar.bz2 otp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.zip |
wx: Remove unnecessary casts
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r-- | lib/wx/api_gen/wx_gen.erl | 4 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 19 |
2 files changed, 7 insertions, 16 deletions
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl index d3d0a78af2..2eb9d9d33d 100644 --- a/lib/wx/api_gen/wx_gen.erl +++ b/lib/wx/api_gen/wx_gen.erl @@ -726,11 +726,9 @@ parse_type2([N="wxTextPos"|R],Info,Opts,T) -> %%long parse_type2(R,Info,Opts,T#type{name=N,base=int}); parse_type2([N="wxPrintQuality"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N,base=int}); -parse_type2([N="wxPaperSize"|R],Info,Opts,T) -> - parse_type2(R,Info,Opts,T#type{name=N,base=int}); parse_type2(["wxDataFormat"|_R],_Info,_Opts,T) -> %% Hack Hack - T#type{name="wxDataFormatId",base=int}; + T#type{name="wxDataFormatId",base={enum,"wxDataFormatId"}}; parse_type2([N="wxArrayInt"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N,base=int,single=array}); parse_type2([N="wxArrayDouble"|R],Info,Opts,T) -> diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 08f8068555..293c97507e 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -781,7 +781,7 @@ return_res1(#type{name=Type,base={class,_},single=list,ref=reference}) -> return_res1(#type{name=Type,base={comp,_,_},single=array,by_val=true}) -> {Type ++ " Result = ", ""}; return_res1(#type{name=Type,single=true,by_val=true, base={class, _}}) -> - %% Memory leak !!!!!! XXXX BUGBUG FIXME or doument!! + %% Temporary memory leak !!!!!! case Type of "wxImage" -> ok; "wxFont" -> ok; @@ -792,13 +792,7 @@ return_res1(#type{name=Type,single=true,by_val=true, base={class, _}}) -> io:format("~s::~s Building return value of temp ~s~n", [get(current_class),get(current_func),Type]) end, - %% ClassDef = get({class,Type}), - %% Class = case is_derived(ClassDef) of - %% true -> "E" ++ Type; - %% false -> Type - %% end, - Class = Type, %% Remove - {Class ++ " * Result = new " ++ Class ++ "(", "); newPtr((void *) Result," + {Type ++ " * Result = new " ++ Type ++ "(", "); newPtr((void *) Result," ++ "3, memenv);"}; return_res1(#type{base={enum,_Type},single=true,by_val=true}) -> {"int Result = " , ""}; @@ -822,15 +816,14 @@ call_arg(#param{where=c, alt={length,Alt}}) when is_list(Alt) -> call_arg(#param{where=c, alt={size,Id}}) when is_integer(Id) -> %% It's a binary "Ecmd.bin["++ integer_to_list(Id) ++ "]->size"; -call_arg(#param{name=N,def=Def,type=#type{name=Type,by_val=true,single=true,base=Base}}) +call_arg(#param{name=N,def=Def,type=#type{by_val=true,single=true,base=Base}}) when Base =:= int; Base =:= long; Base =:= float; Base =:= double; Base =:= bool -> case Def of - none -> "(" ++ to_string(Type) ++ ") *" ++ N; %% Remove + none -> "*" ++ N; _ -> N end; - -call_arg(#param{name=N,type=#type{base={enum,Type}, by_val=true,single=true}}) -> - "(" ++ enum_type(Type) ++") " ++ N; %% Remove +call_arg(#param{name=N,type=#type{base={enum,_Type}, by_val=true,single=true}}) -> + N; call_arg(#param{name=N,type=#type{base={class,_},by_val=true,single=true}}) -> "*" ++ N; call_arg(#param{name=N,type=#type{base={class,_},ref=reference,single=true}}) -> "*" ++ N; call_arg(#param{name=N,type=#type{base=eventType}}) -> |