Skip to content

Commit 63e534d

Browse files
authored
phar: Remove no-op bool casts (php#20227)
The field in this struct is already a bool.
1 parent a29c5d6 commit 63e534d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ext/phar/phar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,11 +1108,11 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname
11081108

11091109
/* set up our manifest */
11101110
zend_hash_init(&mydata->manifest, manifest_count,
1111-
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
1111+
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
11121112
zend_hash_init(&mydata->mounted_dirs, 5,
1113-
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
1113+
zend_get_hash_value, NULL, mydata->is_persistent);
11141114
zend_hash_init(&mydata->virtual_dirs, manifest_count * 2,
1115-
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
1115+
zend_get_hash_value, NULL, mydata->is_persistent);
11161116
mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent);
11171117
#ifdef PHP_WIN32
11181118
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
14511451
zend_hash_init(&mydata->mounted_dirs, sizeof(char *),
14521452
zend_get_hash_value, NULL, 0);
14531453
zend_hash_init(&mydata->virtual_dirs, sizeof(char *),
1454-
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
1454+
zend_get_hash_value, NULL, mydata->is_persistent);
14551455
mydata->fname_len = fname_len;
14561456
snprintf(mydata->version, sizeof(mydata->version), "%s", PHP_PHAR_API_VERSION);
14571457
mydata->is_temporary_alias = alias ? 0 : 1;

ext/phar/tar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
233233
myphar->is_persistent = PHAR_G(persist);
234234
/* estimate number of entries, can't be certain with tar files */
235235
zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12),
236-
zend_get_hash_value, destroy_phar_manifest_entry, (bool)myphar->is_persistent);
236+
zend_get_hash_value, destroy_phar_manifest_entry, myphar->is_persistent);
237237
zend_hash_init(&myphar->mounted_dirs, 5,
238-
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
238+
zend_get_hash_value, NULL, myphar->is_persistent);
239239
zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11),
240-
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
240+
zend_get_hash_value, NULL, myphar->is_persistent);
241241
myphar->is_tar = 1;
242242
/* remember whether this entire phar was compressed with gz/bzip2 */
243243
myphar->flags = compression;

ext/phar/zip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch
336336
php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET);
337337
/* read in central directory */
338338
zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count),
339-
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
339+
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
340340
zend_hash_init(&mydata->mounted_dirs, 5,
341-
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
341+
zend_get_hash_value, NULL, mydata->is_persistent);
342342
zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2,
343-
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
343+
zend_get_hash_value, NULL, mydata->is_persistent);
344344
entry.phar = mydata;
345345
entry.is_zip = 1;
346346
entry.fp_type = PHAR_FP;

0 commit comments

Comments
 (0)