diff options
author | Anatol Belski <ab@php.net> | 2014-08-25 20:22:49 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-25 20:22:49 +0200 |
commit | 4d997f63d98c663b2d9acccd3655572652f61c7d (patch) | |
tree | bce31fa83a23d3ad58d640d581d498f3bdd0cbf4 /ext/standard | |
parent | 6f9f0bf2056f0dc17d9bcc6dd3b7d28ac878c6fc (diff) | |
download | php-git-4d997f63d98c663b2d9acccd3655572652f61c7d.tar.gz |
master renames phase 3
Diffstat (limited to 'ext/standard')
33 files changed, 189 insertions, 189 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 4baaf83b20..2663b404ac 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4247,7 +4247,7 @@ PHP_FUNCTION(array_product) if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) { dval = (double)Z_LVAL_P(return_value) * (double)Z_LVAL(entry_n); - if ( (double)PHP_INT_MIN <= dval && dval <= (double)PHP_INT_MAX ) { + if ( (double)ZEND_LONG_MIN <= dval && dval <= (double)ZEND_LONG_MAX ) { Z_LVAL_P(return_value) *= Z_LVAL(entry_n); continue; } diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 370e1b2d90..544514161b 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -53,7 +53,7 @@ static const short base64_reverse_table[256] = { }; /* }}} */ -PHPAPI zend_string *php_base64_encode(const unsigned char *str, php_size_t length) /* {{{ */ +PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) /* {{{ */ { const unsigned char *current = str; unsigned char *p; @@ -131,13 +131,13 @@ void php_base64_init(void) */ /* }}} */ -PHPAPI zend_string *php_base64_decode(const unsigned char *str, php_size_t length) /* {{{ */ +PHPAPI zend_string *php_base64_decode(const unsigned char *str, size_t length) /* {{{ */ { return php_base64_decode_ex(str, length, 0); } /* }}} */ -PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, php_size_t length, zend_bool strict) /* {{{ */ +PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) /* {{{ */ { const unsigned char *current = str; int ch, i = 0, j = 0, k; diff --git a/ext/standard/base64.h b/ext/standard/base64.h index dd07db56e1..43324e4911 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -24,9 +24,9 @@ PHP_FUNCTION(base64_decode); PHP_FUNCTION(base64_encode); -PHPAPI extern zend_string *php_base64_encode(const unsigned char *, php_size_t); -PHPAPI extern zend_string *php_base64_decode_ex(const unsigned char *, php_size_t, zend_bool); -PHPAPI extern zend_string *php_base64_decode(const unsigned char *, php_size_t); +PHPAPI extern zend_string *php_base64_encode(const unsigned char *, size_t); +PHPAPI extern zend_string *php_base64_decode_ex(const unsigned char *, size_t, zend_bool); +PHPAPI extern zend_string *php_base64_decode(const unsigned char *, size_t); #endif /* BASE64_H */ diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index 95df4bdc59..e53f488805 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -372,7 +372,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1) == 0) { const char *num = salt + sizeof(sha256_rounds_prefix) - 1; char *endp; - zend_ulong srounds = ZEND_STRTOUI(num, &endp, 10); + zend_ulong srounds = ZEND_STRTOUL(num, &endp, 10); if (*endp == '$') { salt = endp + 1; rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX)); diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index 411abf64e6..a673bfac1c 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -405,7 +405,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1) == 0) { const char *num = salt + sizeof(sha512_rounds_prefix) - 1; char *endp; - zend_ulong srounds = ZEND_STRTOUI(num, &endp, 10); + zend_ulong srounds = ZEND_STRTOUL(num, &endp, 10); if (*endp == '$') { salt = endp + 1; diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ff4a3bbc75..4d96384e9c 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -524,7 +524,7 @@ no_results: * able to filter directories out. */ if (flags & GLOB_ONLYDIR) { - php_stat_t s; + zend_stat_t s; if (0 != VCWD_STAT(globbuf.gl_pathv[n], &s)) { continue; diff --git a/ext/standard/file.c b/ext/standard/file.c index e2a63ceef8..28fc790ea9 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -552,7 +552,7 @@ PHP_FUNCTION(file_get_contents) } if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_INT_FMT " in the stream", offset); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset); php_stream_close(stream); RETURN_FALSE; } @@ -628,13 +628,13 @@ PHP_FUNCTION(file_put_contents) switch (Z_TYPE_P(data)) { case IS_RESOURCE: { - php_size_t len; + size_t len; if (php_stream_copy_to_stream_ex(srcstream, stream, PHP_STREAM_COPY_ALL, &len) != SUCCESS) { ret_ok = 0; } else { - if (len > PHP_INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "content truncated from %zu to " ZEND_INT_FMT " bytes", len, PHP_INT_MAX); - len = PHP_INT_MAX; + if (len > ZEND_LONG_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX); + len = ZEND_LONG_MAX; } numbytes = len; } @@ -659,7 +659,7 @@ PHP_FUNCTION(file_put_contents) case IS_ARRAY: if (zend_hash_num_elements(Z_ARRVAL_P(data))) { - php_size_t bytes_written; + size_t bytes_written; zval *tmp; ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), tmp) { @@ -732,7 +732,7 @@ PHP_FUNCTION(file) return; } if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'" ZEND_INT_FMT "' flag is not supported", flags); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags); RETURN_FALSE; } @@ -1888,8 +1888,8 @@ PHP_FUNCTION(fputcsv) } /* }}} */ -/* {{{ PHPAPI php_size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */ -PHPAPI php_size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) +/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */ +PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) { int count, i = 0, ret; zval *field_tmp; diff --git a/ext/standard/file.h b/ext/standard/file.h index e29d4b3c73..4551d5ec44 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -80,7 +80,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC); PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC); PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC); -PHPAPI php_size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC); +PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC); #define META_DEF_BUFSIZE 8192 diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index c0ea9bc056..a081fdf4f0 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -1223,7 +1223,7 @@ PHP_FUNCTION(realpath_cache_get) array_init(&entry); /* bucket->key is unsigned long */ - if (ZEND_INT_MAX >= bucket->key) { + if (ZEND_LONG_MAX >= bucket->key) { add_assoc_long(&entry, "key", bucket->key); } else { add_assoc_double(&entry, "key", (double)bucket->key); diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index a445625297..587474346a 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -52,7 +52,7 @@ static char HEXCHARS[] = "0123456789ABCDEF"; /* php_spintf_appendchar() {{{ */ inline static void -php_sprintf_appendchar(zend_string **buffer, php_size_t *pos, char add TSRMLS_DC) +php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add TSRMLS_DC) { if (!*buffer || (*pos + 1) >= (*buffer)->len) { PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), (*buffer)->len)); @@ -65,14 +65,14 @@ php_sprintf_appendchar(zend_string **buffer, php_size_t *pos, char add TSRMLS_DC /* php_spintf_appendstring() {{{ */ inline static void -php_sprintf_appendstring(zend_string **buffer, php_size_t *pos, char *add, - php_size_t min_width, php_size_t max_width, char padding, - php_size_t alignment, php_size_t len, int neg, int expprec, int always_sign) +php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add, + size_t min_width, size_t max_width, char padding, + size_t alignment, size_t len, int neg, int expprec, int always_sign) { - register php_size_t npad; - php_size_t req_size; - php_size_t copy_len; - php_size_t m_width; + register size_t npad; + size_t req_size; + size_t copy_len; + size_t m_width; copy_len = (expprec ? MIN(max_width, len) : len); npad = (min_width < copy_len) ? 0 : min_width - copy_len; @@ -122,8 +122,8 @@ php_sprintf_appendstring(zend_string **buffer, php_size_t *pos, char *add, /* php_spintf_appendint() {{{ */ inline static void -php_sprintf_appendint(zend_string **buffer, php_size_t *pos, zend_long number, - php_size_t width, char padding, php_size_t alignment, +php_sprintf_appendint(zend_string **buffer, size_t *pos, zend_long number, + size_t width, char padding, size_t alignment, int always_sign) { char numbuf[NUM_BUF_SIZE]; @@ -166,9 +166,9 @@ php_sprintf_appendint(zend_string **buffer, php_size_t *pos, zend_long number, /* php_spintf_appenduint() {{{ */ inline static void -php_sprintf_appenduint(zend_string **buffer, php_size_t *pos, +php_sprintf_appenduint(zend_string **buffer, size_t *pos, zend_ulong number, - php_size_t width, char padding, php_size_t alignment) + size_t width, char padding, size_t alignment) { char numbuf[NUM_BUF_SIZE]; register zend_ulong magn, nmagn; @@ -198,17 +198,17 @@ php_sprintf_appenduint(zend_string **buffer, php_size_t *pos, /* php_spintf_appenddouble() {{{ */ inline static void -php_sprintf_appenddouble(zend_string **buffer, php_size_t *pos, +php_sprintf_appenddouble(zend_string **buffer, size_t *pos, double number, - php_size_t width, char padding, - php_size_t alignment, int precision, + size_t width, char padding, + size_t alignment, int precision, int adjust, char fmt, int always_sign TSRMLS_DC) { char num_buf[NUM_BUF_SIZE]; char *s = NULL; - php_size_t s_len = 0; + size_t s_len = 0; int is_negative = 0; #ifdef HAVE_LOCALE_H struct lconv *lconv; @@ -290,8 +290,8 @@ php_sprintf_appenddouble(zend_string **buffer, php_size_t *pos, /* php_spintf_appendd2n() {{{ */ inline static void -php_sprintf_append2n(zend_string **buffer, php_size_t *pos, zend_long number, - php_size_t width, char padding, php_size_t alignment, int n, +php_sprintf_append2n(zend_string **buffer, size_t *pos, zend_long number, + size_t width, char padding, size_t alignment, int n, char *chartable, int expprec) { char numbuf[NUM_BUF_SIZE]; @@ -321,11 +321,11 @@ php_sprintf_append2n(zend_string **buffer, php_size_t *pos, zend_long number, /* php_spintf_getnumber() {{{ */ inline static int -php_sprintf_getnumber(char *buffer, php_size_t *pos) +php_sprintf_getnumber(char *buffer, size_t *pos) { char *endptr; - register zend_long num = ZEND_STRTOI(&buffer[*pos], &endptr, 10); - register php_size_t i = 0; + register zend_long num = ZEND_STRTOL(&buffer[*pos], &endptr, 10); + register size_t i = 0; if (endptr != NULL) { i = (endptr - &buffer[*pos]); @@ -371,7 +371,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) zval *newargs = NULL; zval *args, *z_format; int argc; - php_size_t size = 240, inpos = 0, outpos = 0, temppos; + size_t size = 240, inpos = 0, outpos = 0, temppos; int alignment, currarg, adjusting, argnum, width, precision; char *format, padding; zend_string *result; @@ -678,7 +678,7 @@ PHP_FUNCTION(vsprintf) PHP_FUNCTION(user_printf) { zend_string *result; - php_size_t rlen; + size_t rlen; if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) { RETURN_FALSE; @@ -694,7 +694,7 @@ PHP_FUNCTION(user_printf) PHP_FUNCTION(vprintf) { zend_string *result; - php_size_t rlen; + size_t rlen; if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) { RETURN_FALSE; diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 741e71aa84..319a0437d6 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -52,11 +52,11 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (persistent) { - spprintf(&hashkey, 0, "pfsockopen__%s:" ZEND_INT_FMT, host, port); + spprintf(&hashkey, 0, "pfsockopen__%s:" ZEND_LONG_FMT, host, port); } if (port > 0) { - hostname_len = spprintf(&hostname, 0, "%s:" ZEND_INT_FMT, host, port); + hostname_len = spprintf(&hostname, 0, "%s:" ZEND_LONG_FMT, host, port); } else { hostname_len = host_len; hostname = host; @@ -83,7 +83,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) efree(hostname); } if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:" ZEND_INT_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val); } if (hashkey) { diff --git a/ext/standard/html.c b/ext/standard/html.c index a2c7c29990..a9e5fbfe9d 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -804,7 +804,7 @@ static inline int process_numeric_entity(const char **buf, unsigned *code_point) return FAILURE; } - code_l = ZEND_STRTOI(*buf, &endptr, hexadecimal ? 16 : 10); + code_l = ZEND_STRTOL(*buf, &endptr, hexadecimal ? 16 : 10); /* we're guaranteed there were valid digits, so *endptr > buf */ *buf = endptr; diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index f0875d8ee5..07466d2966 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -88,7 +88,7 @@ PHP_FUNCTION(linkinfo) { char *link; int link_len; - php_stat_t sb; + zend_stat_t sb; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) { diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 1b0e2e37b6..e45f9f7c90 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -285,9 +285,9 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char f = php_basename(tmp, strlen(tmp), NULL, 0 TSRMLS_CC); if (headers != NULL) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_INT_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_INT_FMT ":%s", php_getuid(TSRMLS_C), f->val); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(TSRMLS_C), f->val); } zend_string_release(f); } diff --git a/ext/standard/math.c b/ext/standard/math.c index f9d144e295..8a99faa665 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -286,8 +286,8 @@ PHP_FUNCTION(abs) if (Z_TYPE_P(value) == IS_DOUBLE) { RETURN_DOUBLE(fabs(Z_DVAL_P(value))); } else if (Z_TYPE_P(value) == IS_LONG) { - if (Z_LVAL_P(value) == ZEND_INT_MIN) { - RETURN_DOUBLE(-(double)ZEND_INT_MIN); + if (Z_LVAL_P(value) == ZEND_LONG_MIN) { + RETURN_DOUBLE(-(double)ZEND_LONG_MIN); } else { RETURN_LONG(Z_LVAL_P(value) < 0 ? -Z_LVAL_P(value) : Z_LVAL_P(value)); } @@ -959,7 +959,7 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base) TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is too big to fit in long", s); - return ZEND_INT_MAX; + return ZEND_LONG_MAX; } } @@ -987,8 +987,8 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) s = Z_STRVAL_P(arg); - cutoff = ZEND_INT_MAX / base; - cutlim = ZEND_INT_MAX % base; + cutoff = ZEND_LONG_MAX / base; + cutlim = ZEND_LONG_MAX % base; for (i = Z_STRLEN_P(arg); i > 0; i--) { c = *s++; @@ -1431,7 +1431,7 @@ PHP_FUNCTION(intdiv) if (divisor == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); RETURN_BOOL(0); - } else if (divisor == -1 && numerator == PHP_INT_MIN) { + } else if (divisor == -1 && numerator == ZEND_LONG_MIN) { /* Prevent overflow error/crash We don't return a float here as that violates function contract */ RETURN_LONG(0); diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 1a1b9d335b..68161da326 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -81,7 +81,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file) unsigned char buf[1024]; unsigned char digest[16]; PHP_MD5_CTX context; - php_size_t n; + size_t n; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) { diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index d2c3ebf9c4..f2feb72ebf 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -25,7 +25,7 @@ #include "php.h" #include "php_metaphone.h" -static int metaphone(unsigned char *word, php_size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional); +static int metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional); /* {{{ proto string metaphone(string text[, int phones]) Break english phrases down into their phonemes */ @@ -165,11 +165,11 @@ static char Lookahead(char *word, int how_far) /* {{{ metaphone */ -static int metaphone(unsigned char *word, php_size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional) +static int metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional) { int w_idx = 0; /* point in the phonization we're at. */ int p_idx = 0; /* end of the phoned phrase */ - php_size_t max_buffer_len = 0; /* maximum length of the destination buffer */ + size_t max_buffer_len = 0; /* maximum length of the destination buffer */ /*-- Parameter checks --*/ /* Negative phoneme length is meaningless */ diff --git a/ext/standard/pack.c b/ext/standard/pack.c index f82e4a394c..59f878e217 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -84,7 +84,7 @@ static int little_endian_long_map[4]; /* {{{ php_pack */ -static void php_pack(zval *val, php_size_t size, int *map, char *output) +static void php_pack(zval *val, size_t size, int *map, char *output) { int i; char *v; @@ -480,7 +480,7 @@ PHP_FUNCTION(pack) /* {{{ php_unpack */ -static zend_long php_unpack(char *data, php_size_t size, int issigned, int *map) +static zend_long php_unpack(char *data, size_t size, int issigned, int *map) { zend_long result; char *cresult = (char *) &result; @@ -514,7 +514,7 @@ PHP_FUNCTION(unpack) { char *format, *input; zend_string *formatarg, *inputarg; - php_size_t formatlen, inputpos, inputlen; + size_t formatlen, inputpos, inputlen; int i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg, @@ -661,7 +661,7 @@ PHP_FUNCTION(unpack) switch ((int) type) { case 'a': { /* a will not strip any trailing whitespace or null padding */ - php_size_t len = inputlen - inputpos; /* Remaining string */ + size_t len = inputlen - inputpos; /* Remaining string */ /* If size was given take minimum of len and size */ if ((size >= 0) && (len > size)) { @@ -676,7 +676,7 @@ PHP_FUNCTION(unpack) case 'A': { /* A will strip any trailing whitespace */ char padn = '\0'; char pads = ' '; char padt = '\t'; char padc = '\r'; char padl = '\n'; - php_size_t len = inputlen - inputpos; /* Remaining string */ + size_t len = inputlen - inputpos; /* Remaining string */ /* If size was given take minimum of len and size */ if ((size >= 0) && (len > size)) { @@ -703,7 +703,7 @@ PHP_FUNCTION(unpack) case 'Z': { /* Z will strip everything after the first null character */ char pad = '\0'; - php_size_t s, + size_t s, len = inputlen - inputpos; /* Remaining string */ /* If size was given take minimum of len and size */ @@ -727,11 +727,11 @@ PHP_FUNCTION(unpack) case 'h': case 'H': { - php_size_t len = (inputlen - inputpos) * 2; /* Remaining */ + size_t len = (inputlen - inputpos) * 2; /* Remaining */ int nibbleshift = (type == 'h') ? 0 : 4; int first = 1; char *buf; - php_size_t ipos, opos; + size_t ipos, opos; /* If size was given take minimum of len and size */ if (size >= 0 && len > (size * 2)) { diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index d2b3cd1ce4..61a4ae6ec2 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -59,7 +59,7 @@ */ PHPAPI void php_statpage(TSRMLS_D) { - php_stat_t *pstat; + zend_stat_t *pstat; pstat = sapi_get_stat(TSRMLS_C); diff --git a/ext/standard/password.c b/ext/standard/password.c index 4010f6a04c..73d468d126 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -196,7 +196,7 @@ PHP_FUNCTION(password_get_info) case PHP_PASSWORD_BCRYPT: { zend_long cost = PHP_PASSWORD_BCRYPT_COST; - sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost); + sscanf(hash, "$2y$" ZEND_LONG_FMT "$", &cost); add_assoc_long(&options, "cost", cost); } break; @@ -253,7 +253,7 @@ PHP_FUNCTION(password_needs_rehash) } } - sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost); + sscanf(hash, "$2y$" ZEND_LONG_FMT "$", &cost); if (cost != new_cost) { RETURN_TRUE; } @@ -336,7 +336,7 @@ PHP_FUNCTION(password_hash) } if (cost < 4 || cost > 31) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_INT_FMT, cost); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost); RETURN_NULL(); } @@ -348,7 +348,7 @@ PHP_FUNCTION(password_hash) break; case PHP_PASSWORD_UNKNOWN: default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_INT_FMT, algo); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo); RETURN_NULL(); } diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 5280a4f014..7b52494688 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -190,7 +190,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa max_memory = PHP_STREAM_MAX_MEM; if (!strncasecmp(path, "/maxmemory:", 11)) { path += 11; - max_memory = ZEND_STRTOI(path, NULL, 10); + max_memory = ZEND_STRTOL(path, NULL, 10); if (max_memory < 0) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; @@ -304,7 +304,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } start = &path[3]; - fildes_ori = ZEND_STRTOI(start, &end, 10); + fildes_ori = ZEND_STRTOL(start, &end, 10); if (end == start || *end != '\0') { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "php://fd/ stream must be specified in the form php://fd/<orig fd>"); @@ -326,7 +326,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa fd = dup(fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, - "Error duping file descriptor " ZEND_INT_FMT "; possibly it doesn't exist: " + "Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; } @@ -380,7 +380,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__) do { - php_stat_t st; + zend_stat_t st; memset(&st, 0, sizeof(st)); if (php_fstat(fd, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { stream = php_stream_sock_open_from_socket(fd, NULL); diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index f2cb5c1755..e0ffff5e23 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -120,23 +120,23 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out); PHPAPI char *php_strtoupper(char *s, size_t len); PHPAPI char *php_strtolower(char *s, size_t len); -PHPAPI char *php_strtr(char *str, php_size_t len, char *str_from, char *str_to, php_size_t trlen); -PHPAPI zend_string *php_addslashes(char *str, php_size_t length, int should_free TSRMLS_DC); -PHPAPI zend_string *php_addcslashes(const char *str, php_size_t length, int freeit, char *what, php_size_t wlength TSRMLS_DC); -PHPAPI void php_stripslashes(char *str, php_size_t *len TSRMLS_DC); -PHPAPI void php_stripcslashes(char *str, php_size_t *len); +PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen); +PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC); +PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength TSRMLS_DC); +PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC); +PHPAPI void php_stripcslashes(char *str, size_t *len); PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC); PHPAPI size_t php_dirname(char *str, size_t len); PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len); -PHPAPI zend_string *php_str_to_str_ex(char *haystack, php_size_t length, char *needle, - php_size_t needle_len, char *str, php_size_t str_len, int case_sensitivity, php_size_t *replace_count); -PHPAPI zend_string *php_str_to_str(char *haystack, php_size_t length, char *needle, - php_size_t needle_len, char *str, php_size_t str_len); -PHPAPI char *php_trim(char *c, php_size_t len, char *what, php_size_t what_len, zval *return_value, int mode TSRMLS_DC); -PHPAPI size_t php_strip_tags(char *rbuf, php_size_t len, int *state, char *allow, php_size_t allow_len); -PHPAPI size_t php_strip_tags_ex(char *rbuf, php_size_t len, int *stateptr, char *allow, php_size_t allow_len, zend_bool allow_tag_spaces); -PHPAPI php_size_t php_char_to_str_ex(char *str, php_size_t len, char from, char *to, php_size_t to_len, zval *result, int case_sensitivity, php_size_t *replace_count); -PHPAPI php_size_t php_char_to_str(char *str, php_size_t len, char from, char *to, php_size_t to_len, zval *result); +PHPAPI zend_string *php_str_to_str_ex(char *haystack, size_t length, char *needle, + size_t needle_len, char *str, size_t str_len, int case_sensitivity, size_t *replace_count); +PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, + size_t needle_len, char *str, size_t str_len); +PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC); +PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, char *allow, size_t allow_len); +PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len, zend_bool allow_tag_spaces); +PHPAPI size_t php_char_to_str_ex(char *str, size_t len, char from, char *to, size_t to_len, zval *result, int case_sensitivity, size_t *replace_count); +PHPAPI size_t php_char_to_str(char *str, size_t len, char from, char *to, size_t to_len, zval *result); PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC); PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, zend_long limit); diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index 670fa3f63e..f1dda2de45 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -24,8 +24,8 @@ PHP_FUNCTION(convert_uudecode); PHP_FUNCTION(convert_uuencode); -PHPAPI zend_string *php_uudecode(char *src, php_size_t src_len); -PHPAPI zend_string *php_uuencode(char *src, php_size_t src_len); +PHPAPI zend_string *php_uudecode(char *src, size_t src_len); +PHPAPI zend_string *php_uuencode(char *src, size_t src_len); #endif /* PHP_UUENCODE_H */ diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index b2186b5ed1..8abccaf820 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -204,7 +204,7 @@ PHP_FUNCTION(quoted_printable_decode) zend_string *arg1; char *str_in; zend_string *str_out; - php_size_t i = 0, j = 0, k; + size_t i = 0, j = 0, k; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg1) == FAILURE) { return; diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 8cff654c3f..fdc86632cd 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -318,7 +318,7 @@ PHP_FUNCTION(mt_rand) if (zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) { return; } else if (max < min) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(" ZEND_INT_FMT ") is smaller than min(" ZEND_INT_FMT ")", max, min); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min); RETURN_FALSE; } } diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 935ead4161..7ae0df6df5 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -356,7 +356,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs) * must not be a mixture of XPG3 specs and non-XPG3 specs * in the same format string. */ - value = ZEND_STRTOUI(format-1, &end, 10); + value = ZEND_STRTOUL(format-1, &end, 10); if (*end != '$') { goto notXpg; } @@ -403,7 +403,7 @@ xpgCheckDone: * Parse any width specifier. */ if (isdigit(UCHAR(*ch))) { - value = ZEND_STRTOUI(format-1, &format, 10); + value = ZEND_STRTOUL(format-1, &format, 10); flags |= SCAN_WIDTH; ch = format++; } @@ -708,7 +708,7 @@ literal: flags |= SCAN_SUPPRESS; ch = format++; } else if ( isdigit(UCHAR(*ch))) { - value = ZEND_STRTOUI(format-1, &end, 10); + value = ZEND_STRTOUL(format-1, &end, 10); if (*end == '$') { format = end+1; ch = format++; @@ -720,7 +720,7 @@ literal: * Parse any width specifier. */ if ( isdigit(UCHAR(*ch))) { - width = ZEND_STRTOUI(format-1, &format, 10); + width = ZEND_STRTOUL(format-1, &format, 10); ch = format++; } else { width = 0; @@ -756,29 +756,29 @@ literal: case 'D': op = 'i'; base = 10; - fn = (zend_long (*)())ZEND_STRTOI_PTR; + fn = (zend_long (*)())ZEND_STRTOL_PTR; break; case 'i': op = 'i'; base = 0; - fn = (zend_long (*)())ZEND_STRTOI_PTR; + fn = (zend_long (*)())ZEND_STRTOL_PTR; break; case 'o': op = 'i'; base = 8; - fn = (zend_long (*)())ZEND_STRTOI_PTR; + fn = (zend_long (*)())ZEND_STRTOL_PTR; break; case 'x': case 'X': op = 'i'; base = 16; - fn = (zend_long (*)())ZEND_STRTOI_PTR; + fn = (zend_long (*)())ZEND_STRTOL_PTR; break; case 'u': op = 'i'; base = 10; flags |= SCAN_UNSIGNED; - fn = (zend_long (*)())ZEND_STRTOUI_PTR; + fn = (zend_long (*)())ZEND_STRTOUL_PTR; break; case 'f': @@ -1051,7 +1051,7 @@ addToInt: *end = '\0'; value = (zend_long) (*fn)(buf, NULL, base); if ((flags & SCAN_UNSIGNED) && (value < 0)) { - snprintf(buf, sizeof(buf), ZEND_UINT_FMT, value); /* INTL: ISO digit */ + snprintf(buf, sizeof(buf), ZEND_ULONG_FMT, value); /* INTL: ISO digit */ if (numVars && objIndex >= argCount) { break; } else if (numVars) { diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 4e8c68f13b..2f596eed44 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -180,7 +180,7 @@ PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX * context) context. */ PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, - php_size_t inputLen) + size_t inputLen) { unsigned int i, index, partLen; diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index 72c793f656..f852386a62 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -31,7 +31,7 @@ typedef struct { } PHP_SHA1_CTX; PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX *); -PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, php_size_t); +PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, size_t); PHPAPI void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *); PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest); diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 5585b8e73d..a0448803f4 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -458,7 +458,7 @@ PHP_FUNCTION(stream_copy_to_stream) php_stream_from_zval(dest, zdest); if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_INT_FMT " in the stream", pos); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos); RETURN_FALSE; } @@ -1374,7 +1374,7 @@ PHP_FUNCTION(stream_set_chunk_size) } if (csize <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_INT_FMT, csize); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize); RETURN_FALSE; } /* stream.chunk_size is actually a size_t, but php_stream_set_option diff --git a/ext/standard/string.c b/ext/standard/string.c index 7e6543555b..325c66affa 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -115,7 +115,7 @@ void register_string_constants(INIT_FUNC_ARGS) } /* }}} */ -int php_tag_find(char *tag, php_size_t len, char *set); +int php_tag_find(char *tag, size_t len, char *set); /* this is read-only, so it's ok */ static char hexconvtab[] = "0123456789abcdef"; @@ -300,7 +300,7 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / if (start < 0) { start = 0; } - } else if ((php_size_t)start > s11->len) { + } else if ((size_t)start > s11->len) { RETURN_FALSE; } @@ -692,7 +692,7 @@ PHP_FUNCTION(nl_langinfo) #endif break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Item '" ZEND_INT_FMT "' is not valid", item); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item); RETURN_FALSE; } /* }}} */ @@ -729,7 +729,7 @@ PHP_FUNCTION(strcoll) * it needs to be incrementing. * Returns: FAILURE/SUCCESS whether the input was correct (i.e. no range errors) */ -static inline int php_charmask(unsigned char *input, php_size_t len, char *mask TSRMLS_DC) +static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRMLS_DC) { unsigned char *end; unsigned char c; @@ -778,7 +778,7 @@ static inline int php_charmask(unsigned char *input, php_size_t len, char *mask * mode 3 : trim left and right * what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0') */ -PHPAPI char *php_trim(char *c, php_size_t len, char *what, php_size_t what_len, zval *return_value, int mode TSRMLS_DC) +PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC) { register zend_long i; int trimmed = 0; @@ -873,7 +873,7 @@ PHP_FUNCTION(ltrim) PHP_FUNCTION(wordwrap) { zend_string *text, *breakchar = NULL, *breakchar_save = NULL; - php_size_t newtextlen, chk; + size_t newtextlen, chk; size_t alloced; zend_long current = 0, laststart = 0, lastspace = 0; zend_long linelength = 75; @@ -933,7 +933,7 @@ PHP_FUNCTION(wordwrap) } else { /* Multiple character line break or forced cut */ if (linelength > 0) { - chk = (php_size_t)(text->len/linelength + 1); + chk = (size_t)(text->len/linelength + 1); newtext = zend_string_alloc(chk * breakchar->len + text->len, 0); alloced = text->len + chk * breakchar->len + 1; } else { @@ -948,9 +948,9 @@ PHP_FUNCTION(wordwrap) laststart = lastspace = 0; for (current = 0; current < text->len; current++) { if (chk <= 0) { - alloced += (php_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 = (php_size_t) ((text->len - current)/linelength) + 1; + chk = (size_t) ((text->len - current)/linelength) + 1; } /* when we hit an existing break, copy to new buffer, and * fix up laststart and lastspace */ @@ -1061,7 +1061,7 @@ PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_valu by doing nothing we return empty array */ } else { - php_size_t allocated = EXPLODE_ALLOC_STEP, found = 0; + size_t allocated = EXPLODE_ALLOC_STEP, found = 0; zend_long i, to_return; char **positions = emalloc(allocated * sizeof(char *)); @@ -1091,7 +1091,7 @@ PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_valu PHP_FUNCTION(explode) { zend_string *str, *delim; - zend_long limit = PHP_INT_MAX; /* No limit */ + zend_long limit = ZEND_LONG_MAX; /* No limit */ zval zdelim, zstr; #ifndef FAST_ZPP @@ -1173,7 +1173,7 @@ again: case IS_DOUBLE: { char *stmp; - php_size_t str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_P(tmp)); + size_t str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_P(tmp)); smart_str_appendl(&implstr, stmp, str_len); efree(stmp); } @@ -1702,7 +1702,7 @@ PHP_FUNCTION(stristr) zval *needle; zend_string *haystack; char *found = NULL; - php_size_t found_offset; + size_t found_offset; char *haystack_dup; char needle_char[2]; zend_bool part = 0; @@ -1922,7 +1922,7 @@ PHP_FUNCTION(strrpos) zval *zneedle; char *needle; zend_string *haystack; - php_size_t needle_len; + size_t needle_len; zend_long offset = 0; char *p, *e, ord_needle[2]; @@ -2005,7 +2005,7 @@ PHP_FUNCTION(strripos) zval *zneedle; char *needle; zend_string *haystack; - php_size_t needle_len; + size_t needle_len; zend_long offset = 0; char *p, *e, ord_needle[2]; char *needle_dup, *haystack_dup; @@ -2138,12 +2138,12 @@ PHP_FUNCTION(strrchr) /* {{{ php_chunk_split */ -static zend_string *php_chunk_split(char *src, php_size_t srclen, char *end, php_size_t endlen, php_size_t chunklen) +static zend_string *php_chunk_split(char *src, size_t srclen, char *end, size_t endlen, size_t chunklen) { char *p, *q; - php_size_t chunks; /* complete chunks! */ - php_size_t restlen; - php_size_t out_len; + size_t chunks; /* complete chunks! */ + size_t restlen; + size_t out_len; zend_string *dest; chunks = srclen / chunklen; @@ -2359,7 +2359,7 @@ PHP_FUNCTION(substr_replace) if (Z_TYPE_P(str) != IS_ARRAY) { if (Z_TYPE_P(from) != IS_ARRAY) { - php_size_t repl_len = 0; + size_t repl_len = 0; f = Z_LVAL_P(from); @@ -2418,7 +2418,7 @@ PHP_FUNCTION(substr_replace) } } else { /* str is array of strings */ zend_string *str_index = NULL; - php_size_t result_len; + size_t result_len; zend_ulong num_index; array_init(return_value); @@ -2778,9 +2778,9 @@ PHP_FUNCTION(ucwords) /* {{{ php_strtr */ -PHPAPI char *php_strtr(char *str, php_size_t len, char *str_from, char *str_to, php_size_t trlen) +PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen) { - php_size_t i; + size_t i; unsigned char xlat[256]; if ((trlen < 1) || (len < 1)) { @@ -2811,14 +2811,14 @@ static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ /* }}} */ /* {{{ php_strtr_array */ -static void php_strtr_array(zval *return_value, char *str, php_size_t slen, HashTable *pats TSRMLS_DC) +static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats TSRMLS_DC) { zend_ulong num_key; zend_string *str_key; - php_size_t len, pos, found; + size_t len, pos, found; int num_keys = 0; - php_size_t minlen = 128*1024; - php_size_t maxlen = 0; + size_t minlen = 128*1024; + size_t maxlen = 0; HashTable str_hash, num_hash; zval *entry, tmp, dummy; char *key; @@ -3038,12 +3038,12 @@ PHP_FUNCTION(strrev) /* {{{ php_similar_str */ -static void php_similar_str(const char *txt1, php_size_t len1, const char *txt2, php_size_t len2, php_size_t *pos1, php_size_t *pos2, php_size_t *max) +static void php_similar_str(const char *txt1, size_t len1, const char *txt2, size_t len2, size_t *pos1, size_t *pos2, size_t *max) { char *p, *q; char *end1 = (char *) txt1 + len1; char *end2 = (char *) txt2 + len2; - php_size_t l; + size_t l; *max = 0; for (p = (char *) txt1; p < end1; p++) { @@ -3061,10 +3061,10 @@ static void php_similar_str(const char *txt1, php_size_t len1, const char *txt2, /* {{{ php_similar_char */ -static php_size_t php_similar_char(const char *txt1, php_size_t len1, const char *txt2, php_size_t len2) +static size_t php_similar_char(const char *txt1, size_t len1, const char *txt2, size_t len2) { - php_size_t sum; - php_size_t pos1 = 0, pos2 = 0, max; + size_t sum; + size_t pos1 = 0, pos2 = 0, max; php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); if ((sum = max)) { @@ -3089,7 +3089,7 @@ PHP_FUNCTION(similar_text) zend_string *t1, *t2; zval *percent = NULL; int ac = ZEND_NUM_ARGS(); - php_size_t sim; + size_t sim; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/", &t1, &t2, &percent) == FAILURE) { return; @@ -3120,10 +3120,10 @@ PHP_FUNCTION(similar_text) /* {{{ php_stripslashes * * be careful, this edits the string in-place */ -PHPAPI void php_stripslashes(char *str, php_size_t *len TSRMLS_DC) +PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC) { char *s, *t; - php_size_t l; + size_t l; if (len != NULL) { l = *len; @@ -3257,10 +3257,10 @@ char *php_strerror(int errnum) /* {{{ php_stripcslashes */ -PHPAPI void php_stripcslashes(char *str, php_size_t *len) +PHPAPI void php_stripcslashes(char *str, size_t *len) { char *source, *target, *end; - php_size_t nlen = *len, i; + size_t nlen = *len, i; char numtmp[4]; for (source=str, end=str+nlen, target=str; source < end; source++) { @@ -3320,13 +3320,13 @@ PHPAPI void php_stripcslashes(char *str, php_size_t *len) /* {{{ php_addcslashes */ -PHPAPI zend_string *php_addcslashes(const char *str, php_size_t length, int should_free, char *what, php_size_t wlength TSRMLS_DC) +PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength TSRMLS_DC) { char flags[256]; char *source, *target; char *end; char c; - php_size_t newlen; + size_t newlen; zend_string *new_str = zend_string_alloc(4 * (length? length : (length = strlen(str))), 0); if (!wlength) { @@ -3370,7 +3370,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, php_size_t length, int shou /* {{{ php_addslashes */ -PHPAPI zend_string *php_addslashes(char *str, php_size_t length, int should_free TSRMLS_DC) +PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC) { /* maximum string length, worst case situation */ char *source, *target; @@ -3423,10 +3423,10 @@ PHPAPI zend_string *php_addslashes(char *str, php_size_t length, int should_free /* {{{ php_char_to_str_ex */ -PHPAPI php_size_t php_char_to_str_ex(char *str, php_size_t len, char from, char *to, php_size_t to_len, zval *result, int case_sensitivity, php_size_t *replace_count) +PHPAPI size_t php_char_to_str_ex(char *str, size_t len, char from, char *to, size_t to_len, zval *result, int case_sensitivity, size_t *replace_count) { - php_size_t char_count = 0; - php_size_t replaced = 0; + size_t char_count = 0; + size_t replaced = 0; char *source, *target, *tmp, *source_end=str+len, *tmp_end = NULL; if (case_sensitivity) { @@ -3496,7 +3496,7 @@ PHPAPI php_size_t php_char_to_str_ex(char *str, php_size_t len, char from, char /* {{{ php_char_to_str */ -PHPAPI php_size_t php_char_to_str(char *str, php_size_t len, char from, char *to, php_size_t to_len, zval *result) +PHPAPI size_t php_char_to_str(char *str, size_t len, char from, char *to, size_t to_len, zval *result) { return php_char_to_str_ex(str, len, from, to, to_len, result, 1, NULL); } @@ -3504,8 +3504,8 @@ PHPAPI php_size_t php_char_to_str(char *str, php_size_t len, char from, char *to /* {{{ php_str_to_str_ex */ -PHPAPI zend_string *php_str_to_str_ex(char *haystack, php_size_t length, - char *needle, php_size_t needle_len, char *str, php_size_t str_len, int case_sensitivity, php_size_t *replace_count) +PHPAPI zend_string *php_str_to_str_ex(char *haystack, size_t length, + char *needle, size_t needle_len, char *str, size_t str_len, int case_sensitivity, size_t *replace_count) { zend_string *new_str; @@ -3551,7 +3551,7 @@ PHPAPI zend_string *php_str_to_str_ex(char *haystack, php_size_t length, if (str_len < needle_len) { new_str = zend_string_alloc(length, 0); } else { - php_size_t count = 0; + size_t count = 0; char *o, *n, *endp; if (case_sensitivity) { @@ -3669,7 +3669,7 @@ nothing_todo: /* {{{ php_str_to_str */ -PHPAPI zend_string *php_str_to_str(char *haystack, php_size_t length, char *needle, php_size_t needle_len, char *str, php_size_t str_len) +PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, size_t needle_len, char *str, size_t str_len) { return php_str_to_str_ex(haystack, length, needle, needle_len, str, str_len, 1, NULL); } @@ -3677,14 +3677,14 @@ PHPAPI zend_string *php_str_to_str(char *haystack, php_size_t length, char *need /* {{{ php_str_replace_in_subject */ -static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, php_size_t *replace_count TSRMLS_DC) +static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count TSRMLS_DC) { zval *search_entry, *replace_entry = NULL, temp_result, tmp_subject; char *replace_value = NULL; - php_size_t replace_len = 0; + size_t replace_len = 0; HashPosition pos; /* Make sure we're dealing with strings. */ @@ -4073,7 +4073,7 @@ PHP_FUNCTION(nl2br) char *tmp; zend_string *str; char *end, *target; - php_size_t repl_cnt = 0; + size_t repl_cnt = 0; zend_bool is_xhtml = 1; zend_string *result; @@ -4341,7 +4341,7 @@ PHP_FUNCTION(parse_str) * 0 start tag * 1 first non-whitespace char seen */ -int php_tag_find(char *tag, php_size_t len, char *set) { +int php_tag_find(char *tag, size_t len, char *set) { char c, *n, *t; int state=0, done=0; char *norm; @@ -4396,7 +4396,7 @@ int php_tag_find(char *tag, php_size_t len, char *set) { } /* }}} */ -PHPAPI php_size_t php_strip_tags(char *rbuf, php_size_t len, int *stateptr, char *allow, php_size_t allow_len) /* {{{ */ +PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len) /* {{{ */ { return php_strip_tags_ex(rbuf, len, stateptr, allow, allow_len, 0); } @@ -4422,7 +4422,7 @@ PHPAPI php_size_t php_strip_tags(char *rbuf, php_size_t len, int *stateptr, char swm: Added ability to strip <?xml tags without assuming it PHP code. */ -PHPAPI size_t php_strip_tags_ex(char *rbuf, php_size_t len, int *stateptr, char *allow, php_size_t allow_len, zend_bool allow_tag_spaces) +PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len, zend_bool allow_tag_spaces) { char *tbuf, *buf, *p, *tp, *rp, c, lc; int br, i=0, depth=0, in_q = 0; @@ -4779,8 +4779,8 @@ PHP_FUNCTION(count_chars) unsigned char *buf; int inx; char retstr[256]; - php_size_t retlen=0; - php_size_t tmp = 0; + size_t retlen=0; + size_t tmp = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &input, &mymode) == FAILURE) { return; @@ -5007,7 +5007,7 @@ PHP_FUNCTION(substr_count) } if (offset > haystack_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_INT_FMT " exceeds string length", offset); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset); RETURN_FALSE; } p += offset; @@ -5019,7 +5019,7 @@ PHP_FUNCTION(substr_count) RETURN_FALSE; } if (length > (haystack_len - offset)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value " ZEND_INT_FMT " exceeds string length", length); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length); RETURN_FALSE; } endp = p + length; @@ -5253,7 +5253,7 @@ PHP_FUNCTION(str_word_count) /* nothing to be done */ break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value " ZEND_INT_FMT, type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type); RETURN_FALSE; } @@ -5350,7 +5350,7 @@ PHP_FUNCTION(str_split) zend_string *str; zend_long split_length = 1; char *p; - php_size_t n_reg_segments; + size_t n_reg_segments; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &split_length) == FAILURE) { return; @@ -5419,7 +5419,7 @@ PHP_FUNCTION(substr_compare) zend_string *s1, *s2; zend_long offset, len=0; zend_bool cs=0; - php_size_t cmp_len; + size_t cmp_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) { RETURN_FALSE; @@ -5444,7 +5444,7 @@ PHP_FUNCTION(substr_compare) RETURN_FALSE; } - cmp_len = (php_size_t) (len ? len : MAX(s2->len, (s1->len - offset))); + cmp_len = (size_t) (len ? len : MAX(s2->len, (s1->len - offset))); if (!cs) { RETURN_LONG(zend_binary_strncmp(s1->val + offset, (s1->len - offset), s2->val, s2->len, cmp_len)); diff --git a/ext/standard/url.c b/ext/standard/url.c index 47b3a793d9..6534d7a034 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -189,7 +189,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) zend_long port; memcpy(port_buf, p, (pp - p)); port_buf[pp - p] = '\0'; - port = ZEND_STRTOI(port_buf, NULL, 10); + port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short) port; } else { @@ -283,7 +283,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) zend_long port; memcpy(port_buf, p, (e - p)); port_buf[e - p] = '\0'; - port = ZEND_STRTOI(port_buf, NULL, 10); + port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short)port; } else { @@ -416,7 +416,7 @@ PHP_FUNCTION(parse_url) if (resource->fragment != NULL) RETVAL_STRING(resource->fragment); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_INT_FMT, key); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key); RETVAL_FALSE; } goto done; diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index d296df360e..40ab379a30 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -65,9 +65,9 @@ #define PHP_UU_DEC(c) (((c) - ' ') & 077) -PHPAPI zend_string *php_uuencode(char *src, php_size_t src_len) /* {{{ */ +PHPAPI zend_string *php_uuencode(char *src, size_t src_len) /* {{{ */ { - php_size_t len = 45; + size_t len = 45; char *p, *s, *e, *ee; zend_string *dest; @@ -127,9 +127,9 @@ PHPAPI zend_string *php_uuencode(char *src, php_size_t src_len) /* {{{ */ } /* }}} */ -PHPAPI zend_string *php_uudecode(char *src, php_size_t src_len) /* {{{ */ +PHPAPI zend_string *php_uudecode(char *src, size_t src_len) /* {{{ */ { - php_size_t len, total_len=0; + size_t len, total_len=0; char *s, *e, *p, *ee; zend_string *dest; diff --git a/ext/standard/var.c b/ext/standard/var.c index d18c754480..b5ece11332 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -57,7 +57,7 @@ static uint zend_obj_num_elements(HashTable *ht) static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ { if (key == NULL) { /* numeric key */ - php_printf("%*c[" ZEND_INT_FMT "]=>\n", level + 1, ' ', index); + php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ php_printf("%*c[\"", level + 1, ' '); PHPWRITE(key->val, key->len); @@ -72,7 +72,7 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke const char *prop_name, *class_name; if (key == NULL) { /* numeric key */ - php_printf("%*c[" ZEND_INT_FMT "]=>\n", level + 1, ' ', index); + php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ int unmangle = zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name); php_printf("%*c[", level + 1, ' '); @@ -120,7 +120,7 @@ again: php_printf("%sNULL\n", COMMON); break; case IS_LONG: - php_printf("%sint(" ZEND_INT_FMT ")\n", COMMON, Z_LVAL_P(struc)); + php_printf("%sint(" ZEND_LONG_FMT ")\n", COMMON, Z_LVAL_P(struc)); break; case IS_DOUBLE: php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_P(struc)); @@ -230,7 +230,7 @@ PHP_FUNCTION(var_dump) static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */ { if (key == NULL) { /* numeric key */ - php_printf("%*c[" ZEND_INT_FMT "]=>\n", level + 1, ' ', index); + php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ php_printf("%*c[\"", level + 1, ' '); PHPWRITE(key->val, key->len); @@ -245,7 +245,7 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k const char *prop_name, *class_name; if (key == NULL) { /* numeric key */ - php_printf("%*c[" ZEND_INT_FMT "]=>\n", level + 1, ' ', index); + php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index); } else { /* string key */ zend_unmangle_property_name(key->val, key->len, &class_name, &prop_name); php_printf("%*c[", level + 1, ' '); @@ -291,7 +291,7 @@ again: php_printf("%sNULL\n", COMMON); break; case IS_LONG: - php_printf("%slong(" ZEND_INT_FMT ")\n", COMMON, Z_LVAL_P(struc)); + php_printf("%slong(" ZEND_LONG_FMT ")\n", COMMON, Z_LVAL_P(struc)); break; case IS_DOUBLE: php_printf("%sdouble(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_P(struc)); @@ -354,7 +354,7 @@ again: break; case IS_RESOURCE: { const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC); - php_printf("%sresource(" ZEND_INT_FMT ") of type (%s) refcount(%u)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown", Z_REFCOUNT_P(struc)); + php_printf("%sresource(" ZEND_LONG_FMT ") of type (%s) refcount(%u)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown", Z_REFCOUNT_P(struc)); break; } case IS_REFERENCE: @@ -456,7 +456,7 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC) { HashTable *myht; char *tmp_str; - php_size_t tmp_len; + size_t tmp_len; zend_string *class_name; zend_string *ztmp, *ztmp2; zend_ulong index; @@ -1031,7 +1031,7 @@ PHP_FUNCTION(unserialize) PHP_VAR_UNSERIALIZE_DESTROY(var_hash); zval_dtor(return_value); if (!EG(exception)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_INT_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len); } RETURN_FALSE; } |