This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 03/10] Move target-dcache out of target.c


On 11/17/2013 08:09 PM, Doug Evans wrote:
> [For a later cleanup I would rename stack_cache_enabled() to
> stack_cache_enabled_p(), and rename the underlying variables of
> course.  I wouldn't do that in this patch of course since it's good to
> keep the moving of code in a patch onto itself.]

FWIW, _p is necessary to disambiguate cases like:

  if (enable_stack_cache ())

Because that's ambiguous --- it can be read as either
a predicate (is it enabled?), or an action (do enable now).

To fix that, you'd usually either rename to:

  if (enable_stack_cache_p ())

or

  if (stack_cache_enabled ())

"enabled" is already clearly a predicate.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]