]> granicus.if.org Git - php/commitdiff
further data type fixes to ext/dba
authorAnatol Belski <ab@php.net>
Mon, 29 May 2017 08:14:47 +0000 (10:14 +0200)
committerAnatol Belski <ab@php.net>
Mon, 29 May 2017 08:17:43 +0000 (10:17 +0200)
ext/dba/dba.c
ext/dba/dba_cdb.c

index a9258631117f1c1e2ac8c9819ee4843ded7eedf1..5dd03e86d7a028212988aee77894c62467a5d225 100644 (file)
@@ -228,7 +228,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
                return len;
        } else {
                zval tmp;
-               int len;
+               size_t len;
 
                ZVAL_COPY(&tmp, key);
                convert_to_string(&tmp);
@@ -613,7 +613,7 @@ dba_info *php_dba_find(const char* path)
 {
        zend_resource *le;
        dba_info *info;
-       int numitems, i;
+       zend_long numitems, i;
 
        numitems = zend_hash_next_free_element(&EG(regular_list));
        for (i=1; i<numitems; i++) {
@@ -642,7 +642,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
        dba_info *info, *other;
        dba_handler *hptr;
        char *key = NULL, *error = NULL;
-       int keylen = 0;
+       size_t keylen = 0;
        int i;
        int lock_mode, lock_flag, lock_dbf = 0;
        char *file_mode;
index ce62bbe37519e7e89f8d30621ca12b5ab14c9778..969cc51a6e2c5f55f85a0f44fadb74f0e9579d2b 100644 (file)
@@ -225,12 +225,12 @@ DBA_DELETE_FUNC(cdb)
 /* {{{ cdb_file_lseek
  php_stream_seek does not return actual position */
 #if DBA_CDB_BUILTIN
-int cdb_file_lseek(php_stream *fp, off_t offset, int whence) {
+zend_off_t cdb_file_lseek(php_stream *fp, zend_off_t offset, int whence) {
        php_stream_seek(fp, offset, whence);
        return php_stream_tell(fp);
 }
 #else
-int cdb_file_lseek(int fd, off_t offset, int whence) {
+zend_off_t cdb_file_lseek(int fd, zend_off_t offset, int whence) {
        return lseek(fd, offset, whence);
 }
 #endif
@@ -238,7 +238,7 @@ int cdb_file_lseek(int fd, off_t offset, int whence) {
 
 #define CSEEK(n) do { \
        if (n >= cdb->eod) return NULL; \
-       if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET) != (off_t) n) return NULL; \
+       if (cdb_file_lseek(cdb->file, (zend_off_t)n, SEEK_SET) != (zend_off_t) n) return NULL; \
 } while (0)