At 4:41 PM -0700 10/24/99, Steve Sabram wrote:
>That was in fact brought up at the development track at PalmSource last
>week. According to David Fedor -- Dave, please correct me on this if I'm
>wrong -- but the *FooPtr typedefing is in fact being phased out of future
>releases of the API. I don't know if this all can be done in 3.5 or not.
Yes, FooPtr is being phased out. We'll still include them in the
compatibility header files.
The problem with FooPtr is you can't use const with it. Well, that's not
the only problem, but it's the one that prompted us to get rid of it. So
instead we just provide FooType, and pointers to it are declared either
"FooType *" or "const FooType *"
Also, VoidPtr is dead. void is the only 'basic' type that we didn't put a
typedef over, because we like the compiler meaning of void. Every other
basic type has a cover Palm-specific typedef, intended to allow the code to
be more portable. The other 'basic' types are (note capitalization): Char,
WChar, Boolean, Int8, UInt8, Int16, UInt16, Int32, UInt32. It's amazing
how much more understandable the code is now. :-)
We're also adding more cover types as apprpriate. e.g. there's a MemHandle
and MemPtr type for memory manager data structures, a ResCreator and ResID
type for data manager resources, etc. Those additions help clarify the
meaning of variables and paramaters that otherwise used to be just Word or
DWords.
In general, updating your sources is a simple search and replace. The only
thing to watch out for is the mutiple variables on a single line problem.
e.g.
FooPtr aP, bP, cP; // obsolete
is NOT the same as:
FooType* aP, bP, cP; // wrong!
Rather, it's:
FooType *aP, *bP, *cP; // right
...love that C syntax...
--Bob