This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 176712 - Navigator for C++ somewhat broken
Summary: Navigator for C++ somewhat broken
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Solaris
: P4 normal with 1 vote (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-12 11:13 UTC by lvskiprof
Modified: 2013-05-07 11:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lvskiprof 2009-11-12 11:13:16 UTC
I am working on a project for a contract job that requires me to use Visual C++ 6.0, but the navigation options in there are more limited than what Netbeans provides.  So I converted the projects into Makefiles and imported them as projects with existing sources into Netbeans 6.7.1.

Navigation seem to work for some things, but not others.  Here is some example code where it fails:

struct WildWin {
    char sym_cnt[9];        // count of each symbol
    char WinSym;            // winning symbol
    char WildCount;            // number of wild symbols in hand
    char anim_bm;            // bit map for each of the symbols
} WildWin;

int CWinDisplay::GetBBWWAward(ulong *symbols, ulong flags)
{
    int won = 0;
    int i,j;

    for (i=0; i<9; i++)
        WildWin.sym_cnt[i] = 0;
    WildWin.WinSym = -1;

    WildWin.anim_bm = 0;
    for (i=0; i<3; i++) {
        ++WildWin.sym_cnt[symbols[i]];    // count the symbols
    }

    if ((j = WildWin.WildCount = WildWin.sym_cnt[BBWW_2xWILD]) == 3) {         j = 0;
        WildWin.WildCount = 0;
    }

    for (i=0; i<9; i++) {
        if ((WildWin.sym_cnt[i] + j) == 3)
        {        // look for 3 of any 1 symbol or wild
            WildWin.WinSym = i;
        }
    }
}

According to the Navigator when I ask it to show usages it says there are 0.  It does not do this for every variable/object.  So far I have only noticed it for structures declared like the one above.

A structure like this one does show proper usage info:

struct sPays g_sPays_BBWW[] = {
    BBWW_APPLE,        10,
    BBWW_1BAR,        10,
    BBWW_2BAR,        20,
};
Comment 1 Vladimir Voskresensky 2009-11-14 07:13:52 UTC
Thanks for the bug. 
just a clarification: we reference all WildWin to struct WildWin and there are 0 usages of variable WildWin (Find Usages from Navigator view)...
Comment 2 Vladimir Voskresensky 2009-11-14 07:16:55 UTC
lvskiprof, for you workaround would be to rename "struct WildWin" to "struct _WildWin" if it is possible.
Btw if WildWin is not used anywhere as struct you can try variable with unnamed struct:
struct {
    char sym_cnt[9];        // count of each symbol
    char WinSym;            // winning symbol
    char WildCount;            // number of wild symbols in hand
    char anim_bm;            // bit map for each of the symbols
} WildWin;