Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!amiga!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.sys.amiga.tech Subject: Re: New RKM:AutoDocs & Includes MAJOR problem! Message-ID: <6195@cbmvax.UUCP> Date: 9 Mar 89 18:01:14 GMT References: <1467@percival.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 39 in article <1467@percival.UUCP>, baer@percival.UUCP (Ken Baer) says: > Keywords: RKM, parameter type, Manx, WARNING Will Robinson! > HOWEVER, to my dismay, I discovered that the type sizes are WRONG! Those > of us who use Manx C, know that when you pass an integer to an Amiga system > function (like Draw()), you have to cast it to LONG (or it must be LONG in > the first place). But, in the new RKM, these variables are listed as > SHORT!! Not as LONG! I guarentee that if you call Draw(rp, (SHORT)x, > (SHORT)y) you'll either go somewhere wierd, or crash horribly. Here we have another case of "something's wrong, it must be Commodore who screwed up!". Possibly not. I would expect the RKM/Autodocs to reflect the parameter size that the routine is actually expecting. Of course, as we all know, those routines pass parameters in registers, and regardless of how the underlying routine uses it, the register contents at the point of function call is 32 bits wide. I suspect that the point of confusion here is in the Manx bindings to the ROM routines. Each high level language has to work out just how it's going to call a function. C has to provide bindings for each function which supply C visable function names and turn C style stack parameters into the registers a particular routine requires. Obviously, stack parameters are very dependent on size, so your stub code and function invocation must match exactly. It's just as likely, if not moreso, that Manx built their stubs incorrectly. They'll still work right if you're following the Manx conventions, but if they've defined their conventions to be different than the Commodore-Amiga conventions, you can't rightly call Commodore "wrong" for this. > My heart goes out to all new Amiga developers who try to use these > functions. Most of us know what a pain it is when you find out the manual > you trusted is wrong. When Manx adds function prototyping, these kind of problems should go away, regardless of who's conventions the stub code follows. > -Ken Baer. -- Dave Haynie "The 32 Bit Guy" Commodore-Amiga "The Crew That Never Rests" {uunet|pyramid|rutgers}!cbmvax!daveh PLINK: D-DAVE H BIX: hazy Amiga -- It's not just a job, it's an obsession