[comp.sys.amiga.programmer] Array alignment and SAS C

jdeckard@bluemoon.uucp (Jack Deckard) (04/12/91)

Does anyone here know how to force a globally declared array
(UBYTE  *array1[32][16]) to be longword aligned. I want to use the
good stuff like CopyMemQuick() on it. Oh yea, this is in SAS C 5.10.
THANKS!!!               - Jack Deckard

 This is from
     jdeckard@bluemoon.uucp
     jdeckard%bluemoon@nstar.rn.com
who doesn't have their own obnoxious signature yet

cs450a03@uc780.umd.edu (04/14/91)

Jack Deckard:
>Does anyone here know how to force a globally declared array
>(UBYTE  *array1[32][16]) to be longword aligned.

typedef   UBYTE *array_thingy[32][16];

array_thingy __aligned array1;


should do the trick...

Raul Rockwell

markv@kuhub.cc.ukans.edu (04/17/91)

In article <8439Z1w164w@bluemoon.uucp>, jdeckard@bluemoon.uucp (Jack Deckard) writes:
> Does anyone here know how to force a globally declared array
> (UBYTE  *array1[32][16]) to be longword aligned. I want to use the
> good stuff like CopyMemQuick() on it. Oh yea, this is in SAS C 5.10.
> THANKS!!!               - Jack Deckard

Yeah, with SAS 5.1 or later try:

	UBYTE __aligned *array1[32][16];

and you should be set.  Note this was originally done to help with
BCPL so you could do things like:

	struct FileInfoBlock __aligned MyFIB;

Now if only they would get a __public keyword so I can save
dynamically allocating all my messages, etc.
 
>  This is from
>      jdeckard@bluemoon.uucp
>      jdeckard%bluemoon@nstar.rn.com
> who doesn't have their own obnoxious signature yet
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark Gooderum			Only...		\    Good Cheer !!!
Academic Computing Services	       ///	  \___________________________
University of Kansas		     ///  /|         __    _
Bix:	  mgooderum	      \\\  ///  /__| |\/| | | _   /_\  makes it
Bitnet:   MARKV@UKANVAX		\/\/  /    | |  | | |__| /   \ possible...
Internet: markv@kuhub.cc.ukans.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~