--On 14 July 2001 14:46 -0700 Jim Schram <[EMAIL PROTECTED]> wrote:
> Well, a little common sense on your part should have caused you to ask
> yourself how an API which takes a pointer into random memory could
> possibly deallocate that memory.
Quite simply:-
#define FAILURE 1
#define SUCCESS 0
#define NIL 0
UInt8 func1(void) {
MemPtr foo;
...
if((foo = MemPtrNew(...)) == NIL)
return FAILURE;
...
if(funct2(&foo) == FAILURE)
return FAILURE;
}
UInt8 func2(MemPtr *ptr) {
...
if(MemPtrFree(*ptr) == NIL)
return FAILURE;
}
> Based on your reaction to your misconception of MemMove's behavior, I'm
> not entirely convinced you'll consider any reason good enough.
Not at all, I just normally follow instructions to the letter, well as far
as SDKs are concerned at least... So, if it says 'move' I imagine it does
exactly that, as opposed to libc functions... :-)
> Be that as
> it may, scroll bars are often used independently of fields. Since the
> parameters to SclSetScrollBar are usually calculated values, the domain
> of signed integers for its parameters is an acceptable and logical
> choice. Fields on the other hand, due to the way they are coded,
> generally never involve the negative domain. Thus FldGetScrollValues uses
> unsigned integers. Scroll bars can therefore be used with fields as long
> as negative values are not involved, since that is outside the common
> domain of each API.
>
> Does that answer your question?
Well, I was under the impression that the purpose of FldGetScrollValues is
to provide values for SclSetScrollBar, same way with the other two...
However, it seems that it provides values which are almost incompatible.
Thus, more or less, defeating the point of that call... I try to write code
both as small as possible and as fast as possible due to obvious
limitations. However, unnecessary typecasts don't help either of the two
main concepts of programming for embeded systems... :-)
Finally, addressing those who are concerned and not pointing a finger at
anyone in particular, what is this idiotic hostility towards eachother???
Isn't the aim of these forums to help and support each other??? If you just
wanna troll, go and join yahoo chat or wonder around EFNet... Most of you
have a lot to learn, especially from people that offer their time and help
on irc.openprojects.net!
IM
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/