[devel] [PATCH 2/8] set.c: get rid of nested functions

Dmitry V. Levin ldv на altlinux.org
Вт Ноя 16 23:07:28 UTC 2010


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);
?


-- 
ldv
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : отсутствует
Тип     : application/pgp-signature
Размер  : 198 байтов
Описание: отсутствует
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20101117/b3449ad7/attachment-0001.bin>


Подробная информация о списке рассылки Devel