On Jun 21, 2007, at 1:39 AM, Allison Randal wrote:
Andy Lester wrote:
I guess I don't see the need to document a standard C behavior
with a macro.
If you had read all the way through the message, you would see that
the biggest benefit is the ability to hang debugging hooks off the
macro
Andy Lester wrote:
I guess I don't see the need to document a standard C behavior with a
macro.
If you had read all the way through the message, you would see that the
biggest benefit is the ability to hang debugging hooks off the macro.
We have a number of these kinds of debugging hooks t
On Jun 20, 2007, at 1:05 PM, Mark J. Reed wrote:
Incrementing a var is much less likely to have unpredictable effects
due to modifying the wrong memory. Sure, x might be a pointer, and
things might gang agley there, but pointers getting set to the wrong
type of pointee is a pretty common probl
On 6/20/07, Andy Lester <[EMAIL PROTECTED]> wrote:
My point is that
*d = *s;
is no more a weird cryptic construct than
n++;
or
while (*s)
*d++ = *s++;
for that matter.
That's a very good point. As you said in the original message, all you need is
*dest = *src;
since the c
On 6/20/07, Andy Lester <[EMAIL PROTECTED]> wrote:
I guess I don't see the need to document a standard C behavior with a
macro. We don't have
#define inc(x) (x)++
do we?
Incrementing a var is much less likely to have unpredictable effects
due to modifying the wrong memory. Sure, x might
On Jun 20, 2007, at 11:50 AM, Allison Randal wrote:
I wasn't entirely happy with either option, so I asked around a bit
for other ideas. I like the macro approach below, it gives us both
self documentation and better checking for the size of the two
structs.
I guess I don't see the need
I wasn't entirely happy with either option, so I asked around a bit for
other ideas. I like the macro approach below, it gives us both self
documentation and better checking for the size of the two structs.
Allison
Original Message
From: Nick Forrette <[EMAIL PROTECTED]>
To:
Am Montag, 18. Juni 2007 23:48 schrieb Andy Lester:
> Is there a reason we use
>
> memcpy( dest, src, sizeof(FOO) );
>
> instead of
>
> *dest = *src;
>
> The latter should be the exact same code, but be much less likely to
> be screwed up.
I'm using a lot of the first kind. The main reason
On 19 Jun 2007, at 08:48, Joshua Isom wrote:
On Jun 18, 2007, at 4:48 PM, Andy Lester wrote:
Is there a reason we use
memcpy( dest, src, sizeof(FOO) );
instead of
*dest = *src;
The latter should be the exact same code, but be much less likely
to be screwed up.
No, they're extremely
On Jun 18, 2007, at 4:48 PM, Andy Lester wrote:
Is there a reason we use
memcpy( dest, src, sizeof(FOO) );
instead of
*dest = *src;
The latter should be the exact same code, but be much less likely to
be screwed up.
No, they're extremely different. In the first, the data of FOO is
10 matches
Mail list logo