@@ -919,12 +919,12 @@ ZEND_FUNCTION(gmp_init)
919
919
}
920
920
/* }}} */
921
921
922
- int gmp_import_export_validate (zend_long size , zend_long options , int * order , int * endian )
922
+ static bool gmp_import_export_validate (zend_long size , zend_long options , int * order , int * endian )
923
923
{
924
924
if (size < 1 ) {
925
925
/* size argument is in second position */
926
926
zend_argument_value_error (2 , "must be greater than or equal to 1" );
927
- return FAILURE ;
927
+ return false ;
928
928
}
929
929
930
930
switch (options & (GMP_LSW_FIRST | GMP_MSW_FIRST )) {
@@ -936,9 +936,9 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
936
936
* order = 1 ;
937
937
break ;
938
938
default :
939
- /* options argument is in second position */
939
+ /* options argument is in third position */
940
940
zend_argument_value_error (3 , "cannot use multiple word order options" );
941
- return FAILURE ;
941
+ return false ;
942
942
}
943
943
944
944
switch (options & (GMP_LITTLE_ENDIAN | GMP_BIG_ENDIAN | GMP_NATIVE_ENDIAN )) {
@@ -953,12 +953,12 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
953
953
* endian = 0 ;
954
954
break ;
955
955
default :
956
- /* options argument is in second position */
956
+ /* options argument is in third position */
957
957
zend_argument_value_error (3 , "cannot use multiple endian options" );
958
- return FAILURE ;
958
+ return false ;
959
959
}
960
960
961
- return SUCCESS ;
961
+ return true ;
962
962
}
963
963
964
964
/* {{{ Imports a GMP number from a binary string */
@@ -975,7 +975,7 @@ ZEND_FUNCTION(gmp_import)
975
975
RETURN_THROWS ();
976
976
}
977
977
978
- if (gmp_import_export_validate (size , options , & order , & endian ) == FAILURE ) {
978
+ if (! gmp_import_export_validate (size , options , & order , & endian )) {
979
979
RETURN_THROWS ();
980
980
}
981
981
@@ -1004,7 +1004,7 @@ ZEND_FUNCTION(gmp_export)
1004
1004
RETURN_THROWS ();
1005
1005
}
1006
1006
1007
- if (gmp_import_export_validate (size , options , & order , & endian ) == FAILURE ) {
1007
+ if (! gmp_import_export_validate (size , options , & order , & endian )) {
1008
1008
RETURN_THROWS ();
1009
1009
}
1010
1010
0 commit comments