Skip to content

Commit e95b06c

Browse files
committed
Make some more arguments const
1 parent eeae987 commit e95b06c

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

ext/dom/parentnode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ zend_result dom_parent_node_child_element_count(dom_object *obj, zval *retval)
108108
}
109109
/* }}} */
110110

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

694-
static zend_result dom_child_removal_preconditions(const xmlNodePtr child, int stricterror)
694+
static zend_result dom_child_removal_preconditions(const xmlNode *child, int stricterror)
695695
{
696696
if (dom_node_is_read_only(child) == SUCCESS ||
697697
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {

ext/dom/php_dom.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ typedef struct _dom_prop_handler {
146146
dom_write_t write_func;
147147
} dom_prop_handler;
148148

149-
/* {{{ int dom_node_is_read_only(xmlNodePtr node) */
150-
int dom_node_is_read_only(xmlNodePtr node) {
149+
int dom_node_is_read_only(const xmlNode *node) {
151150
switch (node->type) {
152151
case XML_ENTITY_REF_NODE:
153152
case XML_ENTITY_NODE:
@@ -168,9 +167,8 @@ int dom_node_is_read_only(xmlNodePtr node) {
168167
}
169168
}
170169
}
171-
/* }}} end dom_node_is_read_only */
172170

173-
bool dom_node_children_valid(xmlNodePtr node) {
171+
bool dom_node_children_valid(const xmlNode *node) {
174172
switch (node->type) {
175173
case XML_DOCUMENT_TYPE_NODE:
176174
case XML_DTD_NODE:

ext/dom/php_dom.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr basep, xmlNodePtr nodep,
145145
void php_dom_create_implementation(zval *retval, bool modern);
146146
int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child);
147147
bool dom_has_feature(zend_string *feature, zend_string *version);
148-
int dom_node_is_read_only(xmlNodePtr node);
149-
bool dom_node_children_valid(xmlNodePtr node);
148+
int dom_node_is_read_only(const xmlNode *node);
149+
bool dom_node_children_valid(const xmlNode *node);
150150
void php_dom_create_iterator(zval *return_value, dom_iterator_type iterator_type, bool modern);
151151
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);
152152
xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID);

0 commit comments

Comments
 (0)