Skip to content

Commit 9fc7be8

Browse files
committed
Use bools
1 parent 79e31c2 commit 9fc7be8

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

ext/dom/php_dom.c

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static void dom_copy_doc_props(php_libxml_ref_obj *source_doc, php_libxml_ref_ob
202202
dest->recover = source->recover;
203203
if (source->classmap) {
204204
ALLOC_HASHTABLE(dest->classmap);
205-
zend_hash_init(dest->classmap, 0, NULL, NULL, 0);
205+
zend_hash_init(dest->classmap, 0, NULL, NULL, false);
206206
zend_hash_copy(dest->classmap, source->classmap, NULL);
207207
}
208208

@@ -221,7 +221,7 @@ void dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece
221221
return;
222222
}
223223
ALLOC_HASHTABLE(doc_props->classmap);
224-
zend_hash_init(doc_props->classmap, 0, NULL, NULL, 0);
224+
zend_hash_init(doc_props->classmap, 0, NULL, NULL, false);
225225
}
226226
if (ce) {
227227
zend_hash_update_ptr(doc_props->classmap, basece->name, ce);
@@ -409,7 +409,7 @@ static HashTable* dom_get_debug_info_helper(zend_object *object, int *is_temp) /
409409
return debug_info;
410410
}
411411

412-
object_str = ZSTR_INIT_LITERAL("(object value omitted)", 0);
412+
object_str = ZSTR_INIT_LITERAL("(object value omitted)", false);
413413

414414
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(prop_handlers, string_key, entry) {
415415
zval value;
@@ -429,7 +429,7 @@ static HashTable* dom_get_debug_info_helper(zend_object *object, int *is_temp) /
429429
zend_hash_update(debug_info, string_key, &value);
430430
} ZEND_HASH_FOREACH_END();
431431

432-
zend_string_release_ex(object_str, 0);
432+
zend_string_release_ex(object_str, false);
433433

434434
return debug_info;
435435
}
@@ -641,7 +641,7 @@ PHP_MINIT_FUNCTION(dom)
641641
dom_object_namespace_node_handlers.free_obj = dom_object_namespace_node_free_storage;
642642
dom_object_namespace_node_handlers.clone_obj = dom_object_namespace_node_clone_obj;
643643

644-
zend_hash_init(&classes, 0, NULL, NULL, 1);
644+
zend_hash_init(&classes, 0, NULL, NULL, true);
645645

646646
dom_domexception_class_entry = register_class_DOMException(zend_ce_exception);
647647

@@ -655,7 +655,7 @@ PHP_MINIT_FUNCTION(dom)
655655
dom_node_class_entry = register_class_DOMNode();
656656
dom_node_class_entry->create_object = dom_objects_new;
657657

658-
zend_hash_init(&dom_node_prop_handlers, 0, NULL, NULL, 1);
658+
zend_hash_init(&dom_node_prop_handlers, 0, NULL, NULL, true);
659659
DOM_REGISTER_PROP_HANDLER(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
660660
DOM_REGISTER_PROP_HANDLER(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write);
661661
DOM_REGISTER_PROP_HANDLER(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
@@ -679,7 +679,7 @@ PHP_MINIT_FUNCTION(dom)
679679
dom_namespace_node_class_entry = register_class_DOMNameSpaceNode();
680680
dom_namespace_node_class_entry->create_object = dom_objects_namespace_node_new;
681681

682-
zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, NULL, 1);
682+
zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, NULL, true);
683683
DOM_REGISTER_PROP_HANDLER(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
684684
DOM_REGISTER_PROP_HANDLER(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL);
685685
DOM_REGISTER_PROP_HANDLER(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
@@ -694,54 +694,54 @@ PHP_MINIT_FUNCTION(dom)
694694

695695
dom_documentfragment_class_entry = register_class_DOMDocumentFragment(dom_node_class_entry, dom_parentnode_class_entry);
696696
dom_documentfragment_class_entry->create_object = dom_objects_new;
697-
zend_hash_init(&dom_documentfragment_prop_handlers, 0, NULL, NULL, 1);
697+
zend_hash_init(&dom_documentfragment_prop_handlers, 0, NULL, NULL, true);
698698

699699
DOM_REGISTER_PROP_HANDLER(&dom_documentfragment_prop_handlers, "firstElementChild", dom_parent_node_first_element_child_read, NULL);
700700
DOM_REGISTER_PROP_HANDLER(&dom_documentfragment_prop_handlers, "lastElementChild", dom_parent_node_last_element_child_read, NULL);
701701
DOM_REGISTER_PROP_HANDLER(&dom_documentfragment_prop_handlers, "childElementCount", dom_parent_node_child_element_count, NULL);
702702

703-
zend_hash_merge(&dom_documentfragment_prop_handlers, &dom_node_prop_handlers, NULL, 0);
703+
zend_hash_merge(&dom_documentfragment_prop_handlers, &dom_node_prop_handlers, NULL, false);
704704
zend_hash_add_new_ptr(&classes, dom_documentfragment_class_entry->name, &dom_documentfragment_prop_handlers);
705705

706706
dom_abstract_base_document_class_entry = register_class_DOM_Document(dom_node_class_entry, dom_parentnode_class_entry);
707707
/* No need to set create_object as it's abstract. */
708708
HashTable dom_abstract_base_document_prop_handlers;
709-
zend_hash_init(&dom_abstract_base_document_prop_handlers, 0, NULL, NULL, 1);
709+
zend_hash_init(&dom_abstract_base_document_prop_handlers, 0, NULL, NULL, true);
710710
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "doctype", dom_document_doctype_read, NULL);
711711
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL);
712712
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write);
713713
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write);
714714
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "firstElementChild", dom_parent_node_first_element_child_read, NULL);
715715
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "lastElementChild", dom_parent_node_last_element_child_read, NULL);
716716
DOM_REGISTER_PROP_HANDLER(&dom_abstract_base_document_prop_handlers, "childElementCount", dom_parent_node_child_element_count, NULL);
717-
zend_hash_merge(&dom_abstract_base_document_prop_handlers, &dom_node_prop_handlers, NULL, 0);
717+
zend_hash_merge(&dom_abstract_base_document_prop_handlers, &dom_node_prop_handlers, NULL, false);
718718
/* No need to register in &classes, because this is only used for merging. This is destroyed down below. */
719719

720720
dom_document_class_entry = register_class_DOMDocument(dom_abstract_base_document_class_entry);
721721
dom_document_class_entry->create_object = dom_objects_new;
722-
zend_hash_init(&dom_document_prop_handlers, 0, NULL, NULL, 1);
722+
zend_hash_init(&dom_document_prop_handlers, 0, NULL, NULL, true);
723723
DOM_REGISTER_PROP_HANDLER(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL);
724724
DOM_REGISTER_PROP_HANDLER(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL);
725725
DOM_REGISTER_PROP_HANDLER(&dom_document_prop_handlers, "config", dom_document_config_read, NULL);
726726
register_nondeprecated_xml_props(&dom_document_prop_handlers);
727727

728-
zend_hash_merge(&dom_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, 0);
728+
zend_hash_merge(&dom_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, false);
729729
zend_hash_add_new_ptr(&classes, dom_document_class_entry->name, &dom_document_prop_handlers);
730730

731731
dom_html_document_class_entry = register_class_DOM_HTMLDocument(dom_abstract_base_document_class_entry);
732732
dom_document_class_entry->create_object = dom_objects_new;
733-
zend_hash_init(&dom_html_document_prop_handlers, 0, NULL, NULL, 1);
733+
zend_hash_init(&dom_html_document_prop_handlers, 0, NULL, NULL, true);
734734
DOM_REGISTER_PROP_HANDLER(&dom_html_document_prop_handlers, "encoding", dom_document_encoding_read, dom_html_document_encoding_write);
735735

736-
zend_hash_merge(&dom_html_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, 0);
736+
zend_hash_merge(&dom_html_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, false);
737737
zend_hash_add_new_ptr(&classes, dom_html_document_class_entry->name, &dom_html_document_prop_handlers);
738738

739739
dom_xml_document_class_entry = register_class_DOM_XMLDocument(dom_abstract_base_document_class_entry);
740740
dom_xml_document_class_entry->create_object = dom_objects_new;
741-
zend_hash_init(&dom_xml_document_prop_handlers, 0, NULL, NULL, 1);
741+
zend_hash_init(&dom_xml_document_prop_handlers, 0, NULL, NULL, true);
742742
register_nondeprecated_xml_props(&dom_xml_document_prop_handlers);
743743

744-
zend_hash_merge(&dom_xml_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, 0);
744+
zend_hash_merge(&dom_xml_document_prop_handlers, &dom_abstract_base_document_prop_handlers, NULL, false);
745745
zend_hash_add_new_ptr(&classes, dom_xml_document_class_entry->name, &dom_xml_document_prop_handlers);
746746

747747
zend_hash_destroy(&dom_abstract_base_document_prop_handlers);
@@ -751,7 +751,7 @@ PHP_MINIT_FUNCTION(dom)
751751
dom_nodelist_class_entry->default_object_handlers = &dom_nodelist_object_handlers;
752752
dom_nodelist_class_entry->get_iterator = php_dom_get_iterator;
753753

754-
zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, 1);
754+
zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, true);
755755
DOM_REGISTER_PROP_HANDLER(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL);
756756
zend_hash_add_new_ptr(&classes, dom_nodelist_class_entry->name, &dom_nodelist_prop_handlers);
757757

@@ -760,37 +760,37 @@ PHP_MINIT_FUNCTION(dom)
760760
dom_namednodemap_class_entry->default_object_handlers = &dom_nnodemap_object_handlers;
761761
dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator;
762762

763-
zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, 1);
763+
zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, true);
764764
DOM_REGISTER_PROP_HANDLER(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL);
765765
zend_hash_add_new_ptr(&classes, dom_namednodemap_class_entry->name, &dom_namednodemap_prop_handlers);
766766

767767
dom_characterdata_class_entry = register_class_DOMCharacterData(dom_node_class_entry, dom_childnode_class_entry);
768768
dom_characterdata_class_entry->create_object = dom_objects_new;
769769

770-
zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, NULL, 1);
770+
zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, NULL, true);
771771
DOM_REGISTER_PROP_HANDLER(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write);
772772
DOM_REGISTER_PROP_HANDLER(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL);
773773
DOM_REGISTER_PROP_HANDLER(&dom_characterdata_prop_handlers, "previousElementSibling", dom_node_previous_element_sibling_read, NULL);
774774
DOM_REGISTER_PROP_HANDLER(&dom_characterdata_prop_handlers, "nextElementSibling", dom_node_next_element_sibling_read, NULL);
775-
zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, NULL, 0);
775+
zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, NULL, false);
776776
zend_hash_add_new_ptr(&classes, dom_characterdata_class_entry->name, &dom_characterdata_prop_handlers);
777777

778778
dom_attr_class_entry = register_class_DOMAttr(dom_node_class_entry);
779779
dom_attr_class_entry->create_object = dom_objects_new;
780780

781-
zend_hash_init(&dom_attr_prop_handlers, 0, NULL, NULL, 1);
781+
zend_hash_init(&dom_attr_prop_handlers, 0, NULL, NULL, true);
782782
DOM_REGISTER_PROP_HANDLER(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL);
783783
DOM_REGISTER_PROP_HANDLER(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL);
784784
DOM_REGISTER_PROP_HANDLER(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write);
785785
DOM_REGISTER_PROP_HANDLER(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL);
786786
DOM_REGISTER_PROP_HANDLER(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL);
787-
zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, NULL, 0);
787+
zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, NULL, false);
788788
zend_hash_add_new_ptr(&classes, dom_attr_class_entry->name, &dom_attr_prop_handlers);
789789

790790
dom_element_class_entry = register_class_DOMElement(dom_node_class_entry, dom_parentnode_class_entry, dom_childnode_class_entry);
791791
dom_element_class_entry->create_object = dom_objects_new;
792792

793-
zend_hash_init(&dom_element_prop_handlers, 0, NULL, NULL, 1);
793+
zend_hash_init(&dom_element_prop_handlers, 0, NULL, NULL, true);
794794
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL);
795795
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "className", dom_element_class_name_read, dom_element_class_name_write);
796796
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "id", dom_element_id_read, dom_element_id_write);
@@ -800,15 +800,15 @@ PHP_MINIT_FUNCTION(dom)
800800
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "childElementCount", dom_parent_node_child_element_count, NULL);
801801
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "previousElementSibling", dom_node_previous_element_sibling_read, NULL);
802802
DOM_REGISTER_PROP_HANDLER(&dom_element_prop_handlers, "nextElementSibling", dom_node_next_element_sibling_read, NULL);
803-
zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, NULL, 0);
803+
zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, NULL, false);
804804
zend_hash_add_new_ptr(&classes, dom_element_class_entry->name, &dom_element_prop_handlers);
805805

806806
dom_text_class_entry = register_class_DOMText(dom_characterdata_class_entry);
807807
dom_text_class_entry->create_object = dom_objects_new;
808808

809-
zend_hash_init(&dom_text_prop_handlers, 0, NULL, NULL, 1);
809+
zend_hash_init(&dom_text_prop_handlers, 0, NULL, NULL, true);
810810
DOM_REGISTER_PROP_HANDLER(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL);
811-
zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, NULL, 0);
811+
zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, NULL, false);
812812
zend_hash_add_new_ptr(&classes, dom_text_class_entry->name, &dom_text_prop_handlers);
813813

814814
dom_comment_class_entry = register_class_DOMComment(dom_characterdata_class_entry);
@@ -822,36 +822,36 @@ PHP_MINIT_FUNCTION(dom)
822822
dom_documenttype_class_entry = register_class_DOMDocumentType(dom_node_class_entry);
823823
dom_documenttype_class_entry->create_object = dom_objects_new;
824824

825-
zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, NULL, 1);
825+
zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, NULL, true);
826826
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL);
827827
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL);
828828
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL);
829829
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL);
830830
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL);
831831
DOM_REGISTER_PROP_HANDLER(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL);
832-
zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, NULL, 0);
832+
zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, NULL, false);
833833
zend_hash_add_new_ptr(&classes, dom_documenttype_class_entry->name, &dom_documenttype_prop_handlers);
834834

835835
dom_notation_class_entry = register_class_DOMNotation(dom_node_class_entry);
836836
dom_notation_class_entry->create_object = dom_objects_new;
837837

838-
zend_hash_init(&dom_notation_prop_handlers, 0, NULL, NULL, 1);
838+
zend_hash_init(&dom_notation_prop_handlers, 0, NULL, NULL, true);
839839
DOM_REGISTER_PROP_HANDLER(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL);
840840
DOM_REGISTER_PROP_HANDLER(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL);
841-
zend_hash_merge(&dom_notation_prop_handlers, &dom_node_prop_handlers, NULL, 0);
841+
zend_hash_merge(&dom_notation_prop_handlers, &dom_node_prop_handlers, NULL, false);
842842
zend_hash_add_new_ptr(&classes, dom_notation_class_entry->name, &dom_notation_prop_handlers);
843843

844844
dom_entity_class_entry = register_class_DOMEntity(dom_node_class_entry);
845845
dom_entity_class_entry->create_object = dom_objects_new;
846846

847-
zend_hash_init(&dom_entity_prop_handlers, 0, NULL, NULL, 1);
847+
zend_hash_init(&dom_entity_prop_handlers, 0, NULL, NULL, true);
848848
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL);
849849
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL);
850850
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL);
851851
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, NULL);
852852
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, NULL);
853853
DOM_REGISTER_PROP_HANDLER(&dom_entity_prop_handlers, "version", dom_entity_version_read, NULL);
854-
zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, NULL, 0);
854+
zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, NULL, false);
855855
zend_hash_add_new_ptr(&classes, dom_entity_class_entry->name, &dom_entity_prop_handlers);
856856

857857
dom_entityreference_class_entry = register_class_DOMEntityReference(dom_node_class_entry);
@@ -861,10 +861,10 @@ PHP_MINIT_FUNCTION(dom)
861861
dom_processinginstruction_class_entry = register_class_DOMProcessingInstruction(dom_node_class_entry);
862862
dom_processinginstruction_class_entry->create_object = dom_objects_new;
863863

864-
zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, NULL, 1);
864+
zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, NULL, true);
865865
DOM_REGISTER_PROP_HANDLER(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL);
866866
DOM_REGISTER_PROP_HANDLER(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write);
867-
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, NULL, 0);
867+
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, NULL, false);
868868
zend_hash_add_new_ptr(&classes, dom_processinginstruction_class_entry->name, &dom_processinginstruction_prop_handlers);
869869

870870
#ifdef LIBXML_XPATH_ENABLED
@@ -877,7 +877,7 @@ PHP_MINIT_FUNCTION(dom)
877877
dom_xpath_class_entry->create_object = dom_xpath_objects_new;
878878
dom_xpath_class_entry->default_object_handlers = &dom_xpath_object_handlers;
879879

880-
zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, NULL, 1);
880+
zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, NULL, true);
881881
DOM_REGISTER_PROP_HANDLER(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL);
882882
DOM_REGISTER_PROP_HANDLER(&dom_xpath_prop_handlers, "registerNodeNamespaces", dom_xpath_register_node_ns_read, dom_xpath_register_node_ns_write);
883883
zend_hash_add_new_ptr(&classes, dom_xpath_class_entry->name, &dom_xpath_prop_handlers);

0 commit comments

Comments
 (0)