#49 open
Thell Fowler

nppDebug Func Guards: accept multiple guard categories in a scope.

Reported by Thell Fowler | November 26th, 2010 @ 08:58 PM | in v2.0.0

I have notes that at one point, I'm not quite sure of when, we had the ability to call funcguard in a fashion similar to:

void foo()
{
    // foo and bar are different func guard categories.
    func_guard(foo|bar);
}

Yet, this method of calling was lost since that point.

This can create an issue with expected results of using guard_debugf_cat with different categories than the one placed in the funcguard() call.

void foo()
{
    func_guard(foo);
    guard_debugf_cat(bar, "cat bar output")
}

If foo & bar are enabled the output is as expected, and if foo is enabled and bar disabled the output is as expected, but if foo is disabled and bar enabled output is not as expected. Since NppDebug's printf will first check the bar cat, and then the FuncGuard state, which when disabled loses the indent level.

That isn't much of an issue, but imagine that the someone enables the Bar cat knowing a common function of Foo and Bar has a debugf_cat call, and knowing that enabling Foo is too much noise.

A brief discussion on notepad++ (log) showed that not only might I might have been wrong in my old notes, but also that it would be nice to have the funcguard accept variadic input.

This ticket item is opened for finding and implementing a method of doing this.

As func-guard capability is a fairly major part of 2.0 and I had already thought that the capability existed to do multiple categories I'd like this to be considered as an addendum to add expected behavior to the previous Func-Guard branches that have been merged into master.

Comments and changes to this ticket

  • Thell Fowler

    Thell Fowler November 27th, 2010 @ 06:49 AM

    (from [9e5d7de144a71bbe6e9c3e30e929a6a2111860da]) NppDebug: process variadic category flags

    • Allow multiple func guard categories in the variadic func_guard() preprocessor command and pass as a list to the FuncGuard function for iteration to find an enabled one.
    • Add Boost Preprocessor and Variadic_Macro library headers in the Common path.
    • Add test cases for passing multiple categories where either both are enabled, the first enabled and the second disabled, the first disabled and second enabled, and both disabled.

    • Variadic_Macro_Data lib was obtained from the Boost SVN Sandbox, the BOOST_PP headers where extracted from Boost using the bcp tool against NppDebug.cpp and the VMD .hpp files.

    [#49]

    Signed-off-by: Thell Fowler git@tbfowler.name
    https://github.com/almostautomated/npp-community/commit/9e5d7de144a...

  • Thell Fowler

    Thell Fowler November 27th, 2010 @ 06:57 AM

    While this patch set does add quite a few files (110) and does add some preprocessor processing that wasn't there before I was not able to determine any noticeable change in a full clean rebuild after multiple tests. Sometimes it was a few seconds slower, sometimes a few seconds faster...

  • Thell Fowler

    Thell Fowler November 27th, 2010 @ 06:58 AM

    • State changed from “new” to “needs_ack”
  • Thell Fowler

    Thell Fowler November 27th, 2010 @ 06:58 AM

    • Assigned user changed from “Thell Fowler” to “npp-community”
  • Thell Fowler

    Thell Fowler November 28th, 2010 @ 06:30 PM

    • State changed from “needs_ack” to “open”

    Reverted status to open because I figured out why we had the 'category' string there. It was for implementing a way to have guard_debugf_cat retain indenting when it was used outside of the current guarded function but within the for the same category.

    I'll see what I can come up with for this.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Notepad++ Community Release

Shared Ticket Bins

People watching this ticket

Tags