Skip to content

Commit 9af582b

Browse files
committed
fix non-standard C
1 parent e10272c commit 9af582b

File tree

1 file changed

+55
-54
lines changed

1 file changed

+55
-54
lines changed

ext/dom/document.c

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ ZEND_END_ARG_INFO();
187187
/* }}} */
188188

189189
/*
190-
* class DOMDocument extends DOMNode
190+
* class DOMDocument extends DOMNode
191191
*
192192
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
193-
* Since:
193+
* Since:
194194
*/
195195

196196
const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
@@ -235,10 +235,10 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
235235
};
236236
/* }}} */
237237

238-
/* {{{ docType DOMDocumentType
239-
readonly=yes
238+
/* {{{ docType DOMDocumentType
239+
readonly=yes
240240
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
241-
Since:
241+
Since:
242242
*/
243243
int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
244244
{
@@ -266,15 +266,15 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
266266
return FAILURE;
267267
}
268268
return SUCCESS;
269-
269+
270270
}
271271

272272
/* }}} */
273273

274-
/* {{{ implementation DOMImplementation
275-
readonly=yes
274+
/* {{{ implementation DOMImplementation
275+
readonly=yes
276276
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
277-
Since:
277+
Since:
278278
*/
279279
int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
280280
{
@@ -285,10 +285,10 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
285285

286286
/* }}} */
287287

288-
/* {{{ documentElement DOMElement
289-
readonly=yes
288+
/* {{{ documentElement DOMElement
289+
readonly=yes
290290
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
291-
Since:
291+
Since:
292292
*/
293293
int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
294294
{
@@ -391,8 +391,8 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
391391

392392
/* }}} */
393393

394-
/* {{{ standalone boolean
395-
readonly=no
394+
/* {{{ standalone boolean
395+
readonly=no
396396
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
397397
Since: DOM Level 3
398398
*/
@@ -455,7 +455,7 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
455455

456456
/* }}} */
457457

458-
/* {{{ version string
458+
/* {{{ version string
459459
readonly=no
460460
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
461461
Since: DOM Level 3
@@ -520,8 +520,8 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
520520

521521
/* }}} */
522522

523-
/* {{{ strictErrorChecking boolean
524-
readonly=no
523+
/* {{{ strictErrorChecking boolean
524+
readonly=no
525525
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
526526
Since: DOM Level 3
527527
*/
@@ -565,7 +565,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
565565

566566
/* }}} */
567567

568-
/* {{{ formatOutput boolean
568+
/* {{{ formatOutput boolean
569569
readonly=no
570570
*/
571571
int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -607,7 +607,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
607607
}
608608
/* }}} */
609609

610-
/* {{{ validateOnParse boolean
610+
/* {{{ validateOnParse boolean
611611
readonly=no
612612
*/
613613
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -649,7 +649,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
649649
}
650650
/* }}} */
651651

652-
/* {{{ resolveExternals boolean
652+
/* {{{ resolveExternals boolean
653653
readonly=no
654654
*/
655655
int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -691,7 +691,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
691691
}
692692
/* }}} */
693693

694-
/* {{{ preserveWhiteSpace boolean
694+
/* {{{ preserveWhiteSpace boolean
695695
readonly=no
696696
*/
697697
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -733,7 +733,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
733733
}
734734
/* }}} */
735735

736-
/* {{{ recover boolean
736+
/* {{{ recover boolean
737737
readonly=no
738738
*/
739739
int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -775,7 +775,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
775775
}
776776
/* }}} */
777777

778-
/* {{{ substituteEntities boolean
778+
/* {{{ substituteEntities boolean
779779
readonly=no
780780
*/
781781
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -817,8 +817,8 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
817817
}
818818
/* }}} */
819819

820-
/* {{{ documentURI string
821-
readonly=no
820+
/* {{{ documentURI string
821+
readonly=no
822822
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
823823
Since: DOM Level 3
824824
*/
@@ -881,8 +881,8 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
881881

882882
/* }}} */
883883

884-
/* {{{ config DOMConfiguration
885-
readonly=yes
884+
/* {{{ config DOMConfiguration
885+
readonly=yes
886886
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
887887
Since: DOM Level 3
888888
*/
@@ -897,7 +897,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
897897

898898
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
899899
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
900-
Since:
900+
Since:
901901
*/
902902
PHP_FUNCTION(dom_document_create_element)
903903
{
@@ -930,7 +930,7 @@ PHP_FUNCTION(dom_document_create_element)
930930

931931
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
932932
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
933-
Since:
933+
Since:
934934
*/
935935
PHP_FUNCTION(dom_document_create_document_fragment)
936936
{
@@ -957,7 +957,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
957957

958958
/* {{{ proto DOMText dom_document_create_text_node(string data);
959959
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
960-
Since:
960+
Since:
961961
*/
962962
PHP_FUNCTION(dom_document_create_text_node)
963963
{
@@ -985,7 +985,7 @@ PHP_FUNCTION(dom_document_create_text_node)
985985

986986
/* {{{ proto DOMComment dom_document_create_comment(string data);
987987
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
988-
Since:
988+
Since:
989989
*/
990990
PHP_FUNCTION(dom_document_create_comment)
991991
{
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(dom_document_create_comment)
10131013

10141014
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
10151015
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
1016-
Since:
1016+
Since:
10171017
*/
10181018
PHP_FUNCTION(dom_document_create_cdatasection)
10191019
{
@@ -1041,7 +1041,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
10411041

10421042
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
10431043
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
1044-
Since:
1044+
Since:
10451045
*/
10461046
PHP_FUNCTION(dom_document_create_processing_instruction)
10471047
{
@@ -1076,7 +1076,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
10761076

10771077
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
10781078
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
1079-
Since:
1079+
Since:
10801080
*/
10811081
PHP_FUNCTION(dom_document_create_attribute)
10821082
{
@@ -1110,7 +1110,7 @@ PHP_FUNCTION(dom_document_create_attribute)
11101110

11111111
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
11121112
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
1113-
Since:
1113+
Since:
11141114
*/
11151115
PHP_FUNCTION(dom_document_create_entity_reference)
11161116
{
@@ -1143,7 +1143,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
11431143

11441144
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
11451145
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
1146-
Since:
1146+
Since:
11471147
*/
11481148
PHP_FUNCTION(dom_document_get_elements_by_tag_name)
11491149
{
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(dom_document_import_node)
11771177
xmlDocPtr docp;
11781178
xmlNodePtr nodep, retnodep;
11791179
dom_object *intern, *nodeobj;
1180-
int ret;
1180+
int ret;
11811181
long recursive = 0;
11821182

11831183
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
@@ -1188,7 +1188,7 @@ PHP_FUNCTION(dom_document_import_node)
11881188

11891189
DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj);
11901190

1191-
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
1191+
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
11921192
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
11931193
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
11941194
RETURN_FALSE;
@@ -1278,7 +1278,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
12781278
RETURN_FALSE;
12791279
}
12801280

1281-
1281+
12821282
nodep->ns = nsptr;
12831283

12841284
DOM_RET_OBJ(nodep, &ret, intern);
@@ -1580,14 +1580,15 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int sourc
15801580
xmlInitParser();
15811581

15821582
if (mode == DOM_LOAD_FILE) {
1583+
char *file_dest;
15831584
if (CHECK_NULL_PATH(source, source_len)) {
15841585
return NULL;
15851586
}
1586-
char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
1587+
file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
15871588
if (file_dest) {
15881589
ctxt = xmlCreateFileParserCtxt(file_dest);
15891590
}
1590-
1591+
15911592
} else {
15921593
ctxt = xmlCreateMemoryParserCtxt(source, source_len);
15931594
}
@@ -1909,7 +1910,7 @@ PHP_FUNCTION(dom_document_xinclude)
19091910
zval *id;
19101911
xmlDoc *docp;
19111912
xmlNodePtr root;
1912-
long flags = 0;
1913+
long flags = 0;
19131914
int err;
19141915
dom_object *intern;
19151916

@@ -1922,7 +1923,7 @@ PHP_FUNCTION(dom_document_xinclude)
19221923
err = xmlXIncludeProcessFlags(docp, flags);
19231924

19241925
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
1925-
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
1926+
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
19261927
but are not wanted in resulting document - must be done even if err as it could fail after
19271928
having processed some xincludes */
19281929
root = (xmlNodePtr) docp->children;
@@ -1938,7 +1939,7 @@ PHP_FUNCTION(dom_document_xinclude)
19381939
} else {
19391940
RETVAL_FALSE;
19401941
}
1941-
1942+
19421943
}
19431944
/* }}} */
19441945

@@ -1959,19 +1960,19 @@ PHP_FUNCTION(dom_document_validate)
19591960
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
19601961

19611962
cvp = xmlNewValidCtxt();
1962-
1963+
19631964
cvp->userData = NULL;
19641965
cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler;
19651966
cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler;
1966-
1967+
19671968
if (xmlValidateDocument(cvp, docp)) {
19681969
RETVAL_TRUE;
19691970
} else {
19701971
RETVAL_FALSE;
19711972
}
1972-
1973+
19731974
xmlFreeValidCtxt(cvp);
1974-
1975+
19751976
}
19761977
/* }}} */
19771978

@@ -2011,7 +2012,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
20112012
break;
20122013
case DOM_LOAD_STRING:
20132014
parser = xmlSchemaNewMemParserCtxt(source, source_len);
2014-
/* If loading from memory, we need to set the base directory for the document
2015+
/* If loading from memory, we need to set the base directory for the document
20152016
but it is not apparent how to do that for schema's */
20162017
break;
20172018
default:
@@ -2100,7 +2101,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
21002101
break;
21012102
case DOM_LOAD_STRING:
21022103
parser = xmlRelaxNGNewMemParserCtxt(source, source_len);
2103-
/* If loading from memory, we need to set the base directory for the document
2104+
/* If loading from memory, we need to set the base directory for the document
21042105
but it is not apparent how to do that for schema's */
21052106
break;
21062107
default:
@@ -2168,7 +2169,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
21682169
int source_len, refcount, ret;
21692170
long options = 0;
21702171
htmlParserCtxtPtr ctxt;
2171-
2172+
21722173
id = getThis();
21732174

21742175
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
@@ -2204,7 +2205,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
22042205
htmlParseDocument(ctxt);
22052206
newdoc = ctxt->myDoc;
22062207
htmlFreeParserCtxt(ctxt);
2207-
2208+
22082209
if (!newdoc)
22092210
RETURN_FALSE;
22102211

@@ -2326,13 +2327,13 @@ PHP_FUNCTION(dom_document_save_html)
23262327
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
23272328
RETURN_FALSE;
23282329
}
2329-
2330+
23302331
buf = xmlBufferCreate();
23312332
if (!buf) {
23322333
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
23332334
RETURN_FALSE;
23342335
}
2335-
2336+
23362337
if (node->type == XML_DOCUMENT_FRAG_NODE) {
23372338
int one_size;
23382339

0 commit comments

Comments
 (0)