summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-10-12 19:18:03 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-10-12 23:10:13 +0200
commit8d4774a2df4e16679c9176e2b6edecc94283af6d (patch)
tree055eb6ee3fa5c45d0240a4f8673b82db5f5fd628 /ext/odbc/php_odbc.c
parent1c596ff1463a187d0fe135de251fb139b63858bd (diff)
downloadphp-git-8d4774a2df4e16679c9176e2b6edecc94283af6d.tar.gz
Change parameters types from int to bool
These are typical boolean parameters, so we shouldn't advertize them as integers. For the `$reverse` parameter that even fixes expectations, because the `reverse` member is a bitfield of 1 bit, so assigning any even integer would not set it. Closes GH-6328.
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index c24e57228f..3e4efb7380 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -2521,9 +2521,9 @@ PHP_FUNCTION(odbc_autocommit)
odbc_connection *conn;
RETCODE rc;
zval *pv_conn;
- zend_long pv_onoff = 0;
+ zend_bool pv_onoff = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_conn, &pv_onoff) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &pv_conn, &pv_onoff) == FAILURE) {
RETURN_THROWS();
}
@@ -2532,7 +2532,7 @@ PHP_FUNCTION(odbc_autocommit)
}
if (ZEND_NUM_ARGS() > 1) {
- rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, (pv_onoff) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF);
+ rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, pv_onoff ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
odbc_sql_error(conn, SQL_NULL_HSTMT, "Set autocommit");
RETURN_FALSE;