I agree that the isSetUserData should take the const modifier for the argument. But since the getUserData operation just returns the pointer, it would allow any operation on the pointer retrieved. So it is potentially a non-const operation, don't you think so?
best
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The answer depends on how ASTNode treats the user data.
So far ASTNode just keeps its void pointer as is.
To me, that does not mean the node is the owner of the data pointed by the pointer.
Rather I think it is the responsibility of client code to or not to mess the data through ASTNode_getUserData().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree that the isSetUserData should take the const modifier for the argument. But since the getUserData operation just returns the pointer, it would allow any operation on the pointer retrieved. So it is potentially a non-const operation, don't you think so?
best
Frank
Thank you for your reply.
The answer depends on how ASTNode treats the user data.
So far ASTNode just keeps its void pointer as is.
To me, that does not mean the node is the owner of the data pointed by the pointer.
Rather I think it is the responsibility of client code to or not to mess the data through ASTNode_getUserData().
This is done in SVN and will be in the next release.