Hi.
I want to call a C library function that returns a data buffer as
a void*. How do I convert the resulting void* into something I
can process in D?
//I have the following function from the GDAL C library.
extern(C) CPLErr GDALReadBlock( GDALRasterBandH, int, int, void*
);
So I have (GB
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
> Hi.
> I want to call a C library function that returns a data buffer as
> a void*. How do I convert the resulting void* into something I
> can process in D?
>
> //I have the following function from the GDAL
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
> Hi.
> I want to call a C library function that returns a data buffer as
> a void*. How do I convert the resulting void* into something I
> can process in D?
>
> //I have the following function from the GDAL
On Wednesday, 15 April 2015 at 04:43:39 UTC, Daniel Kozák wrote:
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
Hi.
I want to call a C library function that returns a data buffer
as a void*. How do I convert the resulting void* into
something I can proce
On Wednesday, 15 April 2015 at 04:43:39 UTC, Daniel Kozák wrote:
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
Hi.
I want to call a C library function that returns a data buffer
as a void*. How do I convert the resulting void* into
something I can proce
On 4/15/15 12:47 AM, Daniel Kozak wrote:
On Wednesday, 15 April 2015 at 04:43:39 UTC, Daniel Kozák wrote:
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
Hi.
I want to call a C library function that returns a data buffer as a
void*. How do I convert the re
On Wednesday, 15 April 2015 at 11:18:03 UTC, Steven Schveighoffer
wrote:
On 4/15/15 12:47 AM, Daniel Kozak wrote:
On Wednesday, 15 April 2015 at 04:43:39 UTC, Daniel Kozák
wrote:
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
Hi.
I want to call a C librar
On Wednesday, 15 April 2015 at 11:18:03 UTC, Steven Schveighoffer
wrote:
clip
Depends on what GByte is. If it doesn't contain pointers (I'm
assuming its probably ubyte?), then it won't be scanned.
clip
-Steve
Yes, GByte is an alias for ubyte.
On 4/15/15 8:35 AM, CraigDillabaugh wrote:
On Wednesday, 15 April 2015 at 11:18:03 UTC, Steven Schveighoffer wrote:
immutable blocksize = GByte.sizeof * x_block_size * y_block_size;
auto buffer = malloc(blocksize)[0..blocksize];
Also, you don't need to cast pointers to void *. Should be able
On Wednesday, 15 April 2015 at 14:02:38 UTC, Steven Schveighoffer
wrote:
On 4/15/15 8:35 AM, CraigDillabaugh wrote:
On Wednesday, 15 April 2015 at 11:18:03 UTC, Steven
Schveighoffer wrote:
immutable blocksize = GByte.sizeof * x_block_size *
y_block_size;
auto buffer = malloc(blocksize)[0..bl
On 4/15/15 11:02 AM, CraigDillabaugh wrote:
Nice. Thanks. I didn't realize you can slice a bare pointer like that.
Does druntime have any way of making sure that is safe, or are you on
your own?
No, druntime cannot know what the pointer actually points at. This would
not work in @safe code.
11 matches
Mail list logo