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
 Technical Support
 VAX 1235: painfully wrong
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - May 11 2004 :  5:24:53 PM  Show Profile


This completion list is by far the wrongest I've ever seen. Look at the definition of the struct:
typedef struct tagSimpleIPStats2
{
	struct tagSimpleIPStats2()
	{
	};

	struct tagSimpleIPStats2(u_long i, __int16 r, __int32 f, __int32 d)
	{
		ZeroMemory(this, sizeof(struct tagSimpleIPStats2));
		ip = i;
		reason = r;
		ref = f;
		id = d;
		::GetSystemTimeAsFileTime((LPFILETIME)×tamp);
	};

	u_long	ip;				//  4
	__int16 reason;			//  2  reason code
	__int32	ref;			//  4  additional data reference id
	__int32 id;				//  4  linear ID 
	__int64 timestamp;		//  8  (file-)time of logging

	// remaining
	__int8	reserved[(32-(4+2+4+4+8))];	// 32 bytes size by record
	
} SIMPLEIPSTATS2;

The completion list contains just about everything - from any parameter used to any called function.

support
Whole Tomato Software

5566 Posts

Posted - May 11 2004 :  7:40:15 PM  Show Profile
We can reproduce the behavior.

Unfortunately, VA X does not distinguish the internal struct from the external since they have the same names. VA X sees what you do as something like this:

#ifdef ONEWAY
struct tagSimpleIPStats2 {
u_long i;
__int16 r;
}
#else
struct tagSimpleIPStats2 {
u_long ip;
__int16 reason;
}
#endif

In this example, VA X keeps track of members from both versions of tagSimpleIPStats2 and offers all when you want a members list. It is doing the same for you, albeit incorrectly.

The problem stems from how VA X identifies symbols since, unlike a traditional compiler, VA X cannot use file offsets to help distinguish similarly-named symbols.

All this said, we will see if we can fix VA X.

ixBug=41

Whole Tomato Software, Inc.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - May 11 2004 :  7:58:09 PM  Show Profile
quote:
Originally posted by support

Unfortunately, VA X does not distinguish the internal struct from the external since they have the same names.


Sorry? Which internal/external? There is just one struct (tagSimpleIPStats2) with a two constructors. VAX is simply mixing constructor with definiton.

And: how do you explain the appearance of the API function as member?


Something similar happens by the way when you use enums like this:

enum SOMEENUM { ... };

typedef struct xy
{
  enum SOMEENUM someval; // this one is colored as enum, instead of member
  SOMEENUM someother; // this one is colored correctly
}
VAX does not detect the USE of the enum, rather assumes that a new enum is defined.

Edited by - Uniwares on May 11 2004 8:00:03 PM
Go to Top of Page

ether
Tomato Guru

USA
130 Posts

Posted - May 12 2004 :  3:17:36 PM  Show Profile
It easy to see that their plugin code doesn't expect to see "struct tagSimpleIPStats2(){}" as anything other than a structure definition. Just a suggestion to make it easier for yourself and anyone else who may use your code, use a class if you need a constructor or member functions. Use structs they way the were intended to be used in C.


Don't know about your second way to produce it.

Edited by - ether on May 12 2004 3:18:54 PM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - May 12 2004 :  3:31:08 PM  Show Profile
Well, for pure data containers I prefer to use struct although its almost the same as class, it makes it more clear that its not intended to be a functional container.
But using the ctor has big advantages in structs too.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000