Menu

#402 Add const modifier to ASTNode_getUserData()'s argument etc.

libSBML-5.11.0
closed
nobody
None
2015-03-20
2015-02-18
Takeshi Abe
No

This is a tiny tweak, as the patch attached.

1 Attachments

Discussion

  • Frank Bergmann

    Frank Bergmann - 2015-02-18

    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

     
  • Takeshi Abe

    Takeshi Abe - 2015-02-18

    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().

     
  • Sarah Keating

    Sarah Keating - 2015-03-20
    • status: open --> closed
    • Priority: -->
     
  • Sarah Keating

    Sarah Keating - 2015-03-20

    This is done in SVN and will be in the next release.

     

Log in to post a comment.

MongoDB Logo MongoDB