You just need the infamous "+%=" operator!  (Or is that "%+="?)

-- Keith

-----Original Message-----
From: Paul [mailto:gdaypar@;aol.com]
Sent: Friday, November 15, 2002 6:07 PM
To: Palm Developer Forum
Subject: Re: Code Warrior compiler optimizations causing bug.


Double oops. Right the first time:
RecordSize += RecordSize % 2;

Gotta stop reading my own posts.

-Paul

"Paul" <[EMAIL PROTECTED]> wrote in message news:101288@;palm-dev-forum...
>
> > BTW,
> > >     if(RecordSize%2==1)//keep the record on word boundries
> > >     RecordSize++;
> > This could be more obfusicated as:
> > RecordSize += RecordSize % 2;    // only works with %2, not %4, etc.
>
> Ooops, I of course meant:
> RecordSize %= 2;
>
> ;-)

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to