summaryrefslogtreecommitdiff
path: root/ext/dba
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-12-07 19:24:55 +0300
committerDmitry Stogov <dmitry@zend.com>2017-12-07 19:24:55 +0300
commit6a9d2b2190923bfbc7b7caa1462ba95965a1b991 (patch)
tree26d1695b07a29a873e5fcd74cd4af47c89454f78 /ext/dba
parentc890d469fab27500f0fa1070dccb16b36aa8be76 (diff)
downloadphp-git-6a9d2b2190923bfbc7b7caa1462ba95965a1b991.tar.gz
Cleanup type conversion
Diffstat (limited to 'ext/dba')
-rw-r--r--ext/dba/dba_db1.c3
-rw-r--r--ext/dba/dba_db2.c3
-rw-r--r--ext/dba/dba_db3.c3
-rw-r--r--ext/dba/dba_db4.c3
-rw-r--r--ext/dba/dba_dbm.c3
-rw-r--r--ext/dba/dba_gdbm.c3
-rw-r--r--ext/dba/dba_lmdb.c3
-rw-r--r--ext/dba/dba_ndbm.c3
8 files changed, 8 insertions, 16 deletions
diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c
index dd08041568..6cb374f848 100644
--- a/ext/dba/dba_db1.c
+++ b/ext/dba/dba_db1.c
@@ -51,8 +51,7 @@ DBA_OPEN_FUNC(db1)
int filemode = 0644;
if (info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
gmode = 0;
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index a688809998..43ce928b02 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -72,8 +72,7 @@ DBA_OPEN_FUNC(db2)
}
if (info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
if (db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 90db5a0a06..5a893f88b5 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -84,8 +84,7 @@ DBA_OPEN_FUNC(db3)
}
if (info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
#ifdef DB_FCNTL_LOCKING
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index 344515d820..a9d751269b 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -117,8 +117,7 @@ DBA_OPEN_FUNC(db4)
}
if (info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
if ((err=db_create(&dbp, NULL, 0)) == 0) {
diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c
index 3428b74905..ace1e32658 100644
--- a/ext/dba/dba_dbm.c
+++ b/ext/dba/dba_dbm.c
@@ -60,8 +60,7 @@ DBA_OPEN_FUNC(dbm)
int filemode = 0644;
if(info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
if(info->mode == DBA_TRUNC) {
diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c
index a45613426d..c21d3e0063 100644
--- a/ext/dba/dba_gdbm.c
+++ b/ext/dba/dba_gdbm.c
@@ -54,8 +54,7 @@ DBA_OPEN_FUNC(gdbm)
return FAILURE; /* not possible */
if(info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
diff --git a/ext/dba/dba_lmdb.c b/ext/dba/dba_lmdb.c
index 6f7d2da21b..de21e0239a 100644
--- a/ext/dba/dba_lmdb.c
+++ b/ext/dba/dba_lmdb.c
@@ -47,8 +47,7 @@ DBA_OPEN_FUNC(lmdb)
int rc, mode = 0644, flags = MDB_NOSUBDIR;
if(info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- mode = Z_LVAL(info->argv[0]);
+ mode = zval_get_long(&info->argv[0]);
/* TODO implement handling of the additional flags. */
}
diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c
index 3b3f16719a..474d3882df 100644
--- a/ext/dba/dba_ndbm.c
+++ b/ext/dba/dba_ndbm.c
@@ -59,8 +59,7 @@ DBA_OPEN_FUNC(ndbm)
}
if(info->argc > 0) {
- convert_to_long_ex(&info->argv[0]);
- filemode = Z_LVAL(info->argv[0]);
+ filemode = zval_get_long(&info->argv[0]);
}
dbf = dbm_open(info->path, gmode, filemode);