#27 Improve "const correctness"

Next_Release
open
5
2012-08-16
2005-07-02
Markus Elfring
No

Would you like to apply the advices from the article
"http://en.wikipedia.org/wiki/Const_correctness" to
your sources?
I suggest to add the key word "const" to the type
specifiers of parameters like "privacy" for the
function "mwSession_setPrivacyInfo" and "stat" for the
function "mwSession_setUserStatus".
-
http://meanwhile.sourceforge.net/docs/api/0.4.2/mw__session_8h-source.html
-
http://cvs.sourceforge.net/viewcvs.py/meanwhile/meanwhile/src/session.c?rev=1.38&view=markup

Discussion

  • Logged In: YES
    user_id=77326

    It's getting there. You'll notice that mw_common.h started
    using const where appropriate in the last release or so.
    It's certainly something that should be applied to the
    entire API

    I'm actually surprised anyone noticed! Are you using the
    library for a project?

     
  • Markus Elfring
    Markus Elfring
    2005-07-03

    Logged In: YES
    user_id=572001

    I'm not using your software at the moment.
    But I 'd like to contribute this little review so that the
    code will be corrected and improved on this useful detail.

     
  • Logged In: YES
    user_id=77326

    Meanwhile 2.0, which I am currently working on, will be
    "const correct" as you put it :)

    Thanks for bringing this to my attention

     


Anonymous


Cancel   Add attachments