John Marshall wrote:

> Adam Wozniak <[EMAIL PROTECTED]> wrote:
> >> MemSet() works exactly as documented.
> >
> > IMHO this is one of the most broken parts of the API.
>
> Agreed.
>
> > I'd really like to see this function renamed in some future release of
> > PalmOS.  I think renaming it would prevent some confusion.  MemFlood() ?
>
> I trust you don't really mean renaming the existing function.  That would
> lead to silent (i.e., impossible to warn about at compile time) changes
> in people's programs.  The only way to really rename it would be if
> you were willing to activate the new MemSet() behaviour by invoking the
> compiler with something like
>

Unfortunately I don't think you could ever really name something in the API 
MemSet() for quite a while.

rename sysTrapMemSet to sysTrapMemFlood.

change


     Err    MemSet(void *dstP, Int32 numBytes, UInt8 value)
            SYS_TRAP(sysTrapMemSet);

to


     Err    MemSetV30(void *dstP, Int32 numBytes, UInt8 value)
            SYS_TRAP(sysTrapMemFlood);

     Err    MemFlood(void *dstP, Int32 numBytes, UInt8 value)
            SYS_TRAP(sysTrapMemFlood);


Now old code will continue to work, just not compile.  You'll have to switch to 
 MemFlood()
if you want to recompile.

Then, maybe, some time in the distant future, once you were certain that 
everybody was using MemFlood(),
you might introduce a new function (with it's own new trap, different from 
sysTrapMemFlood), called
MemSet(), which behaves properly.

--
Adam Wozniak                     Senior Software Design Engineer
                                 Surveyor Corporation
[EMAIL PROTECTED]                4548 Broad Street
[EMAIL PROTECTED]          San Luis Obispo, CA 93401




-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to