Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 The structure members are incorrectly colored
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

skyworth
Junior Member

10 Posts

Posted - Apr 30 2008 :  11:54:25 AM  Show Profile  Reply with Quote
Some times, a structure has pointers pointing to the instances of the same sturcture, then the sturcture pointer may be colored as function. I do not think that's correct behavior. Using VS 2008, VA build 1632.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Apr 30 2008 :  12:38:38 PM  Show Profile  Reply with Quote
Can you post a sample piece of code that shows the problem? Using the simple test case:

struct testStructPointsAtSelf
{
	int nHeight;
	int nWidth;
	testStructPointsAtSelf *pSelf;
};

I am not seeing any problems.

When this happens, do you have any functions in your solution with the same name as the structure pointer? They should be listed in the Find Symbol dialog if you do.

zen is the art of being at one with the two'ness
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - May 03 2008 :  11:19:39 PM  Show Profile  Reply with Quote
/*----------------------------------------------
* The following code is in a header file.
*----------------------------------------------*/
struct AvlNode;

typedef struct AvlNode* AvlTree;



/*----------------------------------------------
* The following code is in a implementation file.
*----------------------------------------------*/
struct AvlNode
{
int element;
AvlTree left;
AvlTree right;
int height;
};

Edited by - skyworth on May 03 2008 11:23:04 PM
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - May 03 2008 :  11:24:53 PM  Show Profile  Reply with Quote
And the problems just happens some times, not always, even in the same file, the member can be both correctly colored or not.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 05 2008 :  1:24:34 PM  Show Profile  Reply with Quote
What colours have you told VA to use?

For me classes are blue and macros are purple. But this is not the colours you have used in your example.
I have copy and pasted the code into VS2005 here, and I am not seeing any colouring problems. Everything is coloured as I would expect.

zen is the art of being at one with the two'ness
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 06 2008 :  9:39:47 PM  Show Profile  Reply with Quote
Can you try 1635? http://www.wholetomato.com/downloads/getBuild.asp?1635

1632 introduced, then 1635 fixed some symbol coloring issues for me.

Edited by - accord on May 06 2008 9:51:24 PM
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - May 10 2008 :  9:56:28 PM  Show Profile  Reply with Quote
Hi, I'm using 1635, I manually set Classes, structures' color to Teal, and Variables to Gray.
For the integer members, it works.
But for the struct pointer members, it works sometimes, does not work sometimes.
Making me more confused is that, in two adjacent lines, one line is colored correctly, but the other line is not.
Sorry for the obscure sample. I'll give out a more detailed figure.

struct AvlNode
{
int element;
AvlTree left;
AvlTree right;
int height;
};

AvlTree tree;

tree->left
tree->right

Sorry, there is not gray, i used green instead.

And, what's more, i'm using a simplified chinese system and vs2008.

Edited by - skyworth on May 10 2008 10:04:22 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 11 2008 :  08:24:27 AM  Show Profile  Reply with Quote
I tried you example here using VA 1635 and VS 2008, but I do not see any problems. I used this code:


/*----------------------------------------------
* The following code is in a header file.
*----------------------------------------------*/
struct AvlNode;

typedef struct AvlNode* AvlTree;


/*----------------------------------------------
* The following code is in a implementation file.
*----------------------------------------------*/
struct AvlNode
{
	int element;
	AvlTree left;
	AvlTree right;
	int height;
};

void v() {
	AvlTree  tree;

	tree->left
	tree->right
}


I believe there is something that confuse the parser of VAX, so we have to figure what the cause of the problems you are seeing.
First, can you try this in a clean new project to see if this helps?

Edited by - accord on May 11 2008 08:26:49 AM
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - May 18 2008 :  12:34:22 AM  Show Profile  Reply with Quote
Sorry for no response for so long.
I've been a little bit busy these days.

I've tried your suggestion, using a new blank project and
your sample code to test.

As you said, it works perfect on your side.So it should work
on my side, but, environment varies.

I'm a dev too, and I can understand under this satuation, it very hard to locate the problem, as the test environment varies, it's nearly impossible to build a identical environment, and the cost may be too high to fix such a trivial issue.

So my suggestion is just keeping it in the known issue list and fix it when you find out the reason.

Thank you very much for you support.

Edited by - skyworth on May 18 2008 12:46:29 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 19 2008 :  07:55:32 AM  Show Profile  Reply with Quote
If you are seeing this problem in a test project, can you please:

Export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

along with your test project.

Then I can import your settings, and open your project here, and see if I see the same problem or not.

Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - May 19 2008 :  09:33:00 AM  Show Profile  Reply with Quote
Done, I've send you the files required.
Actually, I've found a new issue, it marks a static fuction as variable.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 19 2008 :  11:43:36 AM  Show Profile  Reply with Quote
I have the files, thank you for those. So far I cannot reproduce the problem here. The solution is using oriental characters for the folder names in Solution Explorer, so you may find that the next build of VA (after VA 1638) helps. This is currently working its way through internal testing and should be posted soon.

zen is the art of being at one with the two'ness
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - Nov 16 2008 :  03:47:54 AM  Show Profile  Reply with Quote
It seems I've found another issue.
According to the code I supplied previously, the struct AvlNode has a member int height, and there is fuction int height(AvlTree tree);
The fuction was marked as variable.
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - Nov 16 2008 :  03:56:36 AM  Show Profile  Reply with Quote
Another issue, it marks the c standard library fuctions malloc and free as predefined macros, I'm not sure whether it's a problems.
Anyway, it's a little bit weired here.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Nov 18 2008 :  6:44:03 PM  Show Profile  Reply with Quote
"height", when the same symbol name is used both as a function and a variable name VA's colouring code can get confused. The colouring code has to run very fast in order to keep up with scrolling through code, so it is possible to confuse it when a symbol has multiple definitions.

The colour of malloc, for me this is due to the line:

#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)

in the file

C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include\\crtdbg.h
line 612

which is one of the stable header files that VA parses for VS2008. There is a #define for "free" a few lines down in the same file.

zen is the art of being at one with the two'ness
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - Dec 05 2008 :  9:20:24 PM  Show Profile  Reply with Quote
Another problem, it marks name spaces of C# as classes/typedefs.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 05 2008 :  10:46:03 PM  Show Profile  Reply with Quote
Namespaces being colored using the classes/structs/typedefs color is by design. Though the VA Options Dlg doesn't list namespaces on the color selector description, it is listed in the tooltip that appears if you hover over the text (not saying it's easy to come by, just mentioning it to back up my claim that it is by design).
Go to Top of Page

skyworth
Junior Member

10 Posts

Posted - Oct 03 2009 :  11:26:59 PM  Show Profile  Reply with Quote
FT, fixed in latest release, build 1738...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000