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
 1715: Change Signature fails
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Feb 19 2009 :  1:21:50 PM  Show Profile  Reply with Quote
Assume I have the following code:
class SF
{
public:
    inline static BOOL bBlub(const CString &strBlush);
}

BOOL SF::bBlub(const CString &strBlush)
{
    return TRUE;
}
When I now use Change Signature on the declaration and change BOOL to bool then I get for the definition:
BOOL Sinline  bool SF::bBlub(const CString &strBlush)
 return TRUE;
}
I'm using VC6, WinXP, no other add-ins.

Regards
Marcus

P.S.: Just corrected some typos. Was to late last night. Sorry.

Edited by - khb on Feb 20 2009 02:56:18 AM

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 20 2009 :  12:33:58 PM  Show Profile  Reply with Quote
Are you aware that this code is invalid? There is no semi-colon at the end of the class declaration.

Add the missing semi-colon and Change Signature works correctly.

I agree that VA should not delete code, but I am not quite sure what to say here, since the problem is that the invalid code is confusing our parser. "do something sensible for invalid code" is opening a massive area.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Feb 23 2009 :  03:02:28 AM  Show Profile  Reply with Quote
I'm sorry, I forgot to add the semicolon in the message above. I just stripped down my code a bit and missed it here. I my real code the semicolon is there. Otherwise it wouldn't copile, I guess. Anyway, Change Signature doesn't work for me in this case.

Regards
Marcus
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 23 2009 :  11:51:59 AM  Show Profile  Reply with Quote
Is there any chance of getting a copy of the original code where you see this problem? I am guessing something is confusing our parser, but I have no idea what that something is.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Feb 24 2009 :  02:43:16 AM  Show Profile  Reply with Quote
I'll try to set up a test project within the next days...

Regards
Marcus
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 24 2009 :  10:05:00 AM  Show Profile  Reply with Quote
One thing to look out for, do you have code like this:

void functionThatMightBreakThings()
{
#if 0
    {
        {
#endif
}

Obviously this is a very simple example, but it shows the concept. Occasionally this comes up, and it might be causing the problem you are seeing here.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Feb 25 2009 :  02:45:07 AM  Show Profile  Reply with Quote
I don't have any weird "ifdef" constructs, but I missed an important thing: If you have a problem shut down your machine, start it up again and try to reproduce the problem then. On the day I wrote the first message I was able to constantly reproduce the problem. Now I can't reproduce it any more. Anyway, there is still an additional space character between "inline" and "bool" as it can be seen in the second declaration of my first post.

Regards
Marcus

P.S.: As far as I know the inline keyword is either allowed for the declaration or the definition of a function. I always put the inline keyword to the declaration. But if I then use Change Signature for one of my inline functions the inline keyword is also added to the definition.

Edited by - khb on Feb 25 2009 03:14:09 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 25 2009 :  12:55:53 PM  Show Profile  Reply with Quote
*sigh* I hate problems that just appear and disappear, it can be really hard to pin them down.

Change Signature, VA tends to make both the implementation and the declaration look the same, partly for simplicity.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Feb 25 2009 :  2:54:00 PM  Show Profile  Reply with Quote
Me too. My feeling is I always get those. Anyway, I'll try to pin down the next problem a bit better

Regards
Marcus
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