]> granicus.if.org Git - php/commitdiff
64-bit correction to variables passed to zend_parse_parameters
authorDavid Hill <ddhill@php.net>
Fri, 7 Mar 2003 13:42:30 +0000 (13:42 +0000)
committerDavid Hill <ddhill@php.net>
Fri, 7 Mar 2003 13:42:30 +0000 (13:42 +0000)
@64-bit correction to variables passed to zend_parse_parameters (Dave)

22 files changed:
ext/dio/dio.c
ext/domxml/php_domxml.c
ext/fdf/fdf.c
ext/ftp/php_ftp.c
ext/ldap/ldap.c
ext/mcrypt/mcrypt.c
ext/mhash/mhash.c
ext/openssl/openssl.c
ext/pgsql/pgsql.c
ext/posix/posix.c
ext/sockets/sockets.c
ext/standard/exec.c
ext/standard/file.c
ext/standard/fsock.c
ext/standard/head.c
ext/standard/html.c
ext/standard/metaphone.c
ext/standard/string.c
ext/sysvsem/sysvsem.c
ext/zip/zip.c
ext/zlib/zlib.c
main/output.c

index 0aff89767b3b6d7b4ebc9dedd6032e69e9321ff3..6b91b160119f075494754e5b60923f3513312371 100644 (file)
@@ -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) {
@@ -178,7 +178,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) {
@@ -207,8 +207,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) {
@@ -232,7 +232,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;
@@ -293,8 +293,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;
@@ -312,7 +312,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;
index 35ea98d7393f3cd6e60fa8ece9a555b3c8a796ac..31e2c259f288dd5ff20bb10a4d6d7b339de9a0e0 100644 (file)
@@ -1967,7 +1967,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);
 
@@ -3558,7 +3559,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);
 
@@ -3764,7 +3766,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;
@@ -3850,7 +3853,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;
@@ -5211,7 +5215,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);
 
index e6060e66269eab4b414dbf6b77cd855cb676902b..130d2b933a5c69f3e609a96a575e4e897bcaeb21 100644 (file)
@@ -554,7 +554,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;
@@ -941,7 +942,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;
@@ -997,7 +999,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;
 
index 17ca7b16ef3d2f9fcd7bb1705b65426825f62b02..c0bf79e0f8015dc8633e57b600af044fc39bf9c3 100644 (file)
@@ -145,7 +145,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) {
@@ -181,7 +182,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) {
@@ -467,7 +469,8 @@ PHP_FUNCTION(ftp_fget)
        ftptype_t       xtype;
        php_stream      *stream;
        char            *file;
-       int                     file_len, mode, resumepos=0;
+       int             file_len;
+       long            mode, resumepos=0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
                return;
@@ -510,7 +513,8 @@ PHP_FUNCTION(ftp_nb_fget)
        ftptype_t       xtype;
        php_stream      *stream;
        char            *file;
-       int                     file_len, mode, resumepos=0, ret;
+       int             file_len, ret;
+       long            mode, resumepos=0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
                return;
@@ -579,7 +583,8 @@ PHP_FUNCTION(ftp_get)
        ftptype_t       xtype;
        php_stream      *outstream;
        char            *local, *remote;
-       int                     local_len, remote_len, mode, resumepos=0;
+       int             local_len, remote_len;
+       long            mode, resumepos=0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
                return;
@@ -636,7 +641,8 @@ PHP_FUNCTION(ftp_nb_get)
        ftptype_t       xtype;
        php_stream      *outstream;
        char            *local, *remote;
-       int                     local_len, remote_len, mode, resumepos=0, ret;
+       int             local_len, remote_len, ret;
+       long            mode, resumepos=0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
                return;
@@ -735,7 +741,8 @@ PHP_FUNCTION(ftp_fput)
        zval            *z_ftp, *z_file;
        ftpbuf_t        *ftp;
        ftptype_t       xtype;
-       int                     mode, remote_len, startpos=0;
+       int             remote_len;
+       long            mode, startpos=0;
        php_stream      *stream;
        char            *remote;
 
@@ -781,7 +788,8 @@ PHP_FUNCTION(ftp_nb_fput)
        zval            *z_ftp, *z_file;
        ftpbuf_t        *ftp;
        ftptype_t       xtype;
-       int                     mode, remote_len, startpos=0, ret;
+       int             remote_len, ret;
+       long            mode, startpos=0;
        php_stream      *stream;
        char            *remote;
 
@@ -833,7 +841,8 @@ PHP_FUNCTION(ftp_put)
        ftpbuf_t        *ftp;
        ftptype_t       xtype;
        char            *remote, *local;
-       int                     remote_len, local_len, mode, startpos=0;
+       int             remote_len, local_len;
+       long            mode, startpos=0;
        php_stream * instream;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
@@ -887,7 +896,8 @@ PHP_FUNCTION(ftp_nb_put)
        ftpbuf_t        *ftp;
        ftptype_t       xtype;
        char            *remote, *local;
-       int                     remote_len, local_len, mode, startpos=0, ret;
+       int             remote_len, local_len, ret;
+       int             mode, startpos=0;
        php_stream * instream;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
index 7fd92bbf4f554f861032e9b01ae6e1f3f54707bb..724733112af36c4e6130562d52ce277a117bebf4 100644 (file)
@@ -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;
index 9b19c691a0d377ddcfb8a85b4e7dfc641ce01755..f7a7ab6ba55606c4bcc8755af3da54d6ea96000e 100644 (file)
@@ -1435,7 +1435,7 @@ PHP_FUNCTION(mcrypt_ofb)
 PHP_FUNCTION(mcrypt_create_iv)
 {
        char *iv;
-       iv_source source = RANDOM;
+       long source = RANDOM;
        long size;
        int n = 0;
 
index a164a5c46dc388d5816b0a227f7841f6a7b7baae..12b135b5e4e273d34559751c4b2ceb486a023a82 100644 (file)
@@ -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;
        
index 3b3ac2e088e1d775b82b6787a658f95ed72dfe69..cabe01fa20e9465888b463bcf060fd80bc52827e 100644 (file)
@@ -712,7 +712,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;
@@ -1000,7 +1000,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)
@@ -1339,7 +1339,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;
 
@@ -1878,8 +1878,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;
@@ -1934,7 +1934,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;
@@ -2026,7 +2026,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;
@@ -2056,9 +2056,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);
 
@@ -2155,8 +2155,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;
 
@@ -2281,9 +2281,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,
@@ -2381,8 +2381,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)
@@ -2448,7 +2448,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;
@@ -2505,7 +2506,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;
@@ -2568,7 +2569,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;
@@ -2625,7 +2626,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;
@@ -2710,7 +2711,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)
@@ -2750,8 +2751,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)
@@ -2785,7 +2786,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/",
@@ -2913,8 +2914,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)
index 67bf55eb10188a90444e4be1034007ca22a2f2fc..48721582f87fca13876ca44ad3365c1c85ad2c42 100644 (file)
@@ -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();
 
@@ -2601,7 +2601,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;
@@ -2618,7 +2619,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;
@@ -2741,7 +2743,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;
@@ -3917,7 +3920,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;
@@ -4076,7 +4079,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();
@@ -4225,7 +4228,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();
@@ -4314,7 +4317,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();
 
@@ -4451,7 +4455,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();
 
index 13648b4fee12bdf57d34804a56566d45115a1093..e9c561392c5a1923d48c5b47174add6c9397cf0e 100644 (file)
@@ -702,7 +702,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)
index 04f5b619a86f56c0d4278cce1fd22066289d28b2..f7e3e8148dfc74af00aed99c28dcdd3441efe31e 100644 (file)
@@ -555,7 +555,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;
@@ -602,7 +603,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;
@@ -702,7 +703,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;
@@ -739,7 +740,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)
@@ -773,7 +775,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;
@@ -920,7 +923,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) {
@@ -962,7 +965,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;
@@ -1012,7 +1016,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;
@@ -1030,7 +1034,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)
@@ -1127,7 +1132,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;
@@ -1150,7 +1155,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)
@@ -1181,7 +1186,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;
@@ -1209,7 +1214,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;
@@ -1309,7 +1315,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;
@@ -1350,7 +1357,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)
@@ -1378,7 +1386,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)
@@ -1454,7 +1463,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)
@@ -1662,7 +1672,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;
@@ -1747,7 +1758,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;
@@ -1810,7 +1822,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;
@@ -1902,7 +1915,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;
@@ -1959,7 +1972,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)
index f6b942e701bdd388382012ec3b6d10d600d8836e..e90b2fb4fdf6a85d3d86fb82952e4562422cd905 100644 (file)
@@ -671,7 +671,7 @@ PHP_FUNCTION(proc_open)
 #define MAX_DESCRIPTORS        16
 
        char *command;
-       long command_len;
+       int command_len;
        zval *descriptorspec;
        zval *pipes;
        int ndesc = 0;
index b79d5e2eed75cc25cdda53ffd0edb9ec6f96beba..4f93940c977829fa2902e21bfcaa23f2d5be92ba 100644 (file)
@@ -770,7 +770,8 @@ PHP_FUNCTION(stream_select)
        struct timeval *tv_p = NULL;
        fd_set                  rfds, wfds, efds;
        int                             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;
index d1f37a46dc0fd3163a50a5f8389b453c4b21acdf..c73ff481b5e8f4c4ed3493e087cad31d2ee0a8ff 100644 (file)
@@ -136,7 +136,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
        char *host;
        int host_len;
-       int port = -1;
+       long port = -1;
        zval *zerrno = NULL, *zerrstr = NULL;
        double timeout = FG(default_socket_timeout);
        unsigned long conv;
index 234468d5ed274a2982313a99d589735320b1ca02..c993664269700651d5cc054ecbc12e20e49dfc0f 100644 (file)
@@ -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;
 
index 793b18f661b6d4a5046cf510ec5892062f51ec5c..8080698055fce18d6c3db7f0c2b93de6caea3f05 100644 (file)
@@ -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);
index e6cc2cf67f1b611d54839640b06d4e392a707e2c..c160a6a0316e106787bfb17ba6129fcf2e7a21b4 100644 (file)
@@ -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) {
index d4c31fe2500ef452be418e34f02ed10d6e4d1a62..db6ca361ffcc93624f72affbc8dccc82989993ec 100644 (file)
@@ -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;
@@ -1219,7 +1220,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;
index ccbc1679b554d87a34c543d22c0f241eeecc9199..55c502d1321af6d672d94e310ff4c50fd4d886a9 100644 (file)
@@ -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;
index df3622547168832df32edcfbc7e1b698ffb3e677..0ff681f2aa30378594e39f63513e4b1573085ef7 100644 (file)
@@ -285,7 +285,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) {
index 207a3d9af4e307da19bac766954a8f06740e1059..ac59b2c90d2f8adbbb0782e3be01a32dfc4268b9 100644 (file)
@@ -811,7 +811,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;
 
index 044804dbb24e4e34dccf550234c7e7c10fded7dd..c1e33641964c3def50cdb6397932292b364502b3 100644 (file)
@@ -715,7 +715,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();