Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utfyzx!oscvax!rico From: rico@oscvax.UUCP Newsgroups: comp.lang.c,comp.sys.atari.st,comp.sys.amiga Subject: Re: 32bit = 16bit x 16bit Message-ID: <520@oscvax.UUCP> Date: Sat, 24-Oct-87 15:25:37 EST Article-I.D.: oscvax.520 Posted: Sat Oct 24 15:25:37 1987 Date-Received: Sun, 25-Oct-87 22:00:36 EST References: <1912@gryphon.CTS.COM> <3294@sol.ARPA> <2545@cbmvax.UUCP> <4261@well.UUCP> Reply-To: rico@oscvax.UUCP (Rico Mariani) Organization: Ontario Science Centre, Toronto Lines: 41 Xref: utgpu comp.lang.c:4858 comp.sys.atari.st:5507 comp.sys.amiga:9171 Summary: In article <4261@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: > > I think your VOID definition is broken. In the file >exec/interrupts.h is the structure: > >struct Interrupt { > struct Node is_Node; > APTR is_Data; > VOID (*is_Code)(); >}; > > Then, later on, when I try and do this: > >foo () >{ > extern long bar(); > > interrupt.is_Code = (VOID) bar; >} Sorry Leo, I think you missed it... it should be interrupt.is_Code = (VOID (*)()) bar; You want to cast bar into a pointer to a function returning VOID you *don't* want to cast bar into a VOID. Casting something to VOID means "throw it away". Having thrown it away you can't assign it to interrupt.is_Code. The only time you ever (well I can't think of any other reason right now anyways) want to cast something to VOID (as opposed to a pointer to VOID or pointer to function returning VOID or anything like that) is if you want to discard the return value of some function. e.g. (VOID)gets(s); /* throw away the return value */ /* this keeps lint happy */ -Rico -- [NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode] [CSIS food: supermailbox, tuna, fiberglass coffins, Mirabel, microfiche] [Cat food: Nine Lives, Cat Chow, Meow Mix, Crave]