strl* (was: Re: Advent4 patch, second try)

Luis Javier Merino ljmerino at gmail.com
Fri Sep 28 13:14:21 CEST 2007


On 9/28/07, Nanomad <condellog at gmail.com> wrote:
> On 9/27/07, Luis Javier Merino <ljmerino at gmail.com> wrote:
> > #define GROW_SIZE       1000
> [CUT]
> >                 *nsize = ((slen + GROW_SIZE) / GROW_SIZE) * GROW_SIZE;
> [CUT]
> >                         *nsize = ((*size + slen + GROW_SIZE - 1) /
> > GROW_SIZE) * GROW_SIZE;
> [CUT]
>
> Just a quick comment: dividing and then multipling for the same value
> just does nothing (or, better, can lead to problems since you are
> working with int) (or am I missing something?)

It truncates the number to a multiple of GROW_SIZE.



More information about the dslinux-devel mailing list