summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hill <ddhill@php.net>2003-03-06 23:07:28 +0000
committerDavid Hill <ddhill@php.net>2003-03-06 23:07:28 +0000
commit5c90216d2ce8d8cc8d1453eee1a1e5099bd46631 (patch)
tree588ccc95099ca43c0bf46f8078fcb77fefa2f765
parent0338111950edcec427cfa2f1610dd6efcd43a14c (diff)
downloadphp-git-5c90216d2ce8d8cc8d1453eee1a1e5099bd46631.tar.gz
64-bit correction to variables passed to zend_parse_parameters
@64-bit correction to variables passed to zend_parse_parameters (Dave)
-rw-r--r--ext/dio/dio.c18
-rw-r--r--ext/domxml/php_domxml.c15
-rw-r--r--ext/fdf/fdf.c9
-rw-r--r--ext/ftp/php_ftp.c6
-rw-r--r--ext/iconv/iconv.c36
-rw-r--r--ext/ldap/ldap.c4
-rw-r--r--ext/mcrypt/mcrypt.c2
-rw-r--r--ext/mhash/mhash.c8
-rw-r--r--ext/openssl/openssl.c55
-rw-r--r--ext/pgsql/pgsql.c25
-rw-r--r--ext/posix/posix.c3
-rw-r--r--ext/sockets/sockets.c57
-rw-r--r--ext/standard/fsock.c2
-rw-r--r--ext/standard/head.c2
-rw-r--r--ext/standard/html.c5
-rw-r--r--ext/standard/metaphone.c3
-rw-r--r--ext/standard/string.c5
-rw-r--r--ext/sysvsem/sysvsem.c2
-rw-r--r--ext/zip/zip.c2
-rw-r--r--ext/zlib/zlib.c2
-rw-r--r--main/output.c2
21 files changed, 148 insertions, 115 deletions
diff --git a/ext/dio/dio.c b/ext/dio/dio.c
index 5c5282626c..851fc40e91 100644
--- a/ext/dio/dio.c
+++ b/ext/dio/dio.c
@@ -146,8 +146,8 @@ PHP_FUNCTION(dio_open)
php_fd_t *f;
char *file_name;
int file_name_length;
- int flags;
- mode_t mode = 0;
+ long flags;
+ long mode = 0;
int fd;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
@@ -177,7 +177,7 @@ PHP_FUNCTION(dio_read)
zval *r_fd;
php_fd_t *f;
char *data;
- int bytes = 1024;
+ long bytes = 1024;
ssize_t res;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) {
@@ -206,8 +206,8 @@ PHP_FUNCTION(dio_write)
zval *r_fd;
php_fd_t *f;
char *data;
- size_t data_len;
- size_t trunc_len = 0;
+ int data_len;
+ long trunc_len = 0;
ssize_t res;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
@@ -230,7 +230,7 @@ PHP_FUNCTION(dio_truncate)
{
zval *r_fd;
php_fd_t *f;
- off_t offset;
+ long offset;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) {
return;
@@ -289,8 +289,8 @@ PHP_FUNCTION(dio_seek)
{
zval *r_fd;
php_fd_t *f;
- off_t offset;
- int whence = SEEK_SET;
+ long offset;
+ long whence = SEEK_SET;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) {
return;
@@ -308,7 +308,7 @@ PHP_FUNCTION(dio_fcntl)
zval *r_fd;
zval *arg = NULL;
php_fd_t *f;
- int cmd;
+ long cmd;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
return;
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index c53eb0caf4..1031a578c8 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -1971,7 +1971,8 @@ PHP_FUNCTION(domxml_clone_node)
zval *rv = NULL;
zval *id;
xmlNode *n, *node;
- int ret, recursive = 0;;
+ int ret;
+ long recursive = 0;
DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep);
@@ -3565,7 +3566,8 @@ PHP_FUNCTION(domxml_doc_imported_node)
zval *arg1, *id, *rv = NULL;
xmlNodePtr node, srcnode;
xmlDocPtr docp;
- int ret, recursive = 0;
+ int ret;
+ long recursive = 0;
DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp);
@@ -3768,7 +3770,8 @@ PHP_FUNCTION(xmldoc)
int ret;
char *buffer;
int buffer_len;
- int mode = 0, prevSubstValue;
+ long mode = 0;
+ int prevSubstValue;
int oldvalue = xmlDoValidityCheckingDefaultValue;
int oldvalue_keepblanks;
int prevLoadExtDtdValue = xmlLoadExtDtdDefaultValue;
@@ -3854,7 +3857,8 @@ PHP_FUNCTION(xmldocfile)
xmlDoc *docp = NULL;
int ret, file_len;
char *file;
- int mode = 0, prevSubstValue;
+ long mode = 0;
+ int prevSubstValue;
int oldvalue = xmlDoValidityCheckingDefaultValue;
int oldvalue_keepblanks;
zval *errors = NULL;
@@ -5253,7 +5257,8 @@ PHP_FUNCTION(domxml_xslt_result_dump_file)
xmlDocPtr xmldocp;
char *filename;
int filename_len;
- int ret, compression = 0;
+ int ret;
+ long compression = 0;
DOMXML_GET_THIS(idxsl);
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index e64085b302..7ca18beec0 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -551,7 +551,8 @@ PHP_FUNCTION(fdf_set_ap)
PHP_FUNCTION(fdf_get_ap) {
zval *r_fdf;
char *fieldname, *filename;
- int fieldname_len, filename_len, face;
+ int fieldname_len, filename_len;
+ long face;
FDFDoc fdf;
FDFErc err;
FDFAppFace facenr;
@@ -938,7 +939,8 @@ PHP_FUNCTION(fdf_set_flags)
PHP_FUNCTION(fdf_get_flags) {
zval *r_fdf;
char *fieldname;
- int fieldname_len, whichflags;
+ int fieldname_len;
+ long whichflags;
FDFDoc fdf;
FDFErc err;
ASUns32 flags;
@@ -994,7 +996,8 @@ PHP_FUNCTION(fdf_set_opt)
PHP_FUNCTION(fdf_get_opt) {
zval *r_fdf;
char *fieldname;
- int fieldname_len, element = -1;
+ int fieldname_len;
+ long element = -1;
FDFDoc fdf;
FDFErc err;
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index b5a5711da3..68606d2dc7 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -151,7 +151,8 @@ PHP_FUNCTION(ftp_connect)
{
ftpbuf_t *ftp;
char *host;
- int host_len, port = 0;
+ int host_len;
+ long port = 0;
long timeout_sec = FTP_DEFAULT_TIMEOUT;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
@@ -186,7 +187,8 @@ PHP_FUNCTION(ftp_ssl_connect)
{
ftpbuf_t *ftp;
char *host;
- int host_len, port = 0;
+ int host_len;
+ long port = 0;
long timeout_sec = FTP_DEFAULT_TIMEOUT;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 44aee0fb27..22bb195b8d 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -1451,9 +1451,9 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
PHP_FUNCTION(iconv_strlen)
{
char *charset;
- long charset_len;
+ int charset_len;
char *str;
- long str_len;
+ int str_len;
php_iconv_err_t err;
@@ -1481,9 +1481,9 @@ PHP_FUNCTION(iconv_strlen)
PHP_FUNCTION(iconv_substr)
{
char *charset;
- long charset_len;
+ int charset_len;
char *str;
- long str_len;
+ int str_len;
long offset, length;
zval *len_z = NULL;
@@ -1527,11 +1527,11 @@ PHP_FUNCTION(iconv_substr)
PHP_FUNCTION(iconv_strpos)
{
char *charset;
- long charset_len;
+ int charset_len;
char *haystk;
- long haystk_len;
+ int haystk_len;
char *ndl;
- long ndl_len;
+ int ndl_len;
long offset;
php_iconv_err_t err;
@@ -1569,11 +1569,11 @@ PHP_FUNCTION(iconv_strpos)
PHP_FUNCTION(iconv_strrpos)
{
char *charset;
- long charset_len;
+ int charset_len;
char *haystk;
- long haystk_len;
+ int haystk_len;
char *ndl;
- long ndl_len;
+ int ndl_len;
php_iconv_err_t err;
@@ -1604,18 +1604,18 @@ PHP_FUNCTION(iconv_strrpos)
PHP_FUNCTION(iconv_mime_encode)
{
char *field_name;
- long field_name_len;
+ int field_name_len;
char *field_value;
- long field_value_len;
+ int field_value_len;
char *scheme;
- long scheme_len;
+ int scheme_len;
char *in_charset;
- long in_charset_len;
+ int in_charset_len;
char *out_charset;
- long out_charset_len;
+ int out_charset_len;
long line_len = 76;
char *lfchars = "\r\n";
- long lfchars_len = sizeof("\r\n")-1;
+ int lfchars_len = sizeof("\r\n")-1;
php_iconv_enc_scheme_t scheme_id = PHP_ICONV_ENC_SCHEME_BASE64;
@@ -1668,9 +1668,9 @@ PHP_FUNCTION(iconv_mime_encode)
PHP_FUNCTION(iconv_mime_decode)
{
char *encoded_str;
- long encoded_str_len;
+ int encoded_str_len;
char *charset;
- long charset_len;
+ int charset_len;
smart_str retval = {0};
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index a4dbca40bc..5d34d9ccba 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -345,11 +345,11 @@ PHP_FUNCTION(ldap_connect)
{
char *host = NULL;
int hostlen;
- int port = 389; /* Default port */
+ long port = 389; /* Default port */
#ifdef HAVE_ORALDAP
char *wallet, *walletpasswd;
int walletlen, walletpasswdlen;
- int authmode;
+ long authmode;
int ssl=0;
#endif
ldap_linkdata *ld;
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index b40f8bc13a..2e6af38866 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -1210,7 +1210,7 @@ PHP_FUNCTION(mcrypt_ofb)
PHP_FUNCTION(mcrypt_create_iv)
{
char *iv;
- iv_source source = RANDOM;
+ long source = RANDOM;
long size;
int n = 0;
diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c
index a164a5c46d..12b135b5e4 100644
--- a/ext/mhash/mhash.c
+++ b/ext/mhash/mhash.c
@@ -107,7 +107,7 @@ PHP_FUNCTION(mhash_count)
Gets the block size of hash */
PHP_FUNCTION(mhash_get_block_size)
{
- int hash;
+ long hash;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &hash) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -123,7 +123,7 @@ PHP_FUNCTION(mhash_get_block_size)
PHP_FUNCTION(mhash_get_hash_name)
{
char *name;
- int hash;
+ long hash;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &hash) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -147,7 +147,7 @@ PHP_FUNCTION(mhash)
MHASH td;
int bsize;
unsigned char *hash_data;
- int hash;
+ long hash;
int data_len, key_len=0;
char *data, *key=NULL;
@@ -196,7 +196,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
{
KEYGEN keystruct;
char salt[SALT_SIZE], *ret;
- int hash, bytes;
+ long hash, bytes;
char *password, *in_salt;
int password_len, salt_len;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index d465bcee10..612d01531d 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -737,7 +737,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
BIO * bio_out;
long certresource;
char * filename;
- long filename_len;
+ int filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
@@ -1023,7 +1023,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
STACK_OF(X509) * untrustedchain = NULL;
long purpose;
char * untrusted = NULL;
- long untrusted_len;
+ int untrusted_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len)
== FAILURE) {
@@ -1371,7 +1371,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
X509_REQ * csr;
zval * zcsr = NULL;
zend_bool notext = 1;
- char * filename = NULL; long filename_len;
+ char * filename = NULL; int filename_len;
BIO * bio_out;
long csr_resource;
@@ -1917,8 +1917,8 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
{
struct php_x509_request req;
zval * zpkey, * args = NULL;
- char * passphrase = NULL; long passphrase_len = 0;
- char * filename = NULL; long filename_len = 0;
+ char * passphrase = NULL; int passphrase_len = 0;
+ char * filename = NULL; int filename_len = 0;
long key_resource = -1;
EVP_PKEY * key;
BIO * bio_out = NULL;
@@ -1973,7 +1973,7 @@ PHP_FUNCTION(openssl_pkey_export)
{
struct php_x509_request req;
zval * zpkey, * args = NULL, *out;
- char * passphrase = NULL; long passphrase_len = 0;
+ char * passphrase = NULL; int passphrase_len = 0;
long key_resource = -1;
EVP_PKEY * key;
BIO * bio_out = NULL;
@@ -2065,7 +2065,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
zval *cert;
EVP_PKEY *pkey;
char * passphrase = "";
- long passphrase_len;
+ int passphrase_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
return;
@@ -2095,9 +2095,9 @@ PHP_FUNCTION(openssl_pkcs7_verify)
PKCS7 * p7 = NULL;
BIO * in = NULL, * datain = NULL;
long flags = 0;
- char * filename; long filename_len;
- char * extracerts = NULL; long extracerts_len;
- char * signersfilename = NULL; long signersfilename_len;
+ char * filename; int filename_len;
+ char * extracerts = NULL; int extracerts_len;
+ char * signersfilename = NULL; int signersfilename_len;
RETVAL_LONG(-1);
@@ -2196,8 +2196,8 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
uint strindexlen;
ulong intindex;
char * strindex;
- char * infilename = NULL; long infilename_len;
- char * outfilename = NULL; long outfilename_len;
+ char * infilename = NULL; int infilename_len;
+ char * outfilename = NULL; int outfilename_len;
RETVAL_FALSE;
@@ -2351,9 +2351,9 @@ PHP_FUNCTION(openssl_pkcs7_sign)
uint strindexlen;
HashPosition hpos;
char * strindex;
- char * infilename; long infilename_len;
- char * outfilename; long outfilename_len;
- char * extracertsfilename = NULL; long extracertsfilename_len;
+ char * infilename; int infilename_len;
+ char * outfilename; int outfilename_len;
+ char * extracertsfilename = NULL; int extracertsfilename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sszza!|ls",
&infilename, &infilename_len, &outfilename, &outfilename_len,
@@ -2455,8 +2455,8 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
long certresval, keyresval;
BIO * in = NULL, * out = NULL, * datain = NULL;
PKCS7 * p7 = NULL;
- char * infilename; long infilename_len;
- char * outfilename; long outfilename_len;
+ char * infilename; int infilename_len;
+ char * outfilename; int outfilename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &infilename, &infilename_len,
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
@@ -2525,7 +2525,8 @@ PHP_FUNCTION(openssl_private_encrypt)
int successful = 0;
long keyresource = -1;
char * data;
- long data_len, padding = RSA_PKCS1_PADDING;
+ int data_len;
+ long padding = RSA_PKCS1_PADDING;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
@@ -2584,7 +2585,7 @@ PHP_FUNCTION(openssl_private_decrypt)
long padding = RSA_PKCS1_PADDING;
long keyresource = -1;
char * data;
- long data_len;
+ int data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
@@ -2649,7 +2650,7 @@ PHP_FUNCTION(openssl_public_encrypt)
long keyresource = -1;
long padding = RSA_PKCS1_PADDING;
char * data;
- long data_len;
+ int data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
return;
@@ -2708,7 +2709,7 @@ PHP_FUNCTION(openssl_public_decrypt)
long keyresource = -1;
long padding = RSA_PKCS1_PADDING;
char * data;
- long data_len;
+ int data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
@@ -2792,7 +2793,7 @@ PHP_FUNCTION(openssl_sign)
int siglen;
unsigned char *sigbuf;
long keyresource = -1;
- char * data; long data_len;
+ char * data; int data_len;
EVP_MD_CTX md_ctx;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz", &data, &data_len, &signature, &key) == FAILURE) {
@@ -2833,8 +2834,8 @@ PHP_FUNCTION(openssl_verify)
int err;
EVP_MD_CTX md_ctx;
long keyresource = -1;
- char * data; long data_len;
- char * signature; long signature_len;
+ char * data; int data_len;
+ char * signature; int signature_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz", &data, &data_len, &signature, &signature_len, &key) == FAILURE) {
return;
@@ -2868,7 +2869,7 @@ PHP_FUNCTION(openssl_seal)
long * key_resources; /* so we know what to cleanup */
int i, len1, len2, *eksl, nkeys;
unsigned char *buf = NULL, **eks;
- char * data; long data_len;
+ char * data; int data_len;
EVP_CIPHER_CTX ctx;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szza/", &data, &data_len, &sealdata, &ekeys, &pubkeys) == FAILURE) {
@@ -2978,8 +2979,8 @@ PHP_FUNCTION(openssl_open)
unsigned char *buf;
long keyresource = -1;
EVP_CIPHER_CTX ctx;
- char * data; long data_len;
- char * ekey; long ekey_len;
+ char * data; int data_len;
+ char * ekey; int ekey_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szsz", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey) == FAILURE) {
return;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index dd01001a0f..d05a74962a 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1439,7 +1439,7 @@ PHP_FUNCTION(pg_fetch_all)
PHP_FUNCTION(pg_result_seek)
{
zval *result;
- int row;
+ long row;
pgsql_result_handle *pg_result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) {
@@ -2190,7 +2190,7 @@ PHP_FUNCTION(pg_lo_export)
PHP_FUNCTION(pg_lo_seek)
{
zval *pgsql_id = NULL;
- int offset = 0, whence = SEEK_CUR;
+ long offset = 0, whence = SEEK_CUR;
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
@@ -2599,7 +2599,8 @@ PHP_FUNCTION(pg_copy_from)
PHP_FUNCTION(pg_escape_string)
{
char *from = NULL, *to = NULL;
- size_t from_len, to_len;
+ size_t to_len;
+ long from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
@@ -2616,7 +2617,8 @@ PHP_FUNCTION(pg_escape_string)
PHP_FUNCTION(pg_escape_bytea)
{
char *from = NULL, *to = NULL;
- size_t from_len, to_len;
+ size_t to_len;
+ long from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
@@ -2737,7 +2739,8 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *
PHP_FUNCTION(pg_unescape_bytea)
{
char *from = NULL, *to = NULL;
- size_t from_len, to_len;
+ size_t to_len;
+ long from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
@@ -3905,7 +3908,7 @@ PHP_FUNCTION(pg_convert)
{
zval *pgsql_link, *values;
char *table_name;
- size_t table_name_len;
+ int table_name_len;
ulong option = 0;
PGconn *pg_link;
int id = -1;
@@ -4064,7 +4067,7 @@ PHP_FUNCTION(pg_insert)
{
zval *pgsql_link, *values;
char *table, *sql = NULL;
- ulong table_len;
+ int table_len;
ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
int id = -1, argc = ZEND_NUM_ARGS();
@@ -4213,7 +4216,7 @@ PHP_FUNCTION(pg_update)
{
zval *pgsql_link, *values, *ids;
char *table, *sql = NULL;
- ulong table_len;
+ int table_len;
ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
int id = -1, argc = ZEND_NUM_ARGS();
@@ -4302,7 +4305,8 @@ PHP_FUNCTION(pg_delete)
{
zval *pgsql_link, *ids;
char *table, *sql = NULL;
- ulong table_len, option = PGSQL_DML_EXEC;
+ int table_len;
+ ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
int id = -1, argc = ZEND_NUM_ARGS();
@@ -4439,7 +4443,8 @@ PHP_FUNCTION(pg_select)
{
zval *pgsql_link, *ids;
char *table, *sql = NULL;
- ulong table_len, option = PGSQL_DML_EXEC;
+ int table_len;
+ ulong option = PGSQL_DML_EXEC;
PGconn *pg_link;
int id = -1, argc = ZEND_NUM_ARGS();
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 73034d0820..b53740990b 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -687,7 +687,8 @@ PHP_FUNCTION(posix_getcwd)
PHP_FUNCTION(posix_mkfifo)
{
char *path;
- long path_len, mode;
+ int path_len;
+ long mode;
int result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE)
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index c2366f1e47..36fcc8f144 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -553,7 +553,8 @@ PHP_FUNCTION(socket_select)
struct timeval *tv_p = NULL;
fd_set rfds, wfds, efds;
SOCKET max_fd = 0;
- int retval, sets = 0, usec = 0;
+ int retval, sets = 0;
+ long usec = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
@@ -600,7 +601,7 @@ PHP_FUNCTION(socket_select)
PHP_FUNCTION(socket_create_listen)
{
php_socket *php_sock;
- int port, backlog = 128;
+ long port, backlog = 128;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &port, &backlog) == FAILURE)
return;
@@ -699,7 +700,7 @@ PHP_FUNCTION(socket_listen)
{
zval *arg1;
php_socket *php_sock;
- int backlog = 0;
+ long backlog = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &backlog) == FAILURE)
return;
@@ -736,7 +737,8 @@ PHP_FUNCTION(socket_write)
{
zval *arg1;
php_socket *php_sock;
- int retval, str_len, length;
+ int retval, str_len;
+ long length;
char *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE)
@@ -770,7 +772,8 @@ PHP_FUNCTION(socket_read)
zval *arg1;
php_socket *php_sock;
char *tmpbuf;
- int retval, length, type = PHP_BINARY_READ;
+ int retval;
+ long length, type = PHP_BINARY_READ;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE)
return;
@@ -915,7 +918,7 @@ PHP_FUNCTION(socket_getpeername)
Creates an endpoint for communication in the domain specified by domain, of type specified by type */
PHP_FUNCTION(socket_create)
{
- int arg1, arg2, arg3;
+ long arg1, arg2, arg3;
php_socket *php_sock = (php_socket*)emalloc(sizeof(php_socket));
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &arg1, &arg2, &arg3) == FAILURE) {
@@ -956,7 +959,8 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_in sin;
struct sockaddr_un s_un;
char *addr;
- int retval, addr_len, port;
+ int retval, addr_len;
+ long port;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE)
return;
@@ -1004,7 +1008,7 @@ PHP_FUNCTION(socket_connect)
Returns a string describing an error */
PHP_FUNCTION(socket_strerror)
{
- int arg1;
+ long arg1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg1) == FAILURE)
return;
@@ -1022,7 +1026,8 @@ PHP_FUNCTION(socket_bind)
struct sockaddr *sock_type = (struct sockaddr*) &sa_storage;
php_socket *php_sock;
char *addr;
- int addr_len, port = 0;
+ int addr_len;
+ int port = 0;
long retval = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE)
@@ -1119,7 +1124,7 @@ PHP_FUNCTION(socket_iovec_fetch)
{
zval *iovec_id;
php_iovec_t *vector;
- unsigned int iovec_position;
+ unsigned long iovec_position;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &iovec_id, &iovec_position) == FAILURE)
return;
@@ -1142,7 +1147,7 @@ PHP_FUNCTION(socket_iovec_set)
zval *iovec_id;
php_iovec_t *vector;
int new_val_len;
- unsigned int iovec_position;
+ unsigned long iovec_position;
char *new_val;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &iovec_id, &iovec_position, &new_val, &new_val_len) == FAILURE)
@@ -1173,7 +1178,7 @@ PHP_FUNCTION(socket_iovec_add)
zval *iovec_id;
php_iovec_t *vector;
struct iovec *vector_array;
- int iov_len;
+ long iov_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &iovec_id, &iov_len) == FAILURE)
return;
@@ -1201,7 +1206,8 @@ PHP_FUNCTION(socket_iovec_delete)
zval *iovec_id;
php_iovec_t *vector;
struct iovec *vector_array;
- unsigned int i, iov_pos;
+ unsigned int i;
+ unsigned long iov_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &iovec_id, &iov_pos) == FAILURE)
return;
@@ -1301,7 +1307,8 @@ PHP_FUNCTION(socket_recv)
zval *php_sock_res, *buf;
char *recv_buf;
php_socket *php_sock;
- int retval, len, flags;
+ int retval;
+ long len, flags;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzll", &php_sock_res, &buf, &len, &flags) == FAILURE)
return;
@@ -1342,7 +1349,8 @@ PHP_FUNCTION(socket_send)
{
zval *arg1;
php_socket *php_sock;
- int buf_len, len, flags, retval;
+ int buf_len, retval;
+ long len, flags;
char *buf;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE)
@@ -1370,7 +1378,8 @@ PHP_FUNCTION(socket_recvfrom)
struct sockaddr_un s_un;
struct sockaddr_in sin;
socklen_t slen;
- int retval, arg3, arg4;
+ int retval;
+ long arg3, arg4;
char *recv_buf, *address;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzllz|z", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE)
@@ -1445,7 +1454,8 @@ PHP_FUNCTION(socket_sendto)
php_socket *php_sock;
struct sockaddr_un s_un;
struct sockaddr_in sin;
- int retval, buf_len, len, flags, addr_len, port = 0;
+ int retval, buf_len, addr_len;
+ long len, flags, port = 0;
char *buf, *addr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE)
@@ -1645,7 +1655,8 @@ PHP_FUNCTION(socket_sendmsg)
struct sockaddr sa;
char *addr;
socklen_t salen;
- int flags, addr_len, port;
+ int addr_len;
+ long flags, port;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrls|l", &arg1, &arg2, &flags, &addr, &addr_len, &port) == FAILURE)
return;
@@ -1729,7 +1740,8 @@ PHP_FUNCTION(socket_get_option)
struct timeval tv;
socklen_t optlen;
php_socket *php_sock;
- int other_val, level, optname;
+ int other_val;
+ long level, optname;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1, &level, &optname) == FAILURE)
return;
@@ -1788,7 +1800,8 @@ PHP_FUNCTION(socket_set_option)
struct linger lv;
struct timeval tv;
php_socket *php_sock;
- int ov, optlen, retval, level, optname;
+ int ov, optlen, retval;
+ long level, optname;
void *opt_ptr;
HashTable *opt_ht;
@@ -1880,7 +1893,7 @@ PHP_FUNCTION(socket_create_pair)
zval *retval[2], *fds_array_zval;
php_socket *php_sock[2];
SOCKET fds_array[2];
- int domain, type, protocol;
+ long domain, type, protocol;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllz", &domain, &type, &protocol, &fds_array_zval) == FAILURE)
return;
@@ -1932,7 +1945,7 @@ PHP_FUNCTION(socket_create_pair)
PHP_FUNCTION(socket_shutdown)
{
zval *arg1;
- int how_shutdown = 2;
+ long how_shutdown = 2;
php_socket *php_sock;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &how_shutdown) == FAILURE)
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index ddc0812c48..4af044b02c 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -33,7 +33,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *host;
long host_len;
- int port = -1;
+ long port = -1;
zval *zerrno = NULL, *zerrstr = NULL;
double timeout = FG(default_socket_timeout);
unsigned long conv;
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 234468d5ed..c993664269 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -142,7 +142,7 @@ 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;
- time_t expires = 0;
+ long expires = 0;
zend_bool secure = 0;
int name_len, value_len, path_len, domain_len;
diff --git a/ext/standard/html.c b/ext/standard/html.c
index be06b8dbef..fe3b9ad940 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -872,7 +872,8 @@ PHP_FUNCTION(htmlspecialchars)
PHP_FUNCTION(html_entity_decode)
{
char *str, *hint_charset = NULL;
- int str_len, hint_charset_len, len, quote_style = ENT_COMPAT;
+ int str_len, hint_charset_len, len;
+ long quote_style = ENT_COMPAT;
char *replaced;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len,
@@ -898,7 +899,7 @@ PHP_FUNCTION(htmlentities)
Returns the internal translation table used by htmlspecialchars and htmlentities */
PHP_FUNCTION(get_html_translation_table)
{
- int which = HTML_SPECIALCHARS, quote_style = ENT_COMPAT;
+ long which = HTML_SPECIALCHARS, quote_style = ENT_COMPAT;
int i, j;
char ind[2];
enum entity_charset charset = determine_charset(NULL TSRMLS_CC);
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 10e3396edf..716f109b64 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -35,7 +35,8 @@ PHP_FUNCTION(metaphone)
{
char *str;
char *result = 0;
- int phones = 0, str_len;
+ int str_len;
+ long phones = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len,
&phones) == FAILURE) {
diff --git a/ext/standard/string.c b/ext/standard/string.c
index e21cf53f06..341e747f6c 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -202,7 +202,8 @@ PHP_FUNCTION(bin2hex)
static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
{
char *s11, *s22;
- int len1, len2, start, len;
+ int len1, len2;
+ long start, len;
start = 0;
len = 0;
@@ -1228,7 +1229,7 @@ PHP_FUNCTION(pathinfo)
zval *tmp;
char *path, *ret = NULL;
int path_len;
- int opt = PHP_PATHINFO_ALL;
+ long opt = PHP_PATHINFO_ALL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) {
return;
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 96b90c4c16..bf7b0b94b4 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -161,7 +161,7 @@ PHP_MINIT_FUNCTION(sysvsem)
Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */
PHP_FUNCTION(sem_get)
{
- int key, max_acquire, perm, auto_release = 1;
+ long key, max_acquire, perm, auto_release = 1;
int semid;
struct sembuf sop[3];
int count;
diff --git a/ext/zip/zip.c b/ext/zip/zip.c
index 0ae0454ba6..d2d6db0250 100644
--- a/ext/zip/zip.c
+++ b/ext/zip/zip.c
@@ -284,7 +284,7 @@ PHP_FUNCTION(zip_entry_read)
zval *zzip_ent;
php_zzip_dirent *entry = NULL;
char *buf = NULL;
- int len = 1024;
+ long len = 1024;
int ret = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zzip_ent, &len) == FAILURE) {
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 7c1cc1e22d..27fb3aaf43 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -806,7 +806,7 @@ PHP_FUNCTION(gzencode)
{
char *data, *s2;
int data_len;
- int level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP;
+ long level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP;
int status;
z_stream stream;
diff --git a/main/output.c b/main/output.c
index de5b9faaec..00b30ed75d 100644
--- a/main/output.c
+++ b/main/output.c
@@ -712,7 +712,7 @@ static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC)
PHP_FUNCTION(ob_start)
{
zval *output_handler=NULL;
- uint chunk_size=0;
+ long chunk_size=0;
zend_bool erase=1;
int argc = ZEND_NUM_ARGS();