From 9d35ff433b9faa293ee619071156b2966ee4c14b Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 26 Sep 2017 14:35:13 +0200 Subject: [PATCH] Fixing last commit concerning Cs Wrapper --- wrappers/csharp/genwrapper.py | 2 +- wrappers/csharp/wrapper_impl.mustache | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wrappers/csharp/genwrapper.py b/wrappers/csharp/genwrapper.py index 0dab2d818..424bc8ebb 100644 --- a/wrappers/csharp/genwrapper.py +++ b/wrappers/csharp/genwrapper.py @@ -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': diff --git a/wrappers/csharp/wrapper_impl.mustache b/wrappers/csharp/wrapper_impl.mustache index 1c33e7aeb..8837b4475 100644 --- a/wrappers/csharp/wrapper_impl.mustache +++ b/wrappers/csharp/wrapper_impl.mustache @@ -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}});