diff options
author | Anatol Belski <ab@php.net> | 2014-08-27 19:25:28 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-27 20:49:36 +0200 |
commit | 6db8d4f829553f61822a794f94c55270e5478a13 (patch) | |
tree | 03a63a6e8bf452020d20b1963dd064fed95dc446 /ext | |
parent | bdc4f235179abb3f1fac08144a875d3cc9e0a242 (diff) | |
download | php-git-6db8d4f829553f61822a794f94c55270e5478a13.tar.gz |
's' works with size_t round 3
Diffstat (limited to 'ext')
38 files changed, 171 insertions, 142 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 132c74bf3a..6731ea74aa 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -667,7 +667,7 @@ PHP_FUNCTION(com_create_guid) php_com_initialize(TSRMLS_C); if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) { - int len; + size_t len; char *str; str = php_com_olestring_to_string(guid_string, &len, CP_ACP TSRMLS_CC); diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 4ec1ab3ba3..409b8f9956 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -176,7 +176,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames( for (i = 0; i < cNames; i++) { char *name; - unsigned int namelen; + size_t namelen; zval *tmp; name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC); @@ -220,7 +220,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid( { HRESULT ret = DISP_E_UNKNOWNNAME; char *name; - unsigned int namelen; + size_t namelen; zval *tmp; FETCH_DISP("GetDispID"); diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index dacb8904bf..ba91f9b44c 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -535,7 +535,7 @@ PHP_FUNCTION(enchant_broker_request_dict) enchant_dict *dict; EnchantDict *d; char *tag; - int taglen; + size_t taglen; int pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { @@ -648,7 +648,7 @@ PHP_FUNCTION(enchant_broker_dict_exists) { zval *broker; char *tag; - int taglen; + size_t taglen; enchant_broker * pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { @@ -672,9 +672,9 @@ PHP_FUNCTION(enchant_broker_set_ordering) { zval *broker; char *pordering; - int porderinglen; + size_t porderinglen; char *ptag; - int ptaglen; + size_t ptaglen; enchant_broker * pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) { diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 7db1de1a36..9b6d86c415 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -4091,7 +4091,8 @@ PHP_FUNCTION(exif_thumbnail) { zval *p_width = 0, *p_height = 0, *p_imagetype = 0; char *p_name; - int p_name_len, ret, arg_c = ZEND_NUM_ARGS(); + size_t p_name_len; + int ret, arg_c = ZEND_NUM_ARGS(); image_info_type ImageInfo; memset(&ImageInfo, 0, sizeof(ImageInfo)); diff --git a/ext/fileinfo/libmagic/magic.c b/ext/fileinfo/libmagic/magic.c index ba66f0b681..d67b695fac 100644 --- a/ext/fileinfo/libmagic/magic.c +++ b/ext/fileinfo/libmagic/magic.c @@ -350,7 +350,7 @@ file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream) { int rv = -1; unsigned char *buf; - struct stat sb; + zend_stat_t sb; ssize_t nbytes = 0; /* number of bytes read from a datafile */ int no_in_stream = 0; TSRMLS_FETCH(); diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 5f84a48c2f..f13953843f 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1421,7 +1421,8 @@ PHP_FUNCTION(imageloadfont) { zval *ind; char *file; - int file_name, hdr_size = sizeof(gdFont) - sizeof(char *); + size_t file_name; + int hdr_size = sizeof(gdFont) - sizeof(char *); int body_size, n = 0, b, i, body_size_check; gdFontPtr font; php_stream *stream; @@ -2555,7 +2556,8 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char gdImagePtr im; char *fn = NULL; FILE *fp; - int file_len = 0, argc = ZEND_NUM_ARGS(); + size_t file_len = 0; + int argc = ZEND_NUM_ARGS(); int q = -1, i, t = 1; /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 8466349578..3f1909e753 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -205,7 +205,7 @@ PHP_NAMED_FUNCTION(zif_gettext) PHP_NAMED_FUNCTION(zif_dgettext) { char *domain, *msgid, *msgstr; - int domain_len, msgid_len; + size_t domain_len, msgid_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &msgid, &msgid_len) == FAILURE) { return; @@ -225,7 +225,7 @@ PHP_NAMED_FUNCTION(zif_dgettext) PHP_NAMED_FUNCTION(zif_dcgettext) { char *domain, *msgid, *msgstr; - int domain_len, msgid_len; + size_t domain_len, msgid_len; zend_long category; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &domain, &domain_len, &msgid, &msgid_len, &category) == FAILURE) { @@ -246,7 +246,7 @@ PHP_NAMED_FUNCTION(zif_dcgettext) PHP_NAMED_FUNCTION(zif_bindtextdomain) { char *domain, *dir; - int domain_len, dir_len; + size_t domain_len, dir_len; char *retval, dir_name[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &dir, &dir_len) == FAILURE) { @@ -304,7 +304,7 @@ PHP_NAMED_FUNCTION(zif_ngettext) PHP_NAMED_FUNCTION(zif_dngettext) { char *domain, *msgid1, *msgid2, *msgstr = NULL; - int domain_len, msgid1_len, msgid2_len; + size_t domain_len, msgid1_len, msgid2_len; zend_long count; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl", &domain, &domain_len, @@ -330,7 +330,7 @@ PHP_NAMED_FUNCTION(zif_dngettext) PHP_NAMED_FUNCTION(zif_dcngettext) { char *domain, *msgid1, *msgid2, *msgstr = NULL; - int domain_len, msgid1_len, msgid2_len; + size_t domain_len, msgid1_len, msgid2_len; zend_long count, category; RETVAL_FALSE; diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 4bf5fa6f7e..95d1d659dd 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -120,7 +120,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_ { zend_string *digest; char *algo, *data; - int algo_len, data_len; + size_t algo_len, data_len; zend_bool raw_output = raw_output_default; const php_hash_ops *ops; void *context; @@ -237,7 +237,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_string *digest; char *algo, *data, *key; unsigned char *K; - int algo_len, data_len, key_len; + size_t algo_len, data_len, key_len; zend_bool raw_output = raw_output_default; const php_hash_ops *ops; void *context; @@ -329,7 +329,8 @@ Initialize a hashing context */ PHP_FUNCTION(hash_init) { char *algo, *key = NULL; - int algo_len, key_len = 0, argc = ZEND_NUM_ARGS(); + size_t algo_len, key_len = 0; + int argc = ZEND_NUM_ARGS(); zend_long options = 0; void *context; const php_hash_ops *ops; diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index 42c559d971..d6905cfbd5 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -138,7 +138,7 @@ PHP_FUNCTION(hash_algos); PHP_FUNCTION(hash_pbkdf2); PHP_FUNCTION(hash_equals); -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); PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops); PHP_HASH_API int php_hash_copy(const void *ops, void *orig_context, void *dest_context); diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index f2adc31d0c..54314e2285 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -422,7 +422,7 @@ ZEND_END_ARG_INFO(); static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PARAMETERS) { php_converter_object *objval = CONV_GET(getThis()); char *enc; - int enc_len; + size_t enc_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &enc, &enc_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Bad arguments, " @@ -590,7 +590,8 @@ ZEND_END_ARG_INFO(); static PHP_METHOD(UConverter, setSubstChars) { php_converter_object *objval = CONV_GET(getThis()); char *chars; - int chars_len, ret = 1; + size_t chars_len; + int ret = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &chars, &chars_len) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -799,7 +800,7 @@ ZEND_END_ARG_INFO(); static PHP_METHOD(UConverter, transcode) { char *str, *src, *dest; - int str_len, src_len, dest_len; + size_t str_len, src_len, dest_len; zval *options = NULL; UConverter *src_cnv = NULL, *dest_cnv = NULL; diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 3b3eea031a..183ccb261c 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -167,9 +167,9 @@ PHP_FUNCTION(datefmt_parse) PHP_FUNCTION(datefmt_localtime) { 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; + int32_t parse_pos = -1; DATE_FORMAT_METHOD_INIT_VARS; diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 66575696d2..7278007c35 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -211,7 +211,7 @@ PHP_FUNCTION( numfmt_set_text_attribute ) UChar *svalue = NULL; zend_long attribute; char *value; - int len; + size_t len; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ @@ -387,7 +387,7 @@ PHP_FUNCTION( numfmt_get_pattern ) PHP_FUNCTION( numfmt_set_pattern ) { char* value = NULL; - int value_len = 0; + size_t value_len = 0; int slength = 0; UChar* svalue = NULL; FORMATTER_METHOD_INIT_VARS; diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 5808bef47e..55ce63955f 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -55,7 +55,7 @@ void grapheme_register_constants( INIT_FUNC_ARGS ) PHP_FUNCTION(grapheme_strlen) { unsigned char* string; - int string_len; + size_t string_len; UChar* ustring = NULL; int ustring_len = 0; int ret_len; @@ -109,7 +109,7 @@ PHP_FUNCTION(grapheme_strlen) PHP_FUNCTION(grapheme_strpos) { unsigned char *haystack, *needle; - int haystack_len, needle_len; + size_t haystack_len, needle_len; unsigned char *found; zend_long loffset = 0; int32_t offset = 0; @@ -176,7 +176,7 @@ PHP_FUNCTION(grapheme_strpos) PHP_FUNCTION(grapheme_stripos) { unsigned char *haystack, *needle, *haystack_dup, *needle_dup; - int haystack_len, needle_len; + size_t haystack_len, needle_len; unsigned char *found; zend_long loffset = 0; int32_t offset = 0; @@ -251,7 +251,7 @@ PHP_FUNCTION(grapheme_stripos) PHP_FUNCTION(grapheme_strrpos) { unsigned char *haystack, *needle; - int haystack_len, needle_len; + size_t haystack_len, needle_len; zend_long loffset = 0; int32_t offset = 0; int32_t ret_pos; @@ -321,7 +321,7 @@ PHP_FUNCTION(grapheme_strrpos) PHP_FUNCTION(grapheme_strripos) { unsigned char *haystack, *needle; - int haystack_len, needle_len; + size_t haystack_len, needle_len; zend_long loffset = 0; int32_t offset = 0; int32_t ret_pos; @@ -400,7 +400,9 @@ PHP_FUNCTION(grapheme_substr) { unsigned char *str, *sub_str; UChar *ustr; - int str_len, sub_str_len, ustr_len; + size_t str_len; + int32_t ustr_len; + int32_t sub_str_len; zend_long lstart = 0, length = 0; int32_t start = 0; int iter_val; @@ -618,7 +620,7 @@ PHP_FUNCTION(grapheme_substr) static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_case) { unsigned char *haystack, *needle, *found; - int haystack_len, needle_len; + size_t haystack_len, needle_len; int ret_pos, uchar_pos; zend_bool part = 0; @@ -815,7 +817,8 @@ PHP_FUNCTION(grapheme_extract) { unsigned char *str, *pstr; UChar *ustr; - int str_len, ustr_len; + size_t str_len; + int32_t ustr_len; zend_long size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type) to return */ zend_long lstart = 0; /* starting position in str in bytes */ int32_t start = 0; diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 8075c86124..99e484c17e 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -264,7 +264,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS, static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode) { char *domain; - int domain_len; + size_t domain_len; zend_long option = 0, variant = INTL_IDN_VARIANT_2003; zval *idna_info = NULL; diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index bbecda8c28..843f669342 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -224,7 +224,7 @@ PHP_NAMED_FUNCTION(zif_locale_get_default) PHP_NAMED_FUNCTION(zif_locale_set_default) { char* locale_name = NULL; - int len=0; + size_t len = 0; zend_string *ini_name; if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", @@ -685,7 +685,7 @@ PHP_FUNCTION( locale_get_keywords ) int32_t kw_key_len = 0; const char* loc_name = NULL; - int loc_name_len = 0; + size_t loc_name_len = 0; /* ICU expects the buffer to be allocated before calling the function @@ -1099,7 +1099,7 @@ static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name PHP_FUNCTION(locale_parse) { const char* loc_name = NULL; - int loc_name_len = 0; + size_t loc_name_len = 0; int grOffset = 0; intl_error_reset( NULL TSRMLS_CC ); @@ -1143,7 +1143,7 @@ PHP_FUNCTION(locale_parse) PHP_FUNCTION(locale_get_all_variants) { const char* loc_name = NULL; - int loc_name_len = 0; + size_t loc_name_len = 0; int result = 0; char* token = NULL; @@ -1531,7 +1531,7 @@ PHP_FUNCTION(locale_lookup) char* fallback_loc = NULL; size_t fallback_loc_len = 0; const char* loc_range = NULL; - int loc_range_len = 0; + size_t loc_range_len = 0; zval* arr = NULL; HashTable* hash_arr = NULL; diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index 691a2a2518..516f493ec9 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -96,7 +96,7 @@ PHP_FUNCTION( msgfmt_parse_message ) const char *slocale = NULL; size_t slocale_len = 0; char *source = NULL; - int src_len = 0; + size_t src_len = 0; MessageFormatter_object mf = {0}; MessageFormatter_object *mfo = &mf; diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c index 41921132c9..d3ac07024b 100644 --- a/ext/intl/normalizer/normalizer_normalize.c +++ b/ext/intl/normalizer/normalizer_normalize.c @@ -175,7 +175,7 @@ PHP_FUNCTION( normalizer_is_normalized ) 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 da93373075..a8252de638 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -315,7 +315,7 @@ ZEND_END_ARG_INFO() PHP_FUNCTION( resourcebundle_locales ) { char * bundlename; - int bundlename_len = 0; + size_t bundlename_len = 0; const char * entry; int entry_len; UEnumeration *icuenum; diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index f86d659d3a..978c830da7 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -104,7 +104,7 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct PHP_FUNCTION( transliterator_create ) { char *str_id; - int str_id_len; + size_t str_id_len; zend_long direction = TRANSLITERATOR_FORWARD; int res; diff --git a/ext/json/json.c b/ext/json/json.c index ffaefa1c9d..3c5e22cf5c 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -799,7 +799,7 @@ static PHP_FUNCTION(json_encode) static PHP_FUNCTION(json_decode) { char *str; - int str_len; + size_t str_len; zend_bool assoc = 0; /* return JS objects as PHP objects by default */ zend_long depth = JSON_PARSER_DEFAULT_DEPTH; zend_long options = 0; diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 12b64004a5..8718e9f8f2 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1881,7 +1881,7 @@ PHP_FUNCTION(mb_http_input) PHP_FUNCTION(mb_http_output) { const char *name = NULL; - int name_len; + size_t name_len; const mbfl_encoding *encoding; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { @@ -2028,7 +2028,7 @@ PHP_FUNCTION(mb_preferred_mime_name) { enum mbfl_no_encoding no_encoding; char *name = NULL; - int name_len; + size_t name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { return; @@ -2214,7 +2214,7 @@ PHP_FUNCTION(mb_strlen) int n; mbfl_string string; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; mbfl_string_init(&string); @@ -2250,7 +2250,7 @@ PHP_FUNCTION(mb_strpos) zend_long offset; mbfl_string haystack, needle; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; mbfl_string_init(&haystack); mbfl_string_init(&needle); @@ -2313,7 +2313,7 @@ PHP_FUNCTION(mb_strrpos) int n; mbfl_string haystack, needle; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; zval *zoffset = NULL; long offset = 0, str_flg; char *enc_name2 = NULL; @@ -2466,7 +2466,7 @@ PHP_FUNCTION(mb_strstr) int n, len, mblen; mbfl_string haystack, needle, result, *ret = NULL; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; zend_bool part = 0; mbfl_string_init(&haystack); @@ -2528,7 +2528,7 @@ PHP_FUNCTION(mb_strrchr) int n, len, mblen; mbfl_string haystack, needle, result, *ret = NULL; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; zend_bool part = 0; mbfl_string_init(&haystack); @@ -2590,7 +2590,7 @@ PHP_FUNCTION(mb_strrchr) PHP_FUNCTION(mb_stristr) { zend_bool part = 0; - unsigned int from_encoding_len, len, mblen; + size_t from_encoding_len, len, mblen; int n; mbfl_string haystack, needle, result, *ret = NULL; const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name; @@ -2653,7 +2653,8 @@ PHP_FUNCTION(mb_stristr) PHP_FUNCTION(mb_strrichr) { zend_bool part = 0; - int n, from_encoding_len, len, mblen; + int n, len, mblen; + size_t from_encoding_len; mbfl_string haystack, needle, result, *ret = NULL; const char *from_encoding = MBSTRG(current_internal_encoding)->name; mbfl_string_init(&haystack); @@ -2712,7 +2713,7 @@ PHP_FUNCTION(mb_substr_count) int n; mbfl_string haystack, needle; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; mbfl_string_init(&haystack); mbfl_string_init(&needle); @@ -2754,7 +2755,8 @@ PHP_FUNCTION(mb_substr) size_t argc = ZEND_NUM_ARGS(); char *str, *encoding; zend_long from, len; - int mblen, str_len, encoding_len; + int mblen; + size_t str_len, encoding_len; zval *z_len = NULL; mbfl_string string, result, *ret; @@ -2902,7 +2904,7 @@ PHP_FUNCTION(mb_strwidth) int n; mbfl_string string; char *enc_name = NULL; - int enc_name_len; + size_t enc_name_len; mbfl_string_init(&string); @@ -3149,7 +3151,7 @@ PHP_FUNCTION(mb_convert_case) { const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name; char *str; - int str_len, from_encoding_len; + size_t str_len, from_encoding_len; zend_long case_mode = 0; char *newstr; size_t ret_len; @@ -3177,7 +3179,7 @@ PHP_FUNCTION(mb_strtoupper) { const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name; char *str; - int str_len, from_encoding_len; + size_t str_len, from_encoding_len; char *newstr; size_t ret_len; @@ -3204,7 +3206,7 @@ PHP_FUNCTION(mb_strtolower) { const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name; char *str; - int str_len, from_encoding_len; + size_t str_len, from_encoding_len; char *newstr; size_t ret_len; @@ -3229,7 +3231,7 @@ PHP_FUNCTION(mb_strtolower) PHP_FUNCTION(mb_detect_encoding) { char *str; - int str_len; + size_t str_len; zend_bool strict=0; zval *encoding_list; @@ -3324,7 +3326,7 @@ PHP_FUNCTION(mb_encoding_aliases) { const mbfl_encoding *encoding; char *name = NULL; - int name_len; + size_t name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { return; @@ -3353,11 +3355,11 @@ PHP_FUNCTION(mb_encode_mimeheader) enum mbfl_no_encoding charset, transenc; mbfl_string string, result, *ret; char *charset_name = NULL; - int charset_name_len; + size_t charset_name_len; char *trans_enc_name = NULL; - int trans_enc_name_len; + size_t trans_enc_name_len; char *linefeed = "\r\n"; - int linefeed_len; + size_t linefeed_len; zend_long indent = 0; mbfl_string_init(&string); @@ -3438,9 +3440,9 @@ PHP_FUNCTION(mb_convert_kana) int opt, i; mbfl_string string, result, *ret; char *optstr = NULL; - int optstr_len; + size_t optstr_len; char *encname = NULL; - int encname_len; + size_t encname_len; mbfl_string_init(&string); string.no_language = MBSTRG(language); @@ -3771,10 +3773,10 @@ static void php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type) { char *str, *encoding; - int str_len, encoding_len; + size_t str_len, encoding_len; zval *zconvmap, *hash_entry; HashTable *target_hash; - size_t argc = ZEND_NUM_ARGS(); + int argc = ZEND_NUM_ARGS(); int i, *convmap, *mapelm, mapsize=0; zend_bool is_hex = 0; mbfl_string string, result, *ret; diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 4977c9e9cd..9628ee2526 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -655,7 +655,7 @@ PHP_FUNCTION(mb_regex_encoding) { size_t argc = ZEND_NUM_ARGS(); char *encoding; - int encoding_len; + size_t encoding_len; OnigEncoding mbctype; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &encoding, &encoding_len) == FAILURE) { @@ -1311,7 +1311,7 @@ PHP_FUNCTION(mb_ereg_search_init) size_t argc = ZEND_NUM_ARGS(); zval *arg_str; char *arg_pattern = NULL, *arg_options = NULL; - int arg_pattern_len = 0, arg_options_len = 0; + size_t arg_pattern_len = 0, arg_options_len = 0; OnigSyntaxType *syntax = NULL; OnigOptionType option; diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 15c5d70f75..1f02131aa5 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -345,7 +345,7 @@ typedef enum { #define MCRYPT_GET_MODE_DIR_ARGS(DIRECTORY) \ char *dir = NULL; \ - int dir_len; \ + size_t dir_len; \ char *module; \ size_t module_len; \ if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, \ @@ -1003,7 +1003,7 @@ PHP_FUNCTION(mcrypt_get_key_size) { char *cipher; char *module; - int cipher_len, module_len; + size_t cipher_len, module_len; char *cipher_dir_string; char *module_dir_string; MCRYPT td; @@ -1032,7 +1032,7 @@ PHP_FUNCTION(mcrypt_get_block_size) { char *cipher; char *module; - int cipher_len, module_len; + size_t cipher_len, module_len; char *cipher_dir_string; char *module_dir_string; MCRYPT td; @@ -1061,7 +1061,7 @@ PHP_FUNCTION(mcrypt_get_iv_size) { char *cipher; char *module; - int cipher_len, module_len; + size_t cipher_len, module_len; char *cipher_dir_string; char *module_dir_string; MCRYPT td; @@ -1092,7 +1092,7 @@ PHP_FUNCTION(mcrypt_get_cipher_name) char *module_dir_string; char *cipher_name; char *cipher; - int cipher_len; + size_t cipher_len; MCRYPT td; MCRYPT_GET_INI @@ -1304,7 +1304,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons PHP_FUNCTION(mcrypt_encrypt) { char *cipher, *key, *data, *mode, *iv = NULL; - int cipher_len, key_len, data_len, mode_len, iv_len = 0; + size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { @@ -1320,7 +1320,7 @@ PHP_FUNCTION(mcrypt_encrypt) PHP_FUNCTION(mcrypt_decrypt) { char *cipher, *key, *data, *mode, *iv = NULL; - int cipher_len, key_len, data_len, mode_len, iv_len = 0; + size_t cipher_len, key_len, data_len, mode_len, iv_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) { diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index c382fa7565..6d6cbc4918 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -349,7 +349,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */ goto skip_phar; } fname_len = strlen(fname); - if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { + if (FAILURE == phar_split_fname(fname, fname_len, &arch, (int *)&arch_len, &entry, (int *)&entry_len, 2, 0 TSRMLS_CC)) { goto skip_phar; } @@ -371,7 +371,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */ name = entry; } } else { - entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC); + entry = phar_fix_filepath(estrndup(entry, entry_len), (int *)&entry_len, 1 TSRMLS_CC); if (entry[0] == '/') { if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) { /* this file is not in the phar, use the original path */ diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 92bacc8e30..155252233d 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -455,7 +455,7 @@ PHP_METHOD(Phar, running) PHP_METHOD(Phar, mount) { char *fname, *arch = NULL, *entry = NULL, *path, *actual; - int fname_len, arch_len, entry_len, path_len, actual_len; + size_t fname_len, arch_len, entry_len, path_len, actual_len; phar_archive_data *pphar; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &actual, &actual_len) == FAILURE) { @@ -548,7 +548,8 @@ PHP_METHOD(Phar, webPhar) 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; + size_t fname_len, index_php_len = 0; + int entry_len, code, not_cgi; phar_archive_data *phar = NULL; phar_entry_info *info = NULL; @@ -726,7 +727,7 @@ PHP_METHOD(Phar, webPhar) } if (entry_len) { - phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len TSRMLS_CC); + phar_postprocess_ru_web(fname, fname_len, &entry, (int *)&entry_len, &ru, (int *)&ru_len TSRMLS_CC); } if (!entry_len || (entry_len == 1 && entry[0] == '/')) { @@ -946,7 +947,7 @@ PHP_METHOD(Phar, createDefaultStub) PHP_METHOD(Phar, mapPhar) { char *alias = NULL, *error; - int alias_len = 0; + size_t alias_len = 0; zend_long dataoffset = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) { @@ -968,7 +969,7 @@ PHP_METHOD(Phar, mapPhar) PHP_METHOD(Phar, loadPhar) { char *fname, *alias = NULL, *error; - int fname_len, alias_len = 0; + size_t fname_len, alias_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) { return; @@ -1046,7 +1047,8 @@ PHP_METHOD(Phar, isValidPharFilename) { char *fname; const char *ext_str; - int fname_len, ext_len, is_executable; + size_t fname_len; + int ext_len, is_executable; zend_bool executable = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &fname, &fname_len, &executable) == FAILURE) { @@ -1108,7 +1110,8 @@ PHP_METHOD(Phar, __construct) zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Cannot instantiate Phar object without SPL extension"); #else char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname; - int fname_len, alias_len = 0, arch_len, entry_len, is_data; + size_t fname_len, alias_len = 0; + int arch_len, entry_len, is_data; zend_long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS; zend_long format = 0; phar_archive_object *phar_obj; @@ -1289,7 +1292,7 @@ PHP_METHOD(Phar, getSupportedCompression) PHP_METHOD(Phar, unlinkArchive) { char *fname, *error, *zname, *arch, *entry; - int fname_len, zname_len, arch_len, entry_len; + size_t fname_len, zname_len, arch_len, entry_len; phar_archive_data *phar; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) { @@ -1713,7 +1716,7 @@ after_open_fp: PHP_METHOD(Phar, buildFromDirectory) { char *dir, *error, *regex = NULL; - int dir_len, regex_len = 0; + size_t dir_len, regex_len = 0; zend_bool apply_reg = 0; zval arg, arg2, iter, iteriter, regexiter; struct _phar_t pass; @@ -2044,7 +2047,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend ext = "phar"; } } - } else if (phar_path_check(&ext, &ext_len, &pcr_error) > pcr_is_ok) { + } else if (phar_path_check(&ext, (int *)&ext_len, &pcr_error) > pcr_is_ok) { if (phar->is_data) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext); @@ -2296,7 +2299,8 @@ no_copy: PHP_METHOD(Phar, convertToExecutable) { char *ext = NULL; - int is_data, ext_len = 0; + int is_data; + size_t ext_len = 0; php_uint32 flags; zend_object *ret; /* a number that is not 0, 1 or 2 (Which is also Greg's birthday, so there) */ @@ -2399,7 +2403,8 @@ PHP_METHOD(Phar, convertToExecutable) PHP_METHOD(Phar, convertToData) { char *ext = NULL; - int is_data, ext_len = 0; + int is_data; + size_t ext_len = 0; php_uint32 flags; zend_object *ret; /* a number that is not 0, 1 or 2 (Which is also Greg's birthday so there) */ @@ -2551,7 +2556,7 @@ PHP_METHOD(Phar, isWritable) PHP_METHOD(Phar, delete) { char *fname; - int fname_len; + size_t fname_len; char *error; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); @@ -2636,7 +2641,8 @@ PHP_METHOD(Phar, setAlias) { char *alias, *error, *oldalias; phar_archive_data *fd_ptr; - int alias_len, oldalias_len, old_temp, readd = 0; + size_t alias_len, oldalias_len; + int old_temp, readd = 0; PHAR_ARCHIVE_OBJECT(); @@ -2811,7 +2817,7 @@ PHP_METHOD(Phar, setStub) { zval *zstub; char *stub, *error; - int stub_len; + size_t stub_len; zend_long len = -1; php_stream *stream; PHAR_ARCHIVE_OBJECT(); @@ -2889,7 +2895,8 @@ PHP_METHOD(Phar, setStub) PHP_METHOD(Phar, setDefaultStub) { char *index = NULL, *webindex = NULL, *error = NULL, *stub = NULL; - int index_len = 0, webindex_len = 0, created_stub = 0; + size_t index_len = 0, webindex_len = 0; + int created_stub = 0; size_t stub_len = 0; PHAR_ARCHIVE_OBJECT(); @@ -3135,7 +3142,7 @@ PHP_METHOD(Phar, compress) { zend_long method; char *ext = NULL; - int ext_len = 0; + size_t ext_len = 0; php_uint32 flags; zend_object *ret; PHAR_ARCHIVE_OBJECT(); @@ -3203,7 +3210,7 @@ PHP_METHOD(Phar, compress) PHP_METHOD(Phar, decompress) { char *ext = NULL; - int ext_len = 0; + size_t ext_len = 0; zend_object *ret; PHAR_ARCHIVE_OBJECT(); @@ -3368,7 +3375,7 @@ PHP_METHOD(Phar, copy) { char *oldfile, *newfile, *error; const char *pcr_error; - int oldfile_len, newfile_len; + size_t oldfile_len, newfile_len; phar_entry_info *oldentry, newentry = {0}, *temp; PHAR_ARCHIVE_OBJECT(); @@ -3466,7 +3473,7 @@ PHP_METHOD(Phar, copy) PHP_METHOD(Phar, offsetExists) { char *fname; - int fname_len; + size_t fname_len; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); @@ -3503,7 +3510,7 @@ PHP_METHOD(Phar, offsetExists) PHP_METHOD(Phar, offsetGet) { char *fname, *error; - int fname_len; + size_t fname_len; zval zfname; phar_entry_info *entry; zend_string *sfname; @@ -3647,7 +3654,7 @@ static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len PHP_METHOD(Phar, offsetSet) { char *fname, *cont_str = NULL; - int fname_len, cont_len; + size_t fname_len, cont_len; zval *zresource; PHAR_ARCHIVE_OBJECT(); @@ -3686,7 +3693,7 @@ PHP_METHOD(Phar, offsetSet) PHP_METHOD(Phar, offsetUnset) { char *fname, *error; - int fname_len; + size_t fname_len; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); @@ -3738,7 +3745,7 @@ PHP_METHOD(Phar, offsetUnset) PHP_METHOD(Phar, addEmptyDir) { char *dirname; - int dirname_len; + size_t dirname_len; PHAR_ARCHIVE_OBJECT(); @@ -3761,7 +3768,7 @@ PHP_METHOD(Phar, addEmptyDir) PHP_METHOD(Phar, addFile) { char *fname, *localname = NULL; - int fname_len, localname_len = 0; + size_t fname_len, localname_len = 0; php_stream *resource; zval zresource; @@ -4320,7 +4327,7 @@ all_files: PHP_METHOD(PharFileInfo, __construct) { char *fname, *arch, *entry, *error; - int fname_len, arch_len, entry_len; + size_t fname_len, arch_len, entry_len; phar_entry_object *entry_obj; phar_entry_info *entry_info; phar_archive_data *phar_data; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 08434512e3..a78b9ddeaf 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1490,7 +1490,7 @@ PHP_METHOD(SoapServer, handle) soapHeader *soap_headers = NULL; sdlFunctionPtr function; char *arg = NULL; - int arg_len = 0; + size_t arg_len = 0; xmlCharEncodingHandlerPtr old_encoding; HashTable *old_class_map, *old_typemap; int old_features; @@ -2848,7 +2848,8 @@ static void verify_soap_headers_array(HashTable *ht TSRMLS_DC) PHP_METHOD(SoapClient, __call) { char *function, *location=NULL, *soap_action = NULL, *uri = NULL; - int function_len, i = 0; + size_t function_len; + int i = 0; HashTable* soap_headers = NULL; zval *options = NULL; zval *headers = NULL; diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 17f0c95da8..0da81e74f5 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1075,8 +1075,9 @@ PHP_FUNCTION(socket_write) { zval *arg1; php_socket *php_sock; - int retval, str_len; - zend_long length = 0; + int retval; + size_t str_len; + zend_long length = 0; char *str; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) { @@ -1372,7 +1373,8 @@ PHP_FUNCTION(socket_connect) zval *arg1; php_socket *php_sock; char *addr; - int retval, addr_len; + int retval; + size_t addr_len; zend_long port = 0; int argc = ZEND_NUM_ARGS(); @@ -1758,8 +1760,9 @@ PHP_FUNCTION(socket_sendto) #if HAVE_IPV6 struct sockaddr_in6 sin6; #endif - int retval, buf_len, addr_len; - zend_long len, flags, port = 0; + int retval; + size_t buf_len, addr_len; + zend_long len, flags, port = 0; char *buf, *addr; int argc = ZEND_NUM_ARGS(); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index e2b743c79c..666fd1ea43 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, size_t *len TSRMLS_DC) /* {{{ */ +PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, int *len TSRMLS_DC) /* {{{ */ { #ifdef HAVE_GLOB if (intern->type == SPL_FS_DIR) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6bf64838c9..8b43e5e53a 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5551,7 +5551,7 @@ PHP_FUNCTION(getservbyport) PHP_FUNCTION(getprotobyname) { char *name; - int name_len; + size_t name_len; struct protoent *ent; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { diff --git a/ext/standard/file.c b/ext/standard/file.c index 8747d14cb8..dc8b4828bb 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1454,7 +1454,7 @@ PHPAPI PHP_FUNCTION(fpassthru) PHP_FUNCTION(rename) { char *old_name, *new_name; - int old_name_len, new_name_len; + size_t old_name_len, new_name_len; zval *zcontext = NULL; php_stream_wrapper *wrapper; php_stream_context *context; diff --git a/ext/standard/http.c b/ext/standard/http.c index 5547380e08..62b05ed7b5 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -66,7 +66,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, /* private or protected property access outside of the class */ continue; } - zend_unmangle_property_name_ex(key->val, key->len, &tmp, &prop_name, &prop_len); + zend_unmangle_property_name_ex(key->val, key->len, &tmp, &prop_name, (int *)&prop_len); } else { prop_name = key->val; prop_len = key->len; diff --git a/ext/standard/string.c b/ext/standard/string.c index 55eb1f1481..c0423fc35a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5057,7 +5057,7 @@ PHP_FUNCTION(str_pad) /* 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 < 0 || pad_length <= input->len) { RETURN_STRINGL(input->val, input->len); } @@ -5072,7 +5072,7 @@ PHP_FUNCTION(str_pad) } num_pad_chars = pad_length - input->len; - if (num_pad_chars >= ZEND_LONG_MAX) { + if (num_pad_chars >= INT_MAX) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding length is too long"); return; } diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index c540f23c22..931ea81c4e 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -1083,7 +1083,7 @@ PHP_FUNCTION(wddx_serialize_value) { zval *var; char *comment = NULL; - int comment_len = 0; + size_t comment_len = 0; wddx_packet *packet; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &var, &comment, &comment_len) == FAILURE) { @@ -1167,7 +1167,7 @@ void php_wddx_destructor(wddx_packet *packet) PHP_FUNCTION(wddx_packet_start) { char *comment = NULL; - int comment_len = 0; + size_t comment_len = 0; wddx_packet *packet; comment = NULL; diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 1a2859c887..2ad53e77e9 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1092,10 +1092,10 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp int auto_detect = 0; char *encoding_param = NULL; - int encoding_param_len = 0; + size_t encoding_param_len = 0; char *ns_param = NULL; - int ns_param_len = 0; + size_t ns_param_len = 0; XML_Char *encoding; @@ -1365,7 +1365,8 @@ PHP_FUNCTION(xml_parse) xml_parser *parser; zval *pind; char *data; - size_t data_len, ret; + size_t data_len; + int ret; zend_long isFinal = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) { @@ -1389,7 +1390,8 @@ PHP_FUNCTION(xml_parse_into_struct) xml_parser *parser; zval *pind, *xdata, *info = NULL; char *data; - size_t data_len, ret; + size_t data_len; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) { return; diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 1d6849e84f..a90f727cb8 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -480,7 +480,8 @@ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) { #ifdef LIBXML_SCHEMAS_ENABLED zval *id; - int source_len = 0, retval = -1; + size_t source_len = 0; + int retval = -1; xmlreader_object *intern; xmlRelaxNGPtr schema = NULL; char *source; @@ -664,7 +665,8 @@ Positions reader at specified attribute - Returns TRUE on success and FALSE on f PHP_METHOD(xmlreader, moveToAttribute) { zval *id; - int name_len = 0, retval; + size_t name_len = 0; + int retval; xmlreader_object *intern; char *name; @@ -725,7 +727,8 @@ Returns TRUE on success and FALSE on failure */ PHP_METHOD(xmlreader, moveToAttributeNs) { zval *id; - int name_len=0, ns_uri_len=0, retval; + size_t name_len=0, ns_uri_len=0; + int retval; xmlreader_object *intern; char *name, *ns_uri; @@ -805,7 +808,8 @@ Moves the position of the current instance to the next node in the stream. */ PHP_METHOD(xmlreader, next) { zval *id; - int retval, name_len=0; + int retval; + size_t name_len=0; xmlreader_object *intern; char *name = NULL; @@ -936,7 +940,8 @@ PHP_METHOD(xmlreader, setSchema) { #ifdef LIBXML_SCHEMAS_ENABLED zval *id; - int source_len = 0, retval = -1; + size_t source_len = 0; + int retval = -1; xmlreader_object *intern; char *source; diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 09495b5e4f..b5b7e87161 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -1141,7 +1141,7 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data) PHP_FUNCTION(xmlrpc_parse_method_descriptions) { char *arg1; - int arg1_len; + size_t arg1_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1, &arg1_len) == FAILURE) { return; diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 4e7d66d228..cd828c75a0 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -808,7 +808,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_parameter) { zval *id; char *namespace; - int namespace_len = 0; + size_t namespace_len = 0; zval *value; zend_string *name; xsl_object *intern; @@ -833,7 +833,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_parameter) PHP_FUNCTION(xsl_xsltprocessor_remove_parameter) { zval *id; - int namespace_len = 0; + size_t namespace_len = 0; char *namespace; zend_string *name; xsl_object *intern; diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index a195fa801e..fd6953a76b 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1439,7 +1439,7 @@ static ZIPARCHIVE_METHOD(setPassword) struct zip *intern; zval *self = getThis(); char *password; - int password_len; + size_t password_len; if (!self) { RETURN_FALSE; @@ -1522,7 +1522,7 @@ static ZIPARCHIVE_METHOD(addEmptyDir) struct zip *intern; zval *self = getThis(); char *dirname; - int dirname_len; + size_t dirname_len; int idx; struct zip_stat sb; char *s; @@ -1575,7 +1575,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* char *path = NULL; char *remove_path = NULL; char *add_path = NULL; - int add_path_len, remove_path_len = 0, path_len = 0; + size_t add_path_len, remove_path_len = 0, path_len = 0; zend_long remove_all_path = 0; zend_long flags = 0; zval *options = NULL; @@ -1915,7 +1915,7 @@ static ZIPARCHIVE_METHOD(setArchiveComment) { struct zip *intern; zval *self = getThis(); - int comment_len; + size_t comment_len; char * comment; if (!self) { @@ -1969,7 +1969,7 @@ static ZIPARCHIVE_METHOD(setCommentName) { struct zip *intern; zval *self = getThis(); - int comment_len, name_len; + size_t comment_len, name_len; char * comment, *name; int idx; @@ -2003,7 +2003,7 @@ static ZIPARCHIVE_METHOD(setCommentIndex) struct zip *intern; zval *self = getThis(); zend_long index; - int comment_len; + size_t comment_len; char * comment; struct zip_stat sb; @@ -2179,7 +2179,8 @@ static ZIPARCHIVE_METHOD(getCommentName) { struct zip *intern; zval *self = getThis(); - int name_len, idx; + size_t name_len; + int idx; zend_long flags = 0; int comment_len = 0; const char * comment; @@ -2343,7 +2344,7 @@ static ZIPARCHIVE_METHOD(renameName) zval *self = getThis(); struct zip_stat sb; char *name, *new_name; - int name_len, new_name_len; + size_t name_len, new_name_len; if (!self) { RETURN_FALSE; |