aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/gl_gen.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-03-06 12:21:51 +0100
committerDan Gudmundsson <[email protected]>2012-03-06 12:21:51 +0100
commit2738f881102a6c291c8fb1f2305677dba57fa87d (patch)
tree634e8bc7666af4b19f7baeabd474202bbefd2762 /lib/wx/api_gen/gl_gen.erl
parentdf8cd79bef0ca7178efcda97401c892d24f920bc (diff)
downloadotp-2738f881102a6c291c8fb1f2305677dba57fa87d.tar.gz
otp-2738f881102a6c291c8fb1f2305677dba57fa87d.tar.bz2
otp-2738f881102a6c291c8fb1f2305677dba57fa87d.zip
[wx] Fix bad defines
Reported by Vlad Dumitrescu.
Diffstat (limited to 'lib/wx/api_gen/gl_gen.erl')
-rw-r--r--lib/wx/api_gen/gl_gen.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index ce0cb922e9..331ba32ba4 100644
--- a/lib/wx/api_gen/gl_gen.erl
+++ b/lib/wx/api_gen/gl_gen.erl
@@ -190,14 +190,17 @@ parse_define([#xmlElement{name=initializer,content=[#xmlText{value=V}]}|_],Def,_
try
case Val0 of
"0x" ++ Val1 ->
- Val = http_util:hexlist_to_integer(Val1),
- Def#def{val=Val, type=hex};
+ _ = http_util:hexlist_to_integer(Val1),
+ Def#def{val=Val1, type=hex};
_ ->
Val = list_to_integer(Val0),
Def#def{val=Val, type=int}
end
- catch _:_ ->
- Def#def{val=Val0, type=string}
+ catch _:_ ->
+ case catch list_to_float(Val0) of
+ {'EXIT', _} -> Def#def{val=Val0, type=string};
+ _ -> Def#def{val=Val0, type=float_str}
+ end
end;
parse_define([_|R], D, Opts) ->
parse_define(R, D, Opts);