bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

Converting to Palm OS SDK 4.0

I keep posting the link to this article, so I figured I'd list it here too:

http://oasis.palm.com/dev/kb/papers/1710.cfm

This is the Palm knowledgebase article about moving code from SDK 3.1 or older to SDK 3.5 or newer. It has a lot of good information.

One of the big changes in the 3.5 SDK was the elimination of many of the "FooPtr" types. These were types that Palm setup to act as pointers to various system structures. The origin of this usage is pretty interesting. Palm's use of "FooPtr" comes from Mac OS, where this is common. Mac OS C code uses this because a lot of it was originally ported from Pascal, the original language used for system programming on the Macs. In Pascal, if you didn't define a pointer type and use it through your program, all of your pointers would be incompatible with each other. So, the use of this on Palm is tied to the old use of pointers on Mac OS in the mid-80s. Palm finally came to their senses with the 3.5 SDK and went with a more C friendly usage.

One big disadvantage to the FooPtr form is const semantics. "const CharPtr" means something different than "const Char *". The first is a unchangable pointer to a modifyable character; the second is a pointer to a char that never changes. Palm made big improvements in making their SDK const-correct in 3.5, but they couldn't do that and keep the old types.

brought to you by weblogger.com


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich