@@ -665,7 +665,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
665
665
PGresult * pg_result ;
666
666
667
667
ZEND_PARSE_PARAMETERS_START (1 , 2 )
668
- Z_PARAM_STRING (connstring , connstring_len )
668
+ Z_PARAM_PATH (connstring , connstring_len )
669
669
Z_PARAM_OPTIONAL
670
670
Z_PARAM_LONG (connect_type )
671
671
ZEND_PARSE_PARAMETERS_END ();
@@ -1123,7 +1123,7 @@ PHP_FUNCTION(pg_query)
1123
1123
zval * pgsql_link = NULL ;
1124
1124
char * query ;
1125
1125
size_t query_len ;
1126
- int leftover = 0 ;
1126
+ bool leftover = false ;
1127
1127
pgsql_link_handle * link ;
1128
1128
PGconn * pgsql ;
1129
1129
PGresult * pgsql_result ;
@@ -1157,7 +1157,7 @@ PHP_FUNCTION(pg_query)
1157
1157
}
1158
1158
while ((pgsql_result = PQgetResult (pgsql ))) {
1159
1159
PQclear (pgsql_result );
1160
- leftover = 1 ;
1160
+ leftover = true ;
1161
1161
}
1162
1162
if (leftover ) {
1163
1163
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)
1220
1220
zval * pv_param_arr , * tmp ;
1221
1221
char * query ;
1222
1222
size_t query_len ;
1223
- int leftover = 0 ;
1223
+ bool leftover = false ;
1224
1224
int num_params = 0 ;
1225
1225
char * * params = NULL ;
1226
1226
pgsql_link_handle * link ;
@@ -1259,7 +1259,7 @@ PHP_FUNCTION(pg_query_params)
1259
1259
}
1260
1260
while ((pgsql_result = PQgetResult (pgsql ))) {
1261
1261
PQclear (pgsql_result );
1262
- leftover = 1 ;
1262
+ leftover = true ;
1263
1263
}
1264
1264
if (leftover ) {
1265
1265
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)
1335
1335
zval * pgsql_link = NULL ;
1336
1336
char * query , * stmtname ;
1337
1337
size_t query_len , stmtname_len ;
1338
- int leftover = 0 ;
1338
+ bool leftover = false ;
1339
1339
PGconn * pgsql ;
1340
1340
pgsql_link_handle * link ;
1341
1341
PGresult * pgsql_result ;
@@ -1372,7 +1372,7 @@ PHP_FUNCTION(pg_prepare)
1372
1372
}
1373
1373
while ((pgsql_result = PQgetResult (pgsql ))) {
1374
1374
PQclear (pgsql_result );
1375
- leftover = 1 ;
1375
+ leftover = true ;
1376
1376
}
1377
1377
if (leftover ) {
1378
1378
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)
1422
1422
zval * pv_param_arr , * tmp ;
1423
1423
char * stmtname ;
1424
1424
size_t stmtname_len ;
1425
- int leftover = 0 ;
1425
+ bool leftover = false ;
1426
1426
int num_params = 0 ;
1427
1427
char * * params = NULL ;
1428
1428
PGconn * pgsql ;
@@ -1461,7 +1461,7 @@ PHP_FUNCTION(pg_execute)
1461
1461
}
1462
1462
while ((pgsql_result = PQgetResult (pgsql ))) {
1463
1463
PQclear (pgsql_result );
1464
- leftover = 1 ;
1464
+ leftover = true ;
1465
1465
}
1466
1466
if (leftover ) {
1467
1467
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)
1690
1690
zval * result ;
1691
1691
pgsql_result_handle * pg_result ;
1692
1692
zend_long fnum = -1 ;
1693
- bool return_oid = 0 ;
1693
+ bool return_oid = false ;
1694
1694
1695
1695
ZEND_PARSE_PARAMETERS_START (2 , 3 )
1696
1696
Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
@@ -2770,14 +2770,14 @@ PHP_FUNCTION(pg_lo_write)
2770
2770
zval * pgsql_id ;
2771
2771
zend_string * str ;
2772
2772
zend_long z_len ;
2773
- bool z_len_is_null = 1 ;
2773
+ bool z_len_is_null = true ;
2774
2774
size_t nbytes ;
2775
2775
size_t len ;
2776
2776
pgLofp * pgsql ;
2777
2777
2778
2778
ZEND_PARSE_PARAMETERS_START (2 , 3 )
2779
2779
Z_PARAM_OBJECT_OF_CLASS (pgsql_id , pgsql_lob_ce )
2780
- Z_PARAM_STR (str )
2780
+ Z_PARAM_PATH_STR (str )
2781
2781
Z_PARAM_OPTIONAL
2782
2782
Z_PARAM_LONG_OR_NULL (z_len , z_len_is_null )
2783
2783
ZEND_PARSE_PARAMETERS_END ();
@@ -3346,7 +3346,7 @@ PHP_FUNCTION(pg_copy_to)
3346
3346
switch (status ) {
3347
3347
case PGRES_COPY_OUT :
3348
3348
if (pgsql_result ) {
3349
- int copydone = 0 ;
3349
+ bool copydone = false ;
3350
3350
3351
3351
PQclear (pgsql_result );
3352
3352
array_init (return_value );
@@ -3355,7 +3355,7 @@ PHP_FUNCTION(pg_copy_to)
3355
3355
int ret = PQgetCopyData (pgsql , & csv , 0 );
3356
3356
switch (ret ) {
3357
3357
case -1 :
3358
- copydone = 1 ;
3358
+ copydone = true ;
3359
3359
break ;
3360
3360
case 0 :
3361
3361
case -2 :
@@ -4654,7 +4654,7 @@ PHP_FUNCTION(pg_meta_data)
4654
4654
zval * pgsql_link ;
4655
4655
pgsql_link_handle * link ;
4656
4656
zend_string * table_name ;
4657
- bool extended = 0 ;
4657
+ bool extended = false ;
4658
4658
PGconn * pgsql ;
4659
4659
4660
4660
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -4832,7 +4832,7 @@ static zend_string *php_pgsql_add_quotes(zend_string *src)
4832
4832
/* if new_value is string "NULL" and field has default value, remove element to use default value */ \
4833
4833
if (!(opt & PGSQL_CONV_IGNORE_DEFAULT ) && Z_TYPE_P (has_default ) == IS_TRUE ) { \
4834
4834
zval_ptr_dtor (& new_val ); \
4835
- skip_field = 1 ; \
4835
+ skip_field = true ; \
4836
4836
} \
4837
4837
/* raise error if it's not null and cannot be ignored */ \
4838
4838
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 *
4848
4848
{
4849
4849
zend_string * field = NULL ;
4850
4850
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 ;
4852
4853
php_pgsql_data_type data_type ;
4853
4854
4854
4855
ZEND_ASSERT (pg_link != NULL );
@@ -4867,7 +4868,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
4867
4868
}
4868
4869
4869
4870
ZEND_HASH_FOREACH_STR_KEY_VAL (Z_ARRVAL_P (values ), field , val ) {
4870
- skip_field = 0 ;
4871
+ skip_field = false ;
4871
4872
ZVAL_DEREF (val );
4872
4873
ZVAL_NULL (& new_val );
4873
4874
@@ -6324,11 +6325,11 @@ PHP_FUNCTION(pg_close_stmt)
6324
6325
6325
6326
ZEND_PARSE_PARAMETERS_START (2 , 2 )
6326
6327
Z_PARAM_OBJECT_OF_CLASS (pgsql_link , pgsql_link_ce )
6327
- Z_PARAM_STR (stmt )
6328
+ Z_PARAM_PATH_STR (stmt )
6328
6329
ZEND_PARSE_PARAMETERS_END ();
6329
6330
6330
6331
if (ZSTR_LEN (stmt ) == 0 ) {
6331
- zend_argument_value_error ( 2 , "cannot be empty" );
6332
+ zend_argument_must_not_be_empty_error ( 2 );
6332
6333
RETURN_THROWS ();
6333
6334
}
6334
6335
0 commit comments