com php-src: fixed ext/dba: ext/dba/dba.c

From: Date: Fri, 13 Dec 2013 10:55:38 +0000
Subject: com php-src: fixed ext/dba: ext/dba/dba.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74406@lists.php.net to get a copy of this message
Commit: 73a7351a2ca486e5713f182c713b3eaf50e2d3bf Author: Anatol Belski <ab@php.net> Fri, 13 Dec 2013 02:55:38 -0800 Parents: 936124742b212687f12bddb4d21ea83aa5887cad Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=73a7351a2ca486e5713f182c713b3eaf50e2d3bf Log: fixed ext/dba Changed paths: M ext/dba/dba.c Diff: diff --git a/ext/dba/dba.c b/ext/dba/dba.c index ced90f0..940c1df 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -217,10 +217,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void **) &name, &pos); convert_to_string_ex(group); convert_to_string_ex(name); - if (Z_STRLEN_PP(group) == 0) { + if (Z_STRSIZE_PP(group) == 0) { *key_str = Z_STRVAL_PP(name); *key_free = NULL; - return Z_STRLEN_PP(name); + return Z_STRSIZE_PP(name); } len = spprintf(key_str, 0, "[%s]%s", Z_STRVAL_PP(group), Z_STRVAL_PP(name)); *key_free = *key_str; @@ -232,8 +232,8 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS zval_copy_ctor(&tmp); convert_to_string(&tmp); - *key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); - len = Z_STRLEN(tmp); + *key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRSIZE(tmp)); + len = Z_STRSIZE(tmp); zval_dtor(&tmp); return len; @@ -256,7 +256,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS zval *key; \ char *key_str, *key_free; \ size_t key_len; \ - long skip = 0; \ + php_int_t skip = 0; \ switch(ac) { \ case 2: \ if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \ @@ -264,7 +264,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS } \ break; \ case 3: \ - if (zend_parse_parameters(ac TSRMLS_CC, "zlr", &key, &skip, &id) == FAILURE) { \ + if (zend_parse_parameters(ac TSRMLS_CC, "zir", &key, &skip, &id) == FAILURE) { \ return; \ } \ break; \ @@ -551,16 +551,16 @@ PHP_MINFO_FUNCTION(dba) */ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) { - int val_len; + zend_str_size_int val_len; zval *id; dba_info *info = NULL; int ac = ZEND_NUM_ARGS(); zval *key; char *val; char *key_str, *key_free; - size_t key_len; + zend_str_size_size_t key_len; - if (zend_parse_parameters(ac TSRMLS_CC, "zsr", &key, &val, &val_len, &id) == FAILURE) { + if (zend_parse_parameters(ac TSRMLS_CC, "zSr", &key, &val, &val_len, &id) == FAILURE) { return; } @@ -619,7 +619,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; + zend_str_size_int keylen = 0; int i; int lock_mode, lock_flag, lock_dbf = 0; char *file_mode; @@ -642,7 +642,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* we only take string arguments */ for (i = 0; i < ac; i++) { convert_to_string_ex(args[i]); - keylen += Z_STRLEN_PP(args[i]); + keylen += Z_STRSIZE_PP(args[i]); } if (persistent) { @@ -654,8 +654,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) keylen = 0; for(i = 0; i < ac; i++) { - memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); - keylen += Z_STRLEN_PP(args[i]); + memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRSIZE_PP(args[i])); + keylen += Z_STRSIZE_PP(args[i]); } /* try to find if we already have this link in our persistent list */ @@ -1047,7 +1047,7 @@ PHP_FUNCTION(dba_key_split) { zval *zkey; char *key, *name; - int key_len; + zend_str_size_int key_len; if (ZEND_NUM_ARGS() != 1) { WRONG_PARAM_COUNT; @@ -1057,7 +1057,7 @@ PHP_FUNCTION(dba_key_split) RETURN_BOOL(0); } } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key, &key_len) == FAILURE) { RETURN_BOOL(0); } array_init(return_value); @@ -1227,7 +1227,7 @@ PHP_FUNCTION(dba_handlers) List opened databases */ PHP_FUNCTION(dba_list) { - ulong numitems, i; + php_uint_t numitems, i; zend_rsrc_list_entry *le; dba_info *info;

« previous php.cvs (#74406) next »