summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-25 20:22:49 +0200
committerAnatol Belski <ab@php.net>2014-08-25 20:22:49 +0200
commit4d997f63d98c663b2d9acccd3655572652f61c7d (patch)
treebce31fa83a23d3ad58d640d581d498f3bdd0cbf4 /ext
parent6f9f0bf2056f0dc17d9bcc6dd3b7d28ac878c6fc (diff)
downloadphp-git-4d997f63d98c663b2d9acccd3655572652f61c7d.tar.gz
master renames phase 3
Diffstat (limited to 'ext')
-rw-r--r--ext/bz2/bz2.c2
-rw-r--r--ext/com_dotnet/com_wrapper.c2
-rw-r--r--ext/date/lib/timelib.c2
-rw-r--r--ext/date/php_date.c10
-rw-r--r--ext/exif/exif.c2
-rw-r--r--ext/fileinfo/fileinfo.c2
-rw-r--r--ext/fileinfo/libmagic/apprentice.c6
-rw-r--r--ext/fileinfo/libmagic/cdf.c10
-rw-r--r--ext/fileinfo/libmagic/compress.c4
-rw-r--r--ext/fileinfo/libmagic/elfclass.h6
-rw-r--r--ext/fileinfo/libmagic/fsmagic.c2
-rw-r--r--ext/fileinfo/libmagic/readelf.c52
-rw-r--r--ext/filter/filter.c4
-rw-r--r--ext/filter/logical_filters.c4
-rw-r--r--ext/ftp/ftp.c10
-rw-r--r--ext/hash/hash.c4
-rw-r--r--ext/iconv/iconv.c64
-rw-r--r--ext/intl/collator/collator_is_numeric.c4
-rw-r--r--ext/intl/formatter/formatter_parse.c2
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp2
-rw-r--r--ext/ldap/ldap.c4
-rw-r--r--ext/mbstring/mb_gpc.c2
-rw-r--r--ext/mysql/php_mysql.c6
-rw-r--r--ext/mysqli/mysqli.c6
-rw-r--r--ext/mysqli/mysqli_priv.h2
-rw-r--r--ext/mysqli/mysqli_prop.c28
-rw-r--r--ext/mysqlnd/mysqlnd.c6
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c2
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c2
-rw-r--r--ext/mysqlnd/php_mysqlnd.c8
-rw-r--r--ext/odbc/php_odbc.c4
-rw-r--r--ext/opcache/zend_accelerator_debug.c2
-rw-r--r--ext/opcache/zend_accelerator_module.c2
-rwxr-xr-xext/openssl/openssl.c2
-rw-r--r--ext/pdo/pdo.c2
-rw-r--r--ext/pdo/pdo_stmt.c2
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c10
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c8
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c2
-rw-r--r--ext/pgsql/pgsql.c16
-rw-r--r--ext/phar/dirstream.c2
-rw-r--r--ext/phar/dirstream.h2
-rw-r--r--ext/phar/func_interceptors.c4
-rw-r--r--ext/phar/phar.c6
-rw-r--r--ext/phar/phar_internal.h10
-rwxr-xr-xext/phar/phar_object.c6
-rw-r--r--ext/phar/stream.c10
-rw-r--r--ext/phar/stream.h2
-rw-r--r--ext/phar/tar.c2
-rw-r--r--ext/phar/util.c26
-rw-r--r--ext/phar/zip.c12
-rw-r--r--ext/session/mod_files.c8
-rw-r--r--ext/session/session.c10
-rw-r--r--ext/soap/php_http.c2
-rw-r--r--ext/sockets/sendrecvmsg.c2
-rw-r--r--ext/sqlite3/sqlite3.c6
-rw-r--r--ext/standard/array.c2
-rw-r--r--ext/standard/base64.c6
-rw-r--r--ext/standard/base64.h6
-rw-r--r--ext/standard/crypt_sha256.c2
-rw-r--r--ext/standard/crypt_sha512.c2
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/file.c18
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/filestat.c2
-rw-r--r--ext/standard/formatted_print.c48
-rw-r--r--ext/standard/fsock.c6
-rw-r--r--ext/standard/html.c2
-rw-r--r--ext/standard/link_win32.c2
-rw-r--r--ext/standard/mail.c4
-rw-r--r--ext/standard/math.c12
-rw-r--r--ext/standard/md5.c2
-rw-r--r--ext/standard/metaphone.c6
-rw-r--r--ext/standard/pack.c16
-rw-r--r--ext/standard/pageinfo.c2
-rw-r--r--ext/standard/password.c8
-rw-r--r--ext/standard/php_fopen_wrapper.c8
-rw-r--r--ext/standard/php_string.h28
-rw-r--r--ext/standard/php_uuencode.h4
-rw-r--r--ext/standard/quot_print.c2
-rw-r--r--ext/standard/rand.c2
-rw-r--r--ext/standard/scanf.c20
-rw-r--r--ext/standard/sha1.c2
-rw-r--r--ext/standard/sha1.h2
-rw-r--r--ext/standard/streamsfuncs.c4
-rw-r--r--ext/standard/string.c124
-rw-r--r--ext/standard/url.c6
-rw-r--r--ext/standard/uuencode.c8
-rw-r--r--ext/standard/var.c18
-rw-r--r--ext/xmlwriter/php_xmlwriter.c2
90 files changed, 400 insertions, 400 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 7696dbb93d..b2e8f40760 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -406,7 +406,7 @@ static PHP_FUNCTION(bzopen)
} else if (Z_TYPE_P(file) == IS_RESOURCE) {
/* If it is a resource, than its a stream resource */
php_socket_t fd;
- php_size_t stream_mode_len;
+ size_t stream_mode_len;
php_stream_from_zval(stream, file);
stream_mode_len = strlen(stream->mode);
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index 585b207cde..4ec1ab3ba3 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -467,7 +467,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
&pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
- snprintf(namebuf, sizeof(namebuf), ZEND_UINT_FMT, pid);
+ snprintf(namebuf, sizeof(namebuf), ZEND_ULONG_FMT, pid);
name = zend_string_init(namebuf, strlen(namebuf), 0);
} else {
zend_string_addref(name);
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 26bf8f5686..65029e7d1c 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -182,7 +182,7 @@ zend_long timelib_date_to_int(timelib_time *d, int *error)
ts = d->sse;
- if (ts < PHP_INT_MIN || ts > PHP_INT_MAX) {
+ if (ts < ZEND_LONG_MIN || ts > ZEND_LONG_MAX) {
if (error) {
*error = 1;
}
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index e8e135d83a..e8c8aac06a 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1454,7 +1454,7 @@ PHP_FUNCTION(strtotime)
now = timelib_time_ctor();
initial_ts = emalloc(25);
- snprintf(initial_ts, 24, "@" ZEND_INT_FMT " UTC", preset_ts);
+ snprintf(initial_ts, 24, "@" ZEND_LONG_FMT " UTC", preset_ts);
t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); /* we ignore the error here, as this should never fail */
timelib_update_ts(t, tzi);
now->tz_info = tzi;
@@ -3840,7 +3840,7 @@ PHP_FUNCTION(timezone_transitions_get)
zval *object, element;
php_timezone_obj *tzobj;
unsigned int i, begin = 0, found;
- zend_long timestamp_begin = PHP_INT_MIN, timestamp_end = PHP_INT_MAX;
+ zend_long timestamp_begin = ZEND_LONG_MIN, timestamp_end = ZEND_LONG_MAX;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ll", &object, date_ce_timezone, &timestamp_begin, &timestamp_end) == FAILURE) {
RETURN_FALSE;
@@ -3873,7 +3873,7 @@ PHP_FUNCTION(timezone_transitions_get)
array_init(return_value);
- if (timestamp_begin == PHP_INT_MIN) {
+ if (timestamp_begin == ZEND_LONG_MIN) {
add_nominal();
begin = 0;
found = 1;
@@ -4248,8 +4248,8 @@ static zend_string *date_interval_format(char *format, int format_len, timelib_r
case 'I': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
case 'i': length = slprintf(buffer, 32, "%d", (int) t->i); break;
- case 'S': length = slprintf(buffer, 32, "%02" ZEND_INT_FMT_SPEC, (zend_long) t->s); break;
- case 's': length = slprintf(buffer, 32, ZEND_INT_FMT, (zend_long) t->s); break;
+ case 'S': length = slprintf(buffer, 32, "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
+ case 's': length = slprintf(buffer, 32, ZEND_LONG_FMT, (zend_long) t->s); break;
case 'a': {
if ((int) t->days != -99999) {
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 3c3c64398c..6438623525 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3847,7 +3847,7 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all TSRMLS_DC)
{
int ret;
- php_stat_t st;
+ zend_stat_t st;
zend_string *base;
/* Start with an empty image information structure. */
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 4ba687f4d3..db309de181 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -480,7 +480,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
case FILEINFO_MODE_STREAM:
{
php_stream *stream;
- php_off_t streampos;
+ zend_off_t streampos;
php_stream_from_zval_no_verify(stream, what);
if (!stream) {
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index b3b1f746d4..41a3ac5239 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -1145,7 +1145,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
uint32_t i, j;
size_t files = 0, maxfiles = 0;
char **filearr = NULL;
- php_stat_t st;
+ zend_stat_t st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
php_stream *dir;
@@ -2698,7 +2698,7 @@ internal_loaded:
if (NULL != fn) {
nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
- if ((php_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
+ if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu",
dbname, (unsigned long long)st.sb.st_size,
sizeof(struct magic));
@@ -2788,7 +2788,7 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
assert(nm + sizeof(ar) < m);
- if (php_stream_seek(stream,(php_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
+ if (php_stream_seek(stream,(zend_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
file_error(ms, errno, "error seeking `%s'", dbname);
goto out;
}
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index 93cc231884..45ad6e3e57 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -291,11 +291,11 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
}
static ssize_t
-cdf_read(const cdf_info_t *info, php_off_t off, void *buf, size_t len)
+cdf_read(const cdf_info_t *info, zend_off_t off, void *buf, size_t len)
{
size_t siz = (size_t)off + len;
- if ((php_off_t)(off + len) != (php_off_t)siz) {
+ if ((zend_off_t)(off + len) != (zend_off_t)siz) {
errno = EINVAL;
return -1;
}
@@ -308,7 +308,7 @@ cdf_read(const cdf_info_t *info, php_off_t off, void *buf, size_t len)
if (info->i_fd == -1)
return -1;
- if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (php_off_t)-1)
+ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (zend_off_t)-1)
return -1;
if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len)
@@ -323,7 +323,7 @@ cdf_read_header(const cdf_info_t *info, cdf_header_t *h)
char buf[512];
(void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
- if (cdf_read(info, (php_off_t)0, buf, sizeof(buf)) == -1)
+ if (cdf_read(info, (zend_off_t)0, buf, sizeof(buf)) == -1)
return -1;
cdf_unpack_header(h, buf);
cdf_swap_header(h);
@@ -357,7 +357,7 @@ cdf_read_sector(const cdf_info_t *info, void *buf, size_t offs, size_t len,
size_t ss = CDF_SEC_SIZE(h);
size_t pos = CDF_SEC_POS(h, id);
assert(ss == len);
- return cdf_read(info, (php_off_t)pos, ((char *)buf) + offs, len);
+ return cdf_read(info, (zend_off_t)pos, ((char *)buf) + offs, len);
}
ssize_t
diff --git a/ext/fileinfo/libmagic/compress.c b/ext/fileinfo/libmagic/compress.c
index 613fc6a3d2..0da5a3e6ce 100644
--- a/ext/fileinfo/libmagic/compress.c
+++ b/ext/fileinfo/libmagic/compress.c
@@ -300,7 +300,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
return -1;
}
(void)close(tfd);
- if (FINFO_LSEEK_FUNC(fd, (php_off_t)0, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -406,7 +406,7 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
(void) close(0);
if (fd != -1) {
(void) dup(fd);
- (void) FINFO_LSEEK_FUNC(0, (php_off_t)0, SEEK_SET);
+ (void) FINFO_LSEEK_FUNC(0, (zend_off_t)0, SEEK_SET);
} else {
(void) dup(fdin[0]);
(void) close(fdin[0]);
diff --git a/ext/fileinfo/libmagic/elfclass.h b/ext/fileinfo/libmagic/elfclass.h
index 889ff6263e..bfacceb88a 100644
--- a/ext/fileinfo/libmagic/elfclass.h
+++ b/ext/fileinfo/libmagic/elfclass.h
@@ -37,7 +37,7 @@
case ET_CORE:
flags |= FLAGS_IS_CORE;
if (dophn_core(ms, clazz, swap, fd,
- (php_off_t)elf_getu(swap, elfhdr.e_phoff),
+ (zend_off_t)elf_getu(swap, elfhdr.e_phoff),
elf_getu16(swap, elfhdr.e_phnum),
(size_t)elf_getu16(swap, elfhdr.e_phentsize),
fsize, &flags) == -1)
@@ -47,7 +47,7 @@
case ET_EXEC:
case ET_DYN:
if (dophn_exec(ms, clazz, swap, fd,
- (php_off_t)elf_getu(swap, elfhdr.e_phoff),
+ (zend_off_t)elf_getu(swap, elfhdr.e_phoff),
elf_getu16(swap, elfhdr.e_phnum),
(size_t)elf_getu16(swap, elfhdr.e_phentsize),
fsize, &flags, elf_getu16(swap, elfhdr.e_shnum))
@@ -56,7 +56,7 @@
/*FALLTHROUGH*/
case ET_REL:
if (doshn(ms, clazz, swap, fd,
- (php_off_t)elf_getu(swap, elfhdr.e_shoff),
+ (zend_off_t)elf_getu(swap, elfhdr.e_shoff),
elf_getu16(swap, elfhdr.e_shnum),
(size_t)elf_getu16(swap, elfhdr.e_shentsize),
fsize, &flags, elf_getu16(swap, elfhdr.e_machine),
diff --git a/ext/fileinfo/libmagic/fsmagic.c b/ext/fileinfo/libmagic/fsmagic.c
index f945d06a8b..a7b420ff5d 100644
--- a/ext/fileinfo/libmagic/fsmagic.c
+++ b/ext/fileinfo/libmagic/fsmagic.c
@@ -90,7 +90,7 @@ handle_mime(struct magic_set *ms, int mime, const char *str)
}
protected int
-file_fsmagic(struct magic_set *ms, const char *fn, php_stat_t *sb, php_stream *stream)
+file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream)
{
int ret, did = 0;
int mime = ms->flags & MAGIC_MIME;
diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c
index ec316b6bbd..3b0aae54c1 100644
--- a/ext/fileinfo/libmagic/readelf.c
+++ b/ext/fileinfo/libmagic/readelf.c
@@ -42,13 +42,13 @@ FILE_RCSID("@(#)$File: readelf.c,v 1.99 2013/11/05 15:44:01 christos Exp $")
#include "magic.h"
#ifdef ELFCORE
-private int dophn_core(struct magic_set *, int, int, int, php_off_t, int, size_t,
- php_off_t, int *);
+private int dophn_core(struct magic_set *, int, int, int, zend_off_t, int, size_t,
+ zend_off_t, int *);
#endif
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
- php_off_t, int *, int);
+ zend_off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
- php_off_t, int *, int);
+ zend_off_t, int *, int);
private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int,
int, size_t, int *);
@@ -144,7 +144,7 @@ getu64(int swap, uint64_t value)
#define xsh_size (size_t)(clazz == ELFCLASS32 \
? elf_getu32(swap, sh32.sh_size) \
: elf_getu64(swap, sh64.sh_size))
-#define xsh_offset (php_off_t)(clazz == ELFCLASS32 \
+#define xsh_offset (zend_off_t)(clazz == ELFCLASS32 \
? elf_getu32(swap, sh32.sh_offset) \
: elf_getu64(swap, sh64.sh_offset))
#define xsh_type (clazz == ELFCLASS32 \
@@ -162,13 +162,13 @@ getu64(int swap, uint64_t value)
#define xph_type (clazz == ELFCLASS32 \
? elf_getu32(swap, ph32.p_type) \
: elf_getu32(swap, ph64.p_type))
-#define xph_offset (php_off_t)(clazz == ELFCLASS32 \
+#define xph_offset (zend_off_t)(clazz == ELFCLASS32 \
? elf_getu32(swap, ph32.p_offset) \
: elf_getu64(swap, ph64.p_offset))
#define xph_align (size_t)((clazz == ELFCLASS32 \
- ? (php_off_t) (ph32.p_align ? \
+ ? (zend_off_t) (ph32.p_align ? \
elf_getu32(swap, ph32.p_align) : 4) \
- : (php_off_t) (ph64.p_align ? \
+ : (zend_off_t) (ph64.p_align ? \
elf_getu64(swap, ph64.p_align) : 4)))
#define xph_filesz (size_t)((clazz == ELFCLASS32 \
? elf_getu32(swap, ph32.p_filesz) \
@@ -293,8 +293,8 @@ private const char os_style_names[][8] = {
#define FLAGS_IS_CORE 0x10
private int
-dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
- int num, size_t size, php_off_t fsize, int *flags)
+dophn_core(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off,
+ int num, size_t size, zend_off_t fsize, int *flags)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
@@ -312,7 +312,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
* Loop through all the program headers.
*/
for ( ; num; num--) {
- if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -334,7 +334,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -917,7 +917,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
Elf64_Shdr sh64;
int stripped = 1;
void *nbuf;
- php_off_t noff, coff, name_off;
+ zend_off_t noff, coff, name_off;
uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */
char name[50];
@@ -929,7 +929,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
}
for ( ; num; num--) {
- if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -959,8 +959,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
switch (xsh_type) {
case SHT_NOTE:
nbuf = emalloc((size_t)xsh_size);
- if ((noff = FINFO_LSEEK_FUNC(fd, (php_off_t)xsh_offset, SEEK_SET)) ==
- (php_off_t)-1) {
+ if ((noff = FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET)) ==
+ (zend_off_t)-1) {
file_badread(ms);
efree(nbuf);
return -1;
@@ -974,7 +974,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
noff = 0;
for (;;) {
- if (noff >= (php_off_t)xsh_size)
+ if (noff >= (zend_off_t)xsh_size)
break;
noff = donote(ms, nbuf, (size_t)noff,
(size_t)xsh_size, clazz, swap, 4,
@@ -985,8 +985,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
efree(nbuf);
break;
case SHT_SUNW_cap:
- if (FINFO_LSEEK_FUNC(fd, (php_off_t)xsh_offset, SEEK_SET) ==
- (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET) ==
+ (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -996,7 +996,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
Elf64_Cap cap64;
char cbuf[/*CONSTCOND*/
MAX(sizeof cap32, sizeof cap64)];
- if ((coff += xcap_sizeof) > (php_off_t)xsh_size)
+ if ((coff += xcap_sizeof) > (zend_off_t)xsh_size)
break;
if (FINFO_READ_FUNC(fd, cbuf, (size_t)xcap_sizeof) !=
(ssize_t)xcap_sizeof) {
@@ -1099,8 +1099,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
* otherwise it's statically linked.
*/
private int
-dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
- int num, size_t size, php_off_t fsize, int *flags, int sh_num)
+dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off,
+ int num, size_t size, zend_off_t fsize, int *flags, int sh_num)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
@@ -1117,7 +1117,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
}
for ( ; num; num--) {
- if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -1161,7 +1161,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off,
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (php_off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -1204,7 +1204,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
int clazz;
int swap;
struct stat st;
- php_off_t fsize;
+ zend_off_t fsize;
int flags = 0;
Elf32_Ehdr elf32hdr;
Elf64_Ehdr elf64hdr;
@@ -1227,7 +1227,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
/*
* If we cannot seek, it must be a pipe, socket or fifo.
*/
- if((FINFO_LSEEK_FUNC(fd, (php_off_t)0, SEEK_SET) == (php_off_t)-1) && (errno == ESPIPE))
+ if((FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) && (errno == ESPIPE))
fd = file_pipe2file(ms, fd, buf, nbytes);
if (fstat(fd, &st) == -1) {
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 7d3721237a..e5e9be249d 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -77,7 +77,7 @@ static const filter_list_entry filter_list[] = {
#define PARSE_SESSION 6
#endif
-static unsigned int php_sapi_filter(int arg, char *var, char **val, php_size_t val_len, php_size_t *new_val_len TSRMLS_DC);
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC);
static unsigned int php_sapi_filter_init(TSRMLS_D);
/* {{{ arginfo */
@@ -402,7 +402,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
}
/* }}} */
-static unsigned int php_sapi_filter(int arg, char *var, char **val, php_size_t val_len, php_size_t *new_val_len TSRMLS_DC) /* {{{ */
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC) /* {{{ */
{
zval new_var, raw_var;
zval *array_ptr = NULL, *orig_array_ptr = NULL;
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 914d85e3e7..cbefae9d70 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -115,9 +115,9 @@ static int php_filter_parse_int(const char *str, unsigned int str_len, zend_long
while (str < end) {
if (*str >= '0' && *str <= '9') {
digit = (*(str++) - '0');
- if ( (!sign) && ctx_value <= (PHP_INT_MAX-digit)/10 ) {
+ if ( (!sign) && ctx_value <= (ZEND_LONG_MAX-digit)/10 ) {
ctx_value = (ctx_value * 10) + digit;
- } else if ( sign && ctx_value >= (PHP_INT_MIN+digit)/10) {
+ } else if ( sign && ctx_value >= (ZEND_LONG_MIN+digit)/10) {
ctx_value = (ctx_value * 10) - digit;
} else {
return -1;
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 45c6ffed10..27051677c9 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -624,7 +624,7 @@ ftp_alloc(ftpbuf_t *ftp, const zend_long size, zend_string **response)
return 0;
}
- snprintf(buffer, sizeof(buffer) - 1, ZEND_INT_FMT, size);
+ snprintf(buffer, sizeof(buffer) - 1, ZEND_LONG_FMT, size);
if (!ftp_putcmd(ftp, "ALLO", buffer)) {
return 0;
@@ -811,7 +811,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
ftp->data = data;
if (resumepos > 0) {
- snprintf(arg, sizeof(arg), ZEND_INT_FMT, resumepos);
+ snprintf(arg, sizeof(arg), ZEND_LONG_FMT, resumepos);
if (!ftp_putcmd(ftp, "REST", arg)) {
goto bail;
}
@@ -903,7 +903,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, z
ftp->data = data;
if (startpos > 0) {
- snprintf(arg, sizeof(arg), ZEND_INT_FMT, startpos);
+ snprintf(arg, sizeof(arg), ZEND_LONG_FMT, startpos);
if (!ftp_putcmd(ftp, "REST", arg)) {
goto bail;
}
@@ -1729,7 +1729,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
}
if (resumepos>0) {
- snprintf(arg, sizeof(arg), ZEND_INT_FMT, resumepos);
+ snprintf(arg, sizeof(arg), ZEND_LONG_FMT, resumepos);
if (!ftp_putcmd(ftp, "REST", arg)) {
goto bail;
}
@@ -1843,7 +1843,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
goto bail;
}
if (startpos > 0) {
- snprintf(arg, sizeof(arg), ZEND_INT_FMT, startpos);
+ snprintf(arg, sizeof(arg), ZEND_LONG_FMT, startpos);
if (!ftp_putcmd(ftp, "REST", arg)) {
goto bail;
}
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 1af01ef265..ac03aa87ee 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -619,12 +619,12 @@ PHP_FUNCTION(hash_pbkdf2)
}
if (iterations <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iterations must be a positive integer: " ZEND_INT_FMT, iterations);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
RETURN_FALSE;
}
if (length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0: " ZEND_INT_FMT, length);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
RETURN_FALSE;
}
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index b38d755701..d8d132578f 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -196,13 +196,13 @@ static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd
static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC);
-static php_iconv_err_t _php_iconv_strlen(php_size_t *pretval, const char *str, size_t nbytes, const char *enc);
+static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_t nbytes, const char *enc);
static php_iconv_err_t _php_iconv_substr(smart_str *pretval, const char *str, size_t nbytes, zend_long offset, zend_long len, const char *enc);
-static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval, const char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, zend_long offset, const char *enc);
+static php_iconv_err_t _php_iconv_strpos(size_t *pretval, const char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, zend_long offset, const char *enc);
-static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, php_size_t max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc);
+static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, size_t max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc);
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode);
@@ -435,9 +435,9 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
char *p = strstr(get_output_encoding(TSRMLS_C), "//");
if (p) {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (php_size_t) strlen(mimetype), mimetype, (php_size_t)(p - get_output_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C));
} else {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (php_size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
}
if (content_type && SUCCESS == sapi_add_header(content_type, len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
@@ -721,7 +721,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
/* }}} */
/* {{{ _php_iconv_strlen() */
-static php_iconv_err_t _php_iconv_strlen(php_size_t *pretval, const char *str, size_t nbytes, const char *enc)
+static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_t nbytes, const char *enc)
{
char buf[GENERIC_SUPERSET_NBYTES*2];
@@ -735,9 +735,9 @@ static php_iconv_err_t _php_iconv_strlen(php_size_t *pretval, const char *str, s
char *out_p;
size_t out_left;
- php_size_t cnt;
+ size_t cnt;
- *pretval = (php_size_t)-1;
+ *pretval = (size_t)-1;
cd = iconv_open(GENERIC_SUPERSET_NAME, enc);
@@ -820,7 +820,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
char *out_p;
size_t out_left;
- php_size_t cnt;
+ size_t cnt;
zend_long total_len;
err = _php_iconv_strlen(&total_len, str, nbytes, enc);
@@ -951,7 +951,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
/* }}} */
/* {{{ _php_iconv_strpos() */
-static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
+static php_iconv_err_t _php_iconv_strpos(size_t *pretval,
const char *haystk, size_t haystk_nbytes,
const char *ndl, size_t ndl_nbytes,
zend_long offset, const char *enc)
@@ -968,15 +968,15 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
char *out_p;
size_t out_left;
- php_size_t cnt;
+ size_t cnt;
zend_string *ndl_buf;
const char *ndl_buf_p;
size_t ndl_buf_left;
- php_size_t match_ofs;
+ size_t match_ofs;
- *pretval = (php_size_t)-1;
+ *pretval = (size_t)-1;
err = php_iconv_string(ndl, ndl_nbytes, &ndl_buf, GENERIC_SUPERSET_NAME, enc);
@@ -1006,7 +1006,7 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
ndl_buf_p = ndl_buf->val;
ndl_buf_left = ndl_buf->len;
- match_ofs = (php_size_t)-1;
+ match_ofs = (size_t)-1;
for (in_p = haystk, in_left = haystk_nbytes, cnt = 0; in_left > 0; ++cnt) {
size_t prev_in_left;
@@ -1039,9 +1039,9 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
}
}
if (offset >= 0) {
- if (cnt >= (php_size_t)offset) {
+ if (cnt >= (size_t)offset) {
if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) {
- if (match_ofs == (php_size_t)-1) {
+ if (match_ofs == (size_t)-1) {
match_ofs = cnt;
}
ndl_buf_p += GENERIC_SUPERSET_NBYTES;
@@ -1051,11 +1051,11 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
break;
}
} else {
- php_size_t i, j, lim;
+ size_t i, j, lim;
i = 0;
j = GENERIC_SUPERSET_NBYTES;
- lim = (php_size_t)(ndl_buf_p - ndl_buf->val);
+ lim = (size_t)(ndl_buf_p - ndl_buf->val);
while (j < lim) {
if (_php_iconv_memequal(&ndl_buf->val[j], &ndl_buf->val[i],
@@ -1074,7 +1074,7 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
ndl_buf_p = &ndl_buf->val[i];
ndl_buf_left = ndl_buf->len - i;
} else {
- match_ofs = (php_size_t)-1;
+ match_ofs = (size_t)-1;
ndl_buf_p = ndl_buf->val;
ndl_buf_left = ndl_buf->len;
}
@@ -1082,7 +1082,7 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
}
} else {
if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) {
- if (match_ofs == (php_size_t)-1) {
+ if (match_ofs == (size_t)-1) {
match_ofs = cnt;
}
ndl_buf_p += GENERIC_SUPERSET_NBYTES;
@@ -1094,11 +1094,11 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
match_ofs = -1;
}
} else {
- php_size_t i, j, lim;
+ size_t i, j, lim;
i = 0;
j = GENERIC_SUPERSET_NBYTES;
- lim = (php_size_t)(ndl_buf_p - ndl_buf->val);
+ lim = (size_t)(ndl_buf_p - ndl_buf->val);
while (j < lim) {
if (_php_iconv_memequal(&ndl_buf->val[j], &ndl_buf->val[i],
@@ -1117,7 +1117,7 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
ndl_buf_p = &ndl_buf->val[i];
ndl_buf_left = ndl_buf->len - i;
} else {
- match_ofs = (php_size_t)-1;
+ match_ofs = (size_t)-1;
ndl_buf_p = ndl_buf->val;
ndl_buf_left = ndl_buf->len;
}
@@ -1136,11 +1136,11 @@ static php_iconv_err_t _php_iconv_strpos(php_size_t *pretval,
/* }}} */
/* {{{ _php_iconv_mime_encode() */
-static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, php_size_t max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc)
+static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, size_t max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc)
{
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
iconv_t cd = (iconv_t)(-1), cd_pl = (iconv_t)(-1);
- php_size_t char_cnt = 0;
+ size_t char_cnt = 0;
size_t out_charset_len;
size_t lfchars_len;
char *buf = NULL;
@@ -2039,7 +2039,7 @@ PHP_FUNCTION(iconv_strlen)
php_iconv_err_t err;
- php_size_t retval;
+ size_t retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s",
&str, &charset, &charset_len) == FAILURE) {
@@ -2112,7 +2112,7 @@ PHP_FUNCTION(iconv_strpos)
php_iconv_err_t err;
- php_size_t retval;
+ size_t retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ls",
&haystk, &ndl,
@@ -2138,7 +2138,7 @@ PHP_FUNCTION(iconv_strpos)
offset, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
- if (err == PHP_ICONV_ERR_SUCCESS && retval != (php_size_t)-1) {
+ if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
} else {
RETVAL_FALSE;
@@ -2157,7 +2157,7 @@ PHP_FUNCTION(iconv_strrpos)
php_iconv_err_t err;
- php_size_t retval;
+ size_t retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|s",
&haystk, &ndl,
@@ -2178,7 +2178,7 @@ PHP_FUNCTION(iconv_strrpos)
-1, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
- if (err == PHP_ICONV_ERR_SUCCESS && retval != (php_size_t)-1) {
+ if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
} else {
RETVAL_FALSE;
@@ -2347,7 +2347,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
int charset_len = 0;
zend_long mode = 0;
char *enc_str_tmp;
- php_size_t enc_str_len_tmp;
+ size_t enc_str_len_tmp;
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
@@ -2510,7 +2510,7 @@ PHP_FUNCTION(iconv_set_encoding)
PHP_FUNCTION(iconv_get_encoding)
{
char *type = "all";
- php_size_t type_len = sizeof("all")-1;
+ size_t type_len = sizeof("all")-1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
return;
diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c
index 34668bb5a8..db9e41f887 100644
--- a/ext/intl/collator/collator_is_numeric.c
+++ b/ext/intl/collator/collator_is_numeric.c
@@ -184,7 +184,7 @@ static zend_long collator_u_strtol(nptr, endptr, base)
* Set any if any `digits' consumed; make it negative to indicate
* overflow.
*/
- cutoff = neg ? -(zend_ulong)PHP_INT_MIN : PHP_INT_MAX;
+ cutoff = neg ? -(zend_ulong)ZEND_LONG_MIN : ZEND_LONG_MAX;
cutlim = cutoff % (zend_ulong)base;
cutoff /= (zend_ulong)base;
for (acc = 0, any = 0;; c = *s++) {
@@ -208,7 +208,7 @@ static zend_long collator_u_strtol(nptr, endptr, base)
}
}
if (any < 0) {
- acc = neg ? PHP_INT_MIN : PHP_INT_MAX;
+ acc = neg ? ZEND_LONG_MIN : ZEND_LONG_MAX;
errno = ERANGE;
} else if (neg)
acc = -acc;
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 12c9465bc3..fa06648331 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -86,7 +86,7 @@ PHP_FUNCTION( numfmt_parse )
break;
case FORMAT_TYPE_INT64:
val64 = unum_parseInt64(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo));
- if(val64 > ZEND_INT_MAX || val64 < ZEND_INT_MIN) {
+ if(val64 > ZEND_LONG_MAX || val64 < ZEND_LONG_MIN) {
RETVAL_DOUBLE(val64);
} else {
RETVAL_LONG((zend_long)val64);
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 50527b7f06..466db01731 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -663,7 +663,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh
case Formattable::kInt64:
aInt64 = fargs[i].getInt64();
- if(aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX) {
+ if(aInt64 > ZEND_LONG_MAX || aInt64 < -ZEND_LONG_MAX) {
ZVAL_DOUBLE(&(*args)[i], (double)aInt64);
} else {
ZVAL_LONG(&(*args)[i], (zend_long)aInt64);
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 71e6ac4aac..b029a83f63 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -241,9 +241,9 @@ PHP_MINFO_FUNCTION(ldap)
php_info_print_table_row(2, "RCS Version", "$Id$");
if (LDAPG(max_links) == -1) {
- snprintf(tmp, 31, ZEND_INT_FMT "/unlimited", LDAPG(num_links));
+ snprintf(tmp, 31, ZEND_LONG_FMT "/unlimited", LDAPG(num_links));
} else {
- snprintf(tmp, 31, ZEND_INT_FMT "/" ZEND_INT_FMT, LDAPG(num_links), LDAPG(max_links));
+ snprintf(tmp, 31, ZEND_LONG_FMT "/" ZEND_LONG_FMT, LDAPG(num_links), LDAPG(max_links));
}
php_info_print_table_row(2, "Total Links", tmp);
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 786825b35e..92e7327787 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -197,7 +197,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
char *strtok_buf = NULL, **val_list = NULL;
zval *array_ptr = (zval *) arg;
int n, num, *len_list = NULL;
- php_size_t val_len, new_val_len;
+ size_t val_len, new_val_len;
mbfl_string string, resvar, resval;
const mbfl_encoding *from_encoding = NULL;
mbfl_encoding_detector *identd = NULL;
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 4276537368..2bc488fe23 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -686,9 +686,9 @@ PHP_MINFO_FUNCTION(mysql)
php_info_print_table_start();
php_info_print_table_header(2, "MySQL Support", "enabled");
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MySG(num_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MySG(num_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MySG(num_links));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MySG(num_links));
php_info_print_table_row(2, "Active Links", buf);
php_info_print_table_row(2, "Client API version", mysql_get_client_info());
#if !defined (PHP_WIN32) && !defined (NETWARE) && !defined(MYSQL_USE_MYSQLND)
@@ -821,7 +821,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
hashed_details = zend_string_alloc(sizeof("mysql____") + (host_and_port? strlen(host_and_port) : 0)
+ (user? strlen(user) : 0) + (passwd? strlen(passwd) : 0) + MAX_LENGTH_OF_LONG - 1, 0);
- hashed_details->len = snprintf(hashed_details->val, hashed_details->len + 1, "mysql_%s_%s_%s_" ZEND_INT_FMT, SAFE_STRING(host_and_port), SAFE_STRING(user), SAFE_STRING(passwd), client_flags);
+ hashed_details->len = snprintf(hashed_details->val, hashed_details->len + 1, "mysql_%s_%s_%s_" ZEND_LONG_FMT, SAFE_STRING(host_and_port), SAFE_STRING(user), SAFE_STRING(passwd), client_flags);
}
/* We cannot use mysql_port anymore in windows, need to use
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 0ac8f2757b..2c5a4bc662 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -976,11 +976,11 @@ PHP_MINFO_FUNCTION(mysqli)
php_info_print_table_start();
php_info_print_table_header(2, "MysqlI Support", "enabled");
php_info_print_table_row(2, "Client API library version", mysql_get_client_info());
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_active_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MyG(num_active_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_inactive_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MyG(num_inactive_persistent));
php_info_print_table_row(2, "Inactive Persistent Links", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_links));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MyG(num_links));
php_info_print_table_row(2, "Active Links", buf);
#if !defined(MYSQLI_USE_MYSQLND)
php_info_print_table_row(2, "Client API header version", MYSQL_SERVER_VERSION);
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index c00e4b84e9..b240cfab09 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -98,7 +98,7 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry * TSRMLS_DC
#define MYSQLI_RETURN_LONG_INT(__val) \
{ \
- if ((__val) < PHP_INT_MAX) { \
+ if ((__val) < ZEND_LONG_MAX) { \
RETURN_LONG((zend_long) (__val)); \
} else { \
/* always used with my_ulonglong -> %llu */ \
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 49ecab0add..c1fa0a17d6 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -81,7 +81,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
ZVAL_NULL(retval);\
} else {\
l = (__ret_type)__int_func(p);\
- if (l < PHP_INT_MAX) {\
+ if (l < ZEND_LONG_MAX) {\
ZVAL_LONG(retval, (zend_long) l);\
} else { \
ZVAL_STR(retval, strpprintf(0, __ret_type_sprint_mod, l)); \
@@ -167,7 +167,7 @@ static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
return retval;
}
- if (rc < PHP_INT_MAX) {
+ if (rc < ZEND_LONG_MAX) {
ZVAL_LONG(retval, (zend_long) rc);
} else {
ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
@@ -221,18 +221,18 @@ static zval *link_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* link properties */
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
/* {{{ property link_stat_read */
static zval *link_stat_read(mysqli_object *obj, zval *retval TSRMLS_DC)
@@ -310,8 +310,8 @@ static zval *result_lengths_read(mysqli_object *obj, zval *retval TSRMLS_DC)
}
/* }}} */
-MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
/* statement properties */
@@ -354,7 +354,7 @@ static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
return retval;
}
- if (rc < PHP_INT_MAX) {
+ if (rc < ZEND_LONG_MAX) {
ZVAL_LONG(retval, (zend_long) rc);
} else {
ZVAL_STR(retval, strpprintf(0, MYSQLI_LLU_SPEC, rc));
@@ -407,9 +407,9 @@ static zval *stmt_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_UINT_FMT)
-MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), zend_ulong, ZEND_UINT_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
+MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), zend_ulong, ZEND_ULONG_FMT)
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index c05d8af8b1..de7c8c7023 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -2124,11 +2124,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA *
return 0;
}
- major = ZEND_STRTOI(p, &p, 10);
+ major = ZEND_STRTOL(p, &p, 10);
p += 1; /* consume the dot */
- minor = ZEND_STRTOI(p, &p, 10);
+ minor = ZEND_STRTOL(p, &p, 10);
p += 1; /* consume the dot */
- patch = ZEND_STRTOI(p, &p, 10);
+ patch = ZEND_STRTOL(p, &p, 10);
return (zend_ulong)(major * Z_I(10000) + (zend_ulong)(minor * Z_I(100) + patch));
}
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index c669706917..cfe6f26280 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -636,7 +636,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX
We do transformation here, which will be used later when sending types. The code later relies on this.
*/
- if (Z_DVAL(tmp_data_copy) > PHP_INT_MAX || Z_DVAL(tmp_data_copy) < PHP_INT_MIN) {
+ if (Z_DVAL(tmp_data_copy) > ZEND_LONG_MAX || Z_DVAL(tmp_data_copy) < ZEND_LONG_MIN) {
stmt->send_types_to_server = *resend_types_next_time = 1;
convert_to_string_ex(tmp_data);
} else {
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index c42059c641..5af676d02f 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1731,7 +1731,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
*/
p -= len;
if (Z_TYPE_P(current_field) == IS_LONG) {
- bit_area += 1 + sprintf((char *)start, ZEND_INT_FMT, Z_LVAL_P(current_field));
+ bit_area += 1 + sprintf((char *)start, ZEND_LONG_FMT, Z_LVAL_P(current_field));
ZVAL_STRINGL(current_field, (char *) start, bit_area - start - 1);
} else if (Z_TYPE_P(current_field) == IS_STRING){
memcpy(bit_area, Z_STRVAL_P(current_field), Z_STRLEN_P(current_field));
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index ff532a6105..15d572793b 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -138,11 +138,11 @@ PHP_MINFO_FUNCTION(mysqlnd)
#else
"not supported");
#endif
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_cmd_buffer_size));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MYSQLND_G(net_cmd_buffer_size));
php_info_print_table_row(2, "Command buffer size", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_read_buffer_size));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MYSQLND_G(net_read_buffer_size));
php_info_print_table_row(2, "Read buffer size", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_read_timeout));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, MYSQLND_G(net_read_timeout));
php_info_print_table_row(2, "Read timeout", buf);
php_info_print_table_row(2, "Collecting statistics", MYSQLND_G(collect_statistics)? "Yes":"No");
php_info_print_table_row(2, "Collecting memory statistics", MYSQLND_G(collect_memory_statistics)? "Yes":"No");
@@ -208,7 +208,7 @@ static PHP_INI_MH(OnUpdateNetCmdBufferSize)
{
zend_long long_value;
- ZEND_ATOI(long_value, new_value);
+ ZEND_ATOL(long_value, new_value);
if (long_value < MYSQLND_NET_CMD_BUFFER_MIN_SIZE) {
return FAILURE;
}
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 3912b52b13..0b873a0b33 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -841,9 +841,9 @@ PHP_MINFO_FUNCTION(odbc)
php_info_print_table_start();
php_info_print_table_header(2, "ODBC Support", "enabled");
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, ODBCG(num_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ODBCG(num_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, ODBCG(num_links));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ODBCG(num_links));
php_info_print_table_row(2, "Active Links", buf);
php_info_print_table_row(2, "ODBC library", PHP_ODBC_TYPE);
#ifndef PHP_WIN32
diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c
index c9cfc03f00..2a386b812b 100644
--- a/ext/opcache/zend_accelerator_debug.c
+++ b/ext/opcache/zend_accelerator_debug.c
@@ -57,7 +57,7 @@ void zend_accel_error(int type, const char *format, ...)
}
#ifdef ZTS
- fprintf(fLog, "%s (" ZEND_UINT_FMT "): ", time_string, (zend_ulong)tsrm_thread_id());
+ fprintf(fLog, "%s (" ZEND_ULONG_FMT "): ", time_string, (zend_ulong)tsrm_thread_id());
#else
fprintf(fLog, "%s (%d): ", time_string, getpid());
#endif
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index b97e56ac5b..86411af7be 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -411,7 +411,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
php_info_print_table_row(2, "Cache hits", buf);
snprintf(buf, sizeof(buf), "%pd", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses));
php_info_print_table_row(2, "Cache misses", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory));
php_info_print_table_row(2, "Used memory", buf);
snprintf(buf, sizeof(buf), "%pd", zend_shared_alloc_get_free_memory());
php_info_print_table_row(2, "Free memory", buf);
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index fbe83a5f8a..584b87d68e 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -2193,7 +2193,7 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
X509_LOOKUP * dir_lookup, * file_lookup;
int ndirs = 0, nfiles = 0;
zval * item;
- php_stat_t sb;
+ zend_stat_t sb;
store = X509_STORE_new();
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index bb2f808cbc..936428ad7b 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -331,7 +331,7 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC) /* {{{ */
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- while ((pdo_uint64_t)i64 > (pdo_uint64_t)PHP_INT_MAX) {
+ while ((pdo_uint64_t)i64 > (pdo_uint64_t)ZEND_LONG_MAX) {
pdo_uint64_t quo = (pdo_uint64_t)i64 / (unsigned int)10;
unsigned int rem = (unsigned int)(i64 - quo*10U);
*--p = digit_vec[rem];
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 4045a20cee..175e52885d 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -544,7 +544,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
{
struct pdo_column_data *col;
char *value = NULL;
- php_size_t value_len = 0;
+ size_t value_len = 0;
int caller_frees = 0;
int type, new_type;
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index f8e43391f2..fe23e5fac2 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -151,8 +151,8 @@ static int pgsql_lob_flush(php_stream *stream TSRMLS_DC)
return 0;
}
-static int pgsql_lob_seek(php_stream *stream, php_off_t offset, int whence,
- php_off_t *newoffset TSRMLS_DC)
+static int pgsql_lob_seek(php_stream *stream, zend_off_t offset, int whence,
+ zend_off_t *newoffset TSRMLS_DC)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
int pos = lo_lseek(self->conn, self->lfd, offset, whence);
@@ -307,7 +307,7 @@ static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
}
H->pgoid = PQoidValue(res);
if (qs == PGRES_COMMAND_OK) {
- ZEND_ATOI(ret, PQcmdTuples(res));
+ ZEND_ATOL(ret, PQcmdTuples(res));
} else {
ret = Z_I(0);
}
@@ -354,7 +354,7 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
if (H->pgoid == InvalidOid) {
return NULL;
}
- *len = spprintf(&id, 0, ZEND_INT_FMT, (zend_long) H->pgoid);
+ *len = spprintf(&id, 0, ZEND_LONG_FMT, (zend_long) H->pgoid);
} else {
PGresult *res;
ExecStatusType status;
@@ -910,7 +910,7 @@ static PHP_METHOD(PDO, pgsqlLOBCreate)
lfd = lo_creat(H->server, INV_READ|INV_WRITE);
if (lfd != InvalidOid) {
- zend_string *buf = strpprintf(0, ZEND_UINT_FMT, (zend_long) lfd);
+ zend_string *buf = strpprintf(0, ZEND_ULONG_FMT, (zend_long) lfd);
RETURN_STR(buf);
}
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index f50e95e6be..7a315c7f08 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -230,7 +230,7 @@ stmt_retry:
}
if (status == PGRES_COMMAND_OK) {
- ZEND_ATOI(stmt->row_count, PQcmdTuples(S->result));
+ ZEND_ATOL(stmt->row_count, PQcmdTuples(S->result));
H->pgoid = PQoidValue(S->result);
} else {
stmt->row_count = (zend_long)PQntuples(S->result);
@@ -256,14 +256,14 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
/* decode name from $1, $2 into 0, 1 etc. */
if (param->name) {
if (param->name->val[0] == '$') {
- ZEND_ATOI(param->paramno, param->name->val + 1);
+ ZEND_ATOL(param->paramno, param->name->val + 1);
} else {
/* resolve parameter name to rewritten name */
char *namevar;
if (stmt->bound_param_map && (namevar = zend_hash_find_ptr(stmt->bound_param_map,
param->name)) != NULL) {
- ZEND_ATOI(param->paramno, namevar + 1);
+ ZEND_ATOL(param->paramno, namevar + 1);
param->paramno--;
} else {
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val TSRMLS_CC);
@@ -519,7 +519,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulon
switch (cols[colno].param_type) {
case PDO_PARAM_INT:
- ZEND_ATOI(S->cols[colno].intval, *ptr);
+ ZEND_ATOL(S->cols[colno].intval, *ptr);
*ptr = (char *) &(S->cols[colno].intval);
*len = sizeof(zend_long);
break;
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index 739bcc6de8..feaff73b94 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -118,7 +118,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
}
} else {
convert_to_int(parameter);
-#if PHP_INT_MAX > 2147483647
+#if ZEND_LONG_MAX > 2147483647
if (SQLITE_OK == sqlite3_bind_int64(S->stmt, param->paramno + 1, Z_LVAL_P(parameter))) {
return 1;
}
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index ad75b23312..03a4051efb 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -66,9 +66,9 @@
#define PGSQL_MAX_LENGTH_OF_LONG 30
#define PGSQL_MAX_LENGTH_OF_DOUBLE 60
-#if PHP_INT_MAX < UINT_MAX
+#if ZEND_LONG_MAX < UINT_MAX
#define PGSQL_RETURN_OID(oid) do { \
- if (oid > PHP_INT_MAX) { \
+ if (oid > ZEND_LONG_MAX) { \
smart_str s = {0}; \
smart_str_append_unsigned(&s, oid); \
smart_str_0(&s); \
@@ -1254,9 +1254,9 @@ PHP_MINFO_FUNCTION(pgsql)
php_info_print_table_row(2, "SSL support", "disabled");
#endif
#endif /* HAVE_PG_CONFIG_H */
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, PGG(num_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, PGG(num_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
- snprintf(buf, sizeof(buf), ZEND_INT_FMT, PGG(num_links));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, PGG(num_links));
php_info_print_table_row(2, "Active Links", buf);
php_info_print_table_end();
@@ -2412,8 +2412,8 @@ PHP_FUNCTION(pg_field_table)
}
if (return_oid) {
-#if UINT_MAX > PHP_INT_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */
- if (oid > PHP_INT_MAX) {
+#if UINT_MAX > ZEND_LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */
+ if (oid > ZEND_LONG_MAX) {
smart_str oidstr = {0};
smart_str_append_unsigned(&oidstr, oid);
smart_str_0(&oidstr);
@@ -2514,8 +2514,8 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
case PHP_PG_FIELD_TYPE_OID:
oid = PQftype(pgsql_result, field);
-#if UINT_MAX > PHP_INT_MAX
- if (oid > PHP_INT_MAX) {
+#if UINT_MAX > ZEND_LONG_MAX
+ if (oid > ZEND_LONG_MAX) {
smart_str s = {0};
smart_str_append_unsigned(&s, oid);
smart_str_0(&s);
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c
index 238698022f..b8875891b0 100644
--- a/ext/phar/dirstream.c
+++ b/ext/phar/dirstream.c
@@ -58,7 +58,7 @@ static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{
/**
* Used for seeking on a phar directory handle
*/
-static int phar_dir_seek(php_stream *stream, php_off_t offset, int whence, php_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h
index 27d236aca4..f9a300a63c 100644
--- a/ext/phar/dirstream.h
+++ b/ext/phar/dirstream.h
@@ -31,7 +31,7 @@ static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count T
static size_t phar_dir_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC);
static int phar_dir_flush(php_stream *stream TSRMLS_DC);
-static int phar_dir_seek( php_stream *stream, php_off_t offset, int whence, php_off_t *newoffset TSRMLS_DC);
+static int phar_dir_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
#else
php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
#endif
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 99bc98bc5b..6347c72f40 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -433,7 +433,7 @@ skip_phar:
/* {{{ php_stat
*/
-static void phar_fancy_stat(php_stat_t *stat_sb, int type, zval *return_value TSRMLS_DC)
+static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value TSRMLS_DC)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
@@ -611,7 +611,7 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
if (!IS_ABSOLUTE_PATH(filename, filename_length) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- php_stat_t sb = {0};
+ zend_stat_t sb = {0};
phar_entry_info *data = NULL;
phar_archive_data *phar;
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 1e184b8362..2fd46b9621 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -771,7 +771,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
/* be ignored on reading because it is being generated anyways. */
if (manifest_flags & PHAR_HDR_SIGNATURE) {
char sig_buf[8], *sig_ptr = sig_buf;
- php_off_t read_len;
+ zend_off_t read_len;
size_t end_of_phar;
if (-1 == php_stream_seek(fp, -8, SEEK_END)
@@ -792,7 +792,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
case PHAR_SIG_OPENSSL: {
php_uint32 signature_len;
char *sig;
- php_off_t whence;
+ zend_off_t whence;
/* we store the signature followed by the signature length */
if (-1 == php_stream_seek(fp, -12, SEEK_CUR)
@@ -2542,7 +2542,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
int halt_offset, restore_alias_len, global_flags = 0, closeoldfile;
char *pos, has_dirs = 0;
char manifest[18], entry_buffer[24];
- php_off_t manifest_ftell;
+ zend_off_t manifest_ftell;
zend_long offset;
size_t wrote;
php_uint32 manifest_len, mytime, loc, new_manifest_count;
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 1bfd827fc0..77df0a71c2 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -415,7 +415,7 @@ static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp TSRM
PHAR_GLOBALS->cached_fp[phar->phar_pos].ufp = fp;
}
-static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, php_off_t offset TSRMLS_DC)
+static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zend_off_t offset TSRMLS_DC)
{
phar_entry_fp_info *data;
@@ -437,7 +437,7 @@ static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry TSRMLS_D
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type;
}
-static inline php_off_t phar_get_fp_offset(phar_entry_info *entry TSRMLS_DC)
+static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry TSRMLS_DC)
{
if (!entry->is_persistent) {
return entry->offset;
@@ -466,9 +466,9 @@ typedef struct _phar_entry_data {
phar_archive_data *phar;
php_stream *fp;
/* stream position proxy, allows multiple open streams referring to the same fp */
- php_off_t position;
+ zend_off_t position;
/* for copies of the phar fp, defines where 0 is */
- php_off_t zero;
+ zend_off_t zero;
unsigned int for_write:1;
unsigned int is_zip:1;
unsigned int is_tar:1;
@@ -564,7 +564,7 @@ char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC);
phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRMLS_DC);
void destroy_phar_manifest_entry(zval *zv);
-int phar_seek_efp(phar_entry_info *entry, php_off_t offset, int whence, php_off_t position, int follow_links TSRMLS_DC);
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC);
php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC);
int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC);
int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TSRMLS_DC);
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 1f88cae7e0..b0123f30df 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -155,7 +155,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
zend_op_array *new_op_array;
zval result;
php_stream *fp;
- php_off_t position;
+ zend_off_t position;
switch (code) {
case PHAR_MIME_PHPS:
@@ -211,7 +211,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
if (got > 0) {
PHPWRITE(buf, got);
position += got;
- if (position == (php_off_t) info->uncompressed_filesize) {
+ if (position == (zend_off_t) info->uncompressed_filesize) {
break;
}
}
@@ -1940,7 +1940,7 @@ PHP_METHOD(Phar, isFileFormat)
static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */
{
char *error;
- php_off_t offset;
+ zend_off_t offset;
phar_entry_info *link;
if (FAILURE == phar_open_entry_fp(entry, &error, 1 TSRMLS_CC)) {
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index d50982babe..eb2fa607ee 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -377,7 +377,7 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML
got = php_stream_read(data->fp, buf, MIN(count, entry->uncompressed_filesize - data->position));
data->position = php_stream_tell(data->fp) - data->zero;
- stream->eof = (data->position == (php_off_t) entry->uncompressed_filesize);
+ stream->eof = (data->position == (zend_off_t) entry->uncompressed_filesize);
return got;
}
@@ -386,12 +386,12 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML
/**
* Used for fseek($fp) on a phar file handle
*/
-static int phar_stream_seek(php_stream *stream, php_off_t offset, int whence, php_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
phar_entry_info *entry;
int res;
- php_off_t temp;
+ zend_off_t temp;
if (data->internal_file->link) {
entry = phar_get_link_source(data->internal_file TSRMLS_CC);
@@ -412,7 +412,7 @@ static int phar_stream_seek(php_stream *stream, php_off_t offset, int whence, ph
default:
temp = 0;
}
- if (temp > data->zero + (php_off_t) entry->uncompressed_filesize) {
+ if (temp > data->zero + (zend_off_t) entry->uncompressed_filesize) {
*newoffset = -1;
return -1;
}
@@ -440,7 +440,7 @@ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t coun
return -1;
}
data->position = php_stream_tell(data->fp);
- if (data->position > (php_off_t)data->internal_file->uncompressed_filesize) {
+ if (data->position > (zend_off_t)data->internal_file->uncompressed_filesize) {
data->internal_file->uncompressed_filesize = data->position;
}
data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize;
diff --git a/ext/phar/stream.h b/ext/phar/stream.h
index 20cf68d9d7..0171010179 100644
--- a/ext/phar/stream.h
+++ b/ext/phar/stream.h
@@ -34,7 +34,7 @@ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t coun
static size_t phar_stream_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC);
static int phar_stream_flush(php_stream *stream TSRMLS_DC);
-static int phar_stream_seek( php_stream *stream, php_off_t offset, int whence, php_off_t *newoffset TSRMLS_DC);
+static int phar_stream_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
static int phar_stream_stat( php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
END_EXTERN_C()
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index fa97b73a44..985abd14a9 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -256,7 +256,7 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
phar_tar_number(hdr->size, sizeof(hdr->size));
if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) == sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
- php_off_t curloc;
+ zend_off_t curloc;
if (size > 511) {
if (error) {
diff --git a/ext/phar/util.c b/ext/phar/util.c
index 19aa03f9cc..e550b9fbcf 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -38,7 +38,7 @@
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#else
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, php_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC);
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC);
#endif
/* for links to relative location, prepend cwd of the entry */
@@ -117,10 +117,10 @@ php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /*
}
/* }}} */
-int phar_seek_efp(phar_entry_info *entry, php_off_t offset, int whence, php_off_t position, int follow_links TSRMLS_DC) /* {{{ */
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC) /* {{{ */
{
php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
- php_off_t temp, eoffset;
+ zend_off_t temp, eoffset;
if (!fp) {
return -1;
@@ -154,7 +154,7 @@ int phar_seek_efp(phar_entry_info *entry, php_off_t offset, int whence, php_off_
temp = 0;
}
- if (temp > eoffset + (php_off_t) entry->uncompressed_filesize) {
+ if (temp > eoffset + (zend_off_t) entry->uncompressed_filesize) {
return -1;
}
@@ -693,7 +693,7 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
php_stream_filter *filter;
phar_archive_data *phar = entry->phar;
char *filtername;
- php_off_t loc;
+ zend_off_t loc;
php_stream *ufp;
phar_entry_data dummy;
@@ -786,7 +786,7 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
php_stream_flush(ufp);
php_stream_filter_remove(filter, 1 TSRMLS_CC);
- if (php_stream_tell(ufp) - loc != (php_off_t) entry->uncompressed_filesize) {
+ if (php_stream_tell(ufp) - loc != (zend_off_t) entry->uncompressed_filesize) {
spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
return FAILURE;
}
@@ -1388,7 +1388,7 @@ static int phar_hex_str(const char *digest, size_t digest_len, char **signature
/* }}} */
#ifndef PHAR_HAVE_OPENSSL
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, php_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC) /* {{{ */
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC) /* {{{ */
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
@@ -1479,7 +1479,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, php_off_t e
int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error TSRMLS_DC) /* {{{ */
{
int read_size, len;
- php_off_t read_len;
+ zend_off_t read_len;
unsigned char buf[1024];
php_stream_rewind(fp);
@@ -1576,7 +1576,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
while (read_size && (len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
EVP_VerifyUpdate (&md_ctx, buf, len);
- read_len -= (php_off_t)len;
+ read_len -= (zend_off_t)len;
if (read_len < read_size) {
read_size = (int)read_len;
@@ -1616,7 +1616,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
while ((len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
PHP_SHA512Update(&context, buf, len);
- read_len -= (php_off_t)len;
+ read_len -= (zend_off_t)len;
if (read_len < read_size) {
read_size = (int)read_len;
}
@@ -1649,7 +1649,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
while ((len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
PHP_SHA256Update(&context, buf, len);
- read_len -= (php_off_t)len;
+ read_len -= (zend_off_t)len;
if (read_len < read_size) {
read_size = (int)read_len;
}
@@ -1690,7 +1690,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
while ((len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
PHP_SHA1Update(&context, buf, len);
- read_len -= (php_off_t)len;
+ read_len -= (zend_off_t)len;
if (read_len < read_size) {
read_size = (int)read_len;
}
@@ -1723,7 +1723,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
while ((len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
PHP_MD5Update(&context, buf, len);
- read_len -= (php_off_t)len;
+ read_len -= (zend_off_t)len;
if (read_len < read_size) {
read_size = (int)read_len;
}
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 81d7a0b8b9..a314498813 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -338,7 +338,7 @@ foundit:
/* add each central directory item to the manifest */
for (i = 0; i < PHAR_GET_16(locator.count); ++i) {
phar_zip_central_dir_file zipentry;
- php_off_t beforeus = php_stream_tell(fp);
+ zend_off_t beforeus = php_stream_tell(fp);
if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, sizeof(zipentry))) {
PHAR_ZIP_FAIL("unable to read central directory entry, truncated");
@@ -393,7 +393,7 @@ foundit:
if (entry.filename_len == sizeof(".phar/signature.bin")-1 && !strncmp(entry.filename, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
size_t read;
php_stream *sigfile;
- php_off_t now;
+ zend_off_t now;
char *sig;
now = php_stream_tell(fp);
@@ -448,7 +448,7 @@ foundit:
phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len TSRMLS_CC);
if (PHAR_GET_16(zipentry.extra_len)) {
- php_off_t loc = php_stream_tell(fp);
+ zend_off_t loc = php_stream_tell(fp);
if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len) TSRMLS_CC)) {
pefree(entry.filename, entry.is_persistent);
PHAR_ZIP_FAIL("Unable to process extra field header for file in central directory");
@@ -537,7 +537,7 @@ foundit:
if (!actual_alias && entry.filename_len == sizeof(".phar/alias.txt")-1 && !strncmp(entry.filename, ".phar/alias.txt", sizeof(".phar/alias.txt")-1)) {
php_stream_filter *filter;
- php_off_t saveloc;
+ zend_off_t saveloc;
/* verify local file header */
phar_zip_file_header local;
@@ -790,7 +790,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
phar_zip_central_dir_file central;
struct _phar_zip_pass *p;
php_uint32 newcrc32;
- php_off_t offset;
+ zend_off_t offset;
int not_really_modified = 0;
p = (struct _phar_zip_pass*) arg;
@@ -1108,7 +1108,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
char *signature, sigbuf[8];
phar_entry_info entry = {0};
php_stream *newfile;
- php_off_t tell, st;
+ zend_off_t tell, st;
newfile = php_stream_fopen_tmpfile();
if (newfile == NULL) {
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 45e27a96ab..b5c9354c87 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -187,7 +187,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
struct dirent *entry = (struct dirent *) &dentry;
- php_stat_t sbuf;
+ zend_stat_t sbuf;
char buf[MAXPATHLEN];
time_t now;
int nrdels = 0;
@@ -238,7 +238,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
static int ps_files_key_exists(ps_files *data, const char *key TSRMLS_DC)
{
char buf[MAXPATHLEN];
- php_stat_t sbuf;
+ zend_stat_t sbuf;
if (!key || !ps_files_path_create(buf, sizeof(buf), data, key)) {
return FAILURE;
@@ -283,7 +283,7 @@ PS_OPEN_FUNC(files)
if (argc > 1) {
errno = 0;
- dirdepth = (size_t) ZEND_STRTOI(argv[0], NULL, 10);
+ dirdepth = (size_t) ZEND_STRTOL(argv[0], NULL, 10);
if (errno == ERANGE) {
php_error(E_WARNING, "The first parameter in session.save_path is invalid");
return FAILURE;
@@ -292,7 +292,7 @@ PS_OPEN_FUNC(files)
if (argc > 2) {
errno = 0;
- filemode = ZEND_STRTOI(argv[1], NULL, 8);
+ filemode = ZEND_STRTOL(argv[1], NULL, 8);
if (errno == ERANGE || filemode < 0 || filemode > 07777) {
php_error(E_WARNING, "The second parameter in session.save_path is invalid");
return FAILURE;
diff --git a/ext/session/session.c b/ext/session/session.c
index 58bfc33d2d..af1d50c255 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -305,7 +305,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
}
/* maximum 15+19+19+10 bytes */
- spprintf(&buf, 0, "%.15s%ld" ZEND_INT_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
+ spprintf(&buf, 0, "%.15s%ld" ZEND_LONG_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
switch (PS(hash_func)) {
case PS_HASH_FUNC_MD5:
@@ -712,7 +712,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
PS(hash_ops) = NULL;
#endif
- val = ZEND_STRTOI(new_value, &endptr, 10);
+ val = ZEND_STRTOL(new_value, &endptr, 10);
if (endptr && (*endptr == '\0')) {
/* Numeric value */
PS(hash_func) = val ? 1 : 0;
@@ -1148,7 +1148,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */
static inline void last_modified(TSRMLS_D) /* {{{ */
{
const char *path;
- php_stat_t sb;
+ zend_stat_t sb;
char buf[MAX_STR + 1];
path = SG(request_info).path_translated;
@@ -1178,7 +1178,7 @@ CACHE_LIMITER_FUNC(public) /* {{{ */
strcpy_gmt(buf + sizeof(EXPIRES) - 1, &now);
ADD_HEADER(buf);
- snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_INT_FMT, PS(cache_expire) * 60); /* SAFE */
+ snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_LONG_FMT, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
last_modified(TSRMLS_C);
@@ -1189,7 +1189,7 @@ CACHE_LIMITER_FUNC(private_no_expire) /* {{{ */
{
char buf[MAX_STR + 1];
- snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=" ZEND_INT_FMT ", pre-check=" ZEND_INT_FMT, PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */
+ snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=" ZEND_LONG_FMT ", pre-check=" ZEND_LONG_FMT, PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
last_modified(TSRMLS_C);
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 4a7edb417f..09958ac51f 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -631,7 +631,7 @@ try_again:
unsigned char hash[16];
PHP_MD5Init(&md5ctx);
- snprintf(cnonce, sizeof(cnonce), ZEND_INT_FMT, php_rand(TSRMLS_C));
+ snprintf(cnonce, sizeof(cnonce), ZEND_LONG_FMT, php_rand(TSRMLS_C));
PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
PHP_MD5Final(hash, &md5ctx);
make_digest(cnonce, hash);
diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c
index 24e636b0ef..018605fb75 100644
--- a/ext/sockets/sendrecvmsg.c
+++ b/ext/sockets/sendrecvmsg.c
@@ -300,7 +300,7 @@ PHP_FUNCTION(socket_cmsg_space)
return;
}
- if (entry->var_el_size > 0 && n > (PHP_INT_MAX - (zend_long)entry->size -
+ if (entry->var_el_size > 0 && n > (ZEND_LONG_MAX - (zend_long)entry->size -
(zend_long)CMSG_SPACE(0) - 15L) / entry->var_el_size) {
/* the -15 is to account for any padding CMSG_SPACE may add after the data */
php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value for the "
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 1bafae2d06..129997e799 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -719,7 +719,7 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
for (i = 0; i < argc; i++) {
switch (sqlite3_value_type(argv[i])) {
case SQLITE_INTEGER:
-#if PHP_INT_MAX > 2147483647
+#if ZEND_LONG_MAX > 2147483647
ZVAL_LONG(&zargs[i + is_agg], sqlite3_value_int64(argv[i]));
#else
ZVAL_LONG(&zargs[i + is_agg], sqlite3_value_int(argv[i]));
@@ -765,7 +765,7 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
if (!Z_ISUNDEF(retval)) {
switch (Z_TYPE(retval)) {
case IS_LONG:
-#if PHP_INT_MAX > 2147483647
+#if ZEND_LONG_MAX > 2147483647
sqlite3_result_int64(context, Z_LVAL(retval));
#else
sqlite3_result_int(context, Z_LVAL(retval));
@@ -1496,7 +1496,7 @@ PHP_METHOD(sqlite3stmt, execute)
switch (param->type) {
case SQLITE_INTEGER:
convert_to_int(parameter);
-#if PHP_INT_MAX > 2147483647
+#if ZEND_LONG_MAX > 2147483647
sqlite3_bind_int64(stmt_obj->stmt, param->param_number, Z_LVAL_P(parameter));
#else
sqlite3_bind_int(stmt_obj->stmt, param->param_number, Z_LVAL_P(parameter));
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;
}
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 1520b66947..027fd33108 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -635,7 +635,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
dir_len = php_dirname(file_dirname, strlen(source));
if (dir_len > 0) {
- php_stat_t buf;
+ zend_stat_t buf;
if (php_sys_stat(file_dirname, &buf) != 0) {
xmlFreeURI(uri);
return NULL;