Re: Linking C Headers to D

2017-01-11 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 12 January 2017 at 04:54:18 UTC, DRex wrote: Hi, I am trying to link C and D (using GCC and GDC) and I am wondering (I could find no answers on google) if it is possible to compile C headers into object files and link them to D? I have a large code base of C headers and am not a

Linking C Headers to D

2017-01-11 Thread DRex via Digitalmars-d-learn
Hi, I am trying to link C and D (using GCC and GDC) and I am wondering (I could find no answers on google) if it is possible to compile C headers into object files and link them to D? I have a large code base of C headers and am not at a point where I can translate them all to D in one go, s

Re: Auto recursive function

2017-01-11 Thread Ignacious via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the difference being that it is uninitialized. Here is the code: auto m

Re: Android Status

2017-01-11 Thread Ignacious via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 03:49:42 UTC, Joakim wrote: On Tuesday, 10 January 2017 at 18:48:17 UTC, Ignacious wrote: [...] It's probably not easier, and in any case, android-x86 won't be supported, largely because I don't have any working x86 devices. [...] Ok, well the x86 thing wa

Re: Auto recursive function

2017-01-11 Thread Ignacious via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the difference being that it is uninitialized. Here is the code: auto m

Re: Auto recursive function

2017-01-11 Thread Martin Nowak via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:39:17 UTC, Ali Çehreli wrote: return choose(lengths.length == 1, one!T(alloc, lengths[0]), two!T(alloc, lengths)); Well, choose is the right tool when the choice can only be made at runtime. That would be uncommon for dimensionality. Anyhow mentioning

Re: Auto recursive function

2017-01-11 Thread Razvan Nitu via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:30:05 UTC, Stefan Koch wrote: On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the di

Re: Auto recursive function

2017-01-11 Thread Ali Çehreli via Digitalmars-d-learn
On 01/11/2017 11:30 AM, Stefan Koch wrote: On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the difference being that it is

Re: Auto recursive function

2017-01-11 Thread Martin Nowak via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: auto makeMultidimensionalArray(T, Allocator)(auto ref Allocator alloc, size_t[] lengths) { if (lengths.length == 1) Looks like `static if` would fix your specific problem.

Re: Auto recursive function

2017-01-11 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 19:23:10 UTC, Razvan Nitu wrote: Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the difference being that it is uninitialized. Here is the code: [...]

Auto recursive function

2017-01-11 Thread Razvan Nitu via Digitalmars-d-learn
Hi, I am currently trying to create a function makeMultidimensionalArray which allocates memory for a multidimensional array. It is very similar with [1], the difference being that it is uninitialized. Here is the code: auto makeMultidimensionalArray(T, Allocator)(auto ref Allocator alloc, s

Re: Mixin in Inline Assembly

2017-01-11 Thread Era Scarecrow via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 15:39:49 UTC, Guillaume Piolat wrote: On Wednesday, 11 January 2017 at 06:14:35 UTC, Era Scarecrow wrote: Suddenly reminds me some of the speedup assembly I was writing for wideint, but seems I lost my code. too bad, the 128bit multiply had sped up and the div

Re: Check of point inside/outside polygon

2017-01-11 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 13:32:00 UTC, Suliman wrote: Ideally I need algorithm that can return bool if one polygon overlapped/intersected by another. But I do not know math. After some googling I found topic on SO[1] about point inside/outside polygon. It's not directly what I need, but as

Re: Mixin in Inline Assembly

2017-01-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 06:14:35 UTC, Era Scarecrow wrote: Suddenly reminds me some of the speedup assembly I was writing for wideint, but seems I lost my code. too bad, the 128bit multiply had sped up and the division needed some work. I'm a taker if you have some algorithm to reus

Re: taggedPointer to char array on heap

2017-01-11 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 00:26:27 UTC, Ali Çehreli wrote: @property char* p() { Should be @property inout(char)* p() inout Thanks!

Re: Vibe.d: Implementing file upload with WEB interface

2017-01-11 Thread aberba via Digitalmars-d-learn
On Monday, 9 January 2017 at 19:36:18 UTC, aberba wrote: Turns out my question was answered somewhere on vibe.d website For those situations where more control is required, it is possible to simply declare parameters of type HTTPServerRequest or HTTPServerResponse to give a method full access.