Skip to content

Commit a5f6165

Browse files
committed
ext/phar: use bool type instead of uint32_t
1 parent 75c1c32 commit a5f6165

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname
736736
uint32_t len;
737737
zend_long offset;
738738
size_t sig_len;
739-
bool register_alias = 0, temp_alias = 0;
739+
bool register_alias = false, temp_alias = false;
740740
char *signature = NULL;
741741
zend_string *str;
742742

ext/phar/phar_internal.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,21 +224,21 @@ typedef struct _phar_entry_info {
224224
/* for stat */
225225
unsigned short inode;
226226

227-
uint32_t is_crc_checked:1;
228-
uint32_t is_modified:1;
229-
uint32_t is_deleted:1;
230-
uint32_t is_dir:1;
227+
bool is_crc_checked:1;
228+
bool is_modified:1;
229+
bool is_deleted:1;
230+
bool is_dir:1;
231231
/* this flag is used for mounted entries (external files mapped to location
232232
inside a phar */
233-
uint32_t is_mounted:1;
233+
bool is_mounted:1;
234234
/* used when iterating */
235-
uint32_t is_temp_dir:1;
235+
bool is_temp_dir:1;
236236
/* tar-based phar file stuff */
237-
uint32_t is_tar:1;
237+
bool is_tar:1;
238238
/* zip-based phar file stuff */
239-
uint32_t is_zip:1;
239+
bool is_zip:1;
240240
/* for cached phar entries */
241-
uint32_t is_persistent:1;
241+
bool is_persistent:1;
242242
} phar_entry_info;
243243

244244
/* information about a phar file (the archive itself) */
@@ -270,20 +270,20 @@ struct _phar_archive_data {
270270
phar_metadata_tracker metadata_tracker;
271271
uint32_t phar_pos;
272272
/* if 1, then this alias was manually specified by the user and is not a permanent alias */
273-
uint32_t is_temporary_alias:1;
274-
uint32_t is_modified:1;
275-
uint32_t is_writeable:1;
276-
uint32_t is_brandnew:1;
273+
bool is_temporary_alias:1;
274+
bool is_modified:1;
275+
bool is_writeable:1;
276+
bool is_brandnew:1;
277277
/* defer phar creation */
278-
uint32_t donotflush:1;
278+
bool donotflush:1;
279279
/* zip-based phar variables */
280-
uint32_t is_zip:1;
280+
bool is_zip:1;
281281
/* tar-based phar variables */
282-
uint32_t is_tar:1;
282+
bool is_tar:1;
283283
/* PharData variables */
284-
uint32_t is_data:1;
284+
bool is_data:1;
285285
/* for cached phar manifests */
286-
uint32_t is_persistent:1;
286+
bool is_persistent:1;
287287
};
288288

289289
typedef struct _phar_entry_fp_info {

ext/phar/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si
12521252
phar_unixify_path_separators(path, path_len);
12531253
#endif
12541254

1255-
is_dir = (path_len && (path[path_len - 1] == '/')) ? true : false;
1255+
is_dir = path_len && (path[path_len - 1] == '/');
12561256

12571257
if (error) {
12581258
*error = NULL;

0 commit comments

Comments
 (0)