]> granicus.if.org Git - php/commitdiff
Wordsize fixes
authorArd Biesheuvel <abies@php.net>
Wed, 25 Feb 2004 20:16:27 +0000 (20:16 +0000)
committerArd Biesheuvel <abies@php.net>
Wed, 25 Feb 2004 20:16:27 +0000 (20:16 +0000)
16 files changed:
ext/bcmath/bcmath.c
ext/ftp/php_ftp.c
ext/mysqli/mysqli_nonapi.c
ext/mysqli/mysqli_report.c
ext/oci8/oci8.c
ext/pgsql/pgsql.c
ext/soap/soap.c
ext/spl/spl_iterators.c
ext/sqlite/sqlite.c
ext/standard/dir.c
ext/standard/file.c
ext/standard/streamsfuncs.c
ext/standard/string.c
ext/standard/sunfuncs.c
ext/standard/var.c
ext/w32api/w32api.c

index d3e4c53ab503710107155b17f8542dc650a7e12a..b500458ed1eb027d72f4109ca6f287689ba12df1 100644 (file)
@@ -367,7 +367,7 @@ PHP_FUNCTION(bcpowmod)
        char *left, *right, *modulous;
        int left_len, right_len, modulous_len;
        bc_num first, second, mod, result;
-       int scale = BCG(bc_precision);
+       long scale = BCG(bc_precision);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
                WRONG_PARAM_COUNT;
index ae5c2bad90fdb64d12a4988b8933a3833b6ccc96..0466ed99aa4f8feafcce882028d29c93581016b4 100644 (file)
@@ -444,7 +444,7 @@ PHP_FUNCTION(ftp_alloc)
 {
        zval            *z_ftp, *zresponse = NULL;
        ftpbuf_t        *ftp;
-       int                     size, ret;
+       long            size, ret;
        char            *response = NULL;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &z_ftp, &size, &zresponse) == FAILURE) {
index cf97f652993923b69b1db989a01fc290e6f8b853..e0104023127b009da12f7133e7646b924c791c75 100644 (file)
@@ -38,7 +38,7 @@ PHP_FUNCTION(mysqli_connect)
        zval                            *object = getThis();
        char                            *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL;
        unsigned int            hostname_len, username_len, passwd_len, dbname_len, socket_len;
-       unsigned int            port=0;
+       long                            port=0;
 
 
        if (getThis() && !ZEND_NUM_ARGS()) {
index fd3d66d424d672f76c5b9e9ad546a1f22d7bd6a2..c344fad434e270655a8144f37d094d7e192d24b5 100644 (file)
@@ -31,7 +31,7 @@
    sets report level */
 PHP_FUNCTION(mysqli_report)
 {
-       int             flags;
+       long            flags;
 
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
index 76cb139e00fd15490c3e31928c9b67205189f8c9..f6b5a1977d4266117bd906d8b988c5b96b25aac5 100644 (file)
@@ -5012,7 +5012,7 @@ PHP_FUNCTION(oci_lob_write_temporary)
        oci_descriptor *descr;
        ub4 offset = 1;
        ub4 loblen;
-       int lob_type = OCI_TEMP_CLOB;
+       long lob_type = OCI_TEMP_CLOB;
 
        oci_debug ("oci_write_temporary_lob");
 
index 3e2e8a2c5aff55eca10af12acf3516ba70adbe5e..914ad66d65bcc0669b651b60dcbb9e282ed98f6a 100644 (file)
@@ -1401,7 +1401,7 @@ PHP_FUNCTION(pg_fetch_result)
 /* }}} */
 
 /* {{{ void php_pgsql_fetch_hash */
-static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int into_object)
+static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, int into_object)
 {
        zval                *result;
        PGresult            *pgsql_result;
@@ -3254,12 +3254,13 @@ PHP_FUNCTION(pg_result_status)
 PHP_FUNCTION(pg_get_notify)
 {
        zval *pgsql_link;
-       int id = -1, result_type = PGSQL_ASSOC;
+       int id = -1;
+       long result_type = PGSQL_ASSOC;
        PGconn *pgsql;
        PGnotify *pgsql_notify;
 
        if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
-                                                                &pgsql_link) == FAILURE) {
+                                                                &pgsql_link, &result_type) == FAILURE) {
                RETURN_FALSE;
        }
 
index adf219072c1f2f6550cf10e2d4d04ed8bd2fb344..0cf007e0fb6ac435e03166e96f063fc99f2cbe94 100644 (file)
@@ -967,7 +967,7 @@ PHP_FUNCTION(SoapServer,map)
 PHP_METHOD(soapserver,setpersistence)
 {
        soapServicePtr service;
-       int value;
+       long value;
 
        SOAP_SERVER_BEGIN_CODE();
 
index 594f2c49e8346caa3f570dd0db11cbd649d8674c..a9e1d9766a25b96f87b2217fbfe0d4fe10815ae3 100755 (executable)
@@ -318,7 +318,7 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
        spl_recursive_it_object   *intern;
        zval                      *iterator;
        zend_class_entry          *ce_iterator;
-       int                       mode = RIT_LEAVES_ONLY;
+       long                       mode = RIT_LEAVES_ONLY;
 
        php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
 
@@ -401,7 +401,7 @@ SPL_METHOD(RecursiveIteratorIterator, getDepth)
 SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
 {
        spl_recursive_it_object   *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-       int  level = object->level;
+       long  level = object->level;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &level) == FAILURE) {
                return;
index 0753d0bbac1fc7d8bdbb19380b375bb52c3dfb95..d923045125d5d8274e31fa7838085f5f2f8fae99 100644 (file)
@@ -1202,7 +1202,7 @@ PHP_FUNCTION(sqlite_popen)
        }
 
        /* now we need to open the database */
-       php_sqlite_open(fullpath, mode, hashkey, return_value, errmsg, NULL TSRMLS_CC);
+       php_sqlite_open(fullpath, (int)mode, hashkey, return_value, errmsg, NULL TSRMLS_CC);
 
        efree(fullpath);
        efree(hashkey);
@@ -1254,7 +1254,7 @@ PHP_FUNCTION(sqlite_open)
                }
        }
 
-       php_sqlite_open(fullpath ? fullpath : filename, mode, NULL, return_value, errmsg, object TSRMLS_CC);
+       php_sqlite_open(fullpath ? fullpath : filename, (int)mode, NULL, return_value, errmsg, object TSRMLS_CC);
 
        if (fullpath) {
                efree(fullpath);
@@ -1294,7 +1294,7 @@ PHP_FUNCTION(sqlite_factory)
                }
        }
 
-       php_sqlite_open(filename, mode, NULL, return_value, errmsg, return_value TSRMLS_CC);
+       php_sqlite_open(filename, (int)mode, NULL, return_value, errmsg, return_value TSRMLS_CC);
 
        php_std_error_handling();
 }
@@ -1434,7 +1434,7 @@ next_row:
 /* }}} */
 
 /* {{{ sqlite_query */
-void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, long mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
+void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
 {
        struct php_sqlite_result res, *rres;
        int ret;
@@ -1539,7 +1539,7 @@ PHP_FUNCTION(sqlite_unbuffered_query)
                return;
        }
 
-       sqlite_query(object, db, sql, sql_len, mode, 0, return_value, NULL TSRMLS_CC);
+       sqlite_query(object, db, sql, sql_len, (int)mode, 0, return_value, NULL TSRMLS_CC);
 }
 /* }}} */
 
@@ -1646,7 +1646,7 @@ PHP_FUNCTION(sqlite_query)
                return;
        }
 
-       sqlite_query(object, db, sql, sql_len, mode, 1, return_value, NULL TSRMLS_CC);
+       sqlite_query(object, db, sql, sql_len, (int)mode, 1, return_value, NULL TSRMLS_CC);
 }
 /* }}} */
 
@@ -2006,7 +2006,7 @@ PHP_FUNCTION(sqlite_array_query)
        }
        
        rres = (struct php_sqlite_result *)emalloc(sizeof(*rres));
-       sqlite_query(NULL, db, sql, sql_len, mode, 0, NULL, &rres TSRMLS_CC);
+       sqlite_query(NULL, db, sql, sql_len, (int)mode, 0, NULL, &rres TSRMLS_CC);
        if (db->last_err_code != SQLITE_OK) {
                if (rres) {
                        efree(rres);
index 077f4fdfcdb066dc5af2ea077e681affbbbdcad2..b8a8992faccf13c2d838061b9fd4cc010b127f07 100644 (file)
@@ -450,7 +450,7 @@ PHP_FUNCTION(scandir)
 {
        char *dirn;
        int dirn_len;
-       int flags = 0;
+       long flags = 0;
        php_stream_dirent **namelist;
        int n, i;
        zval *zcontext = NULL;
index ee5e9ff9f929c3118225105a066dfb22b9345a84..f650c5fb3da11cbba7a84f2174269af13e8f2973 100644 (file)
@@ -502,7 +502,8 @@ PHP_FUNCTION(file_put_contents)
        char *filename;
        size_t filename_len;
        zval *data;
-       int numbytes = 0, flags = 0;
+       int numbytes = 0;
+       long flags = 0;
        zval *zcontext = NULL;
        php_stream_context *context = NULL;
        
index d61963004ad96558b6ddd7b02576140bd5be0bc4..858638804b7df64956e89d6f147f2d5e7e601864 100644 (file)
@@ -657,7 +657,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 5eed12061fe973d3995386e2df35980e232fb2d0..d15080c76e113c15f566d55fdf374638e6962cd3 100644 (file)
@@ -1649,7 +1649,8 @@ PHP_FUNCTION(strripos)
 {
        zval *zneedle;
        char *needle, *haystack;
-       int needle_len, haystack_len, offset = 0;
+       int needle_len, haystack_len;
+       long offset = 0;
        char *p, *e, ord_needle[2];
        char *needle_dup, *haystack_dup;
 
index edcc7265f146eabde6ce8f1ca161cd85eed28e84..2eea641f4dfe03433d134488992c920956ea2201 100644 (file)
@@ -156,7 +156,8 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
 {
        zval *date;
        double latitude, longitude, zenith, gmt_offset, ret;
-       int time, N, retformat;
+       int time, N;
+       long retformat;
        char retstr[6];
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ldddd", &date, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
index 4f50b844114ab8e3f3599a47049a9d1cfdd0e144..dbd671ec29f6641a68321d0f284cab3fe1a024ad 100644 (file)
@@ -741,7 +741,7 @@ PHP_FUNCTION(unserialize)
                if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf),  &var_hash TSRMLS_CC)) {
                        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
                        zval_dtor(return_value);
-                       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %d of %d bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
+                       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %ld bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
                        RETURN_FALSE;
                }
                PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
index 6f7fe37a830a3d6ee73f836d0d58fbf33101855f..c3ddb30f9d48ef13813e37f202bb2bf01db09739 100644 (file)
@@ -1506,7 +1506,7 @@ W32API_CLASS_FUNCTION(win32, unregisterfunction)
        int function_name_len;
        w32api_func_handle **fh = NULL;
        
-       if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+       if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                                                         &function_name,
                                                         &function_name_len) == FAILURE)
        {
@@ -1532,7 +1532,7 @@ W32API_CLASS_FUNCTION(win32, registercallback)
        int function_definition_len;
        w32api_func_handle **fh = NULL;
        
-       if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+       if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                                                         &function_definition,
                                                         &function_definition_len) == FAILURE)
        {