HomeClusterLabs Projects

API: libcrmcommon: xml_top argument of xpath_search() is now const

Description

API: libcrmcommon: xml_top argument of xpath_search() is now const

xml_top->doc is passed as a non-const variable to xmlXPathNewContext(),
but xmlXPathNewContext() doesn't modify it. It's just another libxml2
function that's unnecessarily non-const.

For clarity of intent, we typically declare a Pacemaker variable as non-
const even if the variable itself is not modified, as long as one of its
members is modified via that variable. However, convenience wins here
and it doesn't break any C rules.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jul 5 2023, 5:59 AM
Parents
rP345ee73b735e: Merge pull request #3149 from kgaillot/build
Branches
Unknown
Tags
Unknown