*BSD News Article 84458


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!arclight.uoregon.edu!news.bc.net!nntp.portal.ca!cynic.portal.ca!not-for-mail
From: cjs@cynic.portal.ca (Curt Sampson)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: 7 Dec 1996 13:53:37 -0800
Organization: Internet Portal Services, Inc.
Lines: 21
Distribution: inet
Message-ID: <58cp11$jkq@cynic.portal.ca>
References: <32986299.AC7@mail.esrin.esa.it> <5869r2$175$1@asgard.sprintlink.co.za> <587shd$2sb@anorak.coverform.lan> <58bnr0$q9q$1@news.cs.tu-berlin.de>
NNTP-Posting-Host: cynic.portal.ca
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:91732 comp.unix.bsd.misc:1724 comp.unix.internals:11507

In article <58bnr0$q9q$1@news.cs.tu-berlin.de>,
Joerg Schilling <js@cs.tu-berlin.de> wrote:
:In article <587shd$2sb@anorak.coverform.lan>,
:Brian Somers <brian%anorak.coverform.lan@awfulhak.demon.co.uk> wrote:
:>
:>How do you align a pointer if you can't cast it to some kind of number ?
:
:On any two's complement machine this can easily be done, if
:sizeof (alignement type) < sizeof (int)
:...
:#define xalign(x, a, m)         ( ((char *)(x)) + ( (a) - (((int)(x))&(m))) )

You've just gone and cast the pointer to a type of number (int, in
this case). The question was how you do this alignment *without*
the cast.

cjs
-- 
Curt Sampson    cjs@portal.ca		Info at http://www.portal.ca/
Internet Portal Services, Inc.	
Vancouver, BC   (604) 257-9400		De gustibus, aut bene aut nihil.