[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [MiNT] What's in, what's out?
> > I don't know where this superstition came from, but Ssystem(S_GETxxx)
> > functions NEVER RETURN ANY ERROR, so there's no "EINVAL" to be detected.
> > If one wants to be sure these functions are present, there's a defined way
> > to check it (please READ the doc).
>
> OK, sorry, I didn't check (somebody mentioned this as a problem in a
> newsgroup).
>
> So, it is usable, but it requires keeping a flag, or doing a version check
> every time. Probably not such a big issue if you move it into a library
> function.
Yes:
short ssystem;
...
ssystem = (Ssystem(-1, 0, 0) == E_OK);
...
if (ssystem)
something();
else
something_else();
> Generally I'd like to repeat that mixing success/error codes with return
> values almost always leads to confusion (like 16-bite negative return values
> from Fopen(), or the return value of Fseek() on a file between 2 GB and 4
> GB), and so on...
Well, the 16-bit Fopen() handles come probably from the fact that GEMDOS
was originally developed for a 16-bit system. Yet Falcon XBIOS functions -
like Vgetmonitor() for example - return short error codes, instead of
expected (intuitionally, not after reading docs) long. I agree that
different meaning (and size) of the return value for different calls *may*
be confusing, yes.
--
Konrad M.Kokoszkiewicz
|mail: draco@atari.org | Atari Falcon030 user |
|http://www.obta.uw.edu.pl/~draco/ | Moderator gregis LATINE |
|http://draco.atari.org | (loquentium) |
** Ea natura multitudinis est,
** aut servit humiliter, aut superbe dominatur (Liv. XXIV,25)
*************************************************************
** U pospolstwa normalne jest, ze albo sluzy ono unizenie,
** albo bezczelnie sie panoszy.