DragonFly commits List (threaded) for 2004-07
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: cvs commit: src/sys/dev/raid/aac aac.c
On Mon, Jul 26, 2004 at 01:37:42PM -0700, Matthew Dillon wrote:
> p.s. I think it's just fine to use a (void *) cast in
> double-cast cases. e.g.
>
> sc->aac_common = (void *)((uint8_t *)sc->aac_common + 8192);
>
> The verbosity of casting to the exact pointer type after
> previously casting to an 8 bit type to perform pointer
> arithmatic is not necessary.
Hm. The above is correct C, of course. But I would prefer tracing down
the full type, just because getting a warning from GCC when aac_common
does change it type. We would want to verify the casts in that situation.
What do you think about a macro __POINTEROFF(type, var, off) in cdefs.h,
which does all the dirty work, similiar to __DEVOLATILE / __DECONST and
the like?
Joerg
>
> -Matt
> Matthew Dillon
> <dillon@xxxxxxxxxxxxx>
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]