sixd            Wed Jul 18 15:10:42 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/oci8   oci8.c oci8_collection.c oci8_interface.c 
                        oci8_lob.c oci8_statement.c 
  Log:
  MFH: add casts to fix compilation warnings
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.33&r2=1.269.2.16.2.34&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.33 
php-src/ext/oci8/oci8.c:1.269.2.16.2.34
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.33     Fri Jun  8 08:44:39 2007
+++ php-src/ext/oci8/oci8.c     Wed Jul 18 15:10:42 2007
@@ -26,7 +26,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8.c,v 1.269.2.16.2.33 2007/06/08 08:44:39 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.34 2007/07/18 15:10:42 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.3");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.33 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.34 $");
 
        snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
        php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -922,14 +922,14 @@
        PHP_OCI_CALL(OCIErrorGet, (error_handle, (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 && tmp_buf[tmp_buf_len - 1] == '\n') {
                        tmp_buf[tmp_buf_len - 1] = '\0';
                }
                if (tmp_buf_len && error_buf) {
                        *error_buf = NULL;
-                       *error_buf = estrndup(tmp_buf, tmp_buf_len);
+                       *error_buf = (text *)estrndup((char *)tmp_buf, 
tmp_buf_len);
                }
        }
        return error_code;
@@ -1041,7 +1041,7 @@
 
 #if HAVE_OCI_ENV_NLS_CREATE
        if (charset && *charset) {
-               PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, 
(OCI_G(env), charset));
+               PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, 
(OCI_G(env), (CONST oratext *)charset));
                if (!charsetid) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
character set name: %s", charset);
                } else {
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.5.2.3.2.5&r2=1.5.2.3.2.6&diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.5 
php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.6
--- php-src/ext/oci8/oci8_collection.c:1.5.2.3.2.5      Mon Jan  1 09:36:03 2007
+++ php-src/ext/oci8/oci8_collection.c  Wed Jul 18 15:10:42 2007
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_collection.c,v 1.5.2.3.2.5 2007/01/01 09:36:03 sebastian Exp $ */
+/* $Id: oci8_collection.c,v 1.5.2.3.2.6 2007/07/18 15:10:42 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, date_len, NULL, 0, NULL, 0, &oci_date));
+       PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, 
(connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date));
 
        if (connection->errcode != OCI_SUCCESS) {
                /* failed to convert string to date */
@@ -366,7 +366,7 @@
        OCIString *ocistr = (OCIString *)0;
        php_oci_connection *connection = collection->connection;
                        
-       PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, 
(connection->env, connection->err, element, element_len, &ocistr));
+       PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, 
(connection->env, connection->err, (CONST oratext *)element, element_len, 
&ocistr));
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -439,8 +439,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);
@@ -484,7 +484,7 @@
                                return 1;
                        }
 
-                       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';
                        
                        return 0;
@@ -498,7 +498,7 @@
                        PHP_OCI_CALL_RETURN(str, OCIStringPtr, 
(connection->env, oci_string));
                        
                        if (str) {
-                               ZVAL_STRING(*result_element, str, 1);
+                               ZVAL_STRING(*result_element, (char *)str, 1);
                        }
                        return 0;
                }
@@ -567,7 +567,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, date_len, NULL, 0, NULL, 0, &oci_date));
+       PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, 
(connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date));
 
        if (connection->errcode != OCI_SUCCESS) {
                /* failed to convert string to date */
@@ -639,7 +639,7 @@
        OCIString *ocistr = (OCIString *)0;
        php_oci_connection *connection = collection->connection;
                        
-       PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, 
(connection->env, connection->err, element, element_len, &ocistr));
+       PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, 
(connection->env, connection->err, (CONST oratext *)element, 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_interface.c?r1=1.8.2.7.2.9&r2=1.8.2.7.2.10&diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.9 
php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.10
--- php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.9       Thu Jan 11 12:01:08 2007
+++ php-src/ext/oci8/oci8_interface.c   Wed Jul 18 15:10:42 2007
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_interface.c,v 1.8.2.7.2.9 2007/01/11 12:01:08 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.8.2.7.2.10 2007/07/18 15:10:42 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1715,7 +1715,7 @@
                        RETURN_FALSE;
                }
 
-               if (php_oci_password_change(connection, user, user_len, 
pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) {
+               if (php_oci_password_change(connection, (char *)user, user_len, 
(char *)pass_old, pass_old_len, (char *)pass_new, pass_new_len TSRMLS_CC)) {
                        RETURN_FALSE;
                }
                RETURN_TRUE;
@@ -1734,7 +1734,7 @@
                        RETURN_FALSE;
                }
 
-               connection = php_oci_do_connect_ex(user, user_len, pass_old, 
pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 
0 TSRMLS_CC);
+               connection = php_oci_do_connect_ex((char *)user, user_len, 
(char *)pass_old, pass_old_len, (char *)pass_new, pass_new_len, (char *)dbname, 
dbname_len, NULL, OCI_DEFAULT, 0, 0 TSRMLS_CC);
                if (!connection) {
                        RETURN_FALSE;
                }
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.7.2.6.2.12&r2=1.7.2.6.2.13&diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.12 
php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.13
--- php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.12    Mon Jun 25 18:26:52 2007
+++ php-src/ext/oci8/oci8_lob.c Wed Jul 18 15:10:42 2007
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_lob.c,v 1.7.2.6.2.12 2007/06/25 18:26:52 tony2001 Exp $ */
+/* $Id: oci8_lob.c,v 1.7.2.6.2.13 2007/07/18 15:10:42 sixd Exp $ */
 
 
 
@@ -672,7 +672,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];
@@ -695,9 +696,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.7.2.14.2.25&r2=1.7.2.14.2.26&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.25 
php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.26
--- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.25     Fri Jun  8 08:44:39 2007
+++ php-src/ext/oci8/oci8_statement.c   Wed Jul 18 15:10:42 2007
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_statement.c,v 1.7.2.14.2.25 2007/06/08 08:44:39 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.26 2007/07/18 15:10:42 sixd Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -838,8 +838,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));
                                                        
@@ -851,7 +851,7 @@
                                                        
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
                                                        ZVAL_NULL(*entry);
                                                } else {
-                                                       ZVAL_STRINGL(*entry, 
buff, buff_len, 1);
+                                                       ZVAL_STRINGL(*entry, 
(char *)buff, buff_len, 1);
                                                }
                                                zend_hash_move_forward(hash);
                                        } else {
@@ -860,7 +860,7 @@
                                                        
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
                                                        
add_next_index_null(bind->zval);
                                                } else {
-                                                       
add_next_index_stringl(bind->zval, buff, buff_len, 1);
+                                                       
add_next_index_stringl(bind->zval, (char *)buff, buff_len, 1);
                                                }
                                        }
                                }
@@ -877,10 +877,10 @@
                                        int curr_element_length = 
bind->array.element_lengths[i];
                                        if ((i < bind->array.old_length) && 
(zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
                                                zval_dtor(*entry);
-                                               ZVAL_STRINGL(*entry, ((text 
*)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
+                                               ZVAL_STRINGL(*entry, (char 
*)(((text *)bind->array.elements)+i*bind->array.max_length), 
curr_element_length, 1);
                                                zend_hash_move_forward(hash);
                                        } else {
-                                               
add_next_index_stringl(bind->zval, ((text 
*)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
+                                               
add_next_index_stringl(bind->zval, (char *)(((text 
*)bind->array.elements)+i*bind->array.max_length), curr_element_length, 1);
                                        }
                                }
                                break;
@@ -1553,7 +1553,7 @@
                if ((i < bind->array.current_length) && 
(zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
                        
                        convert_to_string_ex(entry);
-                       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) {
                                /* failed to convert string to date */
@@ -1567,7 +1567,7 @@
                        ((OCIDate *)bind->array.elements)[i] = oci_date;
                        zend_hash_move_forward(hash);
                } 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) {
                                /* failed to convert string to date */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to