🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #7132

Re: FileInfoBlock

#7132
From: Doug Walker
Date: Thu, 29 Nov 1990 19:51
34 lines
1753 bytes
>Or, if you don't have Lattice, or refuse to never ever ever use another of
>their compilers again, you could use:

A perfect opportunity, you can now use SAS/C instead!  Seriously, it
sounds to me like you haven't tried the compiler environment in the 
last couple of years.  It's changed a tremendous amount.  Come 
see it in the booth at an AmiExpo sometime.

>
>unsigned char space[sizeof(struct FileInfoBlock) + 4];
>struct FileInfoBlock *fib;
>
>fib = (struct FileInfoBlock *) (((unsigned long)space+4)&~3);
>

Or do this:

#define DCL(name, type) char c_##name[sizeof(type)+3];\
                        type * name = (type *)((((long)c_##name+3)>>2)<<2);

DCL(fib, struct FileInfoBlock);

Then fib will automagically be initialized to point to an aligned
FileInfoBlock.  This works for autos, statics or externs, as long
as the compiler you are using supports ANSI token pasting (##) which
I know SAS/C does and I'm pretty sure Manx does.


  *****
=*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
 *|. o.| ||                                          1200/2400/9600 Dual
  | o  |//     For all you do, this bug's for you!
  ====== 
usenet: ...mcnc!rti!sas!walker   plink: dwalker  bix: djwalker 
Technical Details
Message-ID: <1990Nov29.195146.28232@unx.sas.com>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!gatech!mcnc!rti!mozart!walker
References: <15413@cbmvax.commodore.com> <26622.27392887@kuhub.cc.ukans.edu> <AYCOCK.90Nov9201232@rat.cpsc.ucalgary.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!gatech!mcnc!rti!mozart!walker
From: walker@unx.sas.com (Doug Walker)
Newsgroups: comp.sys.amiga.tech
Subject: Re: FileInfoBlock
Message-ID: <1990Nov29.195146.28232@unx.sas.com>
Date: 29 Nov 90 19:51:46 GMT
References: <15413@cbmvax.commodore.com> <26622.27392887@kuhub.cc.ukans.edu> <AYCOCK.90Nov9201232@rat.cpsc.ucalgary.ca>
Distribution: comp
Organization: SAS Institute Inc.
Lines: 34