summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-27 15:31:48 +0200
committerAnatol Belski <ab@php.net>2014-08-27 20:49:31 +0200
commit3234480827b27ff5d3469a732167afd289632a96 (patch)
tree485ed0c4f5d35107a65ab193f3bc7c27806fbfca /ext
parentee552b628c2d9f9455ac85d7791b4b4e8e4ddeb2 (diff)
downloadphp-git-3234480827b27ff5d3469a732167afd289632a96.tar.gz
first show to make 's' work with size_t
Diffstat (limited to 'ext')
-rw-r--r--ext/bcmath/bcmath.c16
-rw-r--r--ext/bz2/bz2.c4
-rw-r--r--ext/com_dotnet/com_com.c8
-rw-r--r--ext/com_dotnet/com_dotnet.c2
-rw-r--r--ext/com_dotnet/com_olechar.c4
-rw-r--r--ext/com_dotnet/com_persist.c6
-rw-r--r--ext/com_dotnet/com_typeinfo.c7
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h4
-rw-r--r--ext/curl/curl_file.c4
-rw-r--r--ext/curl/interface.c4
-rw-r--r--ext/date/php_date.c21
-rw-r--r--ext/date/php_date.h2
-rw-r--r--ext/dba/dba.c4
-rw-r--r--ext/dom/attr.c2
-rw-r--r--ext/dom/cdatasection.c2
-rw-r--r--ext/dom/characterdata.c2
-rw-r--r--ext/dom/comment.c2
-rw-r--r--ext/dom/document.c16
-rw-r--r--ext/dom/documentfragment.c2
-rw-r--r--ext/dom/domimplementation.c8
-rw-r--r--ext/dom/element.c10
-rw-r--r--ext/dom/entityreference.c2
-rw-r--r--ext/dom/namednodemap.c6
-rw-r--r--ext/dom/node.c11
-rw-r--r--ext/dom/processinginstruction.c3
-rw-r--r--ext/dom/text.c2
-rw-r--r--ext/dom/xpath.c4
-rw-r--r--ext/enchant/enchant.c18
-rw-r--r--ext/ereg/ereg.c6
-rw-r--r--ext/exif/exif.c4
-rw-r--r--ext/fileinfo/fileinfo.c4
-rw-r--r--ext/filter/filter.c3
-rw-r--r--ext/ftp/php_ftp.c28
-rw-r--r--ext/gd/gd.c11
-rw-r--r--ext/gd/gd_ctx.c2
-rw-r--r--ext/gettext/gettext.c8
-rw-r--r--ext/hash/hash.c15
-rw-r--r--ext/hash/hash_md.c2
-rw-r--r--ext/hash/hash_sha.c2
-rw-r--r--ext/iconv/iconv.c16
-rw-r--r--ext/interbase/ibase_blobs.c6
-rw-r--r--ext/interbase/ibase_query.c2
-rw-r--r--ext/interbase/ibase_service.c4
-rw-r--r--ext/interbase/interbase.c4
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.cpp4
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp2
-rw-r--r--ext/intl/calendar/calendar_methods.cpp6
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.cpp2
-rw-r--r--ext/intl/collator/collator_compare.c4
-rw-r--r--ext/intl/collator/collator_create.c2
-rw-r--r--ext/intl/collator/collator_sort.c2
-rw-r--r--ext/intl/converter/converter.c8
-rw-r--r--ext/intl/dateformat/dateformat_attr.c2
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp4
-rw-r--r--ext/intl/dateformat/dateformat_format_object.cpp2
-rw-r--r--ext/intl/dateformat/dateformat_parse.c2
-rw-r--r--ext/intl/formatter/formatter_attr.c2
-rw-r--r--ext/intl/formatter/formatter_format.c2
-rw-r--r--ext/intl/formatter/formatter_main.c2
-rw-r--r--ext/intl/formatter/formatter_parse.c4
-rw-r--r--ext/intl/grapheme/grapheme_string.c2
-rw-r--r--ext/intl/locale/locale_methods.c14
-rw-r--r--ext/intl/msgformat/msgformat.c2
-rw-r--r--ext/intl/msgformat/msgformat_attr.c2
-rw-r--r--ext/intl/msgformat/msgformat_format.c4
-rw-r--r--ext/intl/msgformat/msgformat_parse.c8
-rw-r--r--ext/intl/normalizer/normalizer_normalize.c2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c4
-rw-r--r--ext/intl/spoofchecker/spoofchecker_main.c6
-rw-r--r--ext/intl/timezone/timezone_methods.cpp14
-rw-r--r--ext/intl/transliterator/transliterator_methods.c4
-rw-r--r--ext/json/json.c4
-rw-r--r--ext/ldap/ldap.c17
-rw-r--r--ext/mbstring/mbstring.c33
-rw-r--r--ext/mbstring/php_mbregex.c24
-rw-r--r--ext/mcrypt/mcrypt.c18
-rw-r--r--ext/mysql/php_mysql.c16
-rw-r--r--ext/mysqli/mysqli.c2
-rw-r--r--ext/mysqli/mysqli_api.c16
-rw-r--r--ext/mysqli/mysqli_nonapi.c10
-rw-r--r--ext/odbc/birdstep.c4
-rw-r--r--ext/odbc/php_odbc.c16
-rw-r--r--ext/opcache/zend_accelerator_module.c6
-rwxr-xr-xext/openssl/openssl.c80
-rw-r--r--ext/pcntl/pcntl.c2
-rw-r--r--ext/pcre/php_pcre.c4
-rw-r--r--ext/pdo/pdo_dbh.c16
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c12
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c6
-rw-r--r--ext/pgsql/pgsql.c42
-rw-r--r--ext/phar/func_interceptors.c16
-rwxr-xr-xext/phar/phar_object.c18
-rw-r--r--ext/posix/posix.c12
-rw-r--r--ext/pspell/pspell.c20
-rw-r--r--ext/readline/readline.c12
-rw-r--r--ext/recode/recode.c2
-rw-r--r--ext/reflection/php_reflection.c6
-rw-r--r--ext/session/mod_user_class.c2
-rw-r--r--ext/session/session.c7
-rw-r--r--ext/shmop/shmop.c2
-rw-r--r--ext/simplexml/simplexml.c22
-rw-r--r--ext/skeleton/skeleton.c2
-rw-r--r--ext/snmp/snmp.c8
-rw-r--r--ext/soap/soap.c18
-rw-r--r--ext/sockets/sockets.c4
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_directory.c12
-rw-r--r--ext/spl/spl_directory.h2
-rw-r--r--ext/spl/spl_dllist.c2
-rw-r--r--ext/spl/spl_iterators.c4
-rw-r--r--ext/spl/spl_observer.c2
-rw-r--r--ext/sqlite3/sqlite3.c12
-rw-r--r--ext/standard/assert.c3
-rw-r--r--ext/standard/base64.c4
-rw-r--r--ext/standard/basic_functions.c31
-rw-r--r--ext/standard/browscap.c2
-rw-r--r--ext/standard/crc32.c2
-rw-r--r--ext/standard/crypt.c2
-rw-r--r--ext/standard/cyr_convert.c2
-rw-r--r--ext/standard/datetime.c4
-rw-r--r--ext/standard/dir.c12
-rw-r--r--ext/standard/dl.c2
-rw-r--r--ext/standard/dns.c10
-rw-r--r--ext/standard/dns_win32.c6
-rw-r--r--ext/standard/exec.c6
-rw-r--r--ext/standard/file.c35
-rw-r--r--ext/standard/filestat.c12
-rw-r--r--ext/standard/fsock.c2
-rw-r--r--ext/standard/ftok.c2
-rw-r--r--ext/standard/head.c2
-rw-r--r--ext/standard/html.c4
-rw-r--r--ext/standard/http.c2
-rw-r--r--ext/standard/image.c2
-rw-r--r--ext/standard/info.c2
-rw-r--r--ext/standard/iptc.c4
-rw-r--r--ext/standard/levenshtein.c2
-rw-r--r--ext/standard/link.c6
-rw-r--r--ext/standard/link_win32.c8
-rw-r--r--ext/standard/mail.c14
-rw-r--r--ext/standard/math.c2
-rw-r--r--ext/standard/md5.c2
-rw-r--r--ext/standard/password.c6
-rw-r--r--ext/standard/proc_open.c2
-rw-r--r--ext/standard/sha1.c2
-rw-r--r--ext/standard/soundex.c2
-rw-r--r--ext/standard/streamsfuncs.c14
-rw-r--r--ext/standard/string.c111
-rw-r--r--ext/standard/syslog.c4
-rw-r--r--ext/standard/type.c2
-rw-r--r--ext/standard/uniqid.c3
-rw-r--r--ext/standard/url.c2
-rw-r--r--ext/standard/user_filters.c2
-rw-r--r--ext/standard/var.c2
-rw-r--r--ext/standard/versioning.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.c2
-rw-r--r--ext/tidy/tidy.c16
-rw-r--r--ext/wddx/wddx.c2
-rw-r--r--ext/xml/xml.c8
-rw-r--r--ext/xmlreader/php_xmlreader.c10
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c12
-rw-r--r--ext/xmlwriter/php_xmlwriter.c47
-rw-r--r--ext/xsl/xsltprocessor.c7
-rw-r--r--ext/zip/php_zip.c20
-rw-r--r--ext/zlib/zlib.c10
164 files changed, 710 insertions, 685 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index a6775c8c84..51bb0597f2 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -208,7 +208,7 @@ PHP_FUNCTION(bcadd)
char *left, *right;
zend_long scale_param = 0;
bc_num first, second, result;
- int left_len, right_len;
+ size_t left_len, right_len;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
@@ -243,7 +243,7 @@ PHP_FUNCTION(bcadd)
PHP_FUNCTION(bcsub)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
@@ -280,7 +280,7 @@ PHP_FUNCTION(bcsub)
PHP_FUNCTION(bcmul)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
@@ -317,7 +317,7 @@ PHP_FUNCTION(bcmul)
PHP_FUNCTION(bcdiv)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
@@ -360,7 +360,7 @@ PHP_FUNCTION(bcdiv)
PHP_FUNCTION(bcmod)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
bc_num first, second, result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &left, &left_len, &right, &right_len) == FAILURE) {
@@ -394,7 +394,7 @@ PHP_FUNCTION(bcmod)
PHP_FUNCTION(bcpowmod)
{
char *left, *right, *modulous;
- int left_len, right_len, modulous_len;
+ size_t left_len, right_len, modulous_len;
bc_num first, second, mod, result;
zend_long scale = BCG(bc_precision);
int scale_int;
@@ -435,7 +435,7 @@ PHP_FUNCTION(bcpowmod)
PHP_FUNCTION(bcpow)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
@@ -507,7 +507,7 @@ PHP_FUNCTION(bcsqrt)
PHP_FUNCTION(bccomp)
{
char *left, *right;
- int left_len, right_len;
+ size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index b2e8f40760..4bfebce706 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -377,7 +377,7 @@ static PHP_FUNCTION(bzopen)
{
zval *file; /* The file to open */
char *mode; /* The mode to open the stream with */
- int mode_len;
+ size_t mode_len;
BZFILE *bz; /* The compressed file stream */
php_stream *stream = NULL;
@@ -497,7 +497,7 @@ static PHP_FUNCTION(bzcompress)
block_size = 4, /* Block size for compression algorithm */
work_factor = 0, /* Work factor for compression algorithm */
argc; /* Argument count */
- int source_len; /* Length of the source data */
+ size_t source_len; /* Length of the source data */
unsigned int dest_len; /* Length of the destination buffer */
argc = ZEND_NUM_ARGS();
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 002ee7a507..7590ad43c5 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance)
php_com_dotnet_object *obj;
char *module_name, *typelib_name = NULL, *server_name = NULL;
char *user_name = NULL, *domain_name = NULL, *password = NULL;
- int module_name_len, typelib_name_len, server_name_len,
+ size_t module_name_len, typelib_name_len, server_name_len,
user_name_len, domain_name_len, password_len;
OLECHAR *moniker;
CLSID clsid;
@@ -349,7 +349,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
if (silent == 0 && FAILED(hr)) {
char *source = NULL, *desc = NULL, *msg = NULL;
- int source_len, desc_len;
+ size_t source_len, desc_len;
switch (hr) {
case DISP_E_EXCEPTION:
@@ -416,7 +416,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
/* map an ID to a name */
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- int namelen, DISPID *dispid TSRMLS_DC)
+ size_t namelen, DISPID *dispid TSRMLS_DC)
{
OLECHAR *olename;
HRESULT hr;
@@ -750,7 +750,7 @@ PHP_FUNCTION(com_print_typeinfo)
zval *arg1;
char *ifacename = NULL;
char *typelibname = NULL;
- int ifacelen;
+ size_t ifacelen;
zend_bool wantsink = 0;
php_com_dotnet_object *obj = NULL;
ITypeInfo *typeinfo;
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index 9698fb3419..eb13ba8ccd 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -188,7 +188,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
zval *object = getThis();
php_com_dotnet_object *obj;
char *assembly_name, *datatype_name;
- int assembly_name_len, datatype_name_len;
+ size_t assembly_name_len, datatype_name_len;
struct dotnet_runtime_stuff *stuff;
OLECHAR *oleassembly, *oletype;
BSTR oleassembly_sys, oletype_sys;
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index bf42b4fffb..d12120f54f 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
-PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t string_len, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -71,7 +71,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
return olestring;
}
-PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage TSRMLS_DC)
{
char *string;
uint length = 0;
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 0b496404f4..a1c2f77661 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -349,7 +349,7 @@ CPH_METHOD(GetCurFileName)
res = IPersistFile_GetCurFile(helper->ipf, &olename);
if (res == S_OK) {
- int len;
+ size_t len;
char *str = php_com_olestring_to_string(olename,
&len, helper->codepage TSRMLS_CC);
RETVAL_STRINGL(str, len);
@@ -375,7 +375,7 @@ CPH_METHOD(SaveToFile)
{
HRESULT res;
char *filename, *fullpath = NULL;
- int filename_len;
+ size_t filename_len;
zend_bool remember = TRUE;
OLECHAR *olefilename = NULL;
CPH_FETCH();
@@ -438,7 +438,7 @@ CPH_METHOD(LoadFromFile)
{
HRESULT res;
char *filename, *fullpath;
- int filename_len;
+ size_t filename_len;
zend_long flags = 0;
OLECHAR *olefilename;
CPH_FETCH();
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index b32c4b2600..eefa28dd3a 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -164,7 +164,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
zend_constant c;
zval *exists, results, value;
char *const_name;
- int len;
+ size_t len;
if (TL == NULL) {
return FAILURE;
@@ -437,7 +437,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
int i;
OLECHAR *olename;
char *ansiname = NULL;
- unsigned int ansinamelen;
+ size_t ansinamelen;
int ret = 0;
if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) {
@@ -491,7 +491,8 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
if (printdef) {
int j;
char *funcdesc;
- unsigned int funcdesclen, cnames = 0;
+ size_t funcdesclen;
+ unsigned int cnames = 0;
BSTR *names;
names = (BSTR*)safe_emalloc((func->cParams + 1), sizeof(BSTR), 0);
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index b893523748..f153883006 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -87,9 +87,9 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
- uint *string_len, int codepage TSRMLS_DC);
+ size_t *string_len, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
- uint string_len, int codepage TSRMLS_DC);
+ size_t string_len, int codepage TSRMLS_DC);
/* com_com.c */
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index f48480593c..8e66445fb5 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -32,7 +32,7 @@ PHP_CURL_API zend_class_entry *curl_CURLFile_class;
static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
{
char *fname = NULL, *mime = NULL, *postname = NULL;
- int fname_len, mime_len, postname_len;
+ size_t fname_len, mime_len, postname_len;
zval *cf = return_value;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
@@ -83,7 +83,7 @@ static void curlfile_get_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
static void curlfile_set_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
{
char *arg = NULL;
- int arg_len;
+ size_t arg_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index de6bd3b6f1..d3e26bfe17 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1852,7 +1852,7 @@ PHP_FUNCTION(curl_init)
php_curl *ch;
CURL *cp;
char *url = NULL;
- int url_len = 0;
+ size_t url_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
return;
@@ -3314,7 +3314,7 @@ PHP_FUNCTION(curl_reset)
PHP_FUNCTION(curl_escape)
{
char *str = NULL, *res = NULL;
- int str_len = 0;
+ size_t str_len = 0;
zval *zid;
php_curl *ch;
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 94470ca919..0e43a33c73 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1055,7 +1055,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
/* }}} */
/* {{{ date_format - (gm)date helper */
-static zend_string *date_format(char *format, int format_len, timelib_time *t, int localtime TSRMLS_DC)
+static zend_string *date_format(char *format, size_t format_len, timelib_time *t, size_t localtime TSRMLS_DC)
{
smart_str string = {0};
int i, length = 0;
@@ -1216,7 +1216,7 @@ static zend_string *date_format(char *format, int format_len, timelib_time *t, i
static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
{
char *format;
- int format_len;
+ size_t format_len;
zend_long ts;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
@@ -1440,7 +1440,8 @@ PHPAPI zend_long php_parse_date(char *string, zend_long *now)
PHP_FUNCTION(strtotime)
{
char *times, *initial_ts;
- int time_len, error1, error2;
+ size_t time_len;
+ int error1, error2;
struct timelib_error_container *error;
zend_long preset_ts = 0, ts;
@@ -2503,7 +2504,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
DATEG(last_errors) = last_errors;
} /* }}} */
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC) /* {{{ */
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, size_t ctor TSRMLS_DC) /* {{{ */
{
timelib_time *now;
timelib_tzinfo *tzi = NULL;
@@ -2641,7 +2642,7 @@ PHP_FUNCTION(date_create_from_format)
{
zval *timezone_object = NULL;
char *time_str = NULL, *format_str = NULL;
- int time_str_len = 0, format_str_len = 0;
+ size_t time_str_len = 0, format_str_len = 0;
zval datetime_object;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
@@ -2979,7 +2980,7 @@ void php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAMETERS, timelib_time *
PHP_FUNCTION(date_parse)
{
char *date;
- int date_len;
+ size_t date_len;
struct timelib_error_container *error;
timelib_time *parsed_time;
@@ -3781,7 +3782,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
{
char *abbr;
char *tzid;
- int abbr_len;
+ size_t abbr_len;
zend_long gmtoffset = -1;
zend_long isdst = -1;
@@ -4336,7 +4337,7 @@ PHP_METHOD(DatePeriod, __construct)
zval *start, *end = NULL, *interval;
zend_long recurrences = 0, options = 0;
char *isostr = NULL;
- int isostr_len = 0;
+ size_t isostr_len = 0;
timelib_time *clone;
zend_error_handling error_handling;
@@ -4439,7 +4440,7 @@ PHP_FUNCTION(timezone_identifiers_list)
int i, item_count;
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
char *option = NULL;
- int option_len = 0;
+ size_t option_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &what, &option, &option_len) == FAILURE) {
RETURN_FALSE;
@@ -4521,7 +4522,7 @@ PHP_FUNCTION(timezone_abbreviations_list)
PHP_FUNCTION(date_default_timezone_set)
{
char *zone;
- int zone_len;
+ size_t zone_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) {
RETURN_FALSE;
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 1d4ea16a2d..0290bb8823 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -222,7 +222,7 @@ PHPAPI zend_class_entry *php_date_get_timezone_ce(void);
/* Functions for creating DateTime objects, and initializing them from a string */
PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC);
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, size_t ctor TSRMLS_DC);
#endif /* PHP_DATE_H */
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 68751ed6d0..6bb98e24b5 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -551,7 +551,7 @@ PHP_MINFO_FUNCTION(dba)
*/
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
- int val_len;
+ size_t val_len;
zval *id;
dba_info *info = NULL;
int ac = ZEND_NUM_ARGS();
@@ -1054,7 +1054,7 @@ PHP_FUNCTION(dba_key_split)
{
zval *zkey;
char *key, *name;
- int key_len;
+ size_t key_len;
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 4cd4414691..61e1f9675e 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -60,7 +60,7 @@ PHP_METHOD(domattr, __construct)
xmlNodePtr oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
- int name_len, value_len, name_valid;
+ size_t name_len, value_len, name_valid;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index a2f0589464..a126cec573 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -54,7 +54,7 @@ PHP_METHOD(domcdatasection, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *value = NULL;
- int value_len;
+ size_t value_len;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index ccae33ab74..ab407f2caa 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -205,7 +205,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
xmlNode *nodep;
dom_object *intern;
char *arg;
- int arg_len;
+ size_t arg_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
return;
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 0670337651..050c3abf70 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -54,7 +54,7 @@ PHP_METHOD(domcomment, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *value = NULL;
- int value_len;
+ size_t value_len;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 944d55c20b..f305d58e30 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -697,7 +697,8 @@ PHP_FUNCTION(dom_document_create_element)
xmlNode *node;
xmlDocPtr docp;
dom_object *intern;
- int ret, name_len, value_len;
+ int ret;
+ size_t name_len, value_len;
char *name, *value = NULL;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
@@ -756,7 +757,8 @@ PHP_FUNCTION(dom_document_create_text_node)
zval *id;
xmlNode *node;
xmlDocPtr docp;
- int ret, value_len;
+ int ret;
+ size_t value_len;
dom_object *intern;
char *value;
@@ -941,7 +943,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
{
zval *id;
xmlDocPtr docp;
- int name_len;
+ size_t name_len;
dom_object *intern, *namednode;
char *name;
xmlChar *local;
@@ -1150,7 +1152,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
{
zval *id;
xmlDocPtr docp;
- int uri_len, name_len;
+ size_t uri_len, name_len;
dom_object *intern, *namednode;
char *uri, *name;
xmlChar *local, *nsuri;
@@ -1247,7 +1249,7 @@ PHP_METHOD(domdocument, __construct)
xmlDoc *docp = NULL, *olddoc;
dom_object *intern;
char *encoding, *version = NULL;
- int encoding_len = 0, version_len = 0, refcount;
+ size_t encoding_len = 0, version_len = 0, refcount;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
@@ -1341,7 +1343,7 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
}
/* }}} */
-static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int source_len, int options TSRMLS_DC) /* {{{ */
+static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options TSRMLS_DC) /* {{{ */
{
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
@@ -1543,7 +1545,7 @@ PHP_FUNCTION(dom_document_save)
{
zval *id;
xmlDoc *docp;
- int file_len = 0, bytes, format, saveempty = 0;
+ size_t file_len = 0, bytes, format, saveempty = 0;
dom_object *intern;
dom_doc_propsptr doc_props;
char *file;
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index f20ada3db4..a93b30620c 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -122,7 +122,7 @@ PHP_METHOD(domdocumentfragment, appendXML) {
xmlNode *nodep;
dom_object *intern;
char *data = NULL;
- int data_len = 0;
+ size_t data_len = 0;
int err;
xmlNodePtr lst;
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index 8cdd0fe28b..8614c8b1d9 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -70,7 +70,7 @@ Since:
*/
PHP_METHOD(domimplementation, hasFeature)
{
- int feature_len, version_len;
+ size_t feature_len, version_len;
char *feature, *version;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &feature, &feature_len, &version, &version_len) == FAILURE) {
@@ -92,7 +92,8 @@ Since: DOM Level 2
PHP_METHOD(domimplementation, createDocumentType)
{
xmlDtd *doctype;
- int ret, name_len = 0, publicid_len = 0, systemid_len = 0;
+ int ret;
+ size_t name_len = 0, publicid_len = 0, systemid_len = 0;
char *name = NULL, *publicid = NULL, *systemid = NULL;
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
xmlURIPtr uri;
@@ -155,7 +156,8 @@ PHP_METHOD(domimplementation, createDocument)
xmlNode *nodep;
xmlDtdPtr doctype = NULL;
xmlNsPtr nsptr = NULL;
- int ret, uri_len = 0, name_len = 0, errorcode = 0;
+ int ret, errorcode = 0;
+ size_t uri_len = 0, name_len = 0;
char *uri = NULL, *name = NULL;
char *prefix = NULL, *localname = NULL;
dom_object *doctobj;
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 5ecf031c4c..47ba6a31e0 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -160,7 +160,8 @@ PHP_METHOD(domelement, __construct)
char *name, *value = NULL, *uri = NULL;
char *localname = NULL, *prefix = NULL;
int errorcode = 0, uri_len = 0;
- int name_len, value_len = 0, name_valid;
+ size_t name_len, value_len = 0;
+ int name_valid;
xmlNsPtr nsptr = NULL;
zend_error_handling error_handling;
@@ -370,7 +371,8 @@ PHP_FUNCTION(dom_element_set_attribute)
zval *id;
xmlNode *nodep;
xmlNodePtr attr = NULL;
- int ret, name_len, value_len, name_valid;
+ int ret, name_valid;
+ size_t name_len, value_len;
dom_object *intern;
char *name, *value;
@@ -660,7 +662,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
xmlNodePtr elemp;
xmlNsPtr nsptr;
dom_object *intern;
- int uri_len = 0, name_len = 0;
+ size_t uri_len = 0, name_len = 0;
char *uri, *name;
xmlChar *strattr;
@@ -740,7 +742,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
xmlNodePtr elemp, nodep = NULL;
xmlNsPtr nsptr;
xmlAttr *attr;
- int uri_len = 0, name_len = 0, value_len = 0;
+ size_t uri_len = 0, name_len = 0, value_len = 0;
char *uri, *name, *value;
char *localname = NULL, *prefix = NULL;
dom_object *intern;
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index bc03385116..c9e7500719 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -53,7 +53,7 @@ PHP_METHOD(domentityreference, __construct)
xmlNodePtr oldnode = NULL;
dom_object *intern;
char *name;
- int name_len, name_valid;
+ size_t name_len, name_valid;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index bae0b28ec2..39eab7ccdb 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -126,7 +126,8 @@ Since:
PHP_FUNCTION(dom_namednodemap_get_named_item)
{
zval *id;
- int ret, namedlen=0;
+ int ret;
+ size_t namedlen=0;
dom_object *intern;
xmlNodePtr itemnode = NULL;
char *named;
@@ -258,7 +259,8 @@ Since: DOM Level 2
PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
{
zval *id;
- int ret, namedlen=0, urilen=0;
+ int ret;
+ size_t namedlen=0, urilen=0;
dom_object *intern;
xmlNodePtr itemnode = NULL;
char *uri, *named;
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 32880ee7d9..6821348e07 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1413,7 +1413,7 @@ Since: DOM Level 2
PHP_FUNCTION(dom_node_is_supported)
{
zval *id;
- int feature_len, version_len;
+ size_t feature_len, version_len;
char *feature, *version;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
@@ -1501,7 +1501,7 @@ PHP_FUNCTION(dom_node_lookup_prefix)
xmlNodePtr nodep, lookupp = NULL;
dom_object *intern;
xmlNsPtr nsptr;
- int uri_len = 0;
+ size_t uri_len = 0;
char *uri;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
xmlNodePtr nodep;
dom_object *intern;
xmlNsPtr nsptr;
- int uri_len = 0;
+ size_t uri_len = 0;
char *uri;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
@@ -1584,7 +1584,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
xmlNodePtr nodep;
dom_object *intern;
xmlNsPtr nsptr;
- int prefix_len = 0;
+ size_t prefix_len = 0;
char *prefix=NULL;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
@@ -1659,7 +1659,8 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
zend_bool exclusive=0, with_comments=0;
xmlChar **inclusive_ns_prefixes = NULL;
char *file = NULL;
- int ret = -1, file_len = 0;
+ int ret = -1;
+ size_t file_len = 0;
xmlOutputBufferPtr buf;
xmlXPathContextPtr ctxp=NULL;
xmlXPathObjectPtr xpathobjp=NULL;
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index c46b1bf244..78929214ec 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -54,7 +54,8 @@ PHP_METHOD(domprocessinginstruction, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
- int name_len, value_len, name_valid;
+ size_t name_len, value_len;
+ int name_valid;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 9940dbf8d0..2cbb1c7da3 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -69,7 +69,7 @@ PHP_METHOD(domtext, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *value = NULL;
- int value_len;
+ size_t value_len;
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 549411d768..7a7f7a81e1 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -319,7 +319,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
{
zval *id;
xmlXPathContextPtr ctxp;
- int prefix_len, ns_uri_len;
+ size_t prefix_len, ns_uri_len;
dom_xpath_object *intern;
unsigned char *prefix, *ns_uri;
@@ -357,7 +357,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
xmlXPathContextPtr ctxp;
xmlNodePtr nodep = NULL;
xmlXPathObjectPtr xpathobjp;
- int expr_len, nsnbr = 0, xpath_type;
+ size_t expr_len, nsnbr = 0, xpath_type;
dom_xpath_object *intern;
dom_object *nodeobj;
char *expr;
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 28b8d1a15b..dacb8904bf 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -424,7 +424,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
enchant_broker *pbroker;
zend_long dict_type;
char *value;
- int value_len;
+ size_t value_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
RETURN_FALSE;
@@ -583,7 +583,7 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
enchant_dict *dict;
EnchantDict *d;
char *pwl;
- int pwllen;
+ size_t pwllen;
int pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
@@ -713,7 +713,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
{
zval *dict, *sugg = NULL;
char *word;
- int wordlen;
+ size_t wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
@@ -759,7 +759,7 @@ PHP_FUNCTION(enchant_dict_check)
{
zval *dict;
char *word;
- int wordlen;
+ size_t wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
@@ -778,7 +778,7 @@ PHP_FUNCTION(enchant_dict_suggest)
{
zval *dict;
char *word;
- int wordlen;
+ size_t wordlen;
char **suggs;
enchant_dict *pdict;
int n_sugg;
@@ -811,7 +811,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
{
zval *dict;
char *word;
- int wordlen;
+ size_t wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
@@ -830,7 +830,7 @@ PHP_FUNCTION(enchant_dict_add_to_session)
{
zval *dict;
char *word;
- int wordlen;
+ size_t wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
@@ -849,7 +849,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
{
zval *dict;
char *word;
- int wordlen;
+ size_t wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
@@ -871,7 +871,7 @@ PHP_FUNCTION(enchant_dict_store_replacement)
{
zval *dict;
char *mis, *cor;
- int mislen, corlen;
+ size_t mislen, corlen;
enchant_dict *pdict;
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 31416b2585..c1d92ba4e7 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -294,7 +294,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
zval *regex, /* Regular expression */
*array = NULL; /* Optional register array */
char *findin; /* String to apply expression to */
- int findin_len;
+ size_t findin_len;
regex_t re;
regmatch_t *subs;
int err, match_len, string_len;
@@ -634,7 +634,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
regex_t re;
regmatch_t subs[1];
char *spliton, *str, *strp, *endp;
- int spliton_len, str_len;
+ size_t spliton_len, str_len;
int err, size, copts = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
@@ -733,7 +733,7 @@ PHP_FUNCTION(spliti)
PHP_EREG_API PHP_FUNCTION(sql_regcase)
{
char *string, *tmp;
- int string_len;
+ size_t string_len;
unsigned char c;
register int i, j;
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 6438623525..7db1de1a36 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3912,7 +3912,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
PHP_FUNCTION(exif_read_data)
{
char *p_name, *p_sections_needed = NULL;
- int p_name_len, p_sections_needed_len = 0;
+ size_t p_name_len, p_sections_needed_len = 0;
zend_bool sub_arrays=0, read_thumbnail=0, read_all=0;
int i, ret, sections_needed=0;
@@ -4154,7 +4154,7 @@ PHP_FUNCTION(exif_thumbnail)
PHP_FUNCTION(exif_imagetype)
{
char *imagefile;
- int imagefile_len;
+ size_t imagefile_len;
php_stream * stream;
int itype = 0;
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index db309de181..17edd2d40c 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -297,7 +297,7 @@ PHP_FUNCTION(finfo_open)
{
zend_long options = MAGIC_NONE;
char *file = NULL;
- int file_len = 0;
+ size_t file_len = 0;
php_fileinfo *finfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
@@ -414,7 +414,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
{
zend_long options = 0;
char *ret_val = NULL, *buffer = NULL;
- int buffer_len;
+ size_t buffer_len;
php_fileinfo *finfo = NULL;
zval *zfinfo, *zcontext = NULL;
zval *what;
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index e5e9be249d..e53e84f855 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -870,7 +870,8 @@ PHP_FUNCTION(filter_list)
* Returns the filter ID belonging to a named filter */
PHP_FUNCTION(filter_id)
{
- int i, filter_len;
+ int i;
+ size_t filter_len;
int size = sizeof(filter_list) / sizeof(filter_list_entry);
char *filter;
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 19fee1ffaa..e74541ef50 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -343,7 +343,7 @@ PHP_FUNCTION(ftp_connect)
{
ftpbuf_t *ftp;
char *host;
- int host_len;
+ size_t host_len;
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
@@ -379,7 +379,7 @@ PHP_FUNCTION(ftp_ssl_connect)
{
ftpbuf_t *ftp;
char *host;
- int host_len;
+ size_t host_len;
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
@@ -484,7 +484,7 @@ PHP_FUNCTION(ftp_chdir)
zval *z_ftp;
ftpbuf_t *ftp;
char *dir;
- int dir_len;
+ size_t dir_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
@@ -509,7 +509,7 @@ PHP_FUNCTION(ftp_exec)
zval *z_ftp;
ftpbuf_t *ftp;
char *cmd;
- int cmd_len;
+ size_t cmd_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
@@ -534,7 +534,7 @@ PHP_FUNCTION(ftp_raw)
zval *z_ftp;
ftpbuf_t *ftp;
char *cmd;
- int cmd_len;
+ size_t cmd_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
@@ -605,7 +605,7 @@ PHP_FUNCTION(ftp_chmod)
zval *z_ftp;
ftpbuf_t *ftp;
char *filename;
- int filename_len;
+ size_t filename_len;
zend_long mode;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
@@ -741,7 +741,7 @@ PHP_FUNCTION(ftp_fget)
ftptype_t xtype;
php_stream *stream;
char *file;
- int file_len;
+ size_t file_len;
zend_long mode, resumepos=0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
@@ -785,7 +785,7 @@ PHP_FUNCTION(ftp_nb_fget)
ftptype_t xtype;
php_stream *stream;
char *file;
- int file_len;
+ size_t file_len;
zend_long mode, resumepos=0, ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
@@ -855,7 +855,7 @@ PHP_FUNCTION(ftp_get)
ftptype_t xtype;
php_stream *outstream;
char *local, *remote;
- int local_len, remote_len;
+ size_t local_len, remote_len;
zend_long mode, resumepos=0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
@@ -1024,7 +1024,7 @@ PHP_FUNCTION(ftp_fput)
zval *z_ftp, *z_file;
ftpbuf_t *ftp;
ftptype_t xtype;
- int remote_len;
+ size_t remote_len;
zend_long mode, startpos=0;
php_stream *stream;
char *remote;
@@ -1236,7 +1236,7 @@ PHP_FUNCTION(ftp_size)
zval *z_ftp;
ftpbuf_t *ftp;
char *file;
- int file_len;
+ size_t file_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
@@ -1256,7 +1256,7 @@ PHP_FUNCTION(ftp_mdtm)
zval *z_ftp;
ftpbuf_t *ftp;
char *file;
- int file_len;
+ size_t file_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
@@ -1276,7 +1276,7 @@ PHP_FUNCTION(ftp_rename)
zval *z_ftp;
ftpbuf_t *ftp;
char *src, *dest;
- int src_len, dest_len;
+ size_t src_len, dest_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) {
return;
@@ -1301,7 +1301,7 @@ PHP_FUNCTION(ftp_delete)
zval *z_ftp;
ftpbuf_t *ftp;
char *file;
- int file_len;
+ size_t file_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
return;
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 0aeffc137b..5f84a48c2f 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -2343,7 +2343,7 @@ PHP_FUNCTION(imagecreatefromstring)
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)())
{
char *file;
- int file_len;
+ size_t file_len;
zend_long srcx, srcy, width, height;
gdImagePtr im = NULL;
php_stream *stream;
@@ -3514,7 +3514,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
zval *IM;
zend_long SIZE, X, Y, COL;
char *C;
- int C_len;
+ size_t C_len;
gdImagePtr im;
int ch = 0, col, x, y, size, i, l = 0;
unsigned char *str = NULL;
@@ -3805,7 +3805,8 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
zval *IM, *EXT = NULL;
gdImagePtr im=NULL;
zend_long col = -1, x = -1, y = -1;
- int str_len, fontname_len, i, brect[8];
+ size_t str_len, fontname_len;
+ int i, brect[8];
double ptsize, angle;
char *str = NULL, *fontname = NULL;
char *error = NULL;
@@ -4022,7 +4023,7 @@ PHP_FUNCTION(imagepsencodefont)
{
zval *fnt;
char *enc, **enc_vector;
- int enc_len, *f_ind;
+ size_t enc_len, *f_ind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
@@ -4422,7 +4423,7 @@ static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold
static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
{
char *f_org, *f_dest;
- int f_org_len, f_dest_len;
+ size_t f_org_len, f_dest_len;
zend_long height, width, threshold;
gdImagePtr im_org, im_dest, im_tmp;
char *fn_org = NULL;
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 972d4f337c..5c378ffb0f 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -78,7 +78,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
{
zval *imgind;
char *file = NULL;
- int file_len = 0;
+ size_t file_len = 0;
zend_long quality, basefilter;
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index fa3032d4d8..8466349578 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -162,7 +162,7 @@ PHP_MINFO_FUNCTION(php_gettext)
PHP_NAMED_FUNCTION(zif_textdomain)
{
char *domain, *domain_name, *retval;
- int domain_len;
+ size_t domain_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &domain, &domain_len) == FAILURE) {
return;
@@ -187,7 +187,7 @@ PHP_NAMED_FUNCTION(zif_textdomain)
PHP_NAMED_FUNCTION(zif_gettext)
{
char *msgid, *msgstr;
- int msgid_len;
+ size_t msgid_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &msgid, &msgid_len) == FAILURE) {
return;
@@ -280,7 +280,7 @@ PHP_NAMED_FUNCTION(zif_bindtextdomain)
PHP_NAMED_FUNCTION(zif_ngettext)
{
char *msgid1, *msgid2, *msgstr;
- int msgid1_len, msgid2_len;
+ size_t msgid1_len, msgid2_len;
zend_long count;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
@@ -360,7 +360,7 @@ PHP_NAMED_FUNCTION(zif_dcngettext)
PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset)
{
char *domain, *codeset, *retval = NULL;
- int domain_len, codeset_len;
+ size_t domain_len, codeset_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &codeset, &codeset_len) == FAILURE) {
return;
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index b78f979130..4bf5fa6f7e 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -86,7 +86,7 @@ static struct mhash_bc_entry mhash_to_hash[MHASH_NUM_ALGOS] = {
/* Hash Registry Access */
-PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, int algo_len) /* {{{ */
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t algo_len) /* {{{ */
{
char *lower = zend_str_tolower_dup(algo, algo_len);
php_hash_ops *ops = zend_hash_str_find_ptr(&php_hash_hashtable, lower, algo_len);
@@ -211,7 +211,7 @@ static inline void php_hash_string_xor(unsigned char *out, const unsigned char *
}
}
-static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const int key_len) {
+static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const size_t key_len) {
memset(K, 0, ops->block_size);
if (key_len > ops->block_size) {
/* Reduce the key first */
@@ -396,7 +396,7 @@ PHP_FUNCTION(hash_update)
zval *zhash;
php_hash_data *hash;
char *data;
- int data_len;
+ size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zhash, &data, &data_len) == FAILURE) {
return;
@@ -456,7 +456,7 @@ PHP_FUNCTION(hash_update_file)
php_stream_context *context;
php_stream *stream;
char *filename, buf[1024];
- int filename_len, n;
+ size_t filename_len, n;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
return;
@@ -602,8 +602,9 @@ PHP_FUNCTION(hash_pbkdf2)
zend_string *returnval;
char *algo, *salt, *pass = NULL;
unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL;
- zend_long loops, i, j, algo_len, pass_len, iterations, length = 0, digest_length = 0;
- int salt_len = 0;
+ zend_long loops, i, j, iterations, digest_length = 0;
+ size_t algo_len, pass_len, length = 0;
+ size_t salt_len = 0;
zend_bool raw_output = 0;
const php_hash_ops *ops;
void *context;
@@ -920,7 +921,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
zend_long algorithm, l_bytes;
int bytes;
char *password, *salt;
- int password_len, salt_len;
+ size_t password_len, salt_len;
char padded_salt[SALT_SIZE];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index ebd357d2f7..92f97ee506 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -106,7 +106,7 @@ PHP_HASH_API void make_digest(char *md5str, unsigned char *digest)
PHP_NAMED_FUNCTION(php_if_md5)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_bool raw_output = 0;
char md5str[33];
PHP_MD5_CTX context;
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index f39567e6dd..d60a7a9780 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -89,7 +89,7 @@ PHP_HASH_API void make_sha1_digest(char *sha1str, unsigned char *digest)
PHP_FUNCTION(sha1)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_bool raw_output = 0;
char sha1str[41];
PHP_SHA1_CTX context;
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 9a64c99cb9..8af9991f5d 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -2034,7 +2034,7 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
PHP_FUNCTION(iconv_strlen)
{
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_string *str;
php_iconv_err_t err;
@@ -2066,7 +2066,7 @@ PHP_FUNCTION(iconv_strlen)
PHP_FUNCTION(iconv_substr)
{
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_string *str;
zend_long offset, length = 0;
@@ -2105,7 +2105,7 @@ PHP_FUNCTION(iconv_substr)
PHP_FUNCTION(iconv_strpos)
{
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
zend_long offset = 0;
@@ -2151,7 +2151,7 @@ PHP_FUNCTION(iconv_strpos)
PHP_FUNCTION(iconv_strrpos)
{
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2304,7 +2304,7 @@ PHP_FUNCTION(iconv_mime_decode)
{
zend_string *encoded_str;
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_long mode = 0;
smart_str retval = {0};
@@ -2344,7 +2344,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
{
zend_string *encoded_str;
char *charset = get_internal_encoding(TSRMLS_C);
- int charset_len = 0;
+ size_t charset_len = 0;
zend_long mode = 0;
char *enc_str_tmp;
size_t enc_str_len_tmp;
@@ -2442,7 +2442,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
{
char *in_charset, *out_charset;
zend_string *in_buffer;
- int in_charset_len = 0, out_charset_len = 0;
+ size_t in_charset_len = 0, out_charset_len = 0;
php_iconv_err_t err;
zend_string *out_buffer;
@@ -2473,7 +2473,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
PHP_FUNCTION(iconv_set_encoding)
{
char *type, *charset;
- int type_len, charset_len = 0, retval;
+ size_t type_len, charset_len = 0, retval;
zend_string *name;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &type, &type_len, &charset, &charset_len) == FAILURE)
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c
index 8b8d731d7b..b188e54e4f 100644
--- a/ext/interbase/ibase_blobs.c
+++ b/ext/interbase/ibase_blobs.c
@@ -239,7 +239,7 @@ PHP_FUNCTION(ibase_blob_create)
PHP_FUNCTION(ibase_blob_open)
{
char *blob_id;
- int blob_id_len;
+ size_t blob_id_len;
zval *link = NULL;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
@@ -406,7 +406,7 @@ PHP_FUNCTION(ibase_blob_cancel)
PHP_FUNCTION(ibase_blob_info)
{
char *blob_id;
- int blob_id_len;
+ size_t blob_id_len;
zval *link = NULL;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
@@ -482,7 +482,7 @@ PHP_FUNCTION(ibase_blob_info)
PHP_FUNCTION(ibase_blob_echo)
{
char *blob_id;
- int blob_id_len;
+ size_t blob_id_len;
zval *link = NULL;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 1899e5aae1..10d77449dc 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1735,7 +1735,7 @@ PHP_FUNCTION(ibase_prepare)
zval *link_arg, *trans_arg;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
- int query_len, trans_res_id = 0;
+ size_t query_len, trans_res_id = 0;
ibase_query *ib_query;
char *query;
diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c
index 95f068e7ff..bdbec7d5b0 100644
--- a/ext/interbase/ibase_service.c
+++ b/ext/interbase/ibase_service.c
@@ -208,7 +208,7 @@ PHP_FUNCTION(ibase_delete_user)
Connect to the service manager */
PHP_FUNCTION(ibase_service_attach)
{
- int hlen, ulen, plen, spb_len;
+ size_t hlen, ulen, plen, spb_len;
ibase_service *svm;
char buf[128], *host, *user, *pass, *loc;
isc_svc_handle handle = NULL;
@@ -425,7 +425,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
*/
zval *res;
char *db, *bk, buf[200];
- int dblen, bklen, spb_len;
+ size_t dblen, bklen, spb_len;
long opts = 0;
zend_bool verbose = 0;
ibase_service *svm;
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index c6c108f377..41d960ccb2 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -464,7 +464,7 @@ ZEND_GET_MODULE(ibase)
#endif
/* True globals, no need for thread safety */
-int le_link, le_plink, le_trans;
+size_t le_link, le_plink, le_trans;
/* }}} */
@@ -1425,7 +1425,7 @@ PHP_FUNCTION(ibase_gen_id)
{
zval *link = NULL;
char query[128], *generator;
- int gen_len;
+ size_t gen_len;
long inc = 1;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp
index af380e44fd..cb5f669d05 100644
--- a/ext/intl/breakiterator/breakiterator_methods.cpp
+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
@@ -46,7 +46,7 @@ static void _breakiter_factory(const char *func_name,
{
BreakIterator *biter;
const char *locale_str = NULL;
- int dummy;
+ size_t dummy;
char *msg;
UErrorCode status = UErrorCode();
intl_error_reset(NULL TSRMLS_CC);
@@ -149,7 +149,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text)
U_CFUNC PHP_FUNCTION(breakiter_set_text)
{
char *text;
- int text_len;
+ size_t text_len;
UText *ut = NULL;
zval *textzv;
BREAKITER_METHOD_INIT_VARS;
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index 098f8ab3cc..74bebb2db2 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -33,7 +33,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
{
zval *object = getThis();
char *rules;
- int rules_len;
+ size_t rules_len;
zend_bool compiled = 0;
UErrorCode status = U_ZERO_ERROR;
intl_error_reset(NULL TSRMLS_CC);
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 0d808f36fd..168c791d36 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -51,7 +51,7 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance)
{
zval *zv_timezone = NULL;
const char *locale_str = NULL;
- int dummy;
+ size_t dummy;
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
intl_error_reset(NULL TSRMLS_CC);
@@ -143,7 +143,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
UErrorCode status = U_ZERO_ERROR;
char *key,
*locale;
- int key_len,
+ size_t key_len,
locale_len;
zend_bool commonly_used;
intl_error_reset(NULL TSRMLS_CC);
@@ -1144,7 +1144,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
zv_timestamp;
php_date_obj *datetime;
char *locale_str = NULL;
- int locale_str_len;
+ size_t locale_str_len;
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
Calendar *cal;
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index 9c243502fe..790a0519cd 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -42,7 +42,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
zval args_a[6] = {0},
*args = &args_a[0];
char *locale = NULL;
- int locale_len;
+ size_t locale_len;
zend_long largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c
index 4384558ac6..444b1fc4fd 100644
--- a/ext/intl/collator/collator_compare.c
+++ b/ext/intl/collator/collator_compare.c
@@ -33,8 +33,8 @@ PHP_FUNCTION( collator_compare )
{
char* str1 = NULL;
char* str2 = NULL;
- int str1_len = 0;
- int str2_len = 0;
+ size_t str1_len = 0;
+ size_t str2_len = 0;
UChar* ustr1 = NULL;
UChar* ustr2 = NULL;
diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c
index 5801a68d0d..a1b2aa743a 100644
--- a/ext/intl/collator/collator_create.c
+++ b/ext/intl/collator/collator_create.c
@@ -28,7 +28,7 @@
static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
{
const char* locale;
- int locale_len = 0;
+ size_t locale_len = 0;
zval* object;
Collator_object* co;
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index dcf5d09e11..1ec72e3a73 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -536,7 +536,7 @@ PHP_FUNCTION( collator_asort )
PHP_FUNCTION( collator_get_sort_key )
{
char* str = NULL;
- int str_len = 0;
+ size_t str_len = 0;
UChar* ustr = NULL;
int ustr_len = 0;
uint8_t* key = NULL;
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index 24e9789fc0..f00dd003ec 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -562,9 +562,9 @@ ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, __construct) {
php_converter_object *objval = CONV_GET(getThis());
char *src = "utf-8";
- int src_len = sizeof("utf-8") - 1;
+ size_t src_len = sizeof("utf-8") - 1;
char *dest = src;
- int dest_len = src_len;
+ size_t dest_len = src_len;
intl_error_reset(NULL TSRMLS_CC);
@@ -763,7 +763,7 @@ ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, convert) {
php_converter_object *objval = CONV_GET(getThis());
char *str, *dest;
- int str_len, dest_len;
+ size_t str_len, dest_len;
zend_bool reverse = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
@@ -924,7 +924,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 0
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getAliases) {
char *name;
- int name_len;
+ size_t name_len;
UErrorCode error = U_ZERO_ERROR;
uint16_t i, count;
diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c
index b2f34b9c24..0450ef1c37 100644
--- a/ext/intl/dateformat/dateformat_attr.c
+++ b/ext/intl/dateformat/dateformat_attr.c
@@ -128,7 +128,7 @@ PHP_FUNCTION( datefmt_get_pattern )
PHP_FUNCTION( datefmt_set_pattern )
{
char* value = NULL;
- int value_len = 0;
+ size_t value_len = 0;
int slength = 0;
UChar* svalue = NULL;
zend_bool is_pattern_localized =FALSE;
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index 67b61bd067..97997554a5 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -41,7 +41,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval *object;
const char *locale_str;
- int locale_len = 0;
+ size_t locale_len = 0;
Locale locale;
zend_long date_type = 0;
zend_long time_type = 0;
@@ -53,7 +53,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
TimeZone *timezone = NULL;
bool explicit_tz;
char* pattern_str = NULL;
- int pattern_str_len = 0;
+ size_t pattern_str_len = 0;
UChar* svalue = NULL; /* UTF-16 pattern_str */
int slength = 0;
IntlDateFormatter_object* dfo;
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp
index 564867f017..2b431383ff 100644
--- a/ext/intl/dateformat/dateformat_format_object.cpp
+++ b/ext/intl/dateformat/dateformat_format_object.cpp
@@ -63,7 +63,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
zval *object,
*format = NULL;
const char *locale_str = NULL;
- int locale_len;
+ size_t locale_len;
bool pattern = false;
UDate date;
TimeZone *timeZone = NULL;
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 628379e3b3..3b3eea031a 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -128,7 +128,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
PHP_FUNCTION(datefmt_parse)
{
char* text_to_parse = NULL;
- int32_t text_len =0;
+ size_t text_len =0;
zval* z_parse_pos = NULL;
int32_t parse_pos = -1;
diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c
index a4810b5e8c..66575696d2 100644
--- a/ext/intl/formatter/formatter_attr.c
+++ b/ext/intl/formatter/formatter_attr.c
@@ -299,7 +299,7 @@ PHP_FUNCTION( numfmt_set_symbol )
{
zend_long symbol;
char* value = NULL;
- int value_len = 0;
+ size_t value_len = 0;
UChar* svalue = 0;
int slength = 0;
FORMATTER_METHOD_INIT_VARS;
diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c
index c8d221c7ee..1382b88d74 100644
--- a/ext/intl/formatter/formatter_format.c
+++ b/ext/intl/formatter/formatter_format.c
@@ -141,7 +141,7 @@ PHP_FUNCTION( numfmt_format_currency )
UChar* formatted = format_buf;
int formatted_len = USIZE(format_buf);
char* currency = NULL;
- int currency_len = 0;
+ size_t currency_len = 0;
UChar* scurrency = NULL;
int scurrency_len = 0;
FORMATTER_METHOD_INIT_VARS;
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c
index 5e790999e4..f7ac1b789f 100644
--- a/ext/intl/formatter/formatter_main.c
+++ b/ext/intl/formatter/formatter_main.c
@@ -29,7 +29,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
{
const char* locale;
char* pattern = NULL;
- int locale_len = 0, pattern_len = 0;
+ size_t locale_len = 0, pattern_len = 0;
zend_long style;
UChar* spattern = NULL;
int spattern_len = 0;
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 4c17a645cc..a84eecb2a9 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -40,7 +40,7 @@ PHP_FUNCTION( numfmt_parse )
UChar* sstr = NULL;
int sstr_len = 0;
char* str = NULL;
- int str_len;
+ size_t str_len;
int32_t val32, position = 0;
int64_t val64;
double val_double;
@@ -132,7 +132,7 @@ PHP_FUNCTION( numfmt_parse_currency )
char *currency_str = NULL;
int currency_len = 0;
char *str;
- int str_len;
+ size_t str_len;
int32_t* position_p = NULL;
int32_t position = 0;
zval *zcurrency, *zposition = NULL;
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index f8dc9895e5..5808bef47e 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -50,7 +50,7 @@ void grapheme_register_constants( INIT_FUNC_ARGS )
}
/* }}} */
-/* {{{ proto int grapheme_strlen(string str)
+/* {{{ proto size_t grapheme_strlen(string str)
Get number of graphemes in a string */
PHP_FUNCTION(grapheme_strlen)
{
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index f1821a6ada..bbecda8c28 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -373,7 +373,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
{
const char* loc_name = NULL;
- int loc_name_len = 0;
+ size_t loc_name_len = 0;
char* tag_value = NULL;
char* empty_result = "";
@@ -471,10 +471,10 @@ PHP_FUNCTION(locale_get_primary_language )
static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
{
const char* loc_name = NULL;
- int loc_name_len = 0;
+ size_t loc_name_len = 0;
const char* disp_loc_name = NULL;
- int disp_loc_name_len = 0;
+ size_t disp_loc_name_len = 0;
int free_loc_name = 0;
UChar* disp_name = NULL;
@@ -1238,9 +1238,9 @@ static int strToMatch(const char* str ,char *retstr)
PHP_FUNCTION(locale_filter_matches)
{
char* lang_tag = NULL;
- int lang_tag_len = 0;
+ size_t lang_tag_len = 0;
const char* loc_range = NULL;
- int loc_range_len = 0;
+ size_t loc_range_len = 0;
int result = 0;
char* token = 0;
@@ -1529,7 +1529,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
PHP_FUNCTION(locale_lookup)
{
char* fallback_loc = NULL;
- int fallback_loc_len = 0;
+ size_t fallback_loc_len = 0;
const char* loc_range = NULL;
int loc_range_len = 0;
@@ -1582,7 +1582,7 @@ PHP_FUNCTION(locale_accept_from_http)
{
UEnumeration *available;
char *http_accept = NULL;
- int http_accept_len;
+ size_t http_accept_len;
UErrorCode status = 0;
int len;
char resultLocale[INTL_MAX_LOCALE_LEN+1];
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index b9f6c7a369..b42d87967e 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -30,7 +30,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
{
const char* locale;
char* pattern;
- int locale_len = 0, pattern_len = 0;
+ size_t locale_len = 0, pattern_len = 0;
UChar* spattern = NULL;
int spattern_len = 0;
zval* object;
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index a306fc4421..9359b796c3 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -62,7 +62,7 @@ PHP_FUNCTION( msgfmt_get_pattern )
PHP_FUNCTION( msgfmt_set_pattern )
{
char* value = NULL;
- int value_len = 0;
+ size_t value_len = 0;
int spattern_len = 0;
UChar* spattern = NULL;
MSG_FORMAT_METHOD_INIT_VARS;
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index e661c3c17f..cb81137316 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -101,9 +101,9 @@ PHP_FUNCTION( msgfmt_format_message )
UChar *spattern = NULL;
int spattern_len = 0;
char *pattern = NULL;
- int pattern_len = 0;
+ size_t pattern_len = 0;
const char *slocale = NULL;
- int slocale_len = 0;
+ size_t slocale_len = 0;
MessageFormatter_object mf = {0};
MessageFormatter_object *mfo = &mf;
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index 3ae9a49b46..691a2a2518 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -28,7 +28,7 @@
#include "intl_convert.h"
/* {{{ */
-static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, int src_len, zval *return_value TSRMLS_DC)
+static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value TSRMLS_DC)
{
zval *fargs;
int count = 0;
@@ -61,7 +61,7 @@ static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, int src_
PHP_FUNCTION( msgfmt_parse )
{
char *source;
- int source_len;
+ size_t source_len;
MSG_FORMAT_METHOD_INIT_VARS;
@@ -92,9 +92,9 @@ PHP_FUNCTION( msgfmt_parse_message )
UChar *spattern = NULL;
int spattern_len = 0;
char *pattern = NULL;
- int pattern_len = 0;
+ size_t pattern_len = 0;
const char *slocale = NULL;
- int slocale_len = 0;
+ size_t slocale_len = 0;
char *source = NULL;
int src_len = 0;
MessageFormatter_object mf = {0};
diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c
index 9eb8befa7f..41921132c9 100644
--- a/ext/intl/normalizer/normalizer_normalize.c
+++ b/ext/intl/normalizer/normalizer_normalize.c
@@ -35,7 +35,7 @@ PHP_FUNCTION( normalizer_normalize )
char* input = NULL;
/* form is optional, defaults to FORM_C */
zend_long form = NORMALIZER_DEFAULT;
- int input_len = 0;
+ size_t input_len = 0;
UChar* uinput = NULL;
int uinput_len = 0;
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index e2f821ef2c..da93373075 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -77,9 +77,9 @@ static zend_object *ResourceBundle_object_create( zend_class_entry *ce TSRMLS_DC
static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
{
const char *bundlename;
- int bundlename_len = 0;
+ size_t bundlename_len = 0;
const char *locale;
- int locale_len = 0;
+ size_t locale_len = 0;
zend_bool fallback = 1;
zval *object = return_value;
diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c
index 64c641ae10..e5d11a899e 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.c
+++ b/ext/intl/spoofchecker/spoofchecker_main.c
@@ -28,7 +28,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
{
int ret;
char *text;
- int text_len;
+ size_t text_len;
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
@@ -60,7 +60,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
{
int ret;
char *s1, *s2;
- int s1_len, s2_len;
+ size_t s1_len, s2_len;
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
@@ -92,7 +92,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
PHP_METHOD(Spoofchecker, setAllowedLocales)
{
char *locales;
- int locales_len;
+ size_t locales_len;
SPOOFCHECKER_METHOD_INIT_VARS;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &locales, &locales_len)) {
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index adc9c351e0..530e6c5bed 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -47,7 +47,7 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
{
char *str_id;
- int str_id_len;
+ size_t str_id_len;
intl_error_reset(NULL TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
@@ -209,7 +209,7 @@ double_offset:
U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
{
char *str_id;
- int str_id_len;
+ size_t str_id_len;
intl_error_reset(NULL TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
@@ -237,7 +237,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
zend_long zoneType,
offset_arg;
char *region = NULL;
- int region_len = 0;
+ size_t region_len = 0;
int32_t offset,
*offsetp = NULL;
int arg3isnull = 0;
@@ -291,7 +291,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
{
char *str_id;
- int str_id_len;
+ size_t str_id_len;
zval *is_systemid = NULL;
intl_error_reset(NULL TSRMLS_CC);
@@ -335,7 +335,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
U_CFUNC PHP_FUNCTION(intltz_get_region)
{
char *str_id;
- int str_id_len;
+ size_t str_id_len;
char outbuf[3];
intl_error_reset(NULL TSRMLS_CC);
@@ -382,7 +382,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version)
U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
{
char *str_id;
- int str_id_len;
+ size_t str_id_len;
zend_long index;
intl_error_reset(NULL TSRMLS_CC);
@@ -547,7 +547,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
zend_bool daylight = 0;
zend_long display_type = TimeZone::LONG;
const char *locale_str = NULL;
- int dummy = 0;
+ size_t dummy = 0;
TIMEZONE_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c
index e2b1929216..f86d659d3a 100644
--- a/ext/intl/transliterator/transliterator_methods.c
+++ b/ext/intl/transliterator/transliterator_methods.c
@@ -136,7 +136,7 @@ PHP_FUNCTION( transliterator_create )
PHP_FUNCTION( transliterator_create_from_rules )
{
char *str_rules;
- int str_rules_len;
+ size_t str_rules_len;
UChar *ustr_rules = NULL;
int32_t ustr_rules_len = 0;
zend_long direction = TRANSLITERATOR_FORWARD;
@@ -303,7 +303,7 @@ PHP_FUNCTION( transliterator_transliterate )
char *str;
UChar *ustr = NULL,
*uresult = NULL;
- int str_len;
+ size_t str_len;
int32_t ustr_len = 0,
capacity,
uresult_len;
diff --git a/ext/json/json.c b/ext/json/json.c
index 7e27daf36b..ffaefa1c9d 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -664,9 +664,9 @@ again:
}
/* }}} */
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, zend_long depth TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, size_t options, zend_long depth TSRMLS_DC) /* {{{ */
{
- int utf16_len;
+ size_t utf16_len;
unsigned short *utf16;
JSON_parser jp;
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 92b7f3f8c4..38e38daf36 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -294,11 +294,11 @@ PHP_MINFO_FUNCTION(ldap)
PHP_FUNCTION(ldap_connect)
{
char *host = NULL;
- int hostlen;
+ size_t hostlen;
zend_long port = 389; /* Default port */
#ifdef HAVE_ORALDAP
char *wallet = NULL, *walletpasswd = NULL;
- int walletlen = 0, walletpasswdlen = 0;
+ size_t walletlen = 0, walletpasswdlen = 0;
zend_long authmode = GSLC_SSL_NO_AUTH;
int ssl=0;
#endif
@@ -394,7 +394,7 @@ PHP_FUNCTION(ldap_bind)
{
zval *link;
char *ldap_bind_dn = NULL, *ldap_bind_pw = NULL;
- int ldap_bind_dnlen, ldap_bind_pwlen;
+ size_t ldap_bind_dnlen, ldap_bind_pwlen;
ldap_linkdata *ld;
int rc;
@@ -1247,7 +1247,7 @@ PHP_FUNCTION(ldap_explode_dn)
PHP_FUNCTION(ldap_dn2ufn)
{
char *dn, *ufn;
- int dn_len;
+ size_t dn_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dn, &dn_len) != SUCCESS) {
return;
@@ -1500,7 +1500,7 @@ PHP_FUNCTION(ldap_modify_batch)
zval *attrib, *modtype, *vals;
zval *fetched;
char *dn;
- int dn_len;
+ size_t dn_len;
int i, j, k;
int num_mods, num_modprops, num_modvals;
LDAPMod **ldap_mods;
@@ -1878,7 +1878,7 @@ PHP_FUNCTION(ldap_sort)
zval *link, *result;
ldap_linkdata *ld;
char *sortfilter;
- int sflen;
+ size_t sflen;
zend_resource *le;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
@@ -2520,7 +2520,8 @@ static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, con
PHP_FUNCTION(ldap_escape)
{
char *value, *ignores, *result;
- int valuelen = 0, ignoreslen = 0, i;
+ size_t valuelen = 0, ignoreslen = 0;
+ int i;
size_t resultlen;
zend_long flags = 0;
zend_bool map[256] = {0}, havecharlist = 0;
@@ -2617,7 +2618,7 @@ PHP_FUNCTION(ldap_control_paged_result)
zend_bool iscritical;
zval *link;
char *cookie = NULL;
- int cookie_len = 0;
+ size_t cookie_len = 0;
struct berval lcookie = { 0, NULL };
ldap_linkdata *ld;
LDAP *ldap;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index c82e4f483e..ee99d31b54 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1789,7 +1789,7 @@ PHP_FUNCTION(mb_internal_encoding)
PHP_FUNCTION(mb_http_input)
{
char *typ = NULL;
- int typ_len;
+ size_t typ_len;
int retname;
char *list, *temp;
const mbfl_encoding *result = NULL;
@@ -2059,7 +2059,7 @@ PHP_FUNCTION(mb_parse_str)
{
zval *track_vars_array = NULL;
char *encstr = NULL;
- int encstr_len;
+ size_t encstr_len;
php_mb_encoding_handler_info_t info;
const mbfl_encoding *detected;
@@ -2108,7 +2108,7 @@ PHP_FUNCTION(mb_parse_str)
PHP_FUNCTION(mb_output_handler)
{
char *arg_string;
- int arg_string_len;
+ size_t arg_string_len;
zend_long arg_status;
mbfl_string string, result;
const char *charset;
@@ -2412,7 +2412,7 @@ PHP_FUNCTION(mb_stripos)
zend_long offset;
mbfl_string haystack, needle;
const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
- int from_encoding_len;
+ size_t from_encoding_len;
n = -1;
offset = 0;
@@ -2441,7 +2441,7 @@ PHP_FUNCTION(mb_strripos)
zend_long offset;
mbfl_string haystack, needle;
const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
- int from_encoding_len;
+ size_t from_encoding_len;
n = -1;
offset = 0;
@@ -2833,7 +2833,7 @@ PHP_FUNCTION(mb_strcut)
size_t argc = ZEND_NUM_ARGS();
char *encoding;
zend_long from, len;
- int encoding_len;
+ size_t encoding_len;
zval *z_len = NULL;
mbfl_string string, result, *ret;
@@ -2936,7 +2936,7 @@ PHP_FUNCTION(mb_strimwidth)
{
char *str, *trimmarker, *encoding;
zend_long from, width;
- int str_len, trimmarker_len, encoding_len;
+ size_t str_len, trimmarker_len, encoding_len;
mbfl_string string, result, marker, *ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|ss", &str, &str_len, &from, &width, &trimmarker, &trimmarker_len, &encoding, &encoding_len) == FAILURE) {
@@ -3081,7 +3081,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
PHP_FUNCTION(mb_convert_encoding)
{
char *arg_str, *arg_new;
- int str_len, new_len;
+ size_t str_len, new_len;
zval *arg_old;
size_t size, l, n;
char *_from_encodings = NULL, *ret, *s_free = NULL;
@@ -3548,7 +3548,8 @@ PHP_FUNCTION(mb_convert_variables)
const mbfl_encoding *from_encoding, *to_encoding;
mbfl_encoding_detector *identd;
mbfl_buffer_converter *convd;
- int n, to_enc_len, argc, stack_level, stack_max;
+ int n, argc, stack_level, stack_max;
+ size_t to_enc_len;
size_t elistsz;
const mbfl_encoding **elist;
char *to_enc;
@@ -4042,14 +4043,14 @@ PHP_FUNCTION(mb_send_mail)
{
int n;
char *to = NULL;
- int to_len;
+ size_t to_len;
char *message = NULL;
- int message_len;
+ size_t message_len;
char *headers = NULL;
- int headers_len;
+ size_t headers_len;
char *subject = NULL;
zend_string *extra_cmd = NULL;
- int subject_len;
+ size_t subject_len;
int i;
char *to_r = NULL;
char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
@@ -4328,7 +4329,7 @@ PHP_FUNCTION(mb_send_mail)
PHP_FUNCTION(mb_get_info)
{
char *typ = NULL;
- int typ_len;
+ size_t typ_len;
size_t n;
char *name;
const struct mb_overload_def *over_func;
@@ -4506,9 +4507,9 @@ PHP_FUNCTION(mb_get_info)
PHP_FUNCTION(mb_check_encoding)
{
char *var = NULL;
- int var_len;
+ size_t var_len;
char *enc = NULL;
- int enc_len;
+ size_t enc_len;
mbfl_buffer_converter *convd;
const mbfl_encoding *encoding = MBSTRG(current_internal_encoding);
mbfl_string string, result, *ret = NULL;
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 35c741bb37..4977c9e9cd 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -689,7 +689,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
{
zval *arg_pattern, *array;
char *string;
- int string_len;
+ size_t string_len;
php_mb_regex_t *re;
OnigRegion *regs = NULL;
int i, match_len, beg, end;
@@ -788,16 +788,16 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
zval *arg_pattern_zval;
char *arg_pattern;
- int arg_pattern_len;
+ size_t arg_pattern_len;
char *replace;
- int replace_len;
+ size_t replace_len;
zend_fcall_info arg_replace_fci;
zend_fcall_info_cache arg_replace_fci_cache;
char *string;
- int string_len;
+ size_t string_len;
char *p;
php_mb_regex_t *re;
@@ -826,7 +826,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
eval = 0;
{
char *option_str = NULL;
- int option_str_len = 0;
+ size_t option_str_len = 0;
if (!is_callable) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zss|s",
@@ -1052,12 +1052,12 @@ PHP_FUNCTION(mb_ereg_replace_callback)
PHP_FUNCTION(mb_split)
{
char *arg_pattern;
- int arg_pattern_len;
+ size_t arg_pattern_len;
php_mb_regex_t *re;
OnigRegion *regs = NULL;
char *string;
OnigUChar *pos, *chunk_pos;
- int string_len;
+ size_t string_len;
int n, err;
zend_long count = -1;
@@ -1131,10 +1131,10 @@ PHP_FUNCTION(mb_split)
PHP_FUNCTION(mb_ereg_match)
{
char *arg_pattern;
- int arg_pattern_len;
+ size_t arg_pattern_len;
char *string;
- int string_len;
+ size_t string_len;
php_mb_regex_t *re;
OnigSyntaxType *syntax;
@@ -1143,7 +1143,7 @@ PHP_FUNCTION(mb_ereg_match)
{
char *option_str = NULL;
- int option_str_len = 0;
+ size_t option_str_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
&arg_pattern, &arg_pattern_len, &string, &string_len,
@@ -1180,7 +1180,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
size_t argc = ZEND_NUM_ARGS();
char *arg_pattern, *arg_options;
- int arg_pattern_len, arg_options_len;
+ size_t arg_pattern_len, arg_options_len;
int n, i, err, pos, len, beg, end;
OnigOptionType option;
OnigUChar *str;
@@ -1435,7 +1435,7 @@ PHP_FUNCTION(mb_regex_set_options)
OnigOptionType opt;
OnigSyntaxType *syntax;
char *string = NULL;
- int string_len;
+ size_t string_len;
char buf[16];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index dba22948e5..15c5d70f75 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -347,7 +347,7 @@ typedef enum {
char *dir = NULL; \
int dir_len; \
char *module; \
- int module_len; \
+ size_t module_len; \
if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, \
"s|s", &module, &module_len, &dir, &dir_len) == FAILURE) { \
return; \
@@ -508,8 +508,8 @@ PHP_FUNCTION(mcrypt_module_open)
{
char *cipher, *cipher_dir;
char *mode, *mode_dir;
- int cipher_len, cipher_dir_len;
- int mode_len, mode_dir_len;
+ size_t cipher_len, cipher_dir_len;
+ size_t mode_len, mode_dir_len;
MCRYPT td;
php_mcrypt *pm;
@@ -543,7 +543,7 @@ PHP_FUNCTION(mcrypt_module_open)
PHP_FUNCTION(mcrypt_generic_init)
{
char *key, *iv;
- int key_len, iv_len;
+ size_t key_len, iv_len;
zval *mcryptind;
unsigned char *key_s, *iv_s;
int max_key_size, key_size, iv_size;
@@ -616,7 +616,7 @@ PHP_FUNCTION(mcrypt_generic)
{
zval *mcryptind;
char *data;
- int data_len;
+ size_t data_len;
php_mcrypt *pm;
char* data_s;
int block_size, data_size;
@@ -661,7 +661,7 @@ PHP_FUNCTION(mdecrypt_generic)
{
zval *mcryptind;
char *data;
- int data_len;
+ size_t data_len;
php_mcrypt *pm;
char* data_s;
int block_size, data_size;
@@ -949,7 +949,7 @@ PHP_FUNCTION(mcrypt_list_algorithms)
{
char **modules;
char *lib_dir = MCG(algorithms_dir);
- int lib_dir_len;
+ size_t lib_dir_len;
int i, count;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
@@ -976,7 +976,7 @@ PHP_FUNCTION(mcrypt_list_modes)
{
char **modules;
char *lib_dir = MCG(modes_dir);
- int lib_dir_len;
+ size_t lib_dir_len;
int i, count;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
@@ -1238,7 +1238,7 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSR
}
/* }}} */
-static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, const char *data, int data_len, char *mode, const char *iv, int iv_len, int dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
+static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, const char *data, int data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
{
char *cipher_dir_string;
char *module_dir_string;
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 8939e9934a..985f1888be 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -725,7 +725,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
char *user = NULL, *passwd = NULL;
char *host_and_port = NULL, *socket = NULL;
char *tmp = NULL, *host = NULL;
- int user_len = 0, passwd_len = 0, host_len = 0;
+ size_t user_len = 0, passwd_len = 0, host_len = 0;
int port = MYSQL_PORT;
zend_long client_flags = 0;
php_mysql_conn *mysql = NULL;
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(mysql_close)
PHP_FUNCTION(mysql_select_db)
{
char *db;
- int db_len;
+ size_t db_len;
php_mysql_conn *mysql;
zval *mysql_link = NULL;
@@ -1404,7 +1404,7 @@ PHP_FUNCTION(mysql_set_charset)
PHP_FUNCTION(mysql_create_db)
{
char *db;
- int db_len;
+ size_t db_len;
php_mysql_conn *mysql;
zval *mysql_link = NULL;
@@ -1435,7 +1435,7 @@ PHP_FUNCTION(mysql_create_db)
PHP_FUNCTION(mysql_drop_db)
{
char *db;
- int db_len;
+ size_t db_len;
php_mysql_conn *mysql;
zval *mysql_link = NULL;
@@ -1657,7 +1657,7 @@ PHP_FUNCTION(mysql_list_dbs)
PHP_FUNCTION(mysql_list_tables)
{
char *db;
- int db_len;
+ size_t db_len;
php_mysql_conn *mysql;
zval *mysql_link = NULL;
MYSQL_RES *mysql_result;
@@ -1694,7 +1694,7 @@ PHP_FUNCTION(mysql_list_tables)
PHP_FUNCTION(mysql_list_fields)
{
char *db, *table;
- int db_len, table_len;
+ size_t db_len, table_len;
zval *mysql_link = NULL;
php_mysql_conn *mysql;
MYSQL_RES *mysql_result;
@@ -1846,7 +1846,7 @@ PHP_FUNCTION(mysql_affected_rows)
PHP_FUNCTION(mysql_escape_string)
{
char *str;
- int str_len;
+ size_t str_len;
zend_string *escaped_str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
@@ -1870,7 +1870,7 @@ PHP_FUNCTION(mysql_escape_string)
PHP_FUNCTION(mysql_real_escape_string)
{
char *str;
- int str_len;
+ size_t str_len;
zend_string *new_str;
php_mysql_conn *mysql;
zval *mysql_link = NULL;
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 2c5a4bc662..c5124ebc2f 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1047,7 +1047,7 @@ PHP_FUNCTION(mysqli_stmt_construct)
MY_STMT *stmt;
MYSQLI_RESOURCE *mysqli_resource;
char *statement;
- int statement_len;
+ size_t statement_len;
switch (ZEND_NUM_ARGS())
{
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 0b6d866437..b8de1dfe85 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -37,7 +37,7 @@
#if !defined(MYSQLI_USE_MYSQLND)
/* {{{ mysqli_tx_cor_options_to_string */
-static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str * str, const unsigned int mode)
+static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str * str, const unsigned size_t mode)
{
if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
if (str->s && str->s->len) {
@@ -623,7 +623,7 @@ PHP_FUNCTION(mysqli_change_user)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
char *user, *password, *dbname;
- int user_len, password_len, dbname_len;
+ size_t user_len, password_len, dbname_len;
zend_ulong rc;
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
const CHARSET_INFO * old_charset;
@@ -754,7 +754,7 @@ PHP_FUNCTION(mysqli_commit)
zval *mysql_link;
zend_long flags = TRANS_COR_NO_OPT;
char * name = NULL;
- int name_len = 0;
+ size_t name_len = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
@@ -805,7 +805,7 @@ PHP_FUNCTION(mysqli_data_seek)
PHP_FUNCTION(mysqli_debug)
{
char *debug;
- int debug_len;
+ size_t debug_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &debug, &debug_len) == FAILURE) {
return;
@@ -1836,7 +1836,7 @@ PHP_FUNCTION(mysqli_prepare)
MY_MYSQL *mysql;
MY_STMT *stmt;
char *query = NULL;
- int query_len;
+ size_t query_len;
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
@@ -1978,7 +1978,7 @@ PHP_FUNCTION(mysqli_rollback)
zval *mysql_link;
zend_long flags = TRANS_COR_NO_OPT;
char * name = NULL;
- int name_len = 0;
+ size_t name_len = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
@@ -2004,7 +2004,7 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
zval *mysql_stmt;
char *data;
zend_long param_nr;
- int data_len;
+ size_t data_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
return;
@@ -2197,7 +2197,7 @@ PHP_FUNCTION(mysqli_select_db)
MY_MYSQL *mysql;
zval *mysql_link;
char *dbname;
- int dbname_len;
+ size_t dbname_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
return;
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 0acac7fa1f..0342c0282d 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -62,7 +62,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
MYSQLI_RESOURCE *mysqli_resource = NULL;
zval *object = getThis();
char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL;
- int hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0;
+ size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0;
zend_bool persistent = FALSE;
zend_long port = 0, flags = 0;
zend_string *hash_key = NULL;
@@ -503,7 +503,7 @@ PHP_FUNCTION(mysqli_multi_query)
MY_MYSQL *mysql;
zval *mysql_link;
char *query = NULL;
- int query_len;
+ size_t query_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
@@ -1078,7 +1078,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
zval *mysql_link;
zend_long flags = TRANS_START_NO_OPT;
char * name = NULL;
- int name_len = -1;
+ size_t name_len = -1;
zend_bool err = FALSE;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
@@ -1131,7 +1131,7 @@ PHP_FUNCTION(mysqli_savepoint)
MY_MYSQL *mysql;
zval *mysql_link;
char * name = NULL;
- int name_len = -1;
+ size_t name_len = -1;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
@@ -1160,7 +1160,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
MY_MYSQL *mysql;
zval *mysql_link;
char * name = NULL;
- int name_len = -1;
+ size_t name_len = -1;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index e23d8beaa5..09162ae61b 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -287,7 +287,7 @@ static void birdstep_del_result(HashTable *list,int ind)
PHP_FUNCTION(birdstep_connect)
{
char *serv, *user, *pass;
- int serv_len, user_len, pass_len;
+ size_t serv_len, user_len, pass_len;
RETCODE stat;
HDBC hdbc;
VConn *new;
@@ -347,7 +347,7 @@ PHP_FUNCTION(birdstep_exec)
{
char *query;
zend_long ind;
- int query_len, indx;
+ size_t query_len, indx;
VConn *conn;
Vresult *res;
RETCODE stat;
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 9c4e11f3ae..9b1149e13d 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1147,7 +1147,7 @@ PHP_FUNCTION(odbc_prepare)
{
zval *pv_conn;
char *query;
- int query_len;
+ size_t query_len;
odbc_result *result = NULL;
odbc_connection *conn;
RETCODE rc;
@@ -2205,7 +2205,7 @@ PHP_FUNCTION(odbc_result_all)
RETCODE rc;
zval *pv_res;
char *pv_format = NULL;
- int i, pv_format_len = 0;
+ size_t i, pv_format_len = 0;
SQLSMALLINT sql_c_type;
#ifdef HAVE_SQL_EXTENDED_FETCH
SQLULEN crow;
@@ -2500,7 +2500,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *db, *uid, *pwd;
- int db_len, uid_len, pwd_len;
+ size_t db_len, uid_len, pwd_len;
zend_long pv_opt = SQL_CUR_DEFAULT;
odbc_connection *db_conn;
char *hashed_details;
@@ -2868,7 +2868,7 @@ PHP_FUNCTION(odbc_field_scale)
PHP_FUNCTION(odbc_field_num)
{
char *fname;
- int i, field_ind, fname_len;
+ size_t i, field_ind, fname_len;
odbc_result *result;
zval *pv_res;
@@ -3069,7 +3069,7 @@ PHP_FUNCTION(odbc_tables)
odbc_result *result = NULL;
odbc_connection *conn;
char *cat = NULL, *schema = NULL, *table = NULL, *type = NULL;
- int cat_len = 0, schema_len = 0, table_len = 0, type_len = 0;
+ size_t cat_len = 0, schema_len = 0, table_len = 0, type_len = 0;
RETCODE rc;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
@@ -3270,7 +3270,7 @@ PHP_FUNCTION(odbc_foreignkeys)
odbc_result *result = NULL;
odbc_connection *conn;
char *pcat = NULL, *pschema, *ptable, *fcat, *fschema, *ftable;
- int pcat_len = 0, pschema_len, ptable_len, fcat_len, fschema_len, ftable_len;
+ size_t pcat_len = 0, pschema_len, ptable_len, fcat_len, fschema_len, ftable_len;
RETCODE rc;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sssss", &pv_conn, &pcat, &pcat_len, &pschema, &pschema_len,
@@ -3467,7 +3467,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
odbc_result *result = NULL;
odbc_connection *conn;
char *cat = NULL, *schema = NULL, *proc = NULL, *col = NULL;
- int cat_len = 0, schema_len = 0, proc_len = 0, col_len = 0;
+ size_t cat_len = 0, schema_len = 0, proc_len = 0, col_len = 0;
RETCODE rc;
if (ZEND_NUM_ARGS() != 1 && ZEND_NUM_ARGS() != 5) {
@@ -3601,7 +3601,7 @@ PHP_FUNCTION(odbc_specialcolumns)
odbc_result *result = NULL;
odbc_connection *conn;
char *cat = NULL, *schema = NULL, *name = NULL;
- int cat_len = 0, schema_len, name_len;
+ size_t cat_len = 0, schema_len, name_len;
SQLUSMALLINT type, scope, nullable;
RETCODE rc;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 86411af7be..a53ed122e6 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -674,7 +674,7 @@ static ZEND_FUNCTION(opcache_reset)
static ZEND_FUNCTION(opcache_invalidate)
{
char *script_name;
- int script_name_len;
+ size_t script_name_len;
zend_bool force = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &script_name, &script_name_len, &force) == FAILURE) {
@@ -695,7 +695,7 @@ static ZEND_FUNCTION(opcache_invalidate)
static ZEND_FUNCTION(opcache_compile_file)
{
char *script_name;
- int script_name_len;
+ size_t script_name_len;
zend_file_handle handle;
zend_op_array *op_array = NULL;
zend_execute_data *orig_execute_data = NULL;
@@ -738,7 +738,7 @@ static ZEND_FUNCTION(opcache_compile_file)
static ZEND_FUNCTION(opcache_is_script_cached)
{
char *script_name;
- int script_name_len;
+ size_t script_name_len;
if (!validate_api_restriction(TSRMLS_C)) {
RETURN_FALSE;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index d2ecd039f1..e5ed7b5f78 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1408,7 +1408,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
BIO * bio_out;
zend_resource *certresource;
char * filename;
- int filename_len;
+ size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
@@ -1448,7 +1448,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
outputting results to var */
PHP_FUNCTION(openssl_spki_new)
{
- int challenge_len;
+ size_t challenge_len;
char * challenge = NULL, * spkstr = NULL;
zend_string * s = NULL;
zend_resource *keyresource = NULL;
@@ -1793,7 +1793,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
zend_resource *certresource;
zend_bool raw_output = 0;
char *method = "sha1";
- int method_len;
+ size_t method_len;
zend_string *fingerprint;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) {
@@ -2139,7 +2139,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
STACK_OF(X509) * untrustedchain = NULL;
zend_long purpose;
char * untrusted = NULL;
- int untrusted_len = 0, ret;
+ size_t untrusted_len = 0, ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) {
return;
@@ -2353,9 +2353,9 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
PKCS12 * p12 = NULL;
char * filename;
char * friendly_name = NULL;
- int filename_len;
+ size_t filename_len;
char * pass;
- int pass_len;
+ size_t pass_len;
zval *zcert = NULL, *zpkey = NULL, *args = NULL;
EVP_PKEY *priv_key = NULL;
zend_resource *certresource, *keyresource;
@@ -2438,7 +2438,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
EVP_PKEY *priv_key = NULL;
zend_resource *certresource, *keyresource;
char * pass;
- int pass_len;
+ size_t pass_len;
char * friendly_name = NULL;
zval * item;
STACK_OF(X509) *ca = NULL;
@@ -2505,7 +2505,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
{
zval *zout = NULL, zextracerts, zcert, zpkey;
char *pass, *zp12;
- int pass_len, zp12_len;
+ size_t pass_len, zp12_len;
PKCS12 * p12 = NULL;
EVP_PKEY * pkey = NULL;
X509 * cert = NULL;
@@ -2793,7 +2793,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
X509_REQ * csr;
zval * zcsr = NULL;
zend_bool notext = 1;
- char * filename = NULL; int filename_len;
+ char * filename = NULL; size_t filename_len;
BIO * bio_out;
zend_resource *csr_resource;
@@ -3587,7 +3587,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
{
struct php_x509_request req;
zval * zpkey, * args = NULL;
- char * passphrase = NULL; int passphrase_len = 0;
+ char * passphrase = NULL; size_t passphrase_len = 0;
char * filename = NULL; int filename_len = 0;
zend_resource *key_resource = NULL;
EVP_PKEY * key;
@@ -3647,7 +3647,7 @@ PHP_FUNCTION(openssl_pkey_export)
{
struct php_x509_request req;
zval * zpkey, * args = NULL, *out;
- char * passphrase = NULL; int passphrase_len = 0;
+ char * passphrase = NULL; size_t passphrase_len = 0;
zend_resource *key_resource = NULL;
EVP_PKEY * key;
BIO * bio_out = NULL;
@@ -3869,8 +3869,8 @@ PHP_FUNCTION(openssl_pkey_get_details)
PHP_FUNCTION(openssl_pbkdf2)
{
zend_long key_length = 0, iterations = 0;
- char *password; int password_len;
- char *salt; int salt_len;
+ char *password; size_t password_len;
+ char *salt; size_t salt_len;
char *method; int method_len = 0;
zend_string *out_buffer;
@@ -3926,10 +3926,10 @@ PHP_FUNCTION(openssl_pkcs7_verify)
PKCS7 * p7 = NULL;
BIO * in = NULL, * datain = NULL, * dataout = NULL;
zend_long flags = 0;
- char * filename; int filename_len;
- char * extracerts = NULL; int extracerts_len = 0;
- char * signersfilename = NULL; int signersfilename_len = 0;
- char * datafilename = NULL; int datafilename_len = 0;
+ char * filename; size_t filename_len;
+ char * extracerts = NULL; size_t extracerts_len = 0;
+ char * signersfilename = NULL; size_t signersfilename_len = 0;
+ char * datafilename = NULL; size_t datafilename_len = 0;
RETVAL_LONG(-1);
@@ -4038,8 +4038,8 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
const EVP_CIPHER *cipher = NULL;
zend_long cipherid = PHP_OPENSSL_CIPHER_DEFAULT;
zend_string * strindex;
- char * infilename = NULL; int infilename_len;
- char * outfilename = NULL; int outfilename_len;
+ char * infilename = NULL; size_t infilename_len;
+ char * outfilename = NULL; size_t outfilename_len;
RETVAL_FALSE;
@@ -4163,9 +4163,9 @@ PHP_FUNCTION(openssl_pkcs7_sign)
STACK_OF(X509) *others = NULL;
zend_resource *certresource = NULL, *keyresource = NULL;
zend_string * strindex;
- char * infilename; int infilename_len;
- char * outfilename; int outfilename_len;
- char * extracertsfilename = NULL; int extracertsfilename_len;
+ char * infilename; size_t infilename_len;
+ char * outfilename; size_t outfilename_len;
+ char * extracertsfilename = NULL; size_t extracertsfilename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppzza!|lp",
&infilename, &infilename_len, &outfilename, &outfilename_len,
@@ -4263,8 +4263,8 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
zend_resource *certresval, *keyresval;
BIO * in = NULL, * out = NULL, * datain = NULL;
PKCS7 * p7 = NULL;
- char * infilename; int infilename_len;
- char * outfilename; int outfilename_len;
+ char * infilename; size_t infilename_len;
+ char * outfilename; size_t outfilename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppz|z", &infilename, &infilename_len,
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
@@ -4333,7 +4333,7 @@ PHP_FUNCTION(openssl_private_encrypt)
int successful = 0;
zend_resource *keyresource = NULL;
char * data;
- int data_len;
+ size_t data_len;
zend_long padding = RSA_PKCS1_PADDING;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
@@ -4393,7 +4393,7 @@ PHP_FUNCTION(openssl_private_decrypt)
zend_long padding = RSA_PKCS1_PADDING;
zend_resource *keyresource = NULL;
char * data;
- int data_len;
+ size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
@@ -4458,7 +4458,7 @@ PHP_FUNCTION(openssl_public_encrypt)
zend_resource *keyresource = NULL;
zend_long padding = RSA_PKCS1_PADDING;
char * data;
- int data_len;
+ size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
return;
@@ -4516,7 +4516,7 @@ PHP_FUNCTION(openssl_public_decrypt)
zend_resource *keyresource = NULL;
zend_long padding = RSA_PKCS1_PADDING;
char * data;
- int data_len;
+ size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
@@ -4601,7 +4601,7 @@ PHP_FUNCTION(openssl_sign)
zend_string *sigbuf;
zend_resource *keyresource = NULL;
char * data;
- int data_len;
+ size_t data_len;
EVP_MD_CTX md_ctx;
zval *method = NULL;
zend_long signature_algo = OPENSSL_ALGO_SHA1;
@@ -4664,8 +4664,8 @@ PHP_FUNCTION(openssl_verify)
EVP_MD_CTX md_ctx;
const EVP_MD *mdtype;
zend_resource *keyresource = NULL;
- char * data; int data_len;
- char * signature; int signature_len;
+ char * data; size_t data_len;
+ char * signature; size_t signature_len;
zval *method = NULL;
zend_long signature_algo = OPENSSL_ALGO_SHA1;
@@ -4717,7 +4717,7 @@ PHP_FUNCTION(openssl_seal)
zend_resource ** key_resources; /* so we know what to cleanup */
int i, len1, len2, *eksl, nkeys;
unsigned char *buf = NULL, **eks;
- char * data; int data_len;
+ char * data; size_t data_len;
char *method =NULL;
int method_len = 0;
const EVP_CIPHER *cipher;
@@ -4844,8 +4844,8 @@ PHP_FUNCTION(openssl_open)
unsigned char *buf;
zend_resource *keyresource = NULL;
EVP_CIPHER_CTX ctx;
- char * data; int data_len;
- char * ekey; int ekey_len;
+ char * data; size_t data_len;
+ char * ekey; size_t ekey_len;
char *method =NULL;
int method_len = 0;
const EVP_CIPHER *cipher;
@@ -5027,7 +5027,7 @@ PHP_FUNCTION(openssl_encrypt)
{
zend_long options = 0;
char *data, *method, *password, *iv = "";
- int data_len, method_len, password_len, iv_len = 0, max_iv_len;
+ size_t data_len, method_len, password_len, iv_len = 0, max_iv_len;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i=0, outlen, keylen;
@@ -5057,7 +5057,7 @@ PHP_FUNCTION(openssl_encrypt)
if (iv_len <= 0 && max_iv_len > 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Using an empty Initialization Vector (iv) is potentially insecure and not recommended");
}
- free_iv = php_openssl_validate_iv(&iv, &iv_len, max_iv_len TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, max_iv_len TSRMLS_CC);
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5107,7 +5107,7 @@ PHP_FUNCTION(openssl_decrypt)
{
zend_long options = 0;
char *data, *method, *password, *iv = "";
- int data_len, method_len, password_len, iv_len = 0;
+ size_t data_len, method_len, password_len, iv_len = 0;
const EVP_CIPHER *cipher_type;
EVP_CIPHER_CTX cipher_ctx;
int i, outlen, keylen;
@@ -5150,7 +5150,7 @@ PHP_FUNCTION(openssl_decrypt)
key = (unsigned char*)password;
}
- free_iv = php_openssl_validate_iv(&iv, &iv_len, EVP_CIPHER_iv_length(cipher_type) TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, EVP_CIPHER_iv_length(cipher_type) TSRMLS_CC);
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5191,7 +5191,7 @@ PHP_FUNCTION(openssl_decrypt)
PHP_FUNCTION(openssl_cipher_iv_length)
{
char *method;
- int method_len;
+ size_t method_len;
const EVP_CIPHER *cipher_type;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len) == FAILURE) {
@@ -5220,7 +5220,7 @@ PHP_FUNCTION(openssl_dh_compute_key)
{
zval *key;
char *pub_str;
- int pub_len;
+ size_t pub_len;
EVP_PKEY *pkey;
BIGNUM *pub;
zend_string *data;
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 0445edb2c9..5595f31b58 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -750,7 +750,7 @@ PHP_FUNCTION(pcntl_exec)
int pair_length;
zend_string *key;
char *path;
- int path_len;
+ size_t path_len;
zend_ulong key_num;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 9be65164cd..89c5f1155b 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1764,10 +1764,10 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
Quote regular expression characters plus an optional character */
static PHP_FUNCTION(preg_quote)
{
- int in_str_len;
+ size_t in_str_len;
char *in_str; /* Input string argument */
char *in_str_end; /* End of the input string */
- int delim_len = 0;
+ size_t delim_len = 0;
char *delim = NULL; /* Additional delimiter argument */
zend_string *out_str; /* Output string with quoted characters */
char *p, /* Iterator for input string */
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 20ffa560ac..814013d319 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -200,10 +200,10 @@ static PHP_METHOD(PDO, dbh_constructor)
pdo_dbh_t *dbh = NULL;
zend_bool is_persistent = 0;
char *data_source;
- int data_source_len;
+ size_t data_source_len;
char *colon;
char *username=NULL, *password=NULL;
- int usernamelen, passwordlen;
+ size_t usernamelen, passwordlen;
pdo_driver_t *driver = NULL;
zval *options = NULL;
char alt_dsn[512];
@@ -480,7 +480,7 @@ static PHP_METHOD(PDO, prepare)
{
pdo_stmt_t *stmt;
char *statement;
- int statement_len;
+ size_t statement_len;
zval *options = NULL, *opt, *item, ctor_args;
zend_class_entry *dbstmt_ce, *pce;
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis());
@@ -923,7 +923,7 @@ static PHP_METHOD(PDO, exec)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis());
char *statement;
- int statement_len;
+ size_t statement_len;
zend_long ret;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &statement, &statement_len)) {
@@ -952,7 +952,7 @@ static PHP_METHOD(PDO, lastInsertId)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis());
char *name = NULL;
- int namelen;
+ size_t namelen;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &namelen)) {
RETURN_FALSE;
@@ -1058,7 +1058,7 @@ static PHP_METHOD(PDO, query)
{
pdo_stmt_t *stmt;
char *statement;
- int statement_len;
+ size_t statement_len;
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis());
pdo_dbh_t *dbh = dbh_obj->inner;
@@ -1135,7 +1135,7 @@ static PHP_METHOD(PDO, quote)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis());
char *str;
- int str_len;
+ size_t str_len;
zend_long paramtype = PDO_PARAM_STR;
char *qstr;
int qlen;
@@ -1271,7 +1271,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
const zend_function_entry *funcs;
zend_function func;
zend_internal_function *ifunc = (zend_internal_function*)&func;
- int namelen;
+ size_t namelen;
char *lc_name;
pdo_dbh_t *dbh = dbh_obj->inner;
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index edbfc5bcb7..d7f7eced23 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -522,7 +522,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
zval *pg_rows;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL, *pg_fields = NULL;
- int table_name_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
+ size_t table_name_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
char *query;
PGresult *pgsql_result;
@@ -631,7 +631,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
pdo_pgsql_db_handle *H;
char *table_name, *filename, *pg_delim = NULL, *pg_null_as = NULL, *pg_fields = NULL;
- int table_name_len, filename_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
+ size_t table_name_len, filename_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
char *query;
PGresult *pgsql_result;
ExecStatusType status;
@@ -825,7 +825,7 @@ static PHP_METHOD(PDO, pgsqlCopyToArray)
pdo_pgsql_db_handle *H;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL, *pg_fields = NULL;
- int table_name_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
+ size_t table_name_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
char *query;
PGresult *pgsql_result;
@@ -930,9 +930,9 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
Oid oid;
int lfd;
char *oidstr;
- int oidstrlen;
+ size_t oidstrlen;
char *modestr = "rb";
- int modestrlen;
+ size_t modestrlen;
int mode = INV_READ;
char *end_ptr;
@@ -981,7 +981,7 @@ static PHP_METHOD(PDO, pgsqlLOBUnlink)
pdo_pgsql_db_handle *H;
Oid oid;
char *oidstr, *end_ptr;
- int oidlen;
+ size_t oidlen;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&oidstr, &oidlen)) {
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 1fff450623..c76841bae2 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -521,7 +521,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
struct pdo_sqlite_func *func;
zval *callback;
char *func_name;
- int func_name_len;
+ size_t func_name_len;
zend_long argc = -1;
zend_string *cbname = NULL;
pdo_dbh_t *dbh;
@@ -591,7 +591,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
struct pdo_sqlite_func *func;
zval *step_callback, *fini_callback;
char *func_name;
- int func_name_len;
+ size_t func_name_len;
zend_long argc = -1;
zend_string *cbname = NULL;
pdo_dbh_t *dbh;
@@ -652,7 +652,7 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
struct pdo_sqlite_collation *collation;
zval *callback;
char *collation_name;
- int collation_name_len;
+ size_t collation_name_len;
zend_string *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 6e49b55280..6ecf92351f 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1918,7 +1918,7 @@ PHP_FUNCTION(pg_query_params)
zval *pgsql_link = NULL;
zval *pv_param_arr, *tmp;
char *query;
- int query_len, id = -1, argc = ZEND_NUM_ARGS();
+ size_t query_len, id = -1, argc = ZEND_NUM_ARGS();
int leftover = 0;
int num_params = 0;
char **params = NULL;
@@ -2119,7 +2119,7 @@ PHP_FUNCTION(pg_execute)
zval *pgsql_link = NULL;
zval *pv_param_arr, *tmp;
char *stmtname;
- int stmtname_len, id = -1, argc = ZEND_NUM_ARGS();
+ size_t stmtname_len, id = -1, argc = ZEND_NUM_ARGS();
int leftover = 0;
int num_params = 0;
char **params = NULL;
@@ -3077,7 +3077,7 @@ PHP_FUNCTION(pg_last_oid)
PHP_FUNCTION(pg_trace)
{
char *z_filename, *mode = "w";
- int z_filename_len, mode_len;
+ size_t z_filename_len, mode_len;
zval *pgsql_link = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
@@ -3222,7 +3222,7 @@ PHP_FUNCTION(pg_lo_unlink)
zval *pgsql_link = NULL;
zend_long oid_long;
char *oid_string, *end_ptr;
- int oid_strlen;
+ size_t oid_strlen;
PGconn *pgsql;
Oid oid;
int id = -1;
@@ -3292,7 +3292,7 @@ PHP_FUNCTION(pg_lo_open)
zval *pgsql_link = NULL;
zend_long oid_long;
char *oid_string, *end_ptr, *mode_string;
- int oid_strlen, mode_strlen;
+ size_t oid_strlen, mode_strlen;
PGconn *pgsql;
Oid oid;
int id = -1, pgsql_mode=0, pgsql_lofd;
@@ -3471,7 +3471,7 @@ PHP_FUNCTION(pg_lo_write)
zval *pgsql_id;
char *str;
zend_long z_len;
- int str_len, nbytes;
+ size_t str_len, nbytes;
int len;
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
@@ -3536,7 +3536,8 @@ PHP_FUNCTION(pg_lo_import)
{
zval *pgsql_link = NULL, *oid = NULL;
char *file_in;
- int id = -1, name_len;
+ int id = -1;
+ size_t name_len;
int argc = ZEND_NUM_ARGS();
PGconn *pgsql;
Oid returned_oid;
@@ -3623,8 +3624,9 @@ PHP_FUNCTION(pg_lo_export)
{
zval *pgsql_link = NULL;
char *file_out, *oid_string, *end_ptr;
- int oid_strlen;
- int id = -1, name_len;
+ size_t oid_strlen;
+ int id = -1;
+ size_t name_len;
zend_long oid_long;
Oid oid;
PGconn *pgsql;
@@ -3989,7 +3991,7 @@ PHP_FUNCTION(pg_copy_to)
{
zval *pgsql_link;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL;
- int table_name_len, pg_delim_len, pg_null_as_len, free_pg_null = 0;
+ size_t table_name_len, pg_delim_len, pg_null_as_len, free_pg_null = 0;
char *query;
int id = -1;
PGconn *pgsql;
@@ -4126,7 +4128,7 @@ PHP_FUNCTION(pg_copy_from)
zval *pgsql_link = NULL, *pg_rows;
zval *tmp;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL;
- int table_name_len, pg_delim_len, pg_null_as_len;
+ size_t table_name_len, pg_delim_len, pg_null_as_len;
int pg_null_as_free = 0;
char *query;
int id = -1;
@@ -4937,7 +4939,8 @@ PHP_FUNCTION(pg_send_prepare)
{
zval *pgsql_link;
char *query, *stmtname;
- int stmtname_len, query_len, id = -1;
+ size_t stmtname_len, query_len;
+ int id = -1;
PGconn *pgsql;
int is_non_blocking;
int ret;
@@ -5014,7 +5017,8 @@ PHP_FUNCTION(pg_send_execute)
int num_params = 0;
char **params = NULL;
char *stmtname;
- int stmtname_len, id = -1;
+ size_t stmtname_len;
+ int id = -1;
PGconn *pgsql;
int is_non_blocking;
int ret;
@@ -5506,7 +5510,7 @@ PHP_FUNCTION(pg_meta_data)
{
zval *pgsql_link;
char *table_name;
- uint table_name_len;
+ size_t table_name_len;
zend_bool extended=0;
PGconn *pgsql;
int id = -1;
@@ -6351,7 +6355,7 @@ PHP_FUNCTION(pg_convert)
{
zval *pgsql_link, *values;
char *table_name;
- int table_name_len;
+ size_t table_name_len;
zend_ulong option = 0;
PGconn *pg_link;
int id = -1;
@@ -6562,7 +6566,7 @@ PHP_FUNCTION(pg_insert)
{
zval *pgsql_link, *values;
char *table;
- int table_len;
+ size_t table_len;
zend_ulong option = PGSQL_DML_EXEC, return_sql;
PGconn *pg_link;
PGresult *pg_result;
@@ -6778,7 +6782,7 @@ PHP_FUNCTION(pg_update)
{
zval *pgsql_link, *values, *ids;
char *table;
- int table_len;
+ size_t table_len;
zend_ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
zend_string *sql = NULL;
@@ -6868,7 +6872,7 @@ PHP_FUNCTION(pg_delete)
{
zval *pgsql_link, *ids;
char *table;
- int table_len;
+ size_t table_len;
zend_ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
zend_string *sql;
@@ -6998,7 +7002,7 @@ PHP_FUNCTION(pg_select)
{
zval *pgsql_link, *ids;
char *table;
- int table_len;
+ size_t table_len;
zend_ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
zend_string *sql = NULL;
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 6347c72f40..c382fa7565 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -26,7 +26,7 @@
PHAR_FUNC(phar_opendir) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
zval *zcontext = NULL;
if (!PHAR_G(intercepted)) {
@@ -94,7 +94,7 @@ skip_phar:
PHAR_FUNC(phar_file_get_contents) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_string *contents;
zend_bool use_include_path = 0;
php_stream *stream;
@@ -224,7 +224,7 @@ skip_phar:
PHAR_FUNC(phar_readfile) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
int size = 0;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
@@ -320,7 +320,7 @@ skip_phar:
PHAR_FUNC(phar_fopen) /* {{{ */
{
char *filename, *mode;
- int filename_len, mode_len;
+ size_t filename_len, mode_len;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
@@ -339,7 +339,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
char *arch, *entry, *fname;
- int arch_len, entry_len, fname_len;
+ size_t arch_len, entry_len, fname_len;
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
@@ -805,7 +805,7 @@ void fname(INTERNAL_FUNCTION_PARAMETERS) { \
PHAR_G(orig)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
} else { \
char *filename; \
- int filename_len; \
+ size_t filename_len; \
\
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
return; \
@@ -889,7 +889,7 @@ PharFileFunction(phar_is_dir, FS_IS_DIR, orig_is_dir)
PHAR_FUNC(phar_is_file) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
if (!PHAR_G(intercepted)) {
goto skip_phar;
@@ -956,7 +956,7 @@ skip_phar:
PHAR_FUNC(phar_is_link) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
if (!PHAR_G(intercepted)) {
goto skip_phar;
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index b0123f30df..92bacc8e30 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -322,7 +322,7 @@ static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, int f404_len, char *entry, int entry_len TSRMLS_DC) /* {{{ */
+static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len TSRMLS_DC) /* {{{ */
{
sapi_header_line ctr = {0};
phar_entry_info *info;
@@ -545,7 +545,7 @@ PHP_METHOD(Phar, webPhar)
{
zval *mimeoverride = NULL, *rewrite = NULL;
char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL;
- int alias_len = 0, f404_len = 0, free_pathinfo = 0, ru_len = 0;
+ size_t alias_len = 0, f404_len = 0, free_pathinfo = 0, ru_len = 0;
char *fname, *path_info, *mime_type = NULL, *entry, *pt;
const char *basename;
int fname_len, entry_len, code, index_php_len = 0, not_cgi;
@@ -921,7 +921,7 @@ PHP_METHOD(Phar, interceptFileFuncs)
PHP_METHOD(Phar, createDefaultStub)
{
char *index = NULL, *webindex = NULL, *stub, *error;
- int index_len = 0, webindex_len = 0;
+ size_t index_len = 0, webindex_len = 0;
size_t stub_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
@@ -1846,7 +1846,7 @@ PHP_METHOD(Phar, buildFromIterator)
{
zval *obj;
char *error;
- uint base_len = 0;
+ size_t base_len = 0;
char *base = NULL;
struct _phar_t pass;
@@ -1993,7 +1993,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
zend_class_entry *ce;
char *error;
const char *pcr_error;
- int ext_len = ext ? strlen(ext) : 0;
+ size_t ext_len = ext ? strlen(ext) : 0;
int oldname_len;
phar_archive_data *pphar = NULL;
php_stream_statbuf ssb;
@@ -2964,7 +2964,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
{
zend_long algo;
char *error, *key = NULL;
- int key_len = 0;
+ size_t key_len = 0;
PHAR_ARCHIVE_OBJECT();
@@ -3547,7 +3547,7 @@ PHP_METHOD(Phar, offsetGet)
/* {{{ add a file within the phar archive from a string or resource
*/
-static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, int cont_len, zval *zresource TSRMLS_DC)
+static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, size_t cont_len, zval *zresource TSRMLS_DC)
{
char *error;
size_t contents_len;
@@ -3805,7 +3805,7 @@ PHP_METHOD(Phar, addFile)
PHP_METHOD(Phar, addFromString)
{
char *localname, *cont_str;
- int localname_len, cont_len;
+ size_t localname_len, cont_len;
PHAR_ARCHIVE_OBJECT();
@@ -4186,7 +4186,7 @@ PHP_METHOD(Phar, extractTo)
php_stream_statbuf ssb;
phar_entry_info *entry;
char *pathto, *filename, *actual;
- int pathto_len, filename_len;
+ size_t pathto_len, filename_len;
int ret, i;
int nelems;
zval *zval_files = NULL;
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 836b65e8f4..091b42cfdd 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -835,7 +835,7 @@ PHP_FUNCTION(posix_getcwd)
PHP_FUNCTION(posix_mkfifo)
{
char *path;
- int path_len;
+ size_t path_len;
zend_long mode;
int result;
@@ -864,7 +864,7 @@ PHP_FUNCTION(posix_mkfifo)
PHP_FUNCTION(posix_mknod)
{
char *path;
- int path_len;
+ size_t path_len;
zend_long mode;
zend_long major = 0, minor = 0;
int result;
@@ -948,7 +948,7 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
PHP_FUNCTION(posix_access)
{
zend_long mode = 0;
- int filename_len, ret;
+ size_t filename_len, ret;
char *filename, *path;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
@@ -992,7 +992,7 @@ PHP_FUNCTION(posix_getgrnam)
{
char *name;
struct group *g;
- int name_len;
+ size_t name_len;
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
struct group gbuf;
long buflen;
@@ -1111,7 +1111,7 @@ PHP_FUNCTION(posix_getpwnam)
{
struct passwd *pw;
char *name;
- int name_len;
+ size_t name_len;
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
struct passwd pwbuf;
long buflen;
@@ -1355,7 +1355,7 @@ PHP_FUNCTION(posix_initgroups)
{
zend_long basegid;
char *name;
- int name_len;
+ size_t name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) {
RETURN_FALSE;
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index c7994ea73f..bf01f28df6 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -264,7 +264,7 @@ static PHP_MINIT_FUNCTION(pspell)
static PHP_FUNCTION(pspell_new)
{
char *language, *spelling = NULL, *jargon = NULL, *encoding = NULL;
- int language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
+ size_t language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
zend_long mode = Z_L(0), speed = Z_L(0);
int argc = ZEND_NUM_ARGS();
zval *ind;
@@ -361,7 +361,7 @@ static PHP_FUNCTION(pspell_new)
static PHP_FUNCTION(pspell_new_personal)
{
char *personal, *language, *spelling = NULL, *jargon = NULL, *encoding = NULL;
- int personal_len, language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
+ size_t personal_len, language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
zend_long mode = Z_L(0), speed = Z_L(0);
int argc = ZEND_NUM_ARGS();
zval *ind;
@@ -495,7 +495,7 @@ static PHP_FUNCTION(pspell_new_config)
Returns true if word is valid */
static PHP_FUNCTION(pspell_check)
{
- int word_len;
+ size_t word_len;
zend_long scin;
char *word;
PspellManager *manager;
@@ -520,7 +520,7 @@ static PHP_FUNCTION(pspell_suggest)
{
zend_long scin;
char *word;
- int word_len;
+ size_t word_len;
PspellManager *manager;
const PspellWordList *wl;
const char *sug;
@@ -551,7 +551,7 @@ static PHP_FUNCTION(pspell_suggest)
Notify the dictionary of a user-selected replacement */
static PHP_FUNCTION(pspell_store_replacement)
{
- int miss_len, corr_len;
+ size_t miss_len, corr_len;
zend_long scin;
char *miss, *corr;
PspellManager *manager;
@@ -576,7 +576,7 @@ static PHP_FUNCTION(pspell_store_replacement)
Adds a word to a personal list */
static PHP_FUNCTION(pspell_add_to_personal)
{
- int word_len;
+ size_t word_len;
zend_long scin;
char *word;
PspellManager *manager;
@@ -606,7 +606,7 @@ static PHP_FUNCTION(pspell_add_to_personal)
Adds a word to the current session */
static PHP_FUNCTION(pspell_add_to_session)
{
- int word_len;
+ size_t word_len;
zend_long scin;
char *word;
PspellManager *manager;
@@ -685,7 +685,7 @@ static PHP_FUNCTION(pspell_save_wordlist)
static PHP_FUNCTION(pspell_config_create)
{
char *language, *spelling = NULL, *jargon = NULL, *encoding = NULL;
- int language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
+ size_t language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
zval *ind;
PspellConfig *config;
@@ -819,7 +819,7 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
{
zend_long conf;
char *value;
- int value_len;
+ size_t value_len;
PspellConfig *config;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &value, &value_len) == FAILURE) {
@@ -867,7 +867,7 @@ static PHP_FUNCTION(pspell_config_repl)
{
zend_long conf;
char *repl;
- int repl_len;
+ size_t repl_len;
PspellConfig *config;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &repl, &repl_len) == FAILURE) {
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 22db04c86e..5299f839dc 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -213,7 +213,7 @@ PHP_MINFO_FUNCTION(readline)
PHP_FUNCTION(readline)
{
char *prompt = NULL;
- int prompt_len;
+ size_t prompt_len;
char *result;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &prompt, &prompt_len)) {
@@ -240,7 +240,7 @@ PHP_FUNCTION(readline_info)
{
char *what = NULL;
zval *value = NULL;
- int what_len, oldval;
+ size_t what_len, oldval;
char *oldstr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sz", &what, &what_len, &value) == FAILURE) {
@@ -336,7 +336,7 @@ PHP_FUNCTION(readline_info)
PHP_FUNCTION(readline_add_history)
{
char *arg;
- int arg_len;
+ size_t arg_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
@@ -396,7 +396,7 @@ PHP_FUNCTION(readline_list_history)
PHP_FUNCTION(readline_read_history)
{
char *arg = NULL;
- int arg_len;
+ size_t arg_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
return;
@@ -420,7 +420,7 @@ PHP_FUNCTION(readline_read_history)
PHP_FUNCTION(readline_write_history)
{
char *arg = NULL;
- int arg_len;
+ size_t arg_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
return;
@@ -563,7 +563,7 @@ PHP_FUNCTION(readline_callback_handler_install)
zval *callback;
zend_string *name = NULL;
char *prompt;
- int prompt_len;
+ size_t prompt_len;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &prompt, &prompt_len, &callback)) {
return;
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index e90ad060e0..2e044301cb 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -146,7 +146,7 @@ PHP_FUNCTION(recode_string)
RECODE_REQUEST request = NULL;
char *r = NULL;
size_t r_len = 0, r_alen = 0;
- int req_len, str_len;
+ size_t req_len, str_len;
char *req, *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &req, &req_len, &str, &str_len) == FAILURE) {
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 36e1588fe2..962f59dc68 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -226,7 +226,7 @@ static inline reflection_object *reflection_object_from_obj(zend_object *obj) /*
static zend_object_handlers reflection_object_handlers;
-static zval *_default_load_entry(zval *object, char *name, int name_len TSRMLS_DC) /* {{{ */
+static zval *_default_load_entry(zval *object, char *name, size_t name_len TSRMLS_DC) /* {{{ */
{
zval *value;
@@ -1588,7 +1588,7 @@ ZEND_METHOD(reflection_function, __construct)
reflection_object *intern;
zend_function *fptr;
char *name_str;
- int name_len;
+ size_t name_len;
object = getThis();
intern = Z_REFLECTION_P(object);
@@ -2666,7 +2666,7 @@ ZEND_METHOD(reflection_method, __construct)
zend_class_entry *ce;
zend_function *mptr;
char *name_str, *tmp;
- int name_len, tmp_len;
+ size_t name_len, tmp_len;
zval ztmp;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index d6d538cc70..33fc71c569 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -39,7 +39,7 @@
PHP_METHOD(SessionHandler, open)
{
char *save_path = NULL, *session_name = NULL;
- int save_path_len, session_name_len;
+ size_t save_path_len, session_name_len;
PS_SANITY_CHECK;
diff --git a/ext/session/session.c b/ext/session/session.c
index 92fa7fa470..78a43525e7 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1644,7 +1644,8 @@ static PHP_FUNCTION(session_set_cookie_params)
{
zval *lifetime;
char *path = NULL, *domain = NULL;
- int path_len, domain_len, argc = ZEND_NUM_ARGS();
+ size_t path_len, domain_len;
+ int argc = ZEND_NUM_ARGS();
zend_bool secure = 0, httponly = 0;
zend_string *ini_name;
@@ -1990,7 +1991,7 @@ static PHP_FUNCTION(session_regenerate_id)
static PHP_FUNCTION(session_cache_limiter)
{
char *limiter = NULL;
- int limiter_len;
+ size_t limiter_len;
zend_string *ini_name;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &limiter, &limiter_len) == FAILURE) {
@@ -2053,7 +2054,7 @@ static PHP_FUNCTION(session_encode)
static PHP_FUNCTION(session_decode)
{
char *str;
- int str_len;
+ size_t str_len;
if (PS(session_status) == php_session_none) {
RETURN_FALSE;
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index 87faa0bdf7..4bf9d7dedf 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -150,7 +150,7 @@ PHP_FUNCTION(shmop_open)
struct php_shmop *shmop;
struct shmid_ds shm;
char *flags;
- int flags_len;
+ size_t flags_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) {
return;
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index dad3b4674c..e6754a0dd9 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1231,7 +1231,7 @@ SXE_METHOD(xpath)
php_sxe_object *sxe;
zval value;
char *query;
- int query_len;
+ size_t query_len;
int i;
int nsnbr = 0;
xmlNsPtr *ns = NULL;
@@ -1319,7 +1319,7 @@ SXE_METHOD(xpath)
SXE_METHOD(registerXPathNamespace)
{
php_sxe_object *sxe;
- int prefix_len, ns_uri_len;
+ size_t prefix_len, ns_uri_len;
char *prefix, *ns_uri;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
@@ -1349,7 +1349,7 @@ SXE_METHOD(asXML)
xmlChar *strval;
int strval_len;
char *filename;
- int filename_len;
+ size_t filename_len;
if (ZEND_NUM_ARGS() > 1) {
RETURN_FALSE;
@@ -1542,7 +1542,7 @@ SXE_METHOD(children)
{
php_sxe_object *sxe;
char *nsprefix = NULL;
- int nsprefix_len = 0;
+ size_t nsprefix_len = 0;
xmlNodePtr node;
zend_bool isprefix = 0;
@@ -1591,7 +1591,7 @@ SXE_METHOD(attributes)
{
php_sxe_object *sxe;
char *nsprefix = NULL;
- int nsprefix_len = 0;
+ size_t nsprefix_len = 0;
xmlNodePtr node;
zend_bool isprefix = 0;
@@ -1618,7 +1618,7 @@ SXE_METHOD(addChild)
{
php_sxe_object *sxe;
char *qname, *value = NULL, *nsuri = NULL;
- int qname_len, value_len = 0, nsuri_len = 0;
+ size_t qname_len, value_len = 0, nsuri_len = 0;
xmlNodePtr node, newnode;
xmlNsPtr nsptr = NULL;
xmlChar *localname, *prefix = NULL;
@@ -1683,7 +1683,7 @@ SXE_METHOD(addAttribute)
{
php_sxe_object *sxe;
char *qname, *value = NULL, *nsuri = NULL;
- int qname_len, value_len = 0, nsuri_len = 0;
+ size_t qname_len, value_len = 0, nsuri_len = 0;
xmlNodePtr node;
xmlAttrPtr attrp = NULL;
xmlNsPtr nsptr = NULL;
@@ -2117,7 +2117,7 @@ PHP_FUNCTION(simplexml_load_file)
int filename_len;
xmlDocPtr docp;
char *ns = NULL;
- int ns_len = 0;
+ size_t ns_len = 0;
zend_long options = 0;
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
@@ -2151,10 +2151,10 @@ PHP_FUNCTION(simplexml_load_string)
{
php_sxe_object *sxe;
char *data;
- int data_len;
+ size_t data_len;
xmlDocPtr docp;
char *ns = NULL;
- int ns_len = 0;
+ size_t ns_len = 0;
zend_long options = 0;
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
@@ -2188,7 +2188,7 @@ SXE_METHOD(__construct)
{
php_sxe_object *sxe = Z_SXEOBJ_P(getThis());
char *data, *ns = NULL;
- int data_len, ns_len = 0;
+ size_t data_len, ns_len = 0;
xmlDocPtr docp;
zend_long options = 0;
zend_bool is_url = 0, isprefix = 0;
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index ef5aed4bff..5103ba82fc 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -36,7 +36,7 @@ PHP_INI_END()
PHP_FUNCTION(confirm_extname_compiled)
{
char *arg = NULL;
- int arg_len, len;
+ size_t arg_len, len;
char *strg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 7f57143123..f2eb434b9c 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1427,7 +1427,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
{
zval *oid, *value, *type;
char *a1, *a2, *a3, *a4, *a5, *a6, *a7;
- int a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
+ size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
zend_bool use_orignames = 0, suffix_keys = 0;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
zend_long retries = SNMP_DEFAULT_RETRIES;
@@ -1790,7 +1790,7 @@ PHP_FUNCTION(snmp_get_valueretrieval)
PHP_FUNCTION(snmp_read_mib)
{
char *filename;
- int filename_len;
+ size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
@@ -1812,7 +1812,7 @@ PHP_METHOD(snmp, __construct)
php_snmp_object *snmp_object;
zval *object = getThis();
char *a1, *a2;
- int a1_len, a2_len;
+ size_t a1_len, a2_len;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
zend_long retries = SNMP_DEFAULT_RETRIES;
zend_long version = SNMP_DEFAULT_VERSION;
@@ -1915,7 +1915,7 @@ PHP_METHOD(snmp, setSecurity)
php_snmp_object *snmp_object;
zval *object = getThis();
char *a1 = "", *a2 = "", *a3 = "", *a4 = "", *a5 = "", *a6 = "", *a7 = "";
- int a1_len = 0, a2_len = 0, a3_len = 0, a4_len = 0, a5_len = 0, a6_len = 0, a7_len = 0;
+ size_t a1_len = 0, a2_len = 0, a3_len = 0, a4_len = 0, a5_len = 0, a6_len = 0, a7_len = 0;
int argc = ZEND_NUM_ARGS();
snmp_object = Z_SNMP_P(object);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 58c0f1e5d1..08434512e3 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -807,7 +807,7 @@ PHP_METHOD(SoapParam, SoapParam)
{
zval *data;
char *name;
- int name_length;
+ size_t name_length;
zval *this_ptr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) {
@@ -831,7 +831,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
{
zval *data = NULL, *actor = NULL;
char *name, *ns;
- int name_len, ns_len;
+ size_t name_len, ns_len;
zend_bool must_understand = 0;
zval *this_ptr;
@@ -872,7 +872,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
PHP_METHOD(SoapFault, SoapFault)
{
char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *name = NULL, *fault_code_ns = NULL;
- int fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
+ size_t fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
zval *code = NULL, *details = NULL, *headerfault = NULL, *this_ptr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z",
@@ -972,7 +972,7 @@ PHP_METHOD(SoapVar, SoapVar)
{
zval *data, *type, *this_ptr;
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
- int stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
+ size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
return;
@@ -2007,7 +2007,7 @@ fail:
PHP_METHOD(SoapServer, fault)
{
char *code, *string, *actor=NULL, *name=NULL;
- int code_len, string_len, actor_len = 0, name_len = 0;
+ size_t code_len, string_len, actor_len = 0, name_len = 0;
zval* details = NULL;
soapServicePtr service;
xmlCharEncodingHandlerPtr old_encoding;
@@ -2623,7 +2623,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
static void do_soap_call(zval* this_ptr,
char* function,
- int function_len,
+ size_t function_len,
int arg_count,
zval* real_args,
zval* return_value,
@@ -3081,7 +3081,7 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
PHP_METHOD(SoapClient, __doRequest)
{
char *buf, *location, *action;
- int buf_size, location_size, action_size;
+ size_t buf_size, location_size, action_size;
zend_long version;
zend_long one_way = 0;
zval *this_ptr = getThis();
@@ -3116,7 +3116,7 @@ PHP_METHOD(SoapClient, __setCookie)
{
char *name;
char *val = NULL;
- int name_len, val_len = 0;
+ size_t name_len, val_len = 0;
zval *cookies;
zval *this_ptr = getThis();
@@ -3214,7 +3214,7 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
PHP_METHOD(SoapClient, __setLocation)
{
char *location = NULL;
- int location_len = 0;
+ size_t location_len = 0;
zval *tmp;
zval *this_ptr = getThis();
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 6d58732d40..17f0c95da8 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -1476,7 +1476,7 @@ PHP_FUNCTION(socket_bind)
struct sockaddr *sock_type = (struct sockaddr*) &sa_storage;
php_socket *php_sock;
char *addr;
- int addr_len;
+ size_t addr_len;
zend_long port = 0;
zend_long retval = 0;
@@ -1602,7 +1602,7 @@ PHP_FUNCTION(socket_send)
{
zval *arg1;
php_socket *php_sock;
- int buf_len, retval;
+ size_t buf_len, retval;
zend_long len, flags;
char *buf;
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 2a841a5cc4..84c3714da2 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1776,7 +1776,7 @@ SPL_METHOD(Array, unserialize)
spl_array_object *intern = Z_SPLARRAY_P(getThis());
char *buf;
- int buf_len;
+ size_t buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval members, zflags;
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 28a5532721..0feceef25f 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -173,7 +173,7 @@ static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type
}
/* }}} */
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, int *len TSRMLS_DC) /* {{{ */
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_GLOB
if (intern->type == SPL_FS_DIR) {
@@ -375,7 +375,7 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
}
/* }}} */
-void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, int len, int use_copy TSRMLS_DC) /* {{{ */
+void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy TSRMLS_DC) /* {{{ */
{
char *p1, *p2;
@@ -978,7 +978,7 @@ SPL_METHOD(SplFileInfo, getBasename)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
char *fname, *suffix = 0;
size_t flen;
- int slen = 0, path_len;
+ size_t slen = 0, path_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) {
return;
@@ -2577,7 +2577,7 @@ SPL_METHOD(SplFileObject, fgetcsv)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape;
char *delim = NULL, *enclo = NULL, *esc = NULL;
- int d_len = 0, e_len = 0, esc_len = 0;
+ size_t d_len = 0, e_len = 0, esc_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
@@ -2661,7 +2661,7 @@ SPL_METHOD(SplFileObject, setCsvControl)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
char delimiter = ',', enclosure = '"', escape='\\';
char *delim = NULL, *enclo = NULL, *esc = NULL;
- int d_len = 0, e_len = 0, esc_len = 0;
+ size_t d_len = 0, e_len = 0, esc_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
@@ -2868,7 +2868,7 @@ SPL_METHOD(SplFileObject, fwrite)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
char *str;
- int str_len;
+ size_t str_len;
zend_long length = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) {
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index dd747e5863..4993f67b1f 100644
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -45,7 +45,7 @@ typedef struct _spl_filesystem_object spl_filesystem_object;
typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC);
typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC);
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, int *len TSRMLS_DC);
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC);
typedef struct _spl_other_handler {
spl_foreign_dtor_t dtor;
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 927d835bce..e02b9b2e83 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1161,7 +1161,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
spl_dllist_object *intern = Z_SPLDLLIST_P(getThis());
zval flags, elem;
char *buf;
- int buf_len;
+ size_t buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index b8eb7ef662..dcc2a8a573 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -1090,7 +1090,7 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart)
{
zend_long part;
char* prefix;
- int prefix_len;
+ size_t prefix_len;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &part, &prefix, &prefix_len) == FAILURE) {
@@ -1131,7 +1131,7 @@ SPL_METHOD(RecursiveTreeIterator, setPostfix)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
char* postfix;
- int postfix_len;
+ size_t postfix_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &postfix, &postfix_len) == FAILURE) {
return;
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index afc184f71b..bcb316a744 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -792,7 +792,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
char *buf;
- int buf_len;
+ size_t buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval entry, pmembers, pcount, inf;
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 4ec6ae7293..4981fad416 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -102,7 +102,7 @@ PHP_METHOD(sqlite3, open)
php_sqlite3_db_object *db_obj;
zval *object = getThis();
char *filename, *encryption_key, *fullpath;
- int filename_len, encryption_key_len = 0;
+ size_t filename_len, encryption_key_len = 0;
zend_long flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
zend_error_handling error_handling;
@@ -345,7 +345,7 @@ PHP_METHOD(sqlite3, loadExtension)
zval *object = getThis();
char *extension, *lib_path, *extension_dir, *errtext = NULL;
char fullpath[MAXPATHLEN];
- int extension_len, extension_dir_len;
+ size_t extension_len, extension_dir_len;
db_obj = Z_SQLITE3_DB_P(object);
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
@@ -896,7 +896,7 @@ PHP_METHOD(sqlite3, createFunction)
zval *object = getThis();
php_sqlite3_func *func;
char *sql_func;
- int sql_func_len;
+ size_t sql_func_len;
zval *callback_func;
zend_string *callback_name;
zend_long sql_func_num_args = -1;
@@ -947,7 +947,7 @@ PHP_METHOD(sqlite3, createAggregate)
php_sqlite3_func *func;
char *sql_func;
zend_string *callback_name;
- int sql_func_len;
+ size_t sql_func_len;
zval *step_callback, *fini_callback;
zend_long sql_func_num_args = -1;
db_obj = Z_SQLITE3_DB_P(object);
@@ -1005,7 +1005,7 @@ PHP_METHOD(sqlite3, createCollation)
php_sqlite3_collation *collation;
char *collation_name;
zend_string *callback_name;
- int collation_name_len;
+ size_t collation_name_len;
zval *callback_func;
db_obj = Z_SQLITE3_DB_P(object);
@@ -1186,7 +1186,7 @@ PHP_METHOD(sqlite3, openBlob)
php_sqlite3_db_object *db_obj;
zval *object = getThis();
char *table, *column, *dbname = "main";
- int table_len, column_len, dbname_len;
+ size_t table_len, column_len, dbname_len;
zend_long rowid, flags = 0;
sqlite3_blob *blob = NULL;
php_stream_sqlite3_data *sqlite3_stream;
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index abd7c4079e..80ea740100 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -140,7 +140,8 @@ PHP_MINFO_FUNCTION(assert) /* {{{ */
PHP_FUNCTION(assert)
{
zval *assertion;
- int val, description_len = 0;
+ int val;
+ size_t description_len = 0;
char *myeval = NULL;
char *compiled_string_description, *description = NULL;
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 544514161b..0a4093f185 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -216,7 +216,7 @@ PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length
PHP_FUNCTION(base64_encode)
{
char *str;
- int str_len;
+ size_t str_len;
zend_string *result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
@@ -237,7 +237,7 @@ PHP_FUNCTION(base64_decode)
{
char *str;
zend_bool strict = 0;
- int str_len;
+ size_t str_len;
zend_string *result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) {
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index dbccaae265..645cff9c2a 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3984,7 +3984,7 @@ PHP_FUNCTION(long2ip)
PHP_FUNCTION(getenv)
{
char *ptr, *str;
- int str_len;
+ size_t str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
@@ -4047,7 +4047,7 @@ PHP_FUNCTION(getenv)
PHP_FUNCTION(putenv)
{
char *setting;
- int setting_len;
+ size_t setting_len;
char *p, **env;
putenv_entry pe;
#ifdef PHP_WIN32
@@ -4216,7 +4216,8 @@ PHP_FUNCTION(getopt)
char *options = NULL, **argv = NULL;
char opt[2] = { '\0' };
char *optname;
- int argc = 0, options_len = 0, len, o;
+ int argc = 0, len, o;
+ size_t options_len = 0;
char *php_optarg = NULL;
int php_optind = 1;
zval val, *args = NULL, *p_longopts = NULL;
@@ -4543,7 +4544,7 @@ static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args
PHP_FUNCTION(get_cfg_var)
{
char *varname;
- int varname_len;
+ size_t varname_len;
zval *retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
@@ -4624,7 +4625,7 @@ error options:
PHP_FUNCTION(error_log)
{
char *message, *opt = NULL, *headers = NULL;
- int message_len, opt_len = 0, headers_len = 0;
+ size_t message_len, opt_len = 0, headers_len = 0;
int opt_err = 0, argc = ZEND_NUM_ARGS();
zend_long erropt = 0;
@@ -5071,7 +5072,7 @@ ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highl
PHP_FUNCTION(highlight_file)
{
char *filename;
- int filename_len, ret;
+ size_t filename_len, ret;
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
@@ -5112,7 +5113,7 @@ PHP_FUNCTION(highlight_file)
PHP_FUNCTION(php_strip_whitespace)
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_lex_state original_lex_state;
zend_file_handle file_handle = {0};
@@ -5194,7 +5195,7 @@ PHP_FUNCTION(highlight_string)
PHP_FUNCTION(ini_get)
{
char *varname, *str;
- int varname_len;
+ size_t varname_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
return;
@@ -5262,7 +5263,7 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze
PHP_FUNCTION(ini_get_all)
{
char *extname = NULL;
- int extname_len = 0, extnumber = 0;
+ size_t extname_len = 0, extnumber = 0;
zend_module_entry *module;
zend_bool details = 1;
@@ -5301,7 +5302,7 @@ PHP_FUNCTION(ini_set)
{
zend_string *varname;
char *new_value;
- int new_value_len;
+ size_t new_value_len;
char *old_value;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ss", &varname, &new_value, &new_value_len) == FAILURE) {
@@ -5359,7 +5360,7 @@ PHP_FUNCTION(ini_restore)
PHP_FUNCTION(set_include_path)
{
char *new_value;
- int new_value_len;
+ size_t new_value_len;
char *old_value;
zend_string *key;
@@ -5467,7 +5468,7 @@ PHP_FUNCTION(connection_status)
PHP_FUNCTION(ignore_user_abort)
{
char *arg = NULL;
- int arg_len = 0;
+ size_t arg_len = 0;
int old_setting;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
@@ -5525,7 +5526,7 @@ PHP_FUNCTION(getservbyname)
PHP_FUNCTION(getservbyport)
{
char *proto;
- int proto_len;
+ size_t proto_len;
zend_long port;
struct servent *serv;
@@ -5678,7 +5679,7 @@ PHP_FUNCTION(unregister_tick_function)
PHP_FUNCTION(is_uploaded_file)
{
char *path;
- int path_len;
+ size_t path_len;
if (!SG(rfc1867_uploaded_files)) {
RETURN_FALSE;
@@ -5701,7 +5702,7 @@ PHP_FUNCTION(is_uploaded_file)
PHP_FUNCTION(move_uploaded_file)
{
char *path, *new_path;
- int path_len, new_path_len;
+ size_t path_len, new_path_len;
zend_bool successful = 0;
#ifndef PHP_WIN32
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 320d1f90a7..cc8a01f4f4 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -438,7 +438,7 @@ static void browscap_zval_copy_ctor(zval *p) /* {{{ */
PHP_FUNCTION(get_browser)
{
char *agent_name = NULL;
- int agent_name_len = 0;
+ size_t agent_name_len = 0;
zend_bool return_array = 0;
zval *agent, *z_agent_name, *http_user_agent;
zval found_browser_entry;
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index e9176e84da..b3a0593f41 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -27,7 +27,7 @@
PHP_NAMED_FUNCTION(php_if_crc32)
{
char *p;
- int nr;
+ size_t nr;
php_uint32 crcinit = 0;
register php_uint32 crc;
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 5c9fcbafe8..1a9acf5bd6 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -259,7 +259,7 @@ PHP_FUNCTION(crypt)
{
char salt[PHP_MAX_SALT_LEN + 1];
char *str, *salt_in = NULL;
- int str_len, salt_in_len = 0;
+ size_t str_len, salt_in_len = 0;
zend_string *result;
salt[0] = salt[PHP_MAX_SALT_LEN] = '\0';
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index 503f3659ed..e36b8c8d69 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -272,7 +272,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from,
PHP_FUNCTION(convert_cyr_string)
{
char *input, *fr_cs, *to_cs;
- int input_len, fr_cs_len, to_cs_len;
+ size_t input_len, fr_cs_len, to_cs_len;
zend_string *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 80a34a4548..7b6a912244 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -86,9 +86,9 @@ char *strptime(const char *s, const char *format, struct tm *tm);
PHP_FUNCTION(strptime)
{
char *ts;
- int ts_length;
+ size_t ts_length;
char *format;
- int format_length;
+ size_t format_length;
struct tm parsed_time;
char *unparsed_part;
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 4d96384e9c..40632a0cf5 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -214,7 +214,7 @@ PHP_MINIT_FUNCTION(dir)
static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
{
char *dirname;
- int dir_len;
+ size_t dir_len;
zval *zcontext = NULL;
php_stream_context *context = NULL;
php_stream *dirp;
@@ -292,7 +292,8 @@ PHP_FUNCTION(closedir)
PHP_FUNCTION(chroot)
{
char *str;
- int ret, str_len;
+ int ret;
+ size_t str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
@@ -323,7 +324,8 @@ PHP_FUNCTION(chroot)
PHP_FUNCTION(chdir)
{
char *str;
- int ret, str_len;
+ int ret;
+ size_t str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
RETURN_FALSE;
@@ -429,7 +431,7 @@ PHP_FUNCTION(glob)
char *result;
#endif
char *pattern = NULL;
- int pattern_len;
+ size_t pattern_len;
zend_long flags = 0;
glob_t globbuf;
int n;
@@ -552,7 +554,7 @@ no_results:
PHP_FUNCTION(scandir)
{
char *dirn;
- int dirn_len;
+ size_t dirn_len;
zend_long flags = 0;
zend_string **namelist;
int n, i;
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 19573d8e42..7a2a1648d4 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -54,7 +54,7 @@
PHPAPI PHP_FUNCTION(dl)
{
char *filename;
- int filename_len;
+ size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
return;
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 852ebaab22..5f34909c10 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -215,7 +215,7 @@ static zend_string *php_gethostbyaddr(char *ip)
PHP_FUNCTION(gethostbyname)
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) {
return;
@@ -230,7 +230,7 @@ PHP_FUNCTION(gethostbyname)
PHP_FUNCTION(gethostbynamel)
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
struct hostent *hp;
struct in_addr in;
int i;
@@ -345,7 +345,7 @@ PHP_FUNCTION(dns_check_record)
#endif
u_char ans[MAXPACKET];
char *hostname, *rectype = NULL;
- int hostname_len, rectype_len = 0;
+ size_t hostname_len, rectype_len = 0;
int type = T_MX, i;
#if defined(HAVE_DNS_SEARCH)
struct sockaddr_storage from;
@@ -753,7 +753,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t
PHP_FUNCTION(dns_get_record)
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
int type_to_fetch;
@@ -965,7 +965,7 @@ PHP_FUNCTION(dns_get_record)
PHP_FUNCTION(dns_get_mx)
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
zval *mx_list, *weight_list = NULL;
int count, qdc;
u_short type, weight;
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index 7decf91c5c..aab31891da 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -44,7 +44,7 @@
PHP_FUNCTION(dns_get_mx) /* {{{ */
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
zval *mx_list, *weight_list = NULL;
DNS_STATUS status; /* Return value of DnsQuery_A() function */
@@ -93,7 +93,7 @@ PHP_FUNCTION(dns_get_mx) /* {{{ */
PHP_FUNCTION(dns_check_record)
{
char *hostname, *rectype = NULL;
- int hostname_len, rectype_len = 0;
+ size_t hostname_len, rectype_len = 0;
int type = DNS_TYPE_MX;
DNS_STATUS status; /* Return value of DnsQuery_A() function */
@@ -346,7 +346,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw,
PHP_FUNCTION(dns_get_record)
{
char *hostname;
- int hostname_len;
+ size_t hostname_len;
long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
int type, type_to_fetch, first_query = 1, store_results = 1;
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index bd5b2a9f6d..c1a64f4e34 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -171,7 +171,7 @@ err:
static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
char *cmd;
- int cmd_len;
+ size_t cmd_len;
zval *ret_code=NULL, *ret_array=NULL;
int ret;
@@ -399,7 +399,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
PHP_FUNCTION(escapeshellcmd)
{
char *command;
- int command_len;
+ size_t command_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
return;
@@ -436,7 +436,7 @@ PHP_FUNCTION(shell_exec)
{
FILE *in;
char *command;
- int command_len;
+ size_t command_len;
zend_string *ret;
php_stream *stream;
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 28fc790ea9..3aa6a12b9c 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -380,7 +380,7 @@ PHP_FUNCTION(flock)
PHP_FUNCTION(get_meta_tags)
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_bool use_include_path = 0;
int in_tag = 0, done = 0;
int looking_for_val = 0, have_name = 0, have_content = 0;
@@ -523,7 +523,7 @@ PHP_FUNCTION(get_meta_tags)
PHP_FUNCTION(file_get_contents)
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_bool use_include_path = 0;
php_stream *stream;
zend_long offset = -1;
@@ -577,7 +577,7 @@ PHP_FUNCTION(file_put_contents)
{
php_stream *stream;
char *filename;
- int filename_len;
+ size_t filename_len;
zval *data;
zend_long numbytes = 0;
zend_long flags = 0;
@@ -714,7 +714,7 @@ PHP_FUNCTION(file_put_contents)
PHP_FUNCTION(file)
{
char *filename;
- int filename_len;
+ size_t filename_len;
char *p, *s, *e;
register int i = 0;
char eol_marker = '\n';
@@ -806,7 +806,7 @@ parse_eol:
PHP_FUNCTION(tempnam)
{
char *dir, *prefix;
- int dir_len, prefix_len;
+ size_t dir_len, prefix_len;
char *opened_path;
int fd;
zend_string *p;
@@ -861,7 +861,7 @@ PHP_NAMED_FUNCTION(php_if_tmpfile)
PHP_NAMED_FUNCTION(php_if_fopen)
{
char *filename, *mode;
- int filename_len, mode_len;
+ size_t filename_len, mode_len;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
@@ -922,7 +922,7 @@ PHPAPI PHP_FUNCTION(fclose)
PHP_FUNCTION(popen)
{
char *command, *mode;
- int command_len, mode_len;
+ size_t command_len, mode_len;
FILE *fp;
php_stream *stream;
char *posix_mode;
@@ -1153,7 +1153,8 @@ PHPAPI PHP_FUNCTION(fgetss)
Implements a mostly ANSI compatible fscanf() */
PHP_FUNCTION(fscanf)
{
- int result, format_len, type, argc = 0;
+ int result, type, argc = 0;
+ size_t format_len;
zval *args = NULL;
zval *file_handle;
char *buf, *format;
@@ -1194,7 +1195,7 @@ PHPAPI PHP_FUNCTION(fwrite)
{
zval *arg1;
char *arg2;
- int arg2len;
+ size_t arg2len;
int ret;
int num_bytes;
zend_long arg3 = 0;
@@ -1378,7 +1379,7 @@ PHP_FUNCTION(rmdir)
PHP_FUNCTION(readfile)
{
char *filename;
- int filename_len;
+ size_t filename_len;
int size = 0;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
@@ -1490,7 +1491,7 @@ PHP_FUNCTION(rename)
PHP_FUNCTION(unlink)
{
char *filename;
- int filename_len;
+ size_t filename_len;
php_stream_wrapper *wrapper;
zval *zcontext = NULL;
php_stream_context *context = NULL;
@@ -1627,7 +1628,7 @@ PHP_NAMED_FUNCTION(php_if_fstat)
PHP_FUNCTION(copy)
{
char *source, *target;
- int source_len, target_len;
+ size_t source_len, target_len;
zval *zcontext = NULL;
php_stream_context *context;
@@ -1837,7 +1838,7 @@ PHP_FUNCTION(fputcsv)
zval *fp = NULL, *fields = NULL;
int ret;
char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL;
- int delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0;
+ size_t delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|sss",
&fp, &fields, &delimiter_str, &delimiter_str_len,
@@ -1966,9 +1967,9 @@ PHP_FUNCTION(fgetcsv)
char *delimiter_str = NULL;
int delimiter_str_len = 0;
char *enclosure_str = NULL;
- int enclosure_str_len = 0;
+ size_t enclosure_str_len = 0;
char *escape_str = NULL;
- int escape_str_len = 0;
+ size_t escape_str_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zsss",
&fd, &len_zv, &delimiter_str, &delimiter_str_len,
@@ -2309,7 +2310,7 @@ out:
PHP_FUNCTION(realpath)
{
char *filename;
- int filename_len;
+ size_t filename_len;
char resolved_path_buff[MAXPATHLEN];
#ifndef FAST_ZPP
@@ -2453,7 +2454,7 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
PHP_FUNCTION(fnmatch)
{
char *pattern, *filename;
- int pattern_len, filename_len;
+ size_t pattern_len, filename_len;
zend_long flags = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index a081fdf4f0..42ca799458 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -420,7 +420,7 @@ PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC)
static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
zval *group;
#if !defined(WINDOWS)
gid_t gid;
@@ -557,7 +557,7 @@ PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC)
static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
{
char *filename;
- int filename_len;
+ size_t filename_len;
zval *user;
#if !defined(WINDOWS)
uid_t uid;
@@ -667,7 +667,7 @@ PHP_FUNCTION(lchown)
PHP_FUNCTION(chmod)
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_long mode;
int ret;
mode_t imode;
@@ -713,7 +713,7 @@ PHP_FUNCTION(chmod)
PHP_FUNCTION(touch)
{
char *filename;
- int filename_len;
+ size_t filename_len;
zend_long filetime = 0, fileatime = 0;
int ret, argc = ZEND_NUM_ARGS();
FILE *file;
@@ -1081,7 +1081,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
# define FileFunction(name, funcnum) \
void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
- int filename_len; \
+ size_t filename_len; \
\
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
return; \
@@ -1093,7 +1093,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
# define FileFunction(name, funcnum) \
void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
- int filename_len; \
+ size_t filename_len; \
\
ZEND_PARSE_PARAMETERS_START(1, 1) \
Z_PARAM_PATH(filename, filename_len) \
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 319a0437d6..4fcdff276a 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -32,7 +32,7 @@
static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *host;
- int host_len;
+ size_t host_len;
zend_long port = -1;
zval *zerrno = NULL, *zerrstr = NULL;
double timeout = FG(default_socket_timeout);
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 4833bddc01..497b283524 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -32,7 +32,7 @@
PHP_FUNCTION(ftok)
{
char *pathname, *proj;
- int pathname_len, proj_len;
+ size_t pathname_len, proj_len;
key_t k;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 47c4d282cb..4072ad682f 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -73,7 +73,7 @@ PHPAPI int php_header(TSRMLS_D)
}
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, size_t secure, size_t url_encode, size_t httponly TSRMLS_DC)
{
char *cookie;
int len=sizeof("Set-Cookie: ");
diff --git a/ext/standard/html.c b/ext/standard/html.c
index e2a20aa690..a7c58d5bce 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -1505,7 +1505,7 @@ PHP_FUNCTION(htmlspecialchars)
PHP_FUNCTION(htmlspecialchars_decode)
{
char *str;
- int str_len;
+ size_t str_len;
zend_long quote_style = ENT_COMPAT;
zend_string *replaced;
@@ -1631,7 +1631,7 @@ PHP_FUNCTION(get_html_translation_table)
entity_table_opt entity_table;
const enc_to_uni *to_uni_table = NULL;
char *charset_hint = NULL;
- int charset_hint_len;
+ size_t charset_hint_len;
enum entity_charset charset;
/* in this function we have to jump through some loops because we're
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 609a6ffa65..a5ed7c179f 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -34,7 +34,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
zend_string *key = NULL;
char *newprefix, *p;
const char *prop_name;
- int arg_sep_len, newprefix_len, prop_len;
+ size_t arg_sep_len, newprefix_len, prop_len;
zend_ulong idx;
zval *zdata = NULL, copyzval;
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 5488a80d3f..b2b5dcd369 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -1393,7 +1393,7 @@ static void php_getimagesize_from_any(INTERNAL_FUNCTION_PARAMETERS, int mode) {
zval *info = NULL;
php_stream *stream = NULL;
char *input;
- int input_len;
+ size_t input_len;
const int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "s|z/", &input, &input_len, &info) == FAILURE) {
diff --git a/ext/standard/info.c b/ext/standard/info.c
index d0d1d114e6..49244c6676 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1243,7 +1243,7 @@ PHP_FUNCTION(php_sapi_name)
PHP_FUNCTION(php_uname)
{
char *mode = "a";
- int modelen = sizeof("a")-1;
+ size_t modelen = sizeof("a")-1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) {
return;
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index daf667df87..629867484b 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -178,7 +178,7 @@ static char psheader[] = "\xFF\xED\0\0Photoshop 3.0\08BIM\x04\x04\0\0\0\0";
PHP_FUNCTION(iptcembed)
{
char *iptcdata, *jpeg_file;
- int iptcdata_len, jpeg_file_len;
+ size_t iptcdata_len, jpeg_file_len;
zend_long spool = 0;
FILE *fp;
unsigned int marker, done = 0;
@@ -302,7 +302,7 @@ PHP_FUNCTION(iptcparse)
unsigned int tagsfound = 0;
unsigned char *buffer, recnum, dataset, key[ 16 ];
char *str;
- int str_len;
+ size_t str_len;
zval values, *element;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) != SUCCESS) {
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index 03e7e0075d..14d75bf571 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -94,7 +94,7 @@ PHP_FUNCTION(levenshtein)
int argc = ZEND_NUM_ARGS();
char *str1, *str2;
char *callback_name;
- int str1_len, str2_len, callback_len;
+ size_t str1_len, str2_len, callback_len;
zend_long cost_ins, cost_rep, cost_del;
int distance = -1;
diff --git a/ext/standard/link.c b/ext/standard/link.c
index b808e728eb..a36069432f 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -55,7 +55,7 @@
PHP_FUNCTION(readlink)
{
char *link;
- int link_len;
+ size_t link_len;
char buff[MAXPATHLEN];
int ret;
@@ -119,7 +119,7 @@ PHP_FUNCTION(linkinfo)
PHP_FUNCTION(symlink)
{
char *topath, *frompath;
- int topath_len, frompath_len;
+ size_t topath_len, frompath_len;
int ret;
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
@@ -177,7 +177,7 @@ PHP_FUNCTION(symlink)
PHP_FUNCTION(link)
{
char *topath, *frompath;
- int topath_len, frompath_len;
+ size_t topath_len, frompath_len;
int ret;
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index 8c111ac6bc..a1b745af8d 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -63,7 +63,7 @@ TODO:
PHP_FUNCTION(readlink)
{
char *link;
- int link_len;
+ size_t link_len;
char target[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
@@ -87,7 +87,7 @@ PHP_FUNCTION(readlink)
PHP_FUNCTION(linkinfo)
{
char *link;
- int link_len;
+ size_t link_len;
zend_stat_t sb;
int ret;
@@ -110,7 +110,7 @@ PHP_FUNCTION(linkinfo)
PHP_FUNCTION(symlink)
{
char *topath, *frompath;
- int topath_len, frompath_len;
+ size_t topath_len, frompath_len;
BOOLEAN ret;
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
@@ -190,7 +190,7 @@ PHP_FUNCTION(symlink)
PHP_FUNCTION(link)
{
char *topath, *frompath;
- int topath_len, frompath_len;
+ size_t topath_len, frompath_len;
int ret;
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index e45f9f7c90..04ac1825e2 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -79,20 +79,20 @@ extern zend_long php_getuid(TSRMLS_D);
PHP_FUNCTION(ezmlm_hash)
{
char *str = NULL;
- unsigned int h = 5381;
- int j, str_len;
+ zend_ulong h = 5381;
+ size_t j, str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
return;
}
for (j = 0; j < str_len; j++) {
- h = (h + (h << 5)) ^ (unsigned long) (unsigned char) tolower(str[j]);
+ h = (h + (h << Z_UL(5))) ^ (zend_ulong) (unsigned char) tolower(str[j]);
}
- h = (h % 53);
+ h = (h % Z_UL(53));
- RETURN_LONG((int) h);
+ RETURN_LONG((zend_long) h);
}
/* }}} */
@@ -103,8 +103,8 @@ PHP_FUNCTION(mail)
char *to=NULL, *message=NULL, *headers=NULL, *headers_trimmed=NULL;
char *subject=NULL;
zend_string *extra_cmd=NULL;
- int to_len, message_len, headers_len = 0;
- int subject_len, i;
+ size_t to_len, message_len, headers_len = 0;
+ size_t subject_len, i;
char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
char *to_r, *subject_r;
char *p, *e;
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 3196803a97..a1dda23eda 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(number_format)
zend_long dec = 0;
char *thousand_sep = NULL, *dec_point = NULL;
char thousand_sep_chr = ',', dec_point_chr = '.';
- int thousand_sep_len = 0, dec_point_len = 0;
+ size_t thousand_sep_len = 0, dec_point_len = 0;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index 68161da326..4938babf7a 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -75,7 +75,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
PHP_NAMED_FUNCTION(php_if_md5_file)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_bool raw_output = 0;
char md5str[33];
unsigned char buf[1024];
diff --git a/ext/standard/password.c b/ext/standard/password.c
index d6be48f5e2..aafb63f4b0 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -174,7 +174,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
PHP_FUNCTION(password_get_info)
{
php_password_algo algo;
- int hash_len;
+ size_t hash_len;
char *hash, *algo_name;
zval options;
@@ -216,7 +216,7 @@ PHP_FUNCTION(password_needs_rehash)
{
zend_long new_algo = 0;
php_password_algo algo;
- int hash_len;
+ size_t hash_len;
char *hash;
HashTable *options = 0;
zval *option_buffer;
@@ -271,7 +271,7 @@ Verify a hash created using crypt() or password_hash() */
PHP_FUNCTION(password_verify)
{
int status = 0, i;
- int password_len, hash_len;
+ size_t password_len, hash_len;
char *password, *hash;
zend_string *ret;
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index fc58b9f7b8..8f79fffdf8 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -417,7 +417,7 @@ struct php_proc_open_descriptor_item {
PHP_FUNCTION(proc_open)
{
char *command, *cwd=NULL;
- int command_len, cwd_len = 0;
+ size_t command_len, cwd_len = 0;
zval *descriptorspec;
zval *pipes;
zval *environment = NULL;
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index 2f596eed44..8a05f50416 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -65,7 +65,7 @@ PHP_FUNCTION(sha1)
PHP_FUNCTION(sha1_file)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_bool raw_output = 0;
char sha1str[41];
unsigned char buf[1024];
diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c
index af9a719d39..ede06637fa 100644
--- a/ext/standard/soundex.c
+++ b/ext/standard/soundex.c
@@ -29,7 +29,7 @@
PHP_FUNCTION(soundex)
{
char *str;
- int i, _small, str_len, code, last;
+ size_t i, _small, str_len, code, last;
char soundex[4 + 1];
static char soundex_table[26] =
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index d69b7eb816..5557ba1356 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -88,7 +88,7 @@ PHP_FUNCTION(stream_socket_pair)
PHP_FUNCTION(stream_socket_client)
{
char *host;
- int host_len;
+ size_t host_len;
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
double timeout = FG(default_socket_timeout);
php_timeout_ull conv;
@@ -176,7 +176,7 @@ PHP_FUNCTION(stream_socket_client)
PHP_FUNCTION(stream_socket_server)
{
char *host;
- int host_len;
+ size_t host_len;
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
php_stream *stream = NULL;
int err = 0;
@@ -323,7 +323,7 @@ PHP_FUNCTION(stream_socket_sendto)
zval *zstream;
zend_long flags = 0;
char *data, *target_addr = NULL;
- int datalen, target_addr_len = 0;
+ size_t datalen, target_addr_len = 0;
php_sockaddr_storage sa;
socklen_t sl = 0;
@@ -963,7 +963,7 @@ PHP_FUNCTION(stream_context_set_option)
zval *options = NULL, *zcontext = NULL, *zvalue = NULL;
php_stream_context *context;
char *wrappername, *optionname;
- int wrapperlen, optionlen;
+ size_t wrapperlen, optionlen;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"rssz", &zcontext, &wrappername, &wrapperlen,
@@ -1117,7 +1117,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
zval *zstream;
php_stream *stream;
char *filtername;
- int filternamelen;
+ size_t filternamelen;
zend_long read_write = 0;
zval *filterparams = NULL;
php_stream_filter *filter = NULL;
@@ -1241,7 +1241,7 @@ PHP_FUNCTION(stream_filter_remove)
PHP_FUNCTION(stream_get_line)
{
char *str = NULL;
- int str_len = 0;
+ size_t str_len = 0;
zend_long max_length;
zval *zstream;
zend_string *buf;
@@ -1479,7 +1479,7 @@ Determine what file will be opened by calls to fopen() with a relative path */
PHP_FUNCTION(stream_resolve_include_path)
{
char *filename, *resolved_path;
- int filename_len;
+ size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
return;
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 0628a4664c..d7c5490b71 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -872,33 +872,24 @@ PHP_FUNCTION(ltrim)
Wraps buffer to selected number of characters using string break char */
PHP_FUNCTION(wordwrap)
{
- zend_string *text, *breakchar = NULL, *breakchar_save = NULL;
- size_t newtextlen, chk;
+ zend_string *text;
+ char *breakchar = "\n";
+ size_t newtextlen, chk, breakchar_len = 1;
size_t alloced;
zend_long current = 0, laststart = 0, lastspace = 0;
zend_long linelength = 75;
zend_bool docut = 0;
zend_string *newtext;
- breakchar = breakchar_save = zend_string_init("\n", 1, 1);
- if (!breakchar) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) {
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lSb", &text, &linelength, &breakchar, &docut) == FAILURE) {
- zend_string_free(breakchar);
- return;
- }
-
- if (breakchar != breakchar_save) {
- zend_string_free(breakchar_save);
- }
-
if (text->len == 0) {
RETURN_EMPTY_STRING();
}
- if (breakchar->len == 0) {
+ if (breakchar_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Break string cannot be empty");
RETURN_FALSE;
}
@@ -910,21 +901,21 @@ PHP_FUNCTION(wordwrap)
/* Special case for a single-character break as it needs no
additional storage space */
- if (breakchar->len == 1 && !docut) {
+ if (breakchar_len == 1 && !docut) {
newtext = zend_string_init(text->val, text->len, 0);
laststart = lastspace = 0;
for (current = 0; current < text->len; current++) {
- if (text->val[current] == breakchar->val[0]) {
+ if (text->val[current] == breakchar[0]) {
laststart = lastspace = current + 1;
} else if (text->val[current] == ' ') {
if (current - laststart >= linelength) {
- newtext->val[current] = breakchar->val[0];
+ newtext->val[current] = breakchar[0];
laststart = current + 1;
}
lastspace = current;
} else if (current - laststart >= linelength && laststart != lastspace) {
- newtext->val[lastspace] = breakchar->val[0];
+ newtext->val[lastspace] = breakchar[0];
laststart = lastspace + 1;
}
}
@@ -934,12 +925,12 @@ PHP_FUNCTION(wordwrap)
/* Multiple character line break or forced cut */
if (linelength > 0) {
chk = (size_t)(text->len/linelength + 1);
- newtext = zend_string_alloc(chk * breakchar->len + text->len, 0);
- alloced = text->len + chk * breakchar->len + 1;
+ newtext = zend_string_alloc(chk * breakchar_len + text->len, 0);
+ alloced = text->len + chk * breakchar_len + 1;
} else {
chk = text->len;
- alloced = text->len * (breakchar->len + 1) + 1;
- newtext = zend_string_alloc(text->len * (breakchar->len + 1), 0);
+ alloced = text->len * (breakchar_len + 1) + 1;
+ newtext = zend_string_alloc(text->len * (breakchar_len + 1), 0);
}
/* now keep track of the actual new text length */
@@ -948,18 +939,18 @@ PHP_FUNCTION(wordwrap)
laststart = lastspace = 0;
for (current = 0; current < text->len; current++) {
if (chk <= 0) {
- alloced += (size_t) (((text->len - current + 1)/linelength + 1) * breakchar->len) + 1;
+ alloced += (size_t) (((text->len - current + 1)/linelength + 1) * breakchar_len) + 1;
newtext = zend_string_realloc(newtext, alloced, 0);
chk = (size_t) ((text->len - current)/linelength) + 1;
}
/* when we hit an existing break, copy to new buffer, and
* fix up laststart and lastspace */
- if (text->val[current] == breakchar->val[0]
- && current + breakchar->len < text->len
- && !strncmp(text->val+current, breakchar->val, breakchar->len)) {
- memcpy(newtext->val + newtextlen, text->val + laststart, current - laststart + breakchar->len);
- newtextlen += current - laststart + breakchar->len;
- current += breakchar->len - 1;
+ if (text->val[current] == breakchar[0]
+ && current + breakchar_len < text->len
+ && !strncmp(text->val+current, breakchar, breakchar_len)) {
+ memcpy(newtext->val + newtextlen, text->val + laststart, current - laststart + breakchar_len);
+ newtextlen += current - laststart + breakchar_len;
+ current += breakchar_len - 1;
laststart = lastspace = current + 1;
chk--;
}
@@ -969,8 +960,8 @@ PHP_FUNCTION(wordwrap)
if (current - laststart >= linelength) {
memcpy(newtext->val + newtextlen, text->val + laststart, current - laststart);
newtextlen += current - laststart;
- memcpy(newtext->val + newtextlen, breakchar->val, breakchar->len);
- newtextlen += breakchar->len;
+ memcpy(newtext->val + newtextlen, breakchar, breakchar_len);
+ newtextlen += breakchar_len;
laststart = current + 1;
chk--;
}
@@ -983,8 +974,8 @@ PHP_FUNCTION(wordwrap)
&& docut && laststart >= lastspace) {
memcpy(newtext->val + newtextlen, text->val + laststart, current - laststart);
newtextlen += current - laststart;
- memcpy(newtext->val + newtextlen, breakchar->val, breakchar->len);
- newtextlen += breakchar->len;
+ memcpy(newtext->val + newtextlen, breakchar, breakchar_len);
+ newtextlen += breakchar_len;
laststart = lastspace = current;
chk--;
}
@@ -995,8 +986,8 @@ PHP_FUNCTION(wordwrap)
&& laststart < lastspace) {
memcpy(newtext->val + newtextlen, text->val + laststart, lastspace - laststart);
newtextlen += lastspace - laststart;
- memcpy(newtext->val + newtextlen, breakchar->val, breakchar->len);
- newtextlen += breakchar->len;
+ memcpy(newtext->val + newtextlen, breakchar, breakchar_len);
+ newtextlen += breakchar_len;
laststart = lastspace = lastspace + 1;
chk--;
}
@@ -1491,7 +1482,7 @@ quit_loop:
PHP_FUNCTION(basename)
{
char *string, *suffix = NULL;
- int string_len, suffix_len = 0;
+ size_t string_len, suffix_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) {
return;
@@ -1515,7 +1506,7 @@ PHP_FUNCTION(dirname)
{
char *str;
zend_string *ret;
- int str_len;
+ size_t str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
return;
@@ -2633,8 +2624,8 @@ PHP_FUNCTION(quotemeta)
Returns ASCII value of character */
PHP_FUNCTION(ord)
{
- char *str;
- int str_len;
+ char *str;
+ size_t str_len;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
@@ -2743,7 +2734,7 @@ PHP_FUNCTION(ucwords)
zend_string *str;
char *delims = " \t\r\n\f\v";
register char *r, *r_end;
- int delims_len = 6;
+ size_t delims_len = 6;
char mask[256];
#ifndef FAST_ZPP
@@ -2966,7 +2957,7 @@ PHP_FUNCTION(strtr)
{
zval *from;
char *str, *to = NULL;
- int str_len, to_len = 0;
+ size_t str_len, to_len = 0;
int ac = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
@@ -3889,7 +3880,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
int block_start, block_end, block_type, block_length, i;
zend_long max_chars=0;
int begin, end, char_count, orig_begin;
- int str_len;
+ size_t str_len;
zend_string *broken_str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &max_chars) == FAILURE) {
@@ -4304,7 +4295,7 @@ PHP_FUNCTION(parse_str)
char *arg;
zval *arrayArg = NULL;
char *res = NULL;
- int arglen;
+ size_t arglen;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &arg, &arglen, &arrayArg) == FAILURE) {
return;
@@ -4703,7 +4694,7 @@ PHP_FUNCTION(str_getcsv)
zend_string *str;
char delim = ',', enc = '"', esc = '\\';
char *delim_str = NULL, *enc_str = NULL, *esc_str = NULL;
- int delim_len = 0, enc_len = 0, esc_len = 0;
+ size_t delim_len = 0, enc_len = 0, esc_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|sss", &str, &delim_str, &delim_len,
&enc_str, &enc_len, &esc_str, &esc_len) == FAILURE) {
@@ -4986,7 +4977,7 @@ PHP_FUNCTION(substr_count)
zend_long offset = 0, length = 0;
int ac = ZEND_NUM_ARGS();
int count = 0;
- int haystack_len, needle_len;
+ size_t haystack_len, needle_len;
char *p, *endp, cmp;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) {
@@ -5053,32 +5044,24 @@ PHP_FUNCTION(str_pad)
/* Helper variables */
size_t num_pad_chars; /* Number of padding characters (total - input size) */
- zend_string *pad_str, *pad_str_save; /* Pointer to padding string */
+ zend_string *pad_str_save; /* Pointer to padding string */
+ char *pad_str = " ";
+ size_t pad_str_len = 1;
zend_long pad_type_val = STR_PAD_RIGHT; /* The padding type value */
- int i, left_pad=0, right_pad=0;
+ size_t i, left_pad=0, right_pad=0;
zend_string *result = NULL; /* Resulting string */
- pad_str = pad_str_save = zend_string_init(" ", 1, 1);
- if (!pad_str) {
- return;
- }
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|Sl", &input, &pad_length, &pad_str, &pad_type_val) == FAILURE) {
- zend_string_free(pad_str);
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) {
return;
}
- if (pad_str != pad_str_save) {
- zend_string_free(pad_str_save);
- }
-
/* If resulting string turns out to be shorter than input string,
we simply copy the input and return. */
- if (pad_length < 0 || pad_length <= input->len) {
+ if (pad_length <= input->len) {
RETURN_STRINGL(input->val, input->len);
}
- if (pad_str->len == 0) {
+ if (pad_str_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty");
return;
}
@@ -5117,7 +5100,7 @@ PHP_FUNCTION(str_pad)
/* First we pad on the left. */
for (i = 0; i < left_pad; i++)
- result->val[result->len++] = pad_str->val[i % pad_str->len];
+ result->val[result->len++] = pad_str[i % pad_str_len];
/* Then we copy the input string. */
memcpy(result->val + result->len, input->val, input->len);
@@ -5125,7 +5108,7 @@ PHP_FUNCTION(str_pad)
/* Finally, we pad on the right. */
for (i = 0; i < right_pad; i++)
- result->val[result->len++] = pad_str->val[i % pad_str->len];
+ result->val[result->len++] = pad_str[i % pad_str_len];
result->val[result->len] = '\0';
@@ -5231,7 +5214,7 @@ PHP_FUNCTION(str_word_count)
{
zend_string *str;
char *char_list = NULL, *p, *e, *s, ch[256];
- int char_list_len = 0, word_count = 0;
+ size_t char_list_len = 0, word_count = 0;
zend_long type = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) {
@@ -5307,7 +5290,7 @@ PHP_FUNCTION(str_word_count)
Convert monetary value(s) to string */
PHP_FUNCTION(money_format)
{
- int format_len = 0;
+ size_t format_len = 0;
char *format, *p, *e;
double value;
zend_bool check = 0;
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 046393b6bb..900b118a4e 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -136,7 +136,7 @@ PHP_FUNCTION(openlog)
{
char *ident;
zend_long option, facility;
- int ident_len;
+ size_t ident_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &ident,
&ident_len, &option, &facility) == FAILURE) {
@@ -177,7 +177,7 @@ PHP_FUNCTION(syslog)
{
zend_long priority;
char *message;
- int message_len;
+ size_t message_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority,
&message, &message_len) == FAILURE) {
diff --git a/ext/standard/type.c b/ext/standard/type.c
index 08df1d830a..7f18a21c7a 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -94,7 +94,7 @@ PHP_FUNCTION(settype)
{
zval *var;
char *type;
- int type_len = 0;
+ size_t type_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &var, &type, &type_len) == FAILURE) {
return;
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index ddc87f51a8..65cbcf12c3 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -50,7 +50,8 @@ PHP_FUNCTION(uniqid)
zend_bool more_entropy = 0;
#endif
zend_string *uniqid;
- int sec, usec, prefix_len = 0;
+ int sec, usec;
+ size_t prefix_len = 0;
struct timeval tv;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len,
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 6534d7a034..dd8f99f832 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -714,7 +714,7 @@ PHPAPI int php_raw_url_decode(char *str, int len)
PHP_FUNCTION(get_headers)
{
char *url;
- int url_len;
+ size_t url_len;
php_stream_context *context;
php_stream *stream;
zval *prev_val, *hdr = NULL, *h;
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index ec0aea7e71..ea73662db6 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -498,7 +498,7 @@ PHP_FUNCTION(stream_bucket_new)
php_stream *stream;
char *buffer;
char *pbuffer;
- int buffer_len;
+ size_t buffer_len;
php_stream_bucket *bucket;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
diff --git a/ext/standard/var.c b/ext/standard/var.c
index b5ece11332..f005258fcb 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(serialize)
PHP_FUNCTION(unserialize)
{
char *buf = NULL;
- int buf_len;
+ size_t buf_len;
const unsigned char *p;
php_unserialize_data_t var_hash;
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index 9eb3829a08..e6f5e480ae 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -211,7 +211,7 @@ php_version_compare(const char *orig_ver1, const char *orig_ver2)
PHP_FUNCTION(version_compare)
{
char *v1, *v2, *op = NULL;
- int v1_len, v2_len, op_len = 0;
+ size_t v1_len, v2_len, op_len = 0;
int compare, argc;
argc = ZEND_NUM_ARGS();
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index c9e99e1db3..12afe6f278 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -1426,7 +1426,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
zval *sybase_link_index = NULL;
zend_bool store = 1;
char *query;
- int len, id, deadlock_count;
+ size_t len, id, deadlock_count;
sybase_link *sybase_ptr;
sybase_result *result;
CS_INT restype;
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index a3eaec413f..820715ca05 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -554,7 +554,7 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zend_bool use_include_path = 0;
TidyDoc doc;
TidyBuffer *errbuf;
@@ -1182,7 +1182,7 @@ static int php_tidy_output_handler(void **nothing, php_output_context *output_co
static PHP_FUNCTION(tidy_parse_string)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zend_string *input;
zval *options = NULL;
PHPTidyObj *obj;
@@ -1237,7 +1237,7 @@ static PHP_FUNCTION(tidy_get_output)
static PHP_FUNCTION(tidy_parse_file)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zend_bool use_include_path = 0;
zend_string *inputfile, *contents;
zval *options = NULL;
@@ -1334,7 +1334,7 @@ static PHP_FUNCTION(tidy_get_opt_doc)
{
PHPTidyObj *obj;
char *optval, *optname;
- int optname_len;
+ size_t optname_len;
TidyOption opt;
TIDY_SET_CONTEXT;
@@ -1496,7 +1496,7 @@ static PHP_FUNCTION(tidy_getopt)
PHPTidyObj *obj;
char *optname;
void *optval;
- int optname_len;
+ size_t optname_len;
TidyOption opt;
TidyOptionType optt;
@@ -1552,7 +1552,7 @@ static PHP_FUNCTION(tidy_getopt)
static TIDY_DOC_METHOD(__construct)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zend_bool use_include_path = 0;
zval *options = NULL;
zend_string *contents, *inputfile = NULL;
@@ -1584,7 +1584,7 @@ static TIDY_DOC_METHOD(__construct)
static TIDY_DOC_METHOD(parseFile)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zend_bool use_include_path = 0;
zval *options = NULL;
zend_string *inputfile, *contents;
@@ -1618,7 +1618,7 @@ static TIDY_DOC_METHOD(parseFile)
static TIDY_DOC_METHOD(parseString)
{
char *enc = NULL;
- int enc_len = 0;
+ size_t enc_len = 0;
zval *options = NULL;
PHPTidyObj *obj;
zend_string *input;
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 3318909bf2..c540f23c22 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -352,7 +352,7 @@ PHP_MINFO_FUNCTION(wddx)
/* {{{ php_wddx_packet_start
*/
-void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len)
+void php_wddx_packet_start(wddx_packet *packet, char *comment, size_t comment_len)
{
php_wddx_add_chunk_static(packet, WDDX_PACKET_S);
if (comment) {
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 5dea203bca..1a2859c887 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -1365,7 +1365,7 @@ PHP_FUNCTION(xml_parse)
xml_parser *parser;
zval *pind;
char *data;
- int data_len, ret;
+ size_t data_len, ret;
zend_long isFinal = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
@@ -1389,7 +1389,7 @@ PHP_FUNCTION(xml_parse_into_struct)
xml_parser *parser;
zval *pind, *xdata, *info = NULL;
char *data;
- int data_len, ret;
+ size_t data_len, ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
return;
@@ -1620,7 +1620,7 @@ PHP_FUNCTION(xml_parser_get_option)
PHP_FUNCTION(utf8_encode)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_string *encoded;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
@@ -1640,7 +1640,7 @@ PHP_FUNCTION(utf8_encode)
PHP_FUNCTION(utf8_decode)
{
char *arg;
- int arg_len;
+ size_t arg_len;
zend_string *decoded;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 0b55caa357..1d6849e84f 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -270,7 +270,7 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
#ifdef LIBXML_SCHEMAS_ENABLED
/* {{{ _xmlreader_get_relaxNG */
-static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, int source_len, int type,
+static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, size_t type,
xmlRelaxNGValidityErrorFunc error_func,
xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC)
{
@@ -398,7 +398,7 @@ zend_object *xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC)
/* {{{ php_xmlreader_string_arg */
static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_one_char_t internal_function) {
zval *id;
- int name_len = 0;
+ size_t name_len = 0;
char *retchar = NULL;
xmlreader_object *intern;
char *name;
@@ -587,7 +587,7 @@ Get value of a attribute via name and namespace from current element */
PHP_METHOD(xmlreader, getAttributeNs)
{
zval *id;
- int name_len = 0, ns_uri_len = 0;
+ size_t name_len = 0, ns_uri_len = 0;
xmlreader_object *intern;
char *name, *ns_uri, *retchar = NULL;
@@ -846,7 +846,7 @@ Sets the URI that the XMLReader will parse. */
PHP_METHOD(xmlreader, open)
{
zval *id;
- int source_len = 0, encoding_len = 0;
+ size_t source_len = 0, encoding_len = 0;
zend_long options = 0;
xmlreader_object *intern = NULL;
char *source, *valid_file = NULL;
@@ -1029,7 +1029,7 @@ Sets the string that the XMLReader will parse. */
PHP_METHOD(xmlreader, XML)
{
zval *id;
- int source_len = 0, encoding_len = 0;
+ size_t source_len = 0, encoding_len = 0;
zend_long options = 0;
xmlreader_object *intern = NULL;
char *source, *uri = NULL, *encoding = NULL;
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index ce8ad2889b..09495b5e4f 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -666,7 +666,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
char *outBuf;
zval *vals, *out_opts = NULL;
char *method = NULL;
- int method_len;
+ size_t method_len;
php_output_options out;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
@@ -775,7 +775,7 @@ PHP_FUNCTION(xmlrpc_decode_request)
{
char *xml, *encoding = NULL;
zval *method;
- int xml_len, encoding_len = 0;
+ size_t xml_len, encoding_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) {
return;
@@ -792,7 +792,7 @@ PHP_FUNCTION(xmlrpc_decode_request)
PHP_FUNCTION(xmlrpc_decode)
{
char *arg1, *arg2 = NULL;
- int arg1_len, arg2_len = 0;
+ size_t arg1_len, arg2_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
return;
@@ -958,7 +958,7 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
PHP_FUNCTION(xmlrpc_server_register_method)
{
char *method_key;
- int method_key_len;
+ size_t method_key_len;
zval *handle, *method_name;
xmlrpc_server_data* server;
@@ -1020,7 +1020,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
xmlrpc_server_data* server;
zval *caller_params, *handle, *output_opts = NULL;
char *rawxml;
- int rawxml_len;
+ size_t rawxml_len;
php_output_options out;
int argc = ZEND_NUM_ARGS();
@@ -1375,7 +1375,7 @@ PHP_FUNCTION(xmlrpc_set_type)
{
zval *arg;
char *type;
- int type_len;
+ size_t type_len;
XMLRPC_VALUE_TYPE vtype;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/s", &arg, &type, &type_len) == FAILURE) {
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 027fd33108..becfbc2157 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -695,7 +695,7 @@ static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_rea
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name;
- int name_len, retval;
+ size_t name_len, retval;
zval *self = getThis();
@@ -833,7 +833,8 @@ static PHP_FUNCTION(xmlwriter_start_attribute_ns)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *prefix, *uri;
- int name_len, prefix_len, uri_len, retval;
+ size_t name_len, prefix_len, uri_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -874,7 +875,8 @@ static PHP_FUNCTION(xmlwriter_write_attribute)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -915,7 +917,8 @@ static PHP_FUNCTION(xmlwriter_write_attribute_ns)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *prefix, *uri, *content;
- int name_len, prefix_len, uri_len, content_len, retval;
+ size_t name_len, prefix_len, uri_len, content_len;
+ int retval;
zval *self = getThis();
@@ -965,7 +968,8 @@ static PHP_FUNCTION(xmlwriter_start_element_ns)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *prefix, *uri;
- int name_len, prefix_len, uri_len, retval;
+ size_t name_len, prefix_len, uri_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1022,7 +1026,8 @@ static PHP_FUNCTION(xmlwriter_write_element)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content = NULL;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1073,7 +1078,8 @@ static PHP_FUNCTION(xmlwriter_write_element_ns)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *prefix, *uri, *content = NULL;
- int name_len, prefix_len, uri_len, content_len, retval;
+ size_t name_len, prefix_len, uri_len, content_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1140,7 +1146,8 @@ static PHP_FUNCTION(xmlwriter_write_pi)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
zval *self = getThis();
@@ -1296,7 +1303,8 @@ static PHP_FUNCTION(xmlwriter_start_document)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *version = NULL, *enc = NULL, *alone = NULL;
- int version_len, enc_len, alone_len, retval;
+ size_t version_len, enc_len, alone_len;
+ int retval;
zval *self = getThis();
@@ -1341,7 +1349,8 @@ static PHP_FUNCTION(xmlwriter_start_dtd)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *pubid = NULL, *sysid = NULL;
- int name_len, pubid_len, sysid_len, retval;
+ size_t name_len, pubid_len, sysid_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1386,7 +1395,8 @@ static PHP_FUNCTION(xmlwriter_write_dtd)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *pubid = NULL, *sysid = NULL, *subset = NULL;
- int name_len, pubid_len, sysid_len, subset_len, retval;
+ size_t name_len, pubid_len, sysid_len, subset_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1440,7 +1450,8 @@ static PHP_FUNCTION(xmlwriter_write_dtd_element)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1496,7 +1507,8 @@ static PHP_FUNCTION(xmlwriter_write_dtd_attlist)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
zval *self = getThis();
if (self) {
@@ -1536,7 +1548,7 @@ static PHP_FUNCTION(xmlwriter_start_dtd_entity)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name;
- int name_len, retval;
+ size_t name_len, retval;
zend_bool isparm;
zval *self = getThis();
@@ -1583,11 +1595,12 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
char *name, *content;
- int name_len, content_len, retval;
+ size_t name_len, content_len;
+ int retval;
/* Optional parameters */
char *pubid = NULL, *sysid = NULL, *ndataid = NULL;
zend_bool pe = 0;
- int pubid_len, sysid_len, ndataid_len;
+ size_t pubid_len, sysid_len, ndataid_len;
zval *self = getThis();
if (self) {
@@ -1631,7 +1644,7 @@ static PHP_FUNCTION(xmlwriter_open_uri)
xmlTextWriterPtr ptr;
char *source;
char resolved_path[MAXPATHLEN + 1];
- int source_len;
+ size_t source_len;
zval *self = getThis();
ze_xmlwriter_object *ze_obj = NULL;
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 92c04c3ed2..4e7d66d228 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -695,7 +695,8 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
zval *id, *docp = NULL;
xmlDoc *newdocp;
xsltStylesheetPtr sheetp;
- int ret, uri_len;
+ int ret;
+ size_t uri_len;
char *uri;
xsl_object *intern;
@@ -767,7 +768,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
xsl_object *intern;
zend_ulong idx;
char *namespace;
- int namespace_len;
+ size_t namespace_len;
zend_string *string_key, *name, *value;
DOM_GET_THIS(id);
@@ -894,7 +895,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
zval *id;
xsl_object *intern;
char *filename = NULL;
- int filename_len;
+ size_t filename_len;
DOM_GET_THIS(id);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p!", &filename, &filename_len) == SUCCESS) {
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 4a25abc8f3..a195fa801e 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -93,7 +93,7 @@ static int le_zip_entry;
# define add_ascii_assoc_long add_assoc_long
/* Flatten a path by making a relative path (to .)*/
-static char * php_zip_make_relative_path(char *path, int path_len) /* {{{ */
+static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */
{
char *path_begin = path;
size_t i;
@@ -1203,7 +1203,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
zval * zip;
zval * zip_entry;
char *mode = NULL;
- int mode_len = 0;
+ size_t mode_len = 0;
zip_read_rsrc * zr_rsrc;
zip_rsrc *z_rsrc;
@@ -1696,7 +1696,7 @@ static ZIPARCHIVE_METHOD(addFile)
struct zip *intern;
zval *self = getThis();
char *entry_name = NULL;
- int entry_name_len = 0;
+ size_t entry_name_len = 0;
zend_long offset_start = 0, offset_len = 0;
zend_string *filename;
@@ -1737,7 +1737,7 @@ static ZIPARCHIVE_METHOD(addFromString)
zval *self = getThis();
zend_string *buffer;
char *name;
- int name_len;
+ size_t name_len;
ze_zip_object *ze_obj;
struct zip_source *zs;
int pos = 0;
@@ -2032,7 +2032,7 @@ static ZIPARCHIVE_METHOD(setExternalAttributesName)
{
struct zip *intern;
zval *self = getThis();
- int name_len;
+ size_t name_len;
char *name;
zend_long flags=0, opsys, attr;
zip_int64_t idx;
@@ -2099,7 +2099,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName)
{
struct zip *intern;
zval *self = getThis(), *z_opsys, *z_attr;
- int name_len;
+ size_t name_len;
char *name;
zend_long flags=0;
zip_uint8_t opsys;
@@ -2274,7 +2274,7 @@ static ZIPARCHIVE_METHOD(deleteName)
{
struct zip *intern;
zval *self = getThis();
- int name_len;
+ size_t name_len;
char *name;
struct zip_stat sb;
@@ -2307,7 +2307,7 @@ static ZIPARCHIVE_METHOD(renameIndex)
zval *self = getThis();
char *new_name;
- int new_name_len;
+ size_t new_name_len;
zend_long index;
if (!self) {
@@ -2407,7 +2407,7 @@ static ZIPARCHIVE_METHOD(unchangeName)
zval *self = getThis();
struct zip_stat sb;
char *name;
- int name_len;
+ size_t name_len;
if (!self) {
RETURN_FALSE;
@@ -2491,7 +2491,7 @@ static ZIPARCHIVE_METHOD(extractTo)
zval *zval_file = NULL;
php_stream_statbuf ssb;
char *pathto;
- int pathto_len;
+ size_t pathto_len;
int ret, i;
int nelems;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index be22378052..ad6b6fad69 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -447,7 +447,7 @@ static void php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_D)
static PHP_FUNCTION(ob_gzhandler)
{
char *in_str;
- int in_len;
+ size_t in_len;
zend_long flags = 0;
php_output_context ctx = {0};
int encoding, rv;
@@ -533,7 +533,7 @@ static PHP_FUNCTION(zlib_get_coding_type)
static PHP_FUNCTION(gzfile)
{
char *filename;
- int filename_len;
+ size_t filename_len;
int flags = REPORT_ERRORS;
char buf[8192] = {0};
register int i = 0;
@@ -575,7 +575,7 @@ static PHP_FUNCTION(gzopen)
{
char *filename;
char *mode;
- int filename_len, mode_len;
+ size_t filename_len, mode_len;
int flags = REPORT_ERRORS;
php_stream *stream;
zend_long use_include_path = 0;
@@ -602,7 +602,7 @@ static PHP_FUNCTION(gzopen)
static PHP_FUNCTION(readgzfile)
{
char *filename;
- int filename_len;
+ size_t filename_len;
int flags = REPORT_ERRORS;
php_stream *stream;
int size;
@@ -665,7 +665,7 @@ static PHP_FUNCTION(name) \
static PHP_FUNCTION(name) \
{ \
char *in_buf, *out_buf; \
- int in_len; \
+ size_t in_len; \
size_t out_len; \
zend_long max_len = 0; \
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &in_buf, &in_len, &max_len)) { \