bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] Re: base64


From: Stepan Kasal
Subject: Re: [bug-gnulib] Re: base64
Date: Thu, 25 Nov 2004 15:31:13 +0100
User-agent: Mutt/1.4.1i

Hi Jim,

On Thu, Nov 25, 2004 at 03:25:34PM +0100, Jim Meyering wrote:
> There should be parentheses around each RHS:
> 
>   #define BASE64_CEILING_DIV(n, k) ((n + (k-1)) / k)
>   #define BASE64_LENGTH(inlen) (BASE64_CEILING_DIV(inlen, 3) * 4)

Thank you for correcting me.  To make BASE64_CEILING_DIV generally usable,
one would have to do:

    #define BASE64_CEILING_DIV(n, k) (((n) + ((k)-1)) / (k))
    #define BASE64_LENGTH(inlen) (BASE64_CEILING_DIV(inlen, 3) * 4)

but perhaps we can settle with:

    #define _BASE64_CEILING_DIV(n, k) ((n + (k-1)) / k)
    #define BASE64_LENGTH(inlen) (_BASE64_CEILING_DIV(inlen, 3) * 4)

This is identical to your version, only the name of the aux macro is
changed.

Cheers,
        Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]