@@ -665,7 +665,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
665665 PGresult * pg_result ;
666666
667667 ZEND_PARSE_PARAMETERS_START (1 , 2 )
668- Z_PARAM_STRING (connstring , connstring_len )
668+ Z_PARAM_PATH (connstring , connstring_len )
669669 Z_PARAM_OPTIONAL
670670 Z_PARAM_LONG (connect_type )
671671 ZEND_PARSE_PARAMETERS_END ();
@@ -1123,7 +1123,7 @@ PHP_FUNCTION(pg_query)
11231123 zval * pgsql_link = NULL ;
11241124 char * query ;
11251125 size_t query_len ;
1126- int leftover = 0 ;
1126+ bool leftover = false ;
11271127 pgsql_link_handle * link ;
11281128 PGconn * pgsql ;
11291129 PGresult * pgsql_result ;
@@ -1157,7 +1157,7 @@ PHP_FUNCTION(pg_query)
11571157 }
11581158 while ((pgsql_result = PQgetResult (pgsql ))) {
11591159 PQclear (pgsql_result );
1160- leftover = 1 ;
1160+ leftover = true ;
11611161 }
11621162 if (leftover ) {
11631163 php_error_docref (NULL , E_NOTICE , "Found results on this connection. Use pg_get_result() to get these results first" );
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(pg_query_params)
12201220 zval * pv_param_arr , * tmp ;
12211221 char * query ;
12221222 size_t query_len ;
1223- int leftover = 0 ;
1223+ bool leftover = false ;
12241224 int num_params = 0 ;
12251225 char * * params = NULL ;
12261226 pgsql_link_handle * link ;
@@ -1259,7 +1259,7 @@ PHP_FUNCTION(pg_query_params)
12591259 }
12601260 while ((pgsql_result = PQgetResult (pgsql ))) {
12611261 PQclear (pgsql_result );
1262- leftover = 1 ;
1262+ leftover = true ;
12631263 }
12641264 if (leftover ) {
12651265 php_error_docref (NULL , E_NOTICE , "Found results on this connection. Use pg_get_result() to get these results first" );
@@ -1335,7 +1335,7 @@ PHP_FUNCTION(pg_prepare)
13351335 zval * pgsql_link = NULL ;
13361336 char * query , * stmtname ;
13371337 size_t query_len , stmtname_len ;
1338- int leftover = 0 ;
1338+ bool leftover = false ;
13391339 PGconn * pgsql ;
13401340 pgsql_link_handle * link ;
13411341 PGresult * pgsql_result ;
@@ -1372,7 +1372,7 @@ PHP_FUNCTION(pg_prepare)
13721372 }
13731373 while ((pgsql_result = PQgetResult (pgsql ))) {
13741374 PQclear (pgsql_result );
1375- leftover = 1 ;
1375+ leftover = true ;
13761376 }
13771377 if (leftover ) {
13781378 php_error_docref (NULL , E_NOTICE , "Found results on this connection. Use pg_get_result() to get these results first" );
@@ -1422,7 +1422,7 @@ PHP_FUNCTION(pg_execute)
14221422 zval * pv_param_arr , * tmp ;
14231423 char * stmtname ;
14241424 size_t stmtname_len ;
1425- int leftover = 0 ;
1425+ bool leftover = false ;
14261426 int num_params = 0 ;
14271427 char * * params = NULL ;
14281428 PGconn * pgsql ;
@@ -1461,7 +1461,7 @@ PHP_FUNCTION(pg_execute)
14611461 }
14621462 while ((pgsql_result = PQgetResult (pgsql ))) {
14631463 PQclear (pgsql_result );
1464- leftover = 1 ;
1464+ leftover = true ;
14651465 }
14661466 if (leftover ) {
14671467 php_error_docref (NULL , E_NOTICE , "Found results on this connection. Use pg_get_result() to get these results first" );
@@ -1690,7 +1690,7 @@ PHP_FUNCTION(pg_field_table)
16901690 zval * result ;
16911691 pgsql_result_handle * pg_result ;
16921692 zend_long fnum = -1 ;
1693- bool return_oid = 0 ;
1693+ bool return_oid = false ;
16941694
16951695 ZEND_PARSE_PARAMETERS_START (2 , 3 )
16961696 Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
@@ -2770,14 +2770,14 @@ PHP_FUNCTION(pg_lo_write)
27702770 zval * pgsql_id ;
27712771 zend_string * str ;
27722772 zend_long z_len ;
2773- bool z_len_is_null = 1 ;
2773+ bool z_len_is_null = true ;
27742774 size_t nbytes ;
27752775 size_t len ;
27762776 pgLofp * pgsql ;
27772777
27782778 ZEND_PARSE_PARAMETERS_START (2 , 3 )
27792779 Z_PARAM_OBJECT_OF_CLASS (pgsql_id , pgsql_lob_ce )
2780- Z_PARAM_STR (str )
2780+ Z_PARAM_PATH_STR (str )
27812781 Z_PARAM_OPTIONAL
27822782 Z_PARAM_LONG_OR_NULL (z_len , z_len_is_null )
27832783 ZEND_PARSE_PARAMETERS_END ();
@@ -3346,7 +3346,7 @@ PHP_FUNCTION(pg_copy_to)
33463346 switch (status ) {
33473347 case PGRES_COPY_OUT :
33483348 if (pgsql_result ) {
3349- int copydone = 0 ;
3349+ bool copydone = false ;
33503350
33513351 PQclear (pgsql_result );
33523352 array_init (return_value );
@@ -3355,7 +3355,7 @@ PHP_FUNCTION(pg_copy_to)
33553355 int ret = PQgetCopyData (pgsql , & csv , 0 );
33563356 switch (ret ) {
33573357 case -1 :
3358- copydone = 1 ;
3358+ copydone = true ;
33593359 break ;
33603360 case 0 :
33613361 case -2 :
@@ -4654,7 +4654,7 @@ PHP_FUNCTION(pg_meta_data)
46544654 zval * pgsql_link ;
46554655 pgsql_link_handle * link ;
46564656 zend_string * table_name ;
4657- bool extended = 0 ;
4657+ bool extended = false ;
46584658 PGconn * pgsql ;
46594659
46604660 ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -4832,7 +4832,7 @@ static zend_string *php_pgsql_add_quotes(zend_string *src)
48324832 /* if new_value is string "NULL" and field has default value, remove element to use default value */ \
48334833 if (!(opt & PGSQL_CONV_IGNORE_DEFAULT ) && Z_TYPE_P (has_default ) == IS_TRUE ) { \
48344834 zval_ptr_dtor (& new_val ); \
4835- skip_field = 1 ; \
4835+ skip_field = true ; \
48364836 } \
48374837 /* raise error if it's not null and cannot be ignored */ \
48384838 else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL ) && Z_TYPE_P (not_null ) == IS_TRUE ) { \
@@ -4848,7 +4848,8 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
48484848{
48494849 zend_string * field = NULL ;
48504850 zval meta , * def , * type , * not_null , * has_default , * is_enum , * val , new_val ;
4851- int err = 0 , skip_field ;
4851+ int err = 0 ;
4852+ bool skip_field ;
48524853 php_pgsql_data_type data_type ;
48534854
48544855 ZEND_ASSERT (pg_link != NULL );
@@ -4867,7 +4868,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
48674868 }
48684869
48694870 ZEND_HASH_FOREACH_STR_KEY_VAL (Z_ARRVAL_P (values ), field , val ) {
4870- skip_field = 0 ;
4871+ skip_field = false ;
48714872 ZVAL_DEREF (val );
48724873 ZVAL_NULL (& new_val );
48734874
@@ -6324,11 +6325,11 @@ PHP_FUNCTION(pg_close_stmt)
63246325
63256326 ZEND_PARSE_PARAMETERS_START (2 , 2 )
63266327 Z_PARAM_OBJECT_OF_CLASS (pgsql_link , pgsql_link_ce )
6327- Z_PARAM_STR (stmt )
6328+ Z_PARAM_PATH_STR (stmt )
63286329 ZEND_PARSE_PARAMETERS_END ();
63296330
63306331 if (ZSTR_LEN (stmt ) == 0 ) {
6331- zend_argument_value_error ( 2 , "cannot be empty" );
6332+ zend_argument_must_not_be_empty_error ( 2 );
63326333 RETURN_THROWS ();
63336334 }
63346335
0 commit comments