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
 Odd behavior in macro expansion
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dparker
New Member

8 Posts

Posted - Jan 19 2006 :  4:19:24 PM  Show Profile  Reply with Quote
Ok, so who's so lazy they use macros to generate code?
That aside, I saw that in some code having the following #define, what showed up in the definition box when CASE_DRIVER(XX) was expanded had the ":" and "." replaced with "::".

#define CASE_DRIVER(ID) case driver##ID: sendStatus = driver_##ID.Update (packet.msg, &sendPacket); break;

Nothing fatal or earth shaking. Just figured it's not supposed to be that way.

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 19 2006 :  4:39:55 PM  Show Profile  Reply with Quote
i am seeing the same thing on some of the dots.

case=897

out of interest should those #'s be there? or are they just place holders? i try not to use macro's to much, but the hashes look like they wont compile, and i don't recall reading anything about them being control characters in a macro.

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

dparker
New Member

8 Posts

Posted - Jan 19 2006 :  10:39:05 PM  Show Profile  Reply with Quote
The ## is the Token-Pasting Operator (##)
Sometimes old code has old practices.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 22 2006 :  2:15:52 PM  Show Profile  Reply with Quote
that makes sense

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

dparker
New Member

8 Posts

Posted - Jan 30 2006 :  2:12:10 PM  Show Profile  Reply with Quote
This "problem" didn't occur in build 1418. Might be the same as case 923.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 30 2006 :  3:02:34 PM  Show Profile  Reply with Quote
good catch. case 897 has in fact been replaced by the duplicate case 932

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

dparker
New Member

8 Posts

Posted - Feb 01 2006 :  5:11:02 PM  Show Profile  Reply with Quote
Just for testing purposes -
this line :
static const double VoltsPerBit = 10.0 / (double)0x0fff;
is shown in the definition box as :
static const double VoltsPerBit = 10::0 (double)0x0fff;

The tooltip is even stranger.
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