Wordsize fixes

This commit is contained in:
Ard Biesheuvel 2004-02-25 20:16:27 +00:00
parent b1d8f10450
commit 81f05c18f5
16 changed files with 31 additions and 26 deletions

View 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;

View 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) {

View 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()) {

View 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) {

View 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");

View 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;
}

View file

@ -967,7 +967,7 @@ PHP_FUNCTION(SoapServer,map)
PHP_METHOD(soapserver,setpersistence)
{
soapServicePtr service;
int value;
long value;
SOAP_SERVER_BEGIN_CODE();

View file

@ -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;

View 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);

View 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;

View 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;

View 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;

View 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;

View 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) {

View 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);

View 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)
{