grub-devel
[Top][All Lists]
Advanced

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

Re: Eliminating nested functions


From: Pavel Roskin
Subject: Re: Eliminating nested functions
Date: Fri, 17 Apr 2009 17:38:08 -0400

On Sat, 2009-04-18 at 03:33 +0800, Bean wrote: 
> Hi,
> 
> One of the advantage of nested function is to use local variables.
> Without it, we would need to pass them as global variable, or add
> custom data pointer in many of the iterate function, which would make
> the code a lot uglier IMO.

Indeed, I tried to get rid on nested functions in fs/ext2.c, and it
requires more changes than I expected.

However, my impression is that everything can be written nicely with
more effort.  Some arguments could be put into the structures we need to
pass, so the number of arguments doesn't increase.

We should probably try to avoid adding new nested functions in the
meantime.

-- 
Regards,
Pavel Roskin




reply via email to

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