summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c10
-rw-r--r--ext/standard/crypt.c2
-rw-r--r--ext/standard/exec.c4
-rw-r--r--ext/standard/file.c8
-rw-r--r--ext/standard/filters.c2
-rw-r--r--ext/standard/head.c16
-rw-r--r--ext/standard/html.c14
-rw-r--r--ext/standard/http.c4
-rw-r--r--ext/standard/http_fopen_wrapper.c2
-rw-r--r--ext/standard/image.c8
-rw-r--r--ext/standard/info.c8
-rw-r--r--ext/standard/iptc.c8
-rw-r--r--ext/standard/levenshtein.c4
-rw-r--r--ext/standard/mail.c2
-rw-r--r--ext/standard/password.c22
-rw-r--r--ext/standard/php_smart_string.h4
-rw-r--r--ext/standard/streamsfuncs.c76
-rw-r--r--main/php_variables.c2
18 files changed, 98 insertions, 98 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 69e85a5aa6..a00b05d44d 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -99,7 +99,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef INADDR_NONE
-#define INADDR_NONE ((unsigned long int) -1)
+#define INADDR_NONE ((php_uint_t) -1)
#endif
#include "zend_globals.h"
@@ -3914,7 +3914,7 @@ PHP_FUNCTION(ip2long)
#ifdef HAVE_INET_PTON
struct in_addr ip;
#else
- unsigned long int ip;
+ php_uint_t ip;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
@@ -3950,7 +3950,7 @@ PHP_FUNCTION(long2ip)
/* "It's a long but it's not, PHP ints are signed */
char *ip;
int ip_len;
- unsigned long n;
+ php_uint_t n;
struct in_addr myaddr;
#ifdef HAVE_INET_PTON
char str[40];
@@ -4428,10 +4428,10 @@ PHP_FUNCTION(usleep)
Delay for a number of seconds and nano seconds */
PHP_FUNCTION(time_nanosleep)
{
- long tv_sec, tv_nsec;
+ php_int_t tv_sec, tv_nsec;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &tv_sec, &tv_nsec) == FAILURE) {
return;
}
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 86ae9bee13..47436398ff 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -136,7 +136,7 @@ PHP_MSHUTDOWN_FUNCTION(crypt) /* {{{ */
static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-static void php_to64(char *s, long v, int n) /* {{{ */
+static void php_to64(char *s, php_int_t v, int n) /* {{{ */
{
while (--n >= 0) {
*s++ = itoa64[v&0x3f];
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 87e73ee4f2..72878f9c9e 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -470,9 +470,9 @@ PHP_FUNCTION(shell_exec)
Change the priority of the current process */
PHP_FUNCTION(proc_nice)
{
- long pri;
+ php_int_t pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &pri) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index c58db9fd64..1b599b84a0 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1340,11 +1340,11 @@ PHP_FUNCTION(mkdir)
char *dir;
int dir_len;
zval *zcontext = NULL;
- long mode = 0777;
+ php_int_t mode = 0777;
zend_bool recursive = 0;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ibr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -2454,9 +2454,9 @@ PHP_FUNCTION(fnmatch)
{
char *pattern, *filename;
int pattern_len, filename_len;
- long flags = 0;
+ php_int_t flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|i", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 9a0dc672c4..7944cdc4c7 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -1306,7 +1306,7 @@ static php_conv_err_t php_conv_get_bool_prop_ex(const HashTable *ht, int *pretva
#if IT_WAS_USED
static int php_conv_get_int_prop_ex(const HashTable *ht, int *pretval, char *field_name, size_t field_name_len)
{
- long l;
+ php_int_t l;
php_conv_err_t err;
*pretval = 0;
diff --git a/ext/standard/head.c b/ext/standard/head.c
index ec792bee2c..928c26293e 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -41,7 +41,7 @@ PHP_FUNCTION(header)
zend_bool rep = 1;
sapi_header_line ctr = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bi", &ctr.line,
&ctr.line_len, &rep, &ctr.response_code) == FAILURE)
return;
@@ -178,11 +178,11 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
PHP_FUNCTION(setcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
- long expires = 0;
+ php_int_t expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
@@ -201,11 +201,11 @@ PHP_FUNCTION(setcookie)
PHP_FUNCTION(setrawcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
- long expires = 0;
+ php_int_t expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
@@ -289,15 +289,15 @@ PHP_FUNCTION(headers_list)
Sets a response code, or returns the current HTTP response code */
PHP_FUNCTION(http_response_code)
{
- long response_code = 0;
+ php_int_t response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &response_code) == FAILURE) {
return;
}
if (response_code)
{
- long old_response_code;
+ php_int_t old_response_code;
old_response_code = SG(sapi_headers).http_response_code;
SG(sapi_headers).http_response_code = response_code;
diff --git a/ext/standard/html.c b/ext/standard/html.c
index abb15f2440..7df76708a9 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -790,7 +790,7 @@ static inline int numeric_entity_is_allowed(unsigned uni_cp, int document_type)
*/
static inline int process_numeric_entity(const char **buf, unsigned *code_point)
{
- long code_l;
+ php_int_t code_l;
int hexadecimal = (**buf == 'x' || **buf == 'X'); /* TODO: XML apparently disallows "X" */
char *endptr;
@@ -804,7 +804,7 @@ static inline int process_numeric_entity(const char **buf, unsigned *code_point)
return FAILURE;
}
- code_l = strtol(*buf, &endptr, hexadecimal ? 16 : 10);
+ code_l = ZEND_STRTOI(*buf, &endptr, hexadecimal ? 16 : 10);
/* we're guaranteed there were valid digits, so *endptr > buf */
*buf = endptr;
@@ -813,7 +813,7 @@ static inline int process_numeric_entity(const char **buf, unsigned *code_point)
/* many more are invalid, but that depends on whether it's HTML
* (and which version) or XML. */
- if (code_l > 0x10FFFFL)
+ if (code_l > Z_I(0x10FFFF))
return FAILURE;
if (code_point != NULL)
@@ -1506,10 +1506,10 @@ PHP_FUNCTION(htmlspecialchars_decode)
{
char *str;
int str_len;
- long quote_style = ENT_COMPAT;
+ php_int_t quote_style = ENT_COMPAT;
zend_string *replaced;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &quote_style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|i", &str, &str_len, &quote_style) == FAILURE) {
return;
}
@@ -1626,7 +1626,7 @@ static inline void write_s3row_data(
Returns the internal translation table used by htmlspecialchars and htmlentities */
PHP_FUNCTION(get_html_translation_table)
{
- long all = HTML_SPECIALCHARS,
+ php_int_t all = HTML_SPECIALCHARS,
flags = ENT_COMPAT;
int doctype;
entity_table_opt entity_table;
@@ -1639,7 +1639,7 @@ PHP_FUNCTION(get_html_translation_table)
* getting the translated table from data structures that are optimized for
* random access, not traversal */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|iis",
&all, &flags, &charset_hint, &charset_hint_len) == FAILURE) {
return;
}
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 27642da738..d5eb78e417 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -241,9 +241,9 @@ PHP_FUNCTION(http_build_query)
char *prefix = NULL, *arg_sep=NULL;
int arg_sep_len = 0, prefix_len = 0;
smart_str formstr = {0};
- long enc_type = PHP_QUERY_RFC1738;
+ php_int_t enc_type = PHP_QUERY_RFC1738;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssi", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
RETURN_FALSE;
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 7e8ddd51d4..4359c34efa 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -749,7 +749,7 @@ finish:
/* create filter to decode response body */
if (!(options & STREAM_ONLY_GET_HEADERS)) {
- long decode = 1;
+ php_int_t decode = 1;
if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) {
decode = zend_is_true(tmpzval TSRMLS_CC);
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 87ab458800..24576fd671 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -1160,9 +1160,9 @@ PHPAPI char * php_image_type_to_mime_type(int image_type)
Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype */
PHP_FUNCTION(image_type_to_mime_type)
{
- long p_image_type;
+ php_int_t p_image_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &p_image_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &p_image_type) == FAILURE) {
return;
}
@@ -1174,10 +1174,10 @@ PHP_FUNCTION(image_type_to_mime_type)
Get file extension for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype */
PHP_FUNCTION(image_type_to_extension)
{
- long image_type;
+ php_int_t image_type;
zend_bool inc_dot=1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", &image_type, &inc_dot) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|b", &image_type, &inc_dot) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 27bc683ba5..07c183df8e 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1166,9 +1166,9 @@ void register_phpinfo_constants(INIT_FUNC_ARGS)
Output a page of useful information about PHP and the current request */
PHP_FUNCTION(phpinfo)
{
- long flag = PHP_INFO_ALL;
+ php_int_t flag = PHP_INFO_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &flag) == FAILURE) {
return;
}
@@ -1210,9 +1210,9 @@ PHP_FUNCTION(phpversion)
Prints the list of people who've contributed to the PHP project */
PHP_FUNCTION(phpcredits)
{
- long flag = PHP_CREDITS_ALL;
+ php_int_t flag = PHP_CREDITS_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &flag) == FAILURE) {
return;
}
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index cea43dd8d3..9102b4b07a 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -179,7 +179,7 @@ PHP_FUNCTION(iptcembed)
{
char *iptcdata, *jpeg_file;
int iptcdata_len, jpeg_file_len;
- long spool = 0;
+ php_int_t spool = 0;
FILE *fp;
unsigned int marker, done = 0;
int inx;
@@ -187,7 +187,7 @@ PHP_FUNCTION(iptcembed)
struct stat sb;
zend_bool written = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|i", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
return;
}
@@ -334,8 +334,8 @@ PHP_FUNCTION(iptcparse)
if((inx+6) >= str_len) {
break;
}
- len = (((long) buffer[ inx + 2 ]) << 24) + (((long) buffer[ inx + 3 ]) << 16) +
- (((long) buffer[ inx + 4 ]) << 8) + (((long) buffer[ inx + 5 ]));
+ len = (((php_int_t) buffer[ inx + 2 ]) << 24) + (((php_int_t) buffer[ inx + 3 ]) << 16) +
+ (((php_int_t) buffer[ inx + 4 ]) << 8) + (((php_int_t) buffer[ inx + 5 ]));
inx += 6;
} else { /* short tag */
len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ];
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index 86ce0f2fbe..232366e030 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -95,7 +95,7 @@ PHP_FUNCTION(levenshtein)
char *str1, *str2;
char *callback_name;
int str1_len, str2_len, callback_len;
- long cost_ins, cost_rep, cost_del;
+ php_int_t cost_ins, cost_rep, cost_del;
int distance = -1;
switch (argc) {
@@ -107,7 +107,7 @@ PHP_FUNCTION(levenshtein)
break;
case 5: /* more general version: calc cost by ins/rep/del weights */
- if (zend_parse_parameters(5 TSRMLS_CC, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
+ if (zend_parse_parameters(5 TSRMLS_CC, "ssiii", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, cost_ins, cost_rep, cost_del);
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index b08c4858e8..1bd2fa9016 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -72,7 +72,7 @@
*p = ' '; \
} \
-extern long php_getuid(TSRMLS_D);
+extern php_int_t php_getuid(TSRMLS_D);
/* {{{ proto int ezmlm_hash(string addr)
Calculate EZMLM list hash value. */
diff --git a/ext/standard/password.c b/ext/standard/password.c
index d001e475f0..23e0ae4259 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -195,8 +195,8 @@ PHP_FUNCTION(password_get_info)
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long cost = PHP_PASSWORD_BCRYPT_COST;
- sscanf(hash, "$2y$%ld$", &cost);
+ php_int_t cost = PHP_PASSWORD_BCRYPT_COST;
+ sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost);
add_assoc_int(&options, "cost", cost);
}
break;
@@ -214,14 +214,14 @@ PHP_FUNCTION(password_get_info)
PHP_FUNCTION(password_needs_rehash)
{
- long new_algo = 0;
+ php_int_t new_algo = 0;
php_password_algo algo;
int hash_len;
char *hash;
HashTable *options = 0;
zval *option_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "si|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
return;
}
@@ -239,7 +239,7 @@ PHP_FUNCTION(password_needs_rehash)
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0;
+ php_int_t new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0;
if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) {
if (Z_TYPE_P(option_buffer) != IS_INT) {
@@ -253,7 +253,7 @@ PHP_FUNCTION(password_needs_rehash)
}
}
- sscanf(hash, "$2y$%ld$", &cost);
+ sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost);
if (cost != new_cost) {
RETURN_TRUE;
}
@@ -307,21 +307,21 @@ Hash a password */
PHP_FUNCTION(password_hash)
{
char *hash_format, *hash, *salt, *password;
- long algo = 0;
+ php_int_t algo = 0;
int password_len = 0, hash_len;
size_t salt_len = 0, required_salt_len = 0, hash_format_len;
HashTable *options = 0;
zval *option_buffer;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "si|H", &password, &password_len, &algo, &options) == FAILURE) {
return;
}
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long cost = PHP_PASSWORD_BCRYPT_COST;
+ php_int_t cost = PHP_PASSWORD_BCRYPT_COST;
if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) {
if (Z_TYPE_P(option_buffer) != IS_INT) {
@@ -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: %ld", cost);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_INT_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: %ld", algo);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_INT_FMT, algo);
RETURN_NULL();
}
diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h
index 02ba9fe84e..83d59054dd 100644
--- a/ext/standard/php_smart_string.h
+++ b/ext/standard/php_smart_string.h
@@ -119,13 +119,13 @@
__dest->len = __nl; \
} while (0)
-static inline char *smart_string_print_long(char *buf, long num) {
+static inline char *smart_string_print_long(char *buf, php_int_t num) {
char *r;
_zend_print_signed_to_buf(buf, num, unsigned long, r);
return r;
}
-static inline char *smart_string_print_unsigned(char *buf, long num) {
+static inline char *smart_string_print_unsigned(char *buf, php_int_t num) {
char *r;
_zend_print_unsigned_to_buf(buf, num, unsigned long, r);
return r;
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 95c4c49aec..baa28a14b1 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -51,11 +51,11 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
Creates a pair of connected, indistinguishable socket streams */
PHP_FUNCTION(stream_socket_pair)
{
- long domain, type, protocol;
+ php_int_t domain, type, protocol;
php_stream *s1, *s2;
php_socket_t pair[2];
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii",
&domain, &type, &protocol)) {
RETURN_FALSE;
}
@@ -96,13 +96,13 @@ PHP_FUNCTION(stream_socket_client)
char *hashkey = NULL;
php_stream *stream = NULL;
int err;
- long flags = PHP_STREAM_CLIENT_CONNECT;
+ php_int_t flags = PHP_STREAM_CLIENT_CONNECT;
zend_string *errstr = NULL;
php_stream_context *context = NULL;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dir", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -180,13 +180,13 @@ PHP_FUNCTION(stream_socket_server)
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
php_stream *stream = NULL;
int err = 0;
- long flags = STREAM_XPORT_BIND | STREAM_XPORT_LISTEN;
+ php_int_t flags = STREAM_XPORT_BIND | STREAM_XPORT_LISTEN;
zend_string *errstr = NULL;
php_stream_context *context = NULL;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/ir", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -321,13 +321,13 @@ PHP_FUNCTION(stream_socket_sendto)
{
php_stream *stream;
zval *zstream;
- long flags = 0;
+ php_int_t flags = 0;
char *data, *target_addr = NULL;
int datalen, target_addr_len = 0;
php_sockaddr_storage sa;
socklen_t sl = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|is", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, zstream);
@@ -351,12 +351,12 @@ PHP_FUNCTION(stream_socket_recvfrom)
php_stream *stream;
zval *zstream, *zremote = NULL;
zend_string *remote_addr = NULL;
- long to_read = 0;
+ php_int_t to_read = 0;
zend_string *read_buf;
- long flags = 0;
+ php_int_t flags = 0;
int recvd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|iz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
RETURN_FALSE;
}
@@ -398,11 +398,11 @@ PHP_FUNCTION(stream_get_contents)
{
php_stream *stream;
zval *zsrc;
- long maxlen = PHP_STREAM_COPY_ALL,
+ php_int_t maxlen = PHP_STREAM_COPY_ALL,
desiredpos = -1L;
zend_string *contents;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ii", &zsrc, &maxlen, &desiredpos) == FAILURE) {
RETURN_FALSE;
}
@@ -446,11 +446,11 @@ PHP_FUNCTION(stream_copy_to_stream)
{
php_stream *src, *dest;
zval *zsrc, *zdest;
- long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
+ php_int_t maxlen = PHP_STREAM_COPY_ALL, pos = 0;
size_t len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ii", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
@@ -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 %ld in the stream", pos);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_INT_FMT " in the stream", pos);
RETURN_FALSE;
}
@@ -723,10 +723,10 @@ PHP_FUNCTION(stream_select)
fd_set rfds, wfds, efds;
php_socket_t max_fd = 0;
int retval, sets = 0;
- long usec = 0;
+ php_int_t usec = 0;
int set_count, max_set_count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|i", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
FD_ZERO(&rfds);
@@ -1118,12 +1118,12 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
php_stream *stream;
char *filtername;
int filternamelen;
- long read_write = 0;
+ php_int_t read_write = 0;
zval *filterparams = NULL;
php_stream_filter *filter = NULL;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|iz", &zstream,
&filtername, &filternamelen, &read_write, &filterparams) == FAILURE) {
RETURN_FALSE;
}
@@ -1242,12 +1242,12 @@ PHP_FUNCTION(stream_get_line)
{
char *str = NULL;
int str_len = 0;
- long max_length;
+ php_int_t max_length;
zval *zstream;
zend_string *buf;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1276,10 +1276,10 @@ PHP_FUNCTION(stream_set_blocking)
{
zval *arg1;
int block;
- long arg2;
+ php_int_t arg2;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
return;
}
@@ -1302,12 +1302,12 @@ PHP_FUNCTION(stream_set_blocking)
PHP_FUNCTION(stream_set_timeout)
{
zval *socket;
- long seconds, microseconds = 0;
+ php_int_t seconds, microseconds = 0;
struct timeval t;
php_stream *stream;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &socket, &seconds, &microseconds) == FAILURE) {
+ if (zend_parse_parameters(argc TSRMLS_CC, "ri|i", &socket, &seconds, &microseconds) == FAILURE) {
return;
}
@@ -1337,11 +1337,11 @@ PHP_FUNCTION(stream_set_write_buffer)
{
zval *arg1;
int ret;
- long arg2;
+ php_int_t arg2;
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1365,16 +1365,16 @@ PHP_FUNCTION(stream_set_write_buffer)
PHP_FUNCTION(stream_set_chunk_size)
{
int ret;
- long csize;
+ php_int_t csize;
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &csize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &zstream, &csize) == FAILURE) {
RETURN_FALSE;
}
if (csize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given %ld", csize);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_INT_FMT, csize);
RETURN_FALSE;
}
/* stream.chunk_size is actually a size_t, but php_stream_set_option
@@ -1390,7 +1390,7 @@ PHP_FUNCTION(stream_set_chunk_size)
ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL);
- RETURN_INT(ret > 0 ? (long)ret : (long)EOF);
+ RETURN_INT(ret > 0 ? (php_int_t)ret : (php_int_t)EOF);
}
/* }}} */
@@ -1400,11 +1400,11 @@ PHP_FUNCTION(stream_set_read_buffer)
{
zval *arg1;
int ret;
- long arg2;
+ php_int_t arg2;
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1427,13 +1427,13 @@ PHP_FUNCTION(stream_set_read_buffer)
Enable or disable a specific kind of crypto on the stream */
PHP_FUNCTION(stream_socket_enable_crypto)
{
- long cryptokind = 0;
+ php_int_t cryptokind = 0;
zval *zstream, *zsessstream = NULL;
php_stream *stream, *sessstream = NULL;
zend_bool enable, cryptokindnull;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|i!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
RETURN_FALSE;
}
@@ -1558,11 +1558,11 @@ PHP_FUNCTION(stream_supports_lock)
disallowed. */
PHP_FUNCTION(stream_socket_shutdown)
{
- long how;
+ php_int_t how;
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &how) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &zstream, &how) == FAILURE) {
RETURN_FALSE;
}
diff --git a/main/php_variables.c b/main/php_variables.c
index 8a38e97d60..949bd6c6b0 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -358,7 +358,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
zval array;
int free_buffer = 0;
char *strtok_buf = NULL;
- long count = 0;
+ php_int_t count = 0;
ZVAL_UNDEF(&array);
switch (arg) {