[devel] [PATCH 2/8] set.c: get rid of nested functions
Kirill A. Shutemov
kirill на shutemov.name
Вт Ноя 16 23:10:15 UTC 2010
On Wed, Nov 17, 2010 at 02:07:28AM +0300, Dmitry V. Levin wrote:
> On Wed, Nov 17, 2010 at 12:54:53AM +0200, Kirill A. Shutemov wrote:
> > On Wed, Nov 17, 2010 at 01:14:58AM +0300, Dmitry V. Levin wrote:
> > > On Tue, Nov 16, 2010 at 05:56:36PM +0200, Kirill A. Shutsemov wrote:
> > > [...]
> > > > +static inline
> > > > +char *put_digit(char *base62, int c)
> > > > - void put_digit(int c)
> > > > - {
> > >
> > > Why shouldn't this and other functions remain returning void?
> >
> > We shift base62 to the next position and want caller to know about this.
> >
> > So we have two options:
> >
> > - return new position;
> > - pass char ** as argument instead of char *.
> >
> > Do you prefere the last one?
>
> Which one is more readable,
> base62 = put_digit(base62, 61);
> or
> put_digit(&base62, 61);
> ?
Ok, I'll rework it.
Any comments on other patches?
--
Kirill A. Shutemov
Подробная информация о списке рассылки Devel