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
 1440 coloring
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 26 2006 :  02:29:05 AM  Show Profile  Reply with Quote
Something goes wrong w/ DWORD_PTR here.

what color should I use next mode ?:)


ok:


vax1440, c++, vs2k3

-bugfix

http://www.mf-sd.de

feline
Whole Tomato Software

United Kingdom
18079 Posts

Posted - Jan 26 2006 :  2:50:04 PM  Show Profile  Reply with Quote
i believe this is the same problem that causes:

void testFn()
{
    int nCount(3);
    nCount++;
}


to show the variable "nCount" in two different colours, once as a function (the constructor in this case) and once as a local variable. currently the colouring parser thinks that anything that looks just like a function is a function.

beyond that, i was under the impression that DWORD, and so presumably DWORD_PTR was a #define. am i wrong about this? your code snippet does not make sense to me.

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

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 26 2006 :  3:43:27 PM  Show Profile  Reply with Quote
quote:

beyond that, i was under the impression that DWORD, and so presumably DWORD_PTR was a #define. am i wrong about this?


nope, both DWORD and DWORD_PTR are typedefs.
quote:

your code snippet does not make sense to me.


Since when do repro samples do have to make sense?:) If it compiles VAX should accept it as well imho.


Anyways I've found out what makes vax go nuts. It's the const variant of cast operator.
struct blub
{
public:
// fine
    operator const int*() const
    {
        return reinterpret_cast<const int*>(this);
    }
// fine
    operator DWORD_PTR() const
    {
        return reinterpret_cast<DWORD_PTR>(this);
    }
// uncomment block and DWORD_PTR is colored wrong
/*  
    operator const DWORD_PTR() const
    {
         return reinterpret_cast<const DWORD_PTR>(this);
    }
*/
};

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18079 Posts

Posted - Jan 27 2006 :  2:56:19 PM  Show Profile  Reply with Quote
there is no need for examples to make sense, but somehow i had got hold of the idea that DWORD_PTR was some form of #define, so my brain started to hurt when i tried to figure out what the code was really saying

i don't think i have ever felt the need to overload a cast operator in one of my classes, so the first example did not feel familiar either, which did not help. now i see what you are doing, and it makes much more sense. thank you for the clear example of the effect

case=975

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000