From: Jay.Estabrook at hp.com (Jay Estabrook)
Subject: Broken dbus
Date: Sun, 27 Apr 2008 11:05:27 -0400 [thread overview]
Message-ID: <48149637.9070204@hp.com> (raw)
In-Reply-To: <48148D27.9010708@hp.com>
Sigh...
I knew it was too early on a Sunday morning for this... ;-}
Estabrook, Jay wrote:
>
> The poor programming practice (hal) arises from assuming that all
> architectures have a natural boundary of 32-bits. Something like
> the following are indicative:
>
> pointer = (void *)((((char *)address) + 3) & ~3);
Should be:
pointer = (void *)((((char *)address) + 4) & ~3);
which rounds UP to the next 32-bit natural boundary.
>
> Better is:
>
> #define SZM (sizeof(void*)-1)
> pointer = (void *)((((char *)address) + SZM) & ~SZM);
And this should be:
#define SZ (sizeof(void*))
#define SZM (SZ-1)
pointer = (void *)((((char *)address) + SZ) & ~SZM);
which also rounds UP.
Now back to the funny pages... ;-}
--Jay++
next prev parent reply other threads:[~2008-04-27 15:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 21:23 New FC 8 kernel RPMS in updates Jay.Estabrook
2008-04-21 23:16 ` marco
2008-04-22 14:36 ` Jay.Estabrook
2008-04-22 18:30 ` marco
2008-04-25 8:35 ` steven.moix
2008-04-25 8:40 ` oliver
2008-04-25 8:50 ` steven.moix
2008-04-25 8:54 ` oliver
2008-04-25 9:38 ` steven.moix
2008-04-25 9:41 ` oliver
2008-04-26 13:48 ` Are smolt/dbus working well? (Re: New FC 8 kernel RPMS in updates) furutaka
2008-04-26 14:03 ` steven.moix
2008-04-26 18:20 ` Jay.Estabrook
2008-04-26 20:47 ` Are smolt/dbus working well? furutaka
2008-04-26 22:06 ` Jay.Estabrook
2008-04-27 8:09 ` Broken dbus steven.moix
2008-04-27 8:46 ` furutaka
2008-04-27 14:26 ` Jay.Estabrook
2008-04-27 15:05 ` Jay.Estabrook [this message]
2008-04-28 2:51 ` maurice
2008-04-28 12:09 ` Jay.Estabrook
2008-04-28 13:52 ` maurice
2008-04-28 16:33 ` steven.moix
2008-04-28 16:40 ` Jay.Estabrook
2008-04-28 22:03 ` Jay.Estabrook
2008-04-28 23:36 ` furutaka
2008-05-01 7:51 ` steven.moix
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox