"Danny Epstein" <[EMAIL PROTECTED]> wrote in message
news:69416@palm-dev-forum...
>
> > "Index of resource in resource database, or -1 if not found."
> >
> > However the return value from DmFindResourceType should be UInt16.
>
> We use -1 like this several places in the docs. I agree that it's not a
> great thing to do, but I don't know if I'd call it a bug.
It's a fine thing to do ... as long as your return type supports
it. UInt16 can not have the value -1, it can have from 0..65535.
I haven't tested this using the Metrowerks or GCC-for-Palm
yet, but on other systems I have had problems testing unsigned
variables against signed constants. Basically -1 != 65535 when
comparing the values.
Your prototype should indicate Int16, or you should document
the failure return value as 0xFFFF instead -1.
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi/sec: not just a good idea, it's the LAW!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/