Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
d42bc9ac
Commit
d42bc9ac
authored
Aug 07, 2018
by
Sylvain Berfini
🐮
Browse files
Fixed issue in C# wrapper for methods returning a bctbx_list_t of string
parent
c7d207c8
Pipeline
#229
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
wrappers/csharp/wrapper_impl.mustache
View file @
d42bc9ac
...
...
@@ -194,17 +194,21 @@ namespace Linphone
return null;
}
internal static IEnumerable
<string>
MarshalStringArray(IntPtr
array
Ptr)
internal static IEnumerable
<string>
MarshalStringArray(IntPtr
list
Ptr)
{
if (
array
Ptr != IntPtr.Zero)
if (
list
Ptr != IntPtr.Zero)
{
IntPtr ptr =
Marshal.ReadIntPtr(arrayPtr)
;
IntPtr ptr =
listPtr
;
while (ptr != IntPtr.Zero)
{
string key = Marshal.PtrToStringAnsi(ptr);
IntPtr dataPtr = bctbx_list_get_data(ptr);
if (dataPtr == IntPtr.Zero)
{
break;
}
string key = Marshal.PtrToStringAuto(dataPtr);
yield return key;
arrayPtr = new IntPtr(arrayPtr.ToInt64() + IntPtr.Size);
ptr = Marshal.ReadIntPtr(arrayPtr);
ptr = bctbx_list_next(ptr);
}
}
}
...
...
@@ -391,7 +395,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToString
Uni
(linphone_call_get_native_video_window_id(nativePtr));
return Marshal.PtrToString
Auto
(linphone_call_get_native_video_window_id(nativePtr));
}
set
{
...
...
@@ -406,7 +410,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToString
Uni
(linphone_core_get_native_video_window_id(nativePtr));
return Marshal.PtrToString
Auto
(linphone_core_get_native_video_window_id(nativePtr));
}
set
{
...
...
@@ -419,7 +423,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToString
Uni
(linphone_core_get_native_preview_window_id(nativePtr));
return Marshal.PtrToString
Auto
(linphone_core_get_native_preview_window_id(nativePtr));
}
set
{
...
...
@@ -448,7 +452,7 @@ namespace Linphone
{
{{#
is_string
}}
IntPtr stringPtr =
{{
getter_c_name
}}
(
{{
getter_nativePtr
}}
);
return Marshal.PtrToStringA
nsi
(stringPtr);
return Marshal.PtrToStringA
uto
(stringPtr);
{{/
is_string
}}
{{#
is_bool
}}
return
{{
getter_c_name
}}
(
{{
getter_nativePtr
}}
) != 0;
...
...
@@ -517,7 +521,7 @@ namespace Linphone
{
{{#
is_string
}}
IntPtr stringPtr =
{{
c_name
}}
(
{{
nativePtr
}}{{
c_args
}}
);
return Marshal.PtrToStringA
nsi
(stringPtr);
return Marshal.PtrToStringA
uto
(stringPtr);
{{/
is_string
}}
{{#
is_bool
}}
{{
return
}}{{
c_name
}}
(
{{
nativePtr
}}{{
c_args
}}
) == (char)0 ? false : true;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment