Skip to content

Commit

Permalink
Make some more arguments const
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdos committed May 13, 2024
1 parent eeae987 commit e95b06c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ext/dom/parentnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ zend_result dom_parent_node_child_element_count(dom_object *obj, zval *retval)
}
/* }}} */

static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNodePtr node_to_find)
static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNode *node_to_find)
{
for (uint32_t i = 0; i < nodesc; i++) {
if (Z_TYPE(nodes[i]) == IS_OBJECT) {
Expand Down Expand Up @@ -691,7 +691,7 @@ void dom_parent_node_before(dom_object *context, zval *nodes, uint32_t nodesc)
php_dom_pre_insert(context->document, fragment, parentNode, viable_previous_sibling);
}

static zend_result dom_child_removal_preconditions(const xmlNodePtr child, int stricterror)
static zend_result dom_child_removal_preconditions(const xmlNode *child, int stricterror)
{
if (dom_node_is_read_only(child) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
Expand Down
6 changes: 2 additions & 4 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ typedef struct _dom_prop_handler {
dom_write_t write_func;
} dom_prop_handler;

/* {{{ int dom_node_is_read_only(xmlNodePtr node) */
int dom_node_is_read_only(xmlNodePtr node) {
int dom_node_is_read_only(const xmlNode *node) {
switch (node->type) {
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
Expand All @@ -168,9 +167,8 @@ int dom_node_is_read_only(xmlNodePtr node) {
}
}
}
/* }}} end dom_node_is_read_only */

bool dom_node_children_valid(xmlNodePtr node) {
bool dom_node_children_valid(const xmlNode *node) {
switch (node->type) {
case XML_DOCUMENT_TYPE_NODE:
case XML_DTD_NODE:
Expand Down
4 changes: 2 additions & 2 deletions ext/dom/php_dom.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr basep, xmlNodePtr nodep,
void php_dom_create_implementation(zval *retval, bool modern);
int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child);
bool dom_has_feature(zend_string *feature, zend_string *version);
int dom_node_is_read_only(xmlNodePtr node);
bool dom_node_children_valid(xmlNodePtr node);
int dom_node_is_read_only(const xmlNode *node);
bool dom_node_children_valid(const xmlNode *node);
void php_dom_create_iterator(zval *return_value, dom_iterator_type iterator_type, bool modern);
void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, const char *local, size_t local_len, const char *ns, size_t ns_len);
xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID);
Expand Down

0 comments on commit e95b06c

Please sign in to comment.