Fixing last commit concerning Cs Wrapper

This commit is contained in:
Erwan Croze 2017-09-26 14:35:13 +02:00
parent e9a83366ea
commit 9d35ff433b
2 changed files with 3 additions and 3 deletions

View file

@ -223,7 +223,7 @@ class CsharpTranslator(object):
else:
methodDict['impl']['c_args'] += '(int)' + self.translate_argument_name(arg.name)
elif self.translate_type(arg.type, False, False) == "bool":
methodDict['impl']['c_args'] += self.translate_argument_name(arg.name) + " ? '1' : '0'"
methodDict['impl']['c_args'] += self.translate_argument_name(arg.name) + " ? (char)1 : (char)0"
elif self.get_class_array_type(self.translate_type(arg.type, False, False)) is not None:
listtype = self.get_class_array_type(self.translate_type(arg.type, False, False))
if listtype == 'string':

View file

@ -484,7 +484,7 @@ namespace Linphone
{{#exception}}if (exception_result != 0) throw new LinphoneException("{{property_name}} setter returned value " + exception_result);{{/exception}}
{{/is_string}}
{{#is_bool}}
{{#exception}}int exception_result = {{/exception}}{{setter_c_name}}({{setter_nativePtr}}value ? '1' : '0');
{{#exception}}int exception_result = {{/exception}}{{setter_c_name}}({{setter_nativePtr}}value ? (char)1 : (char)0);
{{#exception}}if (exception_result != 0) throw new LinphoneException("{{property_name}} setter returned value " + exception_result);{{/exception}}
{{/is_bool}}
{{#is_class}}
@ -525,7 +525,7 @@ namespace Linphone
return Marshal.PtrToStringAnsi(stringPtr);
{{/is_string}}
{{#is_bool}}
{{return}}{{c_name}}({{nativePtr}}{{c_args}}) == '0' ? false : true;
{{return}}{{c_name}}({{nativePtr}}{{c_args}}) == (char)0 ? false : true;
{{/is_bool}}
{{#is_class}}
IntPtr ptr = {{c_name}}({{nativePtr}}{{c_args}});