Re: Help with C struct by value on OSX 64bits

2012-04-26 Thread Johan Hernandez
On Wednesday, 25 April 2012 at 19:43:27 UTC, Jacob Carlborg wrote: Compile as a 32bit binary. For DMD add "-m32" do the flags. For gcc add "-arch i386". Thanks Jacob, that worked!!! simendsjo: I upvoted and commented the same day bro.

Re: Help with C struct by value on OSX 64bits

2012-04-25 Thread Jacob Carlborg
On 2012-04-25 20:36, Johan Hernandez wrote: On Wednesday, 25 April 2012 at 08:38:02 UTC, simendsjo wrote: Could be this one: http://d.puremagic.com/issues/show_bug.cgi?id=5570 Thank you for your response. It's a huge issue :( Compile as a 32bit binary. For DMD add "-m32" do the flags. For g

Re: Help with C struct by value on OSX 64bits

2012-04-25 Thread simendsjo
On Wed, 25 Apr 2012 20:36:31 +0200, Johan Hernandez wrote: On Wednesday, 25 April 2012 at 08:38:02 UTC, simendsjo wrote: Could be this one: http://d.puremagic.com/issues/show_bug.cgi?id=5570 Thank you for your response. It's a huge issue :( I agree. Let's hope it gets fixed now that it'

Re: Help with C struct by value on OSX 64bits

2012-04-25 Thread Johan Hernandez
On Wednesday, 25 April 2012 at 08:38:02 UTC, simendsjo wrote: Could be this one: http://d.puremagic.com/issues/show_bug.cgi?id=5570 Thank you for your response. It's a huge issue :(

Re: Help with C struct by value on OSX 64bits

2012-04-25 Thread simendsjo
On Wed, 25 Apr 2012 09:57:39 +0200, Johan Hernandez wrote: Hi. I'm having trouble calling a C function passing a structure by value, printing a member and getting it back in D but I must be doing something wrong. Could be this one: http://d.puremagic.com/issues/show_bug.cgi?id=5570

Help with C struct by value on OSX 64bits

2012-04-25 Thread Johan Hernandez
Hi. I'm having trouble calling a C function passing a structure by value, printing a member and getting it back in D but I must be doing something wrong. I have a C file called native.c that defines a function called 'filter' taking a buf_t structure, I compile it using GCC to native.o. From

Re: Help with C++

2012-04-02 Thread Ary Manzana
On 4/3/12 4:01 AM, Dmitry Olshansky wrote: On 02.04.2012 18:27, Ary Manzana wrote: Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type::emit

Re: Help with C++

2012-04-02 Thread Dmitry Olshansky
On 02.04.2012 18:27, Ary Manzana wrote: Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type::emitLink(OutBuffer *buf) { } Then I use it some

Help with C++

2012-04-02 Thread Ary Manzana
Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type::emitLink(OutBuffer *buf) { } Then I use it somewhere, like in AliasDeclaration::toDocBuf

Re: help with c translation

2009-07-02 Thread Bill Baxter
On Thu, Jul 2, 2009 at 9:07 AM, BCS wrote: > Hello Ary, > >> Well, it should work! const means, once a value is assigned to that >> variable, it never changes again. The compiler can do static analysis >> to verify this. And that's why it works. And that's why D should also >> work this way, IMHO.

Re: help with c translation

2009-07-02 Thread Lars T. Kyllingstad
BCS wrote: Hello Ary, Well, it should work! const means, once a value is assigned to that variable, it never changes again. The compiler can do static analysis to verify this. And that's why it works. And that's why D should also work this way, IMHO. In D1, const is truly const, as in never

Re: help with c translation

2009-07-02 Thread BCS
Hello Ary, Well, it should work! const means, once a value is assigned to that variable, it never changes again. The compiler can do static analysis to verify this. And that's why it works. And that's why D should also work this way, IMHO. In D1, const is truly const, as in never changes, eve

Re: help with c translation

2009-07-02 Thread Lars T. Kyllingstad
Ary Borenszweig wrote: Lars T. Kyllingstad escribió: robby wrote: i'm using D1/Tango. sorry, im not sure to how to explain the error messages, but if you need to look a t full code, here is the link http://www.ibsensoftware.com/download.html thanks again. Several places in that code, I not

Re: help with c translation

2009-07-02 Thread Ary Borenszweig
Lars T. Kyllingstad escribió: robby wrote: i'm using D1/Tango. sorry, im not sure to how to explain the error messages, but if you need to look a t full code, here is the link http://www.ibsensoftware.com/download.html thanks again. Several places in that code, I notice things like this:

Re: help with c translation

2009-07-02 Thread robby
Lars T. Kyllingstad Wrote: > robby wrote: > > i'm using D1/Tango. sorry, im not sure to how to explain the error > > messages, but if you need to look a t full code, here is the link > > > > http://www.ibsensoftware.com/download.html > > > > thanks again. > > > Several places in that code, I

Re: help with c translation

2009-07-02 Thread Lars T. Kyllingstad
robby wrote: i'm using D1/Tango. sorry, im not sure to how to explain the error messages, but if you need to look a t full code, here is the link http://www.ibsensoftware.com/download.html thanks again. Several places in that code, I notice things like this: const type foo; ...

Re: help with c translation

2009-07-02 Thread robby
i'm using D1/Tango. sorry, im not sure to how to explain the error messages, but if you need to look a t full code, here is the link http://www.ibsensoftware.com/download.html thanks again.

Re: help with c translation

2009-07-02 Thread Lars T. Kyllingstad
robby wrote: thanks for help, i did the conversion as you mentioned and i get various errors involving constant, lvalue, etc., just fyi, its part of code from brieflz (LZ77 variant) which ive been trying to port to D for use in my program. Perhaps you could paste the error messages here? And

Re: help with c translation

2009-07-02 Thread robby
thanks for help, i did the conversion as you mentioned and i get various errors involving constant, lvalue, etc., just fyi, its part of code from brieflz (LZ77 variant) which ive been trying to port to D for use in my program.

Re: help with c translation

2009-07-02 Thread Lars T. Kyllingstad
robby wrote: can anybody help me translate this c function to d, im having a problem with the data types. thanks. //- unsigned int BLZCC blz_pack(const void *source, void *destination, unsigned int length,

help with c translation

2009-07-02 Thread robby
can anybody help me translate this c function to d, im having a problem with the data types. thanks. //- unsigned int BLZCC blz_pack(const void *source, void *destination, unsigned int length,