All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Eliminating nested functions
Date: Fri, 17 Apr 2009 17:38:08 -0400	[thread overview]
Message-ID: <1240004288.9057.5.camel@mj> (raw)
In-Reply-To: <ca0f59980904171233y55697d2bxe17c2ab9714bf292@mail.gmail.com>

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



  parent reply	other threads:[~2009-04-17 21:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 15:54 Eliminating nested functions Pavel Roskin
2009-04-17 19:33 ` Bean
2009-04-17 19:52   ` Vladimir Serbinenko
2009-04-17 21:38   ` Pavel Roskin [this message]
2009-04-19  6:38     ` Bean
2009-04-19 14:29       ` Pavel Roskin
2009-04-19 14:51         ` Vladimir Serbinenko
2009-04-19 16:52           ` Bean
2009-04-17 21:57 ` Christian Franke
2009-04-17 23:17 ` David Miller
2009-04-18 15:57   ` Colin D Bennett
2009-04-19  3:52     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1240004288.9057.5.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.