After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689483 - const qualifier
const qualifier
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-02 15:55 UTC by Kurt Roeckx
Modified: 2014-10-13 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add more const qualifiers (21.19 KB, patch)
2012-12-02 15:55 UTC, Kurt Roeckx
none Details | Review

Description Kurt Roeckx 2012-12-02 15:55:06 UTC
Created attachment 230444 [details] [review]
Patch to add more const qualifiers

Hi,

It seems there are functions that do use the const qualifier for some of the arguments, but it seems that there are a lot of functions that don't use it and probably should.

So I created a patch against 2.9.0 that makes as much as possible const in tree.h, and changed other files as needed.

There were a lot of cases like "const xmlNodePtr node".  This doesn't actually do anything, there the *pointer* is constant not the object it points to.  So I changed those to "const xmlNode *node".

I also removed some consts, mostly in the Copy functions, because those functions can actually modify the doc or node they copy from.

Kurt
Comment 1 Daniel Veillard 2014-10-13 08:08:49 UTC
 And old one, but a good one ! It applied nearly perfectly and yes
those are good improvements, thanks a lot ! I'm sure it took quite some time
to build that patch and sorry it took so long, it's not lost, now commited:

https://git.gnome.org/browse/libxml2/commit/?id=95ebe53b50dfcff1fc5378309bc4f3c58173298e

  thanks again !

Daniel