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
 1538: Dot no longer converted to ->
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

_Ramirez_
New Member

9 Posts

Posted - Oct 12 2006 :  04:39:13 AM  Show Profile  Reply with Quote
Dot no longer converted to -> when calling operator*(). I don't think it's working like it should. At least it's not working like it used to.

struct OBJ
{
    int x, y;
};

typedef struct OBJ obj;

obj GetObj(const char* control_id);

GetObj("something"). //(this dot isn't converted to ->)


If I want to access x or y I have to type ->

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Oct 12 2006 :  07:52:58 AM  Show Profile  Reply with Quote
there was a change to how the class operator*() function was handled, following on from this thread:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=5205

however that is not going to effect this code. the function is returning an instance of the structure, so dot is correct. did you make a typo when posting this code?

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

_Ramirez_
New Member

9 Posts

Posted - Oct 12 2006 :  07:59:42 AM  Show Profile  Reply with Quote
I did not!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Oct 12 2006 :  09:33:56 AM  Show Profile  Reply with Quote
am I missing something obvious then? the function GetObj(...) returns "obj"
from the typedef "obj" becomes "struct OBJ"
this is an instance, not a pointer. on an instance you use dot, so VA is correct in leaving the dot alone.

using VS2005 and C++ I have just added the following code to a cpp file:

struct OBJ
{
    int x, y;
};

typedef struct OBJ obj;

obj GetObj(const char* control_id)    { static obj test; return test; }

static void getCounter()
{
    int nValue = GetObj("something").x;
}


this is just your sample code with enough added to use it. this compiles perfectly happily.

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

_Ramirez_
New Member

9 Posts

Posted - Oct 12 2006 :  10:25:20 AM  Show Profile  Reply with Quote
I DID make a typo. Sorry!


obj* GetObj(const char* control_id);


VS2003 and it's C, not C++ :)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Oct 12 2006 :  11:03:43 AM  Show Profile  Reply with Quote
confirmed. rather strangely I can only reproduce the bug when there is a string being passed. if i make the string zero length, or assign it to a variable first and pass the variable then the dot is correctly converted to ->

case=2989

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

support
Whole Tomato Software

5566 Posts

Posted - Oct 12 2006 :  6:58:18 PM  Show Profile  Reply with Quote
Fixed in build 1539.
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