From: Antony Dovgal Date: Sun, 25 Sep 2005 21:44:32 +0000 (+0000) Subject: fix 64bit issues caused by wrong "long" usage X-Git-Tag: RELEASE_0_9_0~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de50d0275c4e8b08445f2191867792b4de46bc7f;p=php fix 64bit issues caused by wrong "long" usage --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 4ae76e30ff..9df7318f46 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -864,8 +864,8 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus php_oci_connection *connection; char *username, *password; char *dbname = NULL, *charset = NULL; - long username_len = 0, password_len = 0; - long dbname_len = 0, charset_len = 0; + int username_len = 0, password_len = 0; + int dbname_len = 0, charset_len = 0; long session_mode = OCI_DEFAULT; /* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */ @@ -888,7 +888,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus /* {{{ php_oci_do_connect_ex() * The real connect function. Allocates all the resources needed, establishes the connection and returns the result handle (or NULL) */ -php_oci_connection *php_oci_do_connect_ex(char *username, long username_len, char *password, long password_len, char *new_password, long new_password_len, char *dbname, long dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) +php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC) { list_entry *le; list_entry new_le; @@ -1417,7 +1417,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) /* {{{ php_oci_password_change() Change password for the user with the username given */ -int php_oci_password_change(php_oci_connection *connection, char *user, long user_len, char *pass_old, long pass_old_len, char *pass_new, long pass_new_len TSRMLS_DC) +int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC) { connection->errcode = PHP_OCI_CALL(OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len+1, (text *)pass_old, pass_old_len+1, (text *)pass_new, pass_new_len+1, OCI_DEFAULT)); diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 1659aa3f0f..2c79109463 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -47,7 +47,8 @@ PHP_FUNCTION(oci_define_by_name) { zval *stmt, *var; char *name; - long name_len, type = SQLT_CHR; + int name_len; + long type = SQLT_CHR; php_oci_statement *statement; php_oci_define *define, *tmp_define; @@ -93,7 +94,8 @@ PHP_FUNCTION(oci_define_by_name) PHP_FUNCTION(oci_bind_by_name) { ub2 bind_type = SQLT_CHR; /* unterminated string */ - long name_len, maxlen = -1, type = 0; + int name_len; + long maxlen = -1, type = 0; char *name; zval *z_statement; zval *bind_var = NULL; @@ -148,7 +150,7 @@ PHP_FUNCTION(oci_lob_save) zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *data; - long data_len; + int data_len; long offset = 0; ub4 bytes_written; @@ -189,7 +191,7 @@ PHP_FUNCTION(oci_lob_import) zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *filename; - long filename_len; + int filename_len; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { @@ -453,7 +455,8 @@ PHP_FUNCTION(oci_lob_write) { zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; - long data_len, write_len = 0; + int data_len; + long write_len = 0; ub4 bytes_written; char *data; @@ -803,7 +806,8 @@ PHP_FUNCTION(oci_lob_export) zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *filename, *buffer; - long filename_len, start = -1, length = -1, block_length; + int filename_len; + long start = -1, length = -1, block_length; php_stream *stream; ub4 lob_length; @@ -912,7 +916,8 @@ PHP_FUNCTION(oci_lob_write_temporary) zval **tmp, *z_descriptor = getThis(); php_oci_descriptor *descriptor; char *data; - long data_len, type = OCI_TEMP_CLOB; + int data_len; + long type = OCI_TEMP_CLOB; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) { @@ -1578,7 +1583,7 @@ PHP_FUNCTION(oci_parse) php_oci_connection *connection; php_oci_statement *statement; char *query; - long query_len; + int query_len; zend_bool cached = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_connection, &query, &query_len, &cached) == FAILURE) { @@ -1623,7 +1628,7 @@ PHP_FUNCTION(oci_password_change) { zval *z_connection; text *user, *pass_old, *pass_new, *dbname; - long user_len, pass_old_len, pass_new_len, dbname_len; + int user_len, pass_old_len, pass_new_len, dbname_len; php_oci_connection *connection; /* Disable in Safe Mode */ @@ -1818,7 +1823,7 @@ PHP_FUNCTION(oci_collection_append) zval **tmp, *z_collection = getThis(); php_oci_collection *collection; char *value; - long value_len; + int value_len; if (getThis()) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { @@ -1926,7 +1931,8 @@ PHP_FUNCTION(oci_collection_element_assign) { zval **tmp, *z_collection = getThis(); php_oci_collection *collection; - long element_index, value_len; + int value_len; + long element_index; char *value; if (getThis()) { @@ -2051,7 +2057,7 @@ PHP_FUNCTION(oci_new_collection) php_oci_connection *connection; php_oci_collection *collection; char *tdo, *schema = NULL; - long tdo_len, schema_len = 0; + int tdo_len, schema_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) { return; diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 61667c97d9..d6c450be52 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -274,12 +274,12 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); #endif void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); -php_oci_connection *php_oci_do_connect_ex(char *username, long username_len, char *password, long password_len, char *new_password, long new_password_len, char *dbname, long dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); +php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); int php_oci_connection_rollback(php_oci_connection * TSRMLS_DC); int php_oci_connection_commit(php_oci_connection * TSRMLS_DC); -int php_oci_password_change(php_oci_connection *, char *, long, char *, long, char *, long TSRMLS_DC); +int php_oci_password_change(php_oci_connection *, char *, int, char *, int, char *, int TSRMLS_DC); int php_oci_server_get_version(php_oci_connection *, char ** TSRMLS_DC); void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int, int);