On 13/03/2015 7:47 p.m., zhmt wrote:
On Friday, 13 March 2015 at 06:39:31 UTC, Rikki Cattermole wrote:
On 13/03/2015 7:35 p.m., zhmt wrote:
ubyte[] arr ;
I pass the arr.ptr to c program, it fails silently.
Is there any way to cast a ubyte[] to a clang pointer?
Theoretically this should
On Friday, 13 March 2015 at 06:39:31 UTC, Rikki Cattermole wrote:
On 13/03/2015 7:35 p.m., zhmt wrote:
ubyte[] arr ;
I pass the arr.ptr to c program, it fails silently.
Is there any way to cast a ubyte[] to a clang pointer?
Theoretically this should work.
D:
void func(ubyte[] value) {
ubyte[] arr ;
I pass the arr.ptr to c program, it fails silently.
Is there any way to cast a ubyte[] to a clang pointer?
On 13/03/2015 7:35 p.m., zhmt wrote:
ubyte[] arr ;
I pass the arr.ptr to c program, it fails silently.
Is there any way to cast a ubyte[] to a clang pointer?
Theoretically this should work.
D:
void func(ubyte[] value) {
func(value.length, value.ptr);
}
extern(C) void func(size_t
I have some source code of vibe.d, it does this in the same way,
and it works .
void read(ubyte[] dst)
{
checkConnected(false);
acquireReader();
scope(exit) releaseReader();
while (dst.length 0) {
On 03/12/2015 11:35 PM, zhmt wrote:
ubyte[] arr ;
I pass the arr.ptr to c program
Unless there is sentinel value at the end of the array, you must also
pass the number of elements (as Rikki Cattermole has shown).
However, if the C function holds on to that pointer for later use, you
must
On Friday, 13 March 2015 at 06:56:33 UTC, Ali Çehreli wrote:
On 03/12/2015 11:35 PM, zhmt wrote:
ubyte[] arr ;
I pass the arr.ptr to c program
Unless there is sentinel value at the end of the array, you
must also pass the number of elements (as Rikki Cattermole has
shown).
However, if