Re: convert char[4] to uint at compile time

2008-12-23 Thread Moritz Warning
On Tue, 23 Dec 2008 13:16:28 +0300, Denis Koroskin wrote: > On Tue, 23 Dec 2008 11:07:08 +0300, Janderson wrote: > >> Moritz Warning wrote: >>> On Tue, 16 Dec 2008 19:54:11 +, BCS wrote: >>> Reply to Moritz, > Hi, > > I have problems to convert a char[4] to an uint at c

Re: convert char[4] to uint at compile time

2008-12-23 Thread Moritz Warning
On Tue, 23 Dec 2008 00:07:08 -0800, Janderson wrote: > Moritz Warning wrote: >> On Tue, 16 Dec 2008 19:54:11 +, BCS wrote: >> >>> Reply to Moritz, >>> Hi, I have problems to convert a char[4] to an uint at compile time. All variations (I've tried) of using an enum crashes

Re: convert char[4] to uint at compile time

2008-12-23 Thread Denis Koroskin
On Tue, 23 Dec 2008 11:07:08 +0300, Janderson wrote: Moritz Warning wrote: On Tue, 16 Dec 2008 19:54:11 +, BCS wrote: Reply to Moritz, Hi, I have problems to convert a char[4] to an uint at compile time. All variations (I've tried) of using an enum crashes dmd: union pp { char[4] str

Re: convert char[4] to uint at compile time

2008-12-23 Thread Janderson
Moritz Warning wrote: On Tue, 16 Dec 2008 19:54:11 +, BCS wrote: Reply to Moritz, Hi, I have problems to convert a char[4] to an uint at compile time. All variations (I've tried) of using an enum crashes dmd: union pp { char[4] str; uint num; } const uint x = pp("abcd").num This does al

Re: convert char[4] to uint at compile time

2008-12-16 Thread Moritz Warning
On Tue, 16 Dec 2008 19:54:11 +, BCS wrote: > Reply to Moritz, > >> Hi, >> >> I have problems to convert a char[4] to an uint at compile time. All >> variations (I've tried) of using an enum crashes dmd: >> >> union pp { char[4] str; uint num; } >> const uint x = pp("abcd").num >> This does

Re: convert char[4] to uint at compile time

2008-12-16 Thread BCS
Reply to Moritz, Hi, I have problems to convert a char[4] to an uint at compile time. All variations (I've tried) of using an enum crashes dmd: union pp { char[4] str; uint num; } const uint x = pp("abcd").num This does also doesn't work: const uint x = cast(uint) x"aa aa aa aa"; Any ideas?

convert char[4] to uint at compile time

2008-12-16 Thread Moritz Warning
Hi, I have problems to convert a char[4] to an uint at compile time. All variations (I've tried) of using an enum crashes dmd: union pp { char[4] str; uint num; } const uint x = pp("abcd").num This does also doesn't work: const uint x = cast(uint) x"aa aa aa aa"; Any ideas?