grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Removing nested functions, part one of lots


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] Removing nested functions, part one of lots
Date: Thu, 03 Jan 2013 18:21:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 02.01.2013 03:02, Colin Watson wrote:

> On Wed, Jan 02, 2013 at 12:05:04AM +0000, Colin Watson wrote:
>> On Wed, Jan 02, 2013 at 01:37:38AM +0400, Andrey Borzenkov wrote:
>>> В Tue, 1 Jan 2013 14:42:04 +0000
>>> Colin Watson <address@hidden> пишет:
>>>>  * If a hook requires more than one local variable from its parent
>>>>    function, declare "struct <name-of-parent>_ctx" with the necessary
>>>>    variables, and convert both the hook and the parent to access the
>>>>    variables in question via that structure.
>>>
>>> Personally I find "ctx" part a bit confusing. It is not really execution
>>> context in usual sense, it is just collection of random variables. I
>>> would rather go with "struct <name-of-parent>_data" here.
>>
>> I'm fine with that (and this is exactly why I posted this for a bit of a
>> bikeshedding opportunity :-) ).  Vladimir, any opinions on the naming?
> 
> Actually, "*_data" is suboptimal because (particularly in filesystem
> code) there are many other variables and types called "data".  How about
> "*_vars"?  Then I can use "struct foo_vars *vars = data;" or similar as
> well and it should work out reasonably well.
> 

I feel like "_ctx" is a good one. It is the executional context, it's
just trimmed to what we really need.

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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