diff options
author | Dan Gudmundsson <[email protected]> | 2016-10-05 16:25:59 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-10-05 16:25:59 +0200 |
commit | 097cc3f6679a7c3769111cdb15a630186218d015 (patch) | |
tree | c92a39384d8989695e4318fc16edef10faf7da19 /lib/wx/src/gen/wxSystemOptions.erl | |
parent | 1de609cb262ff34216dce8fbefdb9a153bdd2c93 (diff) | |
download | otp-097cc3f6679a7c3769111cdb15a630186218d015.tar.gz otp-097cc3f6679a7c3769111cdb15a630186218d015.tar.bz2 otp-097cc3f6679a7c3769111cdb15a630186218d015.zip |
Fix guard test for chardata
Previously only accepted lists tough a call is made to
unicode:characters_to_binary/1, and the functions where specified to
handle chardata.
Diffstat (limited to 'lib/wx/src/gen/wxSystemOptions.erl')
-rw-r--r-- | lib/wx/src/gen/wxSystemOptions.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl index 28d77b1e26..c613d66c73 100644 --- a/lib/wx/src/gen/wxSystemOptions.erl +++ b/lib/wx/src/gen/wxSystemOptions.erl @@ -39,7 +39,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -spec getOption(Name) -> unicode:charlist() when Name::unicode:chardata(). getOption(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_GetOption, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -48,7 +48,7 @@ getOption(Name) -spec getOptionInt(Name) -> integer() when Name::unicode:chardata(). getOptionInt(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_GetOptionInt, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -57,7 +57,7 @@ getOptionInt(Name) -spec hasOption(Name) -> boolean() when Name::unicode:chardata(). hasOption(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_HasOption, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -66,7 +66,7 @@ hasOption(Name) -spec isFalse(Name) -> boolean() when Name::unicode:chardata(). isFalse(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_IsFalse, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -81,12 +81,12 @@ isFalse(Name) (Name, Value) -> 'ok' when Name::unicode:chardata(), Value::unicode:chardata(). setOption(Name,Value) - when is_list(Name),is_integer(Value) -> + when ?is_chardata(Name),is_integer(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxSystemOptions_SetOption_2_0, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Value:32/?UI>>); setOption(Name,Value) - when is_list(Name),is_list(Value) -> + when ?is_chardata(Name),?is_chardata(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxSystemOptions_SetOption_2_1, |