sixd Wed Jul 18 15:09:37 2007 UTC Modified files: /php-src/ext/oci8 oci8.c oci8_collection.c oci8_lob.c oci8_statement.c Log: Add casts to fix compilation warnings
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.332&r2=1.333&diff_format=u Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.332 php-src/ext/oci8/oci8.c:1.333 --- php-src/ext/oci8/oci8.c:1.332 Mon Jul 16 19:12:47 2007 +++ php-src/ext/oci8/oci8.c Wed Jul 18 15:09:37 2007 @@ -26,7 +26,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.332 2007/07/16 19:12:47 tony2001 Exp $ */ +/* $Id: oci8.c,v 1.333 2007/07/18 15:09:37 sixd Exp $ */ /* TODO * * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() with OCI_ATTR_LOBEMPTY @@ -433,7 +433,7 @@ OCIErrorGet(OCI_G(env), (ub4)1, NULL, &error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ERROR); if (error_code) { - int tmp_buf_len = strlen(tmp_buf); + int tmp_buf_len = strlen((char *)tmp_buf); if (tmp_buf_len > 0 && tmp_buf[tmp_buf_len - 1] == '\n') { tmp_buf[tmp_buf_len - 1] = '\0'; @@ -674,7 +674,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); php_info_print_table_row(2, "Version", "1.2.2"); - php_info_print_table_row(2, "Revision", "$Revision: 1.332 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.333 $"); snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); @@ -930,14 +930,14 @@ UChar *tmp_buf; int tmp_buf_len; - err_buf_len = strlen(err_buf); + err_buf_len = strlen((char *)err_buf); if (err_buf_len && err_buf[err_buf_len - 1] == '\n') { err_buf[err_buf_len - 1] = '\0'; err_buf_len--; } - if (zend_string_to_unicode(UG(ascii_conv), &tmp_buf, &tmp_buf_len, err_buf, err_buf_len TSRMLS_CC) == SUCCESS) { + if (zend_string_to_unicode(UG(ascii_conv), &tmp_buf, &tmp_buf_len, (char *)err_buf, err_buf_len TSRMLS_CC) == SUCCESS) { *error_buf = (text *)eustrndup(tmp_buf, tmp_buf_len); efree(tmp_buf); } @@ -948,14 +948,14 @@ err_buf[UBYTES(err_buf_len - 1)] = '\0'; } } else { - err_buf_len = strlen(err_buf); + err_buf_len = strlen((char *)err_buf); if (err_buf_len && err_buf[err_buf_len - 1] == '\n') { err_buf[err_buf_len - 1] = '\0'; } } if (err_buf_len && error_buf) { - *error_buf = estrndup(err_buf, TEXT_BYTES(err_buf_len)); + *error_buf = (text *)estrndup((char *)err_buf, TEXT_BYTES(err_buf_len)); } } } @@ -1073,7 +1073,7 @@ #if HAVE_OCI_ENV_NLS_CREATE if (!UG(unicode)) { if (charset.s && *charset.s) { - PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), charset.s)); + PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), (CONST oratext *)charset.s)); if (!charsetid) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset.s); } else { http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.13&r2=1.14&diff_format=u Index: php-src/ext/oci8/oci8_collection.c diff -u php-src/ext/oci8/oci8_collection.c:1.13 php-src/ext/oci8/oci8_collection.c:1.14 --- php-src/ext/oci8/oci8_collection.c:1.13 Wed Mar 28 23:05:36 2007 +++ php-src/ext/oci8/oci8_collection.c Wed Jul 18 15:09:37 2007 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_collection.c,v 1.13 2007/03/28 23:05:36 tony2001 Exp $ */ +/* $Id: oci8_collection.c,v 1.14 2007/07/18 15:09:37 sixd Exp $ */ @@ -296,7 +296,7 @@ php_oci_connection *connection = collection->connection; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -370,7 +370,7 @@ OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); @@ -443,8 +443,8 @@ dvoid *element; OCIInd *element_index; boolean exists; - char buff[1024]; - int buff_len = 1024; + oratext buff[1024]; + ub4 buff_len = 1024; MAKE_STD_ZVAL(*result_element); ZVAL_NULL(*result_element); @@ -492,7 +492,7 @@ ZVAL_UNICODEL(*result_element, (UChar *)buff, TEXT_CHARS(buff_len), 1); /* Z_UNIVAL_P(*result_element)[buff_len] = 0; XXX */ } else { - ZVAL_STRINGL(*result_element, buff, buff_len, 1); + ZVAL_STRINGL(*result_element, (char *)buff, buff_len, 1); Z_STRVAL_P(*result_element)[buff_len] = '\0'; } @@ -513,7 +513,7 @@ if (UG(unicode)) { ZVAL_UNICODEL(*result_element, (UChar *)str, TEXT_CHARS(str_len), 1); } else { - ZVAL_STRINGL(*result_element, str, str_len, 1); + ZVAL_STRINGL(*result_element, (char *)str, str_len, 1); } } return 0; @@ -583,7 +583,7 @@ php_oci_connection *connection = collection->connection; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST oratext *)date.s, TEXT_BYTES(date_len), NULL, 0, NULL, 0, &oci_date)); if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ @@ -659,7 +659,7 @@ OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, element.s, TEXT_BYTES(element_len), &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element.s, TEXT_BYTES(element_len), &ocistr)); if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.28&r2=1.29&diff_format=u Index: php-src/ext/oci8/oci8_lob.c diff -u php-src/ext/oci8/oci8_lob.c:1.28 php-src/ext/oci8/oci8_lob.c:1.29 --- php-src/ext/oci8/oci8_lob.c:1.28 Mon Jun 25 18:25:08 2007 +++ php-src/ext/oci8/oci8_lob.c Wed Jul 18 15:09:37 2007 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_lob.c,v 1.28 2007/06/25 18:25:08 tony2001 Exp $ */ +/* $Id: oci8_lob.c,v 1.29 2007/07/18 15:09:37 sixd Exp $ */ @@ -677,7 +677,8 @@ Import LOB contents from the given file */ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC) { - int fp, loblen; + int fp; + ub4 loblen; OCILobLocator *lob = (OCILobLocator *)descriptor->descriptor; php_oci_connection *connection = descriptor->connection; char buf[8192]; @@ -700,9 +701,9 @@ connection->err, lob, &loblen, - (ub4) offset, + offset, (dvoid *) &buf, - (ub4) loblen, + loblen, OCI_ONE_PIECE, (dvoid *)0, (OCICallbackLobWrite) 0, http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.47&r2=1.48&diff_format=u Index: php-src/ext/oci8/oci8_statement.c diff -u php-src/ext/oci8/oci8_statement.c:1.47 php-src/ext/oci8/oci8_statement.c:1.48 --- php-src/ext/oci8/oci8_statement.c:1.47 Mon Jul 16 19:16:00 2007 +++ php-src/ext/oci8/oci8_statement.c Wed Jul 18 15:09:37 2007 @@ -25,7 +25,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8_statement.c,v 1.47 2007/07/16 19:16:00 tony2001 Exp $ */ +/* $Id: oci8_statement.c,v 1.48 2007/07/18 15:09:37 sixd Exp $ */ #ifdef HAVE_CONFIG_H @@ -859,8 +859,8 @@ break; case SQLT_ODT: for (i = 0; i < bind->array.current_length; i++) { - char buff[1024]; - int buff_len = 1024; + oratext buff[1024]; + ub4 buff_len = 1024; memset((void*)buff,0,sizeof(buff)); @@ -873,14 +873,14 @@ ZVAL_NULL(*entry); } else { zstr tmp; - tmp.s = buff; + tmp.s = (char *)buff; ZVAL_TEXTL(*entry, tmp, TEXT_CHARS(buff_len), 1); } zend_hash_move_forward(hash); } else { zstr tmp; PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - tmp.s = buff; + tmp.s = (char *)buff; if (connection->errcode != OCI_SUCCESS) { php_oci_error(connection->err, connection->errcode TSRMLS_CC); add_next_index_null(bind->zval); @@ -907,13 +907,13 @@ if (UG(unicode)) { tmp.u = ((UChar *)bind->array.elements)+TEXT_CHARS(i*bind->array.max_length); } else { - tmp.s = ((text *)bind->array.elements)+(i*bind->array.max_length); + tmp.s = (char *)(((text *)bind->array.elements)+(i*bind->array.max_length)); } ZVAL_TEXTL(*entry, tmp, curr_element_length, 1); zend_hash_move_forward(hash); } else { - tmp.s = ((text *)bind->array.elements)+(i*bind->array.max_length); + tmp.s = (char *)(((text *)bind->array.elements)+(i*bind->array.max_length)); add_next_index_textl(bind->zval, tmp, curr_element_length, 1); } } @@ -1623,9 +1623,9 @@ convert_to_text_ex(entry); if (UG(unicode)) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (text *)Z_UNIVAL_PP(entry).s, UBYTES(Z_UNILEN_PP(entry)), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_UNIVAL_PP(entry).s, UBYTES(Z_UNILEN_PP(entry)), NULL, 0, NULL, 0, &oci_date)); } else { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); } if (connection->errcode != OCI_SUCCESS) { @@ -1643,10 +1643,10 @@ if (UG(unicode)) { UChar *tmp = USTR_MAKE("01-JAN-00"); - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (text *)tmp, UBYTES(sizeof("01-JAN-00")-1), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)tmp, UBYTES(sizeof("01-JAN-00")-1), NULL, 0, NULL, 0, &oci_date)); efree(tmp); } else { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, "01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); } if (connection->errcode != OCI_SUCCESS) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php