diff options
Diffstat (limited to 'ext/standard')
42 files changed, 165 insertions, 176 deletions
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(); |