Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1538: Dot no longer converted to ->

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
_Ramirez_ Posted - Oct 12 2006 : 04:39:13 AM
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 ->
6   L A T E S T    R E P L I E S    (Newest First)
support Posted - Oct 12 2006 : 6:58:18 PM
Fixed in build 1539.
feline Posted - Oct 12 2006 : 11:03:43 AM
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
_Ramirez_ Posted - Oct 12 2006 : 10:25:20 AM
I DID make a typo. Sorry!


obj* GetObj(const char* control_id);


VS2003 and it's C, not C++ :)
feline Posted - Oct 12 2006 : 09:33:56 AM
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.
_Ramirez_ Posted - Oct 12 2006 : 07:59:42 AM
I did not!
feline Posted - Oct 12 2006 : 07:52:58 AM
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?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000