Skip to content

Commit 3364f8b

Browse files
committed
Revert int to bool return type change
1 parent f7e01fa commit 3364f8b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ext/zip/php_zip.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ typedef struct {
335335
#endif
336336
} zip_options;
337337

338-
static bool php_zip_parse_options(HashTable *options, zip_options *opts)
338+
static int php_zip_parse_options(HashTable *options, zip_options *opts)
339339
/* {{{ */
340340
{
341341
zval *option;
@@ -384,7 +384,7 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
384384
if (Z_TYPE_P(option) != IS_STRING) {
385385
zend_type_error("Option \"enc_password\" must be of type string, %s given",
386386
zend_zval_type_name(option));
387-
return false;
387+
return -1;
388388
}
389389
opts->enc_password = Z_STRVAL_P(option);
390390
}
@@ -395,17 +395,17 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
395395
if (Z_TYPE_P(option) != IS_STRING) {
396396
zend_type_error("Option \"remove_path\" must be of type string, %s given",
397397
zend_zval_type_name(option));
398-
return false;
398+
return -1;
399399
}
400400

401401
if (Z_STRLEN_P(option) == 0) {
402402
zend_value_error("Option \"remove_path\" cannot be empty");
403-
return false;
403+
return -1;
404404
}
405405

406406
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
407407
zend_value_error("Option \"remove_path\" must be less than %d bytes", MAXPATHLEN - 1);
408-
return false;
408+
return -1;
409409
}
410410
opts->remove_path_len = Z_STRLEN_P(option);
411411
opts->remove_path = Z_STRVAL_P(option);
@@ -415,17 +415,17 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
415415
if (Z_TYPE_P(option) != IS_STRING) {
416416
zend_type_error("Option \"add_path\" must be of type string, %s given",
417417
zend_zval_type_name(option));
418-
return false;
418+
return -1;
419419
}
420420

421421
if (Z_STRLEN_P(option) == 0) {
422422
zend_value_error("Option \"add_path\" cannot be empty");
423-
return false;
423+
return -1;
424424
}
425425

426426
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
427427
zend_value_error("Option \"add_path\" must be less than %d bytes", MAXPATHLEN - 1);
428-
return false;
428+
return -1;
429429
}
430430
opts->add_path_len = Z_STRLEN_P(option);
431431
opts->add_path = Z_STRVAL_P(option);
@@ -435,12 +435,12 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
435435
if (Z_TYPE_P(option) != IS_LONG) {
436436
zend_type_error("Option \"flags\" must be of type int, %s given",
437437
zend_zval_type_name(option));
438-
return false;
438+
return -1;
439439
}
440440
opts->flags = Z_LVAL_P(option);
441441
}
442442

443-
return true;
443+
return 1;
444444
}
445445
/* }}} */
446446

@@ -1700,7 +1700,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
17001700
zend_argument_value_error(1, "cannot be empty");
17011701
RETURN_THROWS();
17021702
}
1703-
if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) == false)) {
1703+
if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) < 0)) {
17041704
RETURN_THROWS();
17051705
}
17061706

0 commit comments

Comments
 (0)