Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#49

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.

Reported by Thell Fowler · November 26th, 2010 @ 08:58 PM

State: open
Milestone: v2.0.0
Assigned to: npp-community npp-community

Activity

  1. Thell Fowler
    Thell Fowler

    (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...

    November 27th, 2010 @ 06:49 AM

  2. Thell Fowler
    Thell Fowler

    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...

    November 27th, 2010 @ 06:57 AM

  3. Thell Fowler
    Thell Fowler
    • State changed from new to needs_ack

    November 27th, 2010 @ 06:58 AM

  4. Thell Fowler
    Thell Fowler
    • Assigned user changed from Thell Fowler to npp-community

    November 27th, 2010 @ 06:58 AM

  5. Thell Fowler
    Thell Fowler
    • 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.

    November 28th, 2010 @ 06:30 PM

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.