aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/wx_gen_cpp.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-12-13 12:51:51 +0100
committerDan Gudmundsson <[email protected]>2013-01-09 11:44:28 +0100
commitb6d75e15b9d6400a61f5ea29fa20c1c6376a4b32 (patch)
tree791621c4f18d2a9c38554e4be8e2de3cf9cf5f13 /lib/wx/api_gen/wx_gen_cpp.erl
parentc8b4d62cf92b3e0662adfb9e6a5d80d516413cde (diff)
downloadotp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.tar.gz
otp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.tar.bz2
otp-b6d75e15b9d6400a61f5ea29fa20c1c6376a4b32.zip
wx: Remove unnecessary casts
Diffstat (limited to 'lib/wx/api_gen/wx_gen_cpp.erl')
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl19
1 files changed, 6 insertions, 13 deletions
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}}) ->