Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!bellcore!faline!ulysses!sfmag!sfsup!mpl From: mpl@sfsup.UUCP (M.P.Lindner) Newsgroups: comp.lang.c,comp.sys.atari.st,comp.sys.amiga Subject: Re: 32bit = 16bit x 16bit Message-ID: <2262@sfsup.UUCP> Date: Mon, 26-Oct-87 18:46:04 EST Article-I.D.: sfsup.2262 Posted: Mon Oct 26 18:46:04 1987 Date-Received: Thu, 29-Oct-87 06:37:31 EST References: <1912@gryphon.CTS.COM> <3294@sol.ARPA> <2545@cbmvax.UUCP> <2565@cbmvax.UUCP> Organization: AT&T-IS, Summit N.J. USA Lines: 50 Summary: the final word Xref: mnetor comp.lang.c:5163 comp.sys.atari.st:5958 comp.sys.amiga:9998 In article <2565@cbmvax.UUCP>, grr@cbmvax.UUCP writes: > In article <4261@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: > > In article <2545@cbmvax.UUCP> andy@cbmvax.UUCP (Andy Finkel) writes: > > >We at the Banzai Institute always use typedefs :-) > > >To maintain readability, however, the names were a bit a bit boring, ie > > >LONG, ULONG, WORD, UWORD, BYTE, UBYTE, and VOID. Here's the final word on several offshoots to the original article I've been reading. 1. > > I think your VOID definition is broken. In the file > > exec/interrupts.h is the structure: > > > > interrupt.is_Code = (VOID) bar; What you *should* be doing is interrupt.is_Code = (VOID (*)()) bar; 2. as for the person doing int x; (long) (x * x) What *you* should be doing is ((long) x * x) since you can't get back the 16 bits lost after you do the multiply as a 16 bit quantity. 3. as for the people who say "Never use the basic types", I say the following: 1. use "char" to mean a character or a byte (guaranteed in K&R) 2. use short for a small integer 3. use int where the size doesn't matter 4. use long where you need a long (ie in interfacing to the OS, etc.) 5. use pointers with care 6. use void where you mean void (either the compiler handles it or it doesn't - if it does, great, if it doesn't, try "cc -Dvoid=int" but don't go changint the input language because you have a bad compiler. 7. NEVER NEVER NEVER! use LONG, ULONG, VOID, etc. if you're using ULONG because you want an unsigned 32 bit integer try using typedef unsigned long uint32; typedef long int32; so someone can try to figure out what bizzare thing you were trying to do. Mike Lindner attunix!mpl