Skip to content

Commit 26f88c6

Browse files
committed
phar: Use true / false instead of 1 / 0 for bool parameters
Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2)
1 parent d793de1 commit 26f88c6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,7 @@ zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **er
23392339
return FAILURE;
23402340
}
23412341

2342-
if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, 0, REPORT_ERRORS, NULL, 0) == SUCCESS) {
2342+
if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, false, REPORT_ERRORS, NULL, 0) == SUCCESS) {
23432343
return SUCCESS;
23442344
}
23452345

ext/phar/stream.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{
546546
return -1;
547547
}
548548

549-
phar_dostat(data->phar, data->internal_file, ssb, 0);
549+
phar_dostat(data->phar, data->internal_file, ssb, false);
550550
return 0;
551551
}
552552
/* }}} */
@@ -594,7 +594,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
594594
}
595595
if (*internal_file == '\0') {
596596
/* root directory requested */
597-
phar_dostat(phar, NULL, ssb, 1);
597+
phar_dostat(phar, NULL, ssb, true);
598598
php_url_free(resource);
599599
return SUCCESS;
600600
}
@@ -605,12 +605,12 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
605605
internal_file_len = strlen(internal_file);
606606
/* search through the manifest of files, and if we have an exact match, it's a file */
607607
if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
608-
phar_dostat(phar, entry, ssb, 0);
608+
phar_dostat(phar, entry, ssb, false);
609609
php_url_free(resource);
610610
return SUCCESS;
611611
}
612612
if (zend_hash_str_exists(&(phar->virtual_dirs), internal_file, internal_file_len)) {
613-
phar_dostat(phar, NULL, ssb, 1);
613+
phar_dostat(phar, NULL, ssb, true);
614614
php_url_free(resource);
615615
return SUCCESS;
616616
}
@@ -646,7 +646,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
646646
if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
647647
goto free_resource;
648648
}
649-
phar_dostat(phar, entry, ssb, 0);
649+
phar_dostat(phar, entry, ssb, false);
650650
php_url_free(resource);
651651
return SUCCESS;
652652
}

0 commit comments

Comments
 (0)