1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phar: Remove no-op bool casts (#20227)

The field in this struct is already a bool.
This commit is contained in:
Niels Dossche
2025-10-19 23:29:08 +02:00
committed by GitHub
parent a29c5d6928
commit 63e534d7ca
3 changed files with 10 additions and 10 deletions

View File

@@ -1108,11 +1108,11 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname
/* set up our manifest */
zend_hash_init(&mydata->manifest, manifest_count,
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, manifest_count * 2,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
@@ -1451,7 +1451,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(c
zend_hash_init(&mydata->mounted_dirs, sizeof(char *),
zend_get_hash_value, NULL, 0);
zend_hash_init(&mydata->virtual_dirs, sizeof(char *),
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
mydata->fname_len = fname_len;
snprintf(mydata->version, sizeof(mydata->version), "%s", PHP_PHAR_API_VERSION);
mydata->is_temporary_alias = alias ? 0 : 1;

View File

@@ -233,11 +233,11 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
myphar->is_persistent = PHAR_G(persist);
/* estimate number of entries, can't be certain with tar files */
zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12),
zend_get_hash_value, destroy_phar_manifest_entry, (bool)myphar->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, myphar->is_persistent);
zend_hash_init(&myphar->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
zend_get_hash_value, NULL, myphar->is_persistent);
zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11),
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
zend_get_hash_value, NULL, myphar->is_persistent);
myphar->is_tar = 1;
/* remember whether this entire phar was compressed with gz/bzip2 */
myphar->flags = compression;

View File

@@ -336,11 +336,11 @@ foundit:
php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET);
/* read in central directory */
zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count),
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
entry.phar = mydata;
entry.is_zip = 1;
entry.fp_type = PHAR_FP;