tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: proposal: some pointer and arithmetic utilities

On Thu, Mar 21, 2013 at 06:42:16PM +0000, Taylor R Campbell wrote:
> Urk...sorry to self-reply, but ten-fingered copypasta invariably
> tastes wrong.  Let's try asking the computer to make copypasta for me
> from the code that I actually tested:
> /* typeof-free roundup2/rounddown2 */
> #define       roundup2(x, m)  (((x) + ((m) - 1)) & ~((m) - 1 + ((x) - (x))))
> #define       rounddown2(x,m) ((x) & ~((m) - 1 + ((x) - (x))))

If I remember correctly, we have at least a couple different sets of
macros that do things like this.  Are you planning on replacing those,
or adding to them?  Where are you proposing to add these?


Home | Main Index | Thread Index | Old Index