On Sat, Mar 7, 2009 at 11:02 AM, David Cournapeau <courn...@gmail.com>wrote:

> On Sun, Mar 8, 2009 at 2:52 AM, Charles R Harris
> <charlesr.har...@gmail.com> wrote:
> >
> >
> > On Sat, Mar 7, 2009 at 11:41 AM, David Cournapeau <courn...@gmail.com>
> > wrote:
> >>
> >> On Sat, Mar 7, 2009 at 6:01 AM, Charles R Harris
> >> <charlesr.har...@gmail.com> wrote:
> >> > Hi David,
> >> >
> >> > Currently,
> >> >
> >> > bint.i = __STR2INTCST("ABCD");
> >> >
> >> > It is probably more portable to just initialize the union
> >> >
> >> >     union {
> >> >         char c[4];
> >> >         npy_uint32 i;
> >> >     } bint = {'A','B','C','D'};
> >> >
> >
> > Yes, but look at the second version. It does essentially what your macro
> > does, only uses 1,2,3,4 instead of 'A','B','C','D'.
>
> Yes, it is the same thing, so I don't see the point of changing :)


The macro is ugly, unneeded, and obfuscating. Why construct a number from
characters and shifts when you can just *write it down*?


> The
> const union does not help, BTW.


True, it is initialized here:

        movl    $16909060, -8(%ebp)

contrast that with the macro.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to