tony2001                Tue Aug 15 13:08:18 2006 UTC

  Modified files:              
    /php-src/ext/oci8   oci8.c oci8_collection.c oci8_lob.c 
                        oci8_statement.c 
  Log:
  minor CS/WS fixes
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.315&r2=1.316&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.315 php-src/ext/oci8/oci8.c:1.316
--- php-src/ext/oci8/oci8.c:1.315       Tue Aug 15 12:27:04 2006
+++ php-src/ext/oci8/oci8.c     Tue Aug 15 13:08:18 2006
@@ -26,7 +26,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8.c,v 1.315 2006/08/15 12:27:04 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.316 2006/08/15 13:08:18 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -443,8 +443,7 @@
                        
                        OCI_G(env) = NULL;
                        OCI_G(err) = NULL;
-               }
-               else {
+               } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
                }
        }
@@ -668,7 +667,7 @@
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
        php_info_print_table_row(2, "Version", "1.2.1");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.315 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.316 $");
 
        sprintf(buf, "%ld", OCI_G(num_persistent));
        php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -1072,8 +1071,7 @@
                        if (le->type == le_pconnection) {
                                connection = (php_oci_connection *)le->ptr;     
                        }
-               }
-               else if (!persistent && zend_hash_find(&EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) {
+               } else if (!persistent && zend_hash_find(&EG(regular_list), 
hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) {
                        found = 1;
                        if (le->type == le_index_ptr) {
                                int type, link;
@@ -1103,8 +1101,7 @@
                                                 * */
                                                if ( (connection->next_ping > 
0) && (timestamp >= connection->next_ping) && 
!php_oci_connection_ping(connection TSRMLS_CC)) {
                                                        /* server died */
-                                               }
-                                               else {
+                                               } else {
                                                        int rsrc_type;
 
                                                        /* okay, the connection 
is open and the server is still alive */
@@ -1123,8 +1120,7 @@
                                        zend_hash_del(&EG(persistent_list), 
hashed_details.c, hashed_details.len+1);
                                        connection = NULL;
                                        goto open;
-                               }
-                               else {
+                               } else {
                                        /* we do not ping non-persistent 
connections */
                                        smart_str_free_ex(&hashed_details, 0);
                                        zend_list_addref(connection->rsrc_id);
@@ -1139,8 +1135,7 @@
                        /* found something, but it's not a connection, delete 
it */
                        if (persistent) {
                                zend_hash_del(&EG(persistent_list), 
hashed_details.c, hashed_details.len+1);
-                       }
-                       else {
+                       } else {
                                zend_hash_del(&EG(regular_list), 
hashed_details.c, hashed_details.len+1);
                        }
                }
@@ -1164,14 +1159,12 @@
                        connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
                        connection->hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
                        connection->is_persistent = 0;
-               }
-               else {
+               } else {
                        connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
                        connection->hash_key = zend_strndup(hashed_details.c, 
hashed_details.len);
                        connection->is_persistent = 1;
                }
-       }
-       else {
+       } else {
                connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
                connection->hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
                connection->is_persistent = 0;
@@ -1180,8 +1173,7 @@
        connection->idle_expiry = (OCI_G(persistent_timeout) > 0) ? (timestamp 
+ OCI_G(persistent_timeout)) : 0;
        if (OCI_G(ping_interval) >= 0) {
                connection->next_ping = timestamp + OCI_G(ping_interval);
-       }
-       else {
+       } else {
                /* -1 means "Off" */
                connection->next_ping = 0;
        }
@@ -1390,15 +1382,13 @@
                connection->rsrc_id = zend_list_insert(connection, 
le_pconnection);
                zend_hash_update(&EG(persistent_list), connection->hash_key, 
strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), 
NULL);
                OCI_G(num_persistent)++;
-       }
-       else if (!exclusive) {
+       } else if (!exclusive) {
                connection->rsrc_id = zend_list_insert(connection, 
le_connection);
                new_le.ptr = (void *)connection->rsrc_id;
                new_le.type = le_index_ptr;
                zend_hash_update(&EG(regular_list), connection->hash_key, 
strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), 
NULL);
                OCI_G(num_links)++;
-       }
-       else {
+       } else {
                connection->rsrc_id = zend_list_insert(connection, 
le_connection);      
                OCI_G(num_links)++;
        }
@@ -1532,8 +1522,7 @@
                        free(connection->hash_key);
                }
                free(connection);
-       }
-       else {
+       } else {
                if (connection->hash_key) {
                        efree(connection->hash_key);
                }
@@ -1592,8 +1581,7 @@
        if (column->is_cursor) { /* REFCURSOR -> simply return the statement id 
*/
                ZVAL_RESOURCE(value, column->stmtid);
                zend_list_addref(column->stmtid);
-       } 
-       else if (column->is_descr) {
+       } else if (column->is_descr) {
                
                if (column->data_type != SQLT_RDD) {
                        int rsrc_type;
@@ -1620,8 +1608,7 @@
                        } else {
                                if (lob_length > 0) {
                                        ZVAL_STRINGL(value, lob_buffer, 
lob_length, 0);
-                               }
-                               else {
+                               } else {
                                        ZVAL_EMPTY_STRING(value);
                                }
                                return 0;
@@ -1632,8 +1619,7 @@
                        add_property_resource(value, "descriptor", 
column->descid);
                        zend_list_addref(column->descid);
                }
-       } 
-       else {
+       } else {
                switch (column->retcode) {
                        case 0: 
                                /* intact value */
@@ -1676,8 +1662,7 @@
                if (ZEND_NUM_ARGS() == 2) {
                        fetch_mode = mode;
                }
-       }
-       else if (expected_args == 2) {
+       } else if (expected_args == 2) {
                /* only for oci_fetch_array() */
 
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", 
&z_statement, &fetch_mode) == FAILURE) {
@@ -1687,8 +1672,7 @@
                if (ZEND_NUM_ARGS() == 1) {
                        fetch_mode = mode;
                }
-       } 
-       else {
+       } else {
                /* for all oci_fetch_*() */
                
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", 
&z_statement) == FAILURE) {
@@ -1797,15 +1781,13 @@
                
                        if (OCI_G(ping_interval) >= 0) {
                                connection->next_ping = timestamp + 
OCI_G(ping_interval);
-                       }
-                       else {
+                       } else {
                                /* ping_interval is -1 */
                                connection->next_ping = 0;
                        }
 
                        connection->used_this_request = 0;
-               }
-               else if (OCI_G(persistent_timeout) != -1) {
+               } else if (OCI_G(persistent_timeout) != -1) {
                        if (connection->idle_expiry < timestamp) {
                                /* connection has timed out */
                                return 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.7 
php-src/ext/oci8/oci8_collection.c:1.8
--- php-src/ext/oci8/oci8_collection.c:1.7      Tue May 30 21:38:00 2006
+++ php-src/ext/oci8/oci8_collection.c  Tue Aug 15 13:08:18 2006
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_collection.c,v 1.7 2006/05/30 21:38:00 tony2001 Exp $ */
+/* $Id: oci8_collection.c,v 1.8 2006/08/15 13:08:18 tony2001 Exp $ */
 
 
 
@@ -57,7 +57,22 @@
        collection->collection = NULL;
        
        /* get type handle by name */
-       connection->errcode = PHP_OCI_CALL(OCITypeByName,       
(connection->env, connection->err, connection->svc, (text *) schema, (ub4) 
schema_len, (text *) tdo, (ub4) tdo_len, (CONST text *) 0, (ub4) 0, 
OCI_DURATION_SESSION, OCI_TYPEGET_ALL, &(collection->tdo)));
+       connection->errcode = PHP_OCI_CALL(OCITypeByName,
+                       (
+                        connection->env,
+                        connection->err,
+                        connection->svc,
+                        (text *) schema,
+                        (ub4) schema_len,
+                        (text *) tdo,
+                        (ub4) tdo_len,
+                        (CONST text *) 0,
+                        (ub4) 0,
+                        OCI_DURATION_SESSION,
+                        OCI_TYPEGET_ALL,
+                        &(collection->tdo)
+                       )
+       );
 
        if (connection->errcode) {
                goto CLEANUP;
@@ -71,7 +86,18 @@
        }
 
        /* describe TDO */
-       connection->errcode = PHP_OCI_CALL(OCIDescribeAny, (connection->svc, 
connection->err, (dvoid *) collection->tdo, (ub4) 0, OCI_OTYPE_PTR, (ub1) 
OCI_DEFAULT, (ub1) OCI_PTYPE_TYPE, dschp1));
+       connection->errcode = PHP_OCI_CALL(OCIDescribeAny, 
+                       (
+                        connection->svc,
+                        connection->err,
+                        (dvoid *) collection->tdo,
+                        (ub4) 0,
+                        OCI_OTYPE_PTR,
+                        (ub1) OCI_DEFAULT,
+                        (ub1) OCI_PTYPE_TYPE,
+                        dschp1
+                       )
+       );
 
        if (connection->errcode) {
                goto CLEANUP;
@@ -85,7 +111,16 @@
        }
 
        /* get the collection type code of the attribute */
-       connection->errcode = PHP_OCI_CALL(OCIAttrGet, ((dvoid*) parmp1, (ub4) 
OCI_DTYPE_PARAM, (dvoid*) &(collection->coll_typecode), (ub4 *) 0, (ub4) 
OCI_ATTR_COLLECTION_TYPECODE, connection->err));
+       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
+                       (
+                        (dvoid*) parmp1,
+                        (ub4) OCI_DTYPE_PARAM,
+                        (dvoid*) &(collection->coll_typecode),
+                        (ub4 *) 0,
+                        (ub4) OCI_ATTR_COLLECTION_TYPECODE,
+                        connection->err
+                       )
+       );
 
        if (connection->errcode) {
                goto CLEANUP;
@@ -95,28 +130,64 @@
                case OCI_TYPECODE_TABLE:
                case OCI_TYPECODE_VARRAY:
                        /* get collection element handle */
-                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
((dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, (dvoid*) &parmp2, (ub4 *) 0, (ub4) 
OCI_ATTR_COLLECTION_ELEMENT, connection->err));
+                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
+                                       (
+                                        (dvoid*) parmp1,
+                                        (ub4) OCI_DTYPE_PARAM,
+                                        (dvoid*) &parmp2,
+                                        (ub4 *) 0,
+                                        (ub4) OCI_ATTR_COLLECTION_ELEMENT,
+                                        connection->err
+                                       )
+                       );
 
                        if (connection->errcode) {
                                goto CLEANUP;
                        }
 
                        /* get REF of the TDO for the type */
-                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
((dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, (dvoid*) &(collection->elem_ref), (ub4 
*) 0, (ub4) OCI_ATTR_REF_TDO, connection->err));
+                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
+                                       (
+                                        (dvoid*) parmp2,
+                                        (ub4) OCI_DTYPE_PARAM,
+                                        (dvoid*) &(collection->elem_ref),
+                                        (ub4 *) 0,
+                                        (ub4) OCI_ATTR_REF_TDO,
+                                        connection->err
+                                       )
+                       );
 
                        if (connection->errcode) {
                                goto CLEANUP;
                        }
 
                        /* get the TDO (only header) */
-                       connection->errcode = PHP_OCI_CALL(OCITypeByRef, 
(connection->env, connection->err, collection->elem_ref, OCI_DURATION_SESSION, 
OCI_TYPEGET_HEADER, &(collection->element_type)));
+                       connection->errcode = PHP_OCI_CALL(OCITypeByRef, 
+                                       (
+                                        connection->env,
+                                        connection->err,
+                                        collection->elem_ref,
+                                        OCI_DURATION_SESSION,
+                                        OCI_TYPEGET_HEADER,
+                                        &(collection->element_type)
+                                       )
+                       );
 
                        if (connection->errcode) {
                                goto CLEANUP;
                        }
 
                        /* get typecode */
-                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
((dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, (dvoid*) 
&(collection->element_typecode), (ub4 *) 0, (ub4) OCI_ATTR_TYPECODE, 
connection->err));
+                       connection->errcode = PHP_OCI_CALL(OCIAttrGet, 
+                                       (
+                                        (dvoid*) parmp2,
+                                        (ub4) OCI_DTYPE_PARAM,
+                                        (dvoid*) 
&(collection->element_typecode),
+                                        (ub4 *) 0,
+                                        (ub4) OCI_ATTR_TYPECODE,
+                                        connection->err
+                                       )
+                       );
 
                        if (connection->errcode) {
                                goto CLEANUP;
@@ -233,7 +304,15 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, 
connection->err, (dvoid *) &oci_date, (dvoid *) &new_index, (OCIColl *) 
collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAppend, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (dvoid *) &oci_date,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                       )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -261,7 +340,15 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, 
connection->err, (dvoid *) &oci_number, (dvoid *) &new_index, (OCIColl *) 
collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAppend, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (dvoid *) &oci_number,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                       )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -286,7 +373,15 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, 
connection->err, (dvoid *) ocistr, (dvoid *) &new_index,    (OCIColl *) 
collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAppend, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (dvoid *) ocistr,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                       )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -350,7 +445,17 @@
        MAKE_STD_ZVAL(*result_element);
        ZVAL_NULL(*result_element);
 
-       connection->errcode = PHP_OCI_CALL(OCICollGetElem, (connection->env, 
connection->err, collection->collection, (ub4)index, &exists, &element,    
(dvoid **)&element_index));
+       connection->errcode = PHP_OCI_CALL(OCICollGetElem, 
+                       (
+                        connection->env,
+                        connection->err,
+                        collection->collection,
+                        (ub4)index,
+                        &exists,
+                        &element,
+                        (dvoid **)&element_index
+                       )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -470,7 +575,16 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, 
connection->err, (ub4)index, (dvoid *) &oci_date, (dvoid *) &new_index, 
(OCIColl *) collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (ub4)index,
+                        (dvoid *) &oci_date,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                        )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -498,7 +612,16 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, 
connection->err, (ub4) index, (dvoid *) &oci_number, (dvoid *) &new_index, 
(OCIColl *) collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (ub4) index,
+                        (dvoid *) &oci_number,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                        )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -523,7 +646,16 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, 
connection->err, (ub4)index, (dvoid *) ocistr, (dvoid *) &new_index,    
(OCIColl *) collection->collection));
+       connection->errcode = PHP_OCI_CALL(OCICollAssignElem, 
+                       (
+                        connection->env,
+                        connection->err,
+                        (ub4)index,
+                        (dvoid *) ocistr,
+                        (dvoid *) &new_index,
+                        (OCIColl *) collection->collection
+                        )
+       );
 
        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.15&r2=1.16&diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.15 php-src/ext/oci8/oci8_lob.c:1.16
--- php-src/ext/oci8/oci8_lob.c:1.15    Wed Aug  9 15:23:50 2006
+++ php-src/ext/oci8/oci8_lob.c Tue Aug 15 13:08:18 2006
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_lob.c,v 1.15 2006/08/09 15:23:50 tony2001 Exp $ */
+/* $Id: oci8_lob.c,v 1.16 2006/08/15 13:08:18 tony2001 Exp $ */
 
 
 
@@ -464,8 +464,7 @@
        
        if (on_off) {
                connection->errcode = PHP_OCI_CALL(OCILobEnableBuffering, 
(connection->svc, connection->err, descriptor->descriptor));
-       }
-       else {
+       } else {
                connection->errcode = PHP_OCI_CALL(OCILobDisableBuffering, 
(connection->svc, connection->err, descriptor->descriptor));
        }
 
@@ -484,8 +483,7 @@
 {
        if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) {
                return 1;
-       } 
-       else {
+       } else {
                return 0;
        }
 } /* }}} */
@@ -507,8 +505,7 @@
 
        if (length == -1) {
                copy_len = length_from - descriptor_from->lob_current_position;
-       }
-       else {
+       } else {
                copy_len = length;
        }
 
@@ -517,7 +514,17 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCILobCopy, (connection->svc, 
connection->err, descriptor_dest->descriptor, descriptor_from->descriptor, 
copy_len, descriptor_dest->lob_current_position+1, 
descriptor_from->lob_current_position+1));
+       connection->errcode = PHP_OCI_CALL(OCILobCopy, 
+                       (
+                        connection->svc,
+                        connection->err,
+                        descriptor_dest->descriptor,
+                        descriptor_from->descriptor,
+                        copy_len,
+                        descriptor_dest->lob_current_position+1,
+                        descriptor_from->lob_current_position+1
+                       )
+       );
 
        if (connection->errcode != OCI_SUCCESS) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -827,7 +834,18 @@
                return 1;
        }
 
-       connection->errcode = PHP_OCI_CALL(OCILobCreateTemporary, 
(connection->svc, connection->err, lob, OCI_DEFAULT, OCI_DEFAULT, type, 
OCI_ATTR_NOCACHE, OCI_DURATION_SESSION));
+       connection->errcode = PHP_OCI_CALL(OCILobCreateTemporary, 
+                       (
+                        connection->svc,
+                        connection->err,
+                        lob,
+                        OCI_DEFAULT,
+                        OCI_DEFAULT,
+                        type,
+                        OCI_ATTR_NOCACHE,
+                        OCI_DURATION_SESSION
+                       )
+       );
 
        if (connection->errcode) {
                php_oci_error(connection->err, connection->errcode TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.24&r2=1.25&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.24 
php-src/ext/oci8/oci8_statement.c:1.25
--- php-src/ext/oci8/oci8_statement.c:1.24      Wed Aug  9 15:23:50 2006
+++ php-src/ext/oci8/oci8_statement.c   Tue Aug 15 13:08:18 2006
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_statement.c,v 1.24 2006/08/09 15:23:50 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.25 2006/08/15 13:08:18 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -62,7 +62,19 @@
        
        if (query_len > 0) {
 #if HAVE_OCI_STMT_PREPARE2
-               connection->errcode = PHP_OCI_CALL(OCIStmtPrepare2, 
(connection->svc, &(statement->stmt), connection->err, (text *)query, 
query_len, NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT));
+               connection->errcode = PHP_OCI_CALL(OCIStmtPrepare2, 
+                               (
+                                connection->svc,
+                                &(statement->stmt),
+                                connection->err,
+                                (text *)query,
+                                query_len,
+                                NULL,
+                                0,
+                                OCI_NTV_SYNTAX,
+                                OCI_DEFAULT
+                               )
+               );
 #else
                connection->errcode = PHP_OCI_CALL(OCIStmtPrepare, 
(statement->stmt, connection->err, (text *)query, query_len, OCI_NTV_SYNTAX, 
OCI_DEFAULT));
 #endif         
@@ -189,7 +201,18 @@
 
                                column->cb_retlen = PHP_OCI_PIECE_SIZE;
 
-                               PHP_OCI_CALL( OCIStmtSetPieceInfo, ((void *) 
column->oci_define, OCI_HTYPE_DEFINE, statement->err, ((char*)column->data) + 
column->retlen4, &(column->cb_retlen), OCI_NEXT_PIECE, &column->indicator, 
&column->retcode));
+                               PHP_OCI_CALL(OCIStmtSetPieceInfo, 
+                                               (
+                                                (void *) column->oci_define,
+                                                OCI_HTYPE_DEFINE,
+                                                statement->err,
+                                                ((char*)column->data) + 
column->retlen4,
+                                                &(column->cb_retlen),
+                                                OCI_NEXT_PIECE,
+                                                &column->indicator,
+                                                &column->retcode
+                                               )
+                               );
                        }
                }
 
@@ -611,8 +634,7 @@
 #if HAVE_OCI_STMT_PREPARE2
                if (statement->last_query_len) { /* FIXME: magical */
                        PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, 
statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE));
-               }
-               else {
+               } else {
                        PHP_OCI_CALL(OCIHandleFree, (statement->stmt, 
OCI_HTYPE_STMT));
                }
 #else
@@ -680,8 +702,7 @@
        } else if (Z_TYPE_P(bind->zval) == IS_STRING && Z_STRLEN_P(bind->zval) 
> 0) {
                Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), 
Z_STRLEN_P(bind->zval)+1);
                Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
-       }
-       else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
+       } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
                int i;
                zval **entry;
                HashTable *hash = HASH_OF(bind->zval);
@@ -697,8 +718,7 @@
                                                zval_dtor(*entry);
                                                ZVAL_LONG(*entry, ((ub4 
*)(bind->array.elements))[i]);
                                                zend_hash_move_forward(hash);
-                                       }
-                                       else {
+                                       } else {
                                                add_next_index_long(bind->zval, 
((ub4 *)(bind->array.elements))[i]);
                                        }
                                }
@@ -709,8 +729,7 @@
                                                zval_dtor(*entry);
                                                ZVAL_DOUBLE(*entry, ((double 
*)(bind->array.elements))[i]);
                                                zend_hash_move_forward(hash);
-                                       }
-                                       else {
+                                       } else {
                                                
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
                                        }
                                }
@@ -729,19 +748,16 @@
                                                if (connection->errcode != 
OCI_SUCCESS) {
                                                        
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
                                                        ZVAL_NULL(*entry);
-                                               }
-                                               else {
+                                               } else {
                                                        ZVAL_STRINGL(*entry, 
buff, buff_len, 1);
                                                }
                                                zend_hash_move_forward(hash);
-                                       }
-                                       else {
+                                       } else {
                                                connection->errcode = 
PHP_OCI_CALL(OCIDateToText, (connection->err, &(((OCIDate 
*)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
                                                if (connection->errcode != 
OCI_SUCCESS) {
                                                        
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
                                                        
add_next_index_null(bind->zval);
-                                               }
-                                               else {
+                                               } else {
                                                        
add_next_index_stringl(bind->zval, buff, buff_len, 1);
                                                }
                                        }
@@ -761,8 +777,7 @@
                                                zval_dtor(*entry);
                                                ZVAL_STRINGL(*entry, ((text 
*)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
                                                zend_hash_move_forward(hash);
-                                       }
-                                       else {
+                                       } else {
                                                
add_next_index_stringl(bind->zval, ((text 
*)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
                                        }
                                }
@@ -853,8 +868,7 @@
                        }
                        if (maxlength == -1) {
                                value_sz = (Z_TYPE_P(var) == IS_STRING) ? 
Z_STRLEN_P(var) : 0;
-                       }
-                       else {
+                       } else {
                                value_sz = maxlength;
                        }
                        break;
@@ -921,7 +935,16 @@
        }
 
        if (mode == OCI_DATA_AT_EXEC) {
-               statement->errcode = PHP_OCI_CALL(OCIBindDynamic, (bindp->bind, 
statement->err, (dvoid *)bindp, php_oci_bind_in_callback, (dvoid *)bindp, 
php_oci_bind_out_callback));
+               statement->errcode = PHP_OCI_CALL(OCIBindDynamic, 
+                               (
+                                bindp->bind,
+                                statement->err,
+                                (dvoid *)bindp,
+                                php_oci_bind_in_callback,
+                                (dvoid *)bindp,
+                                php_oci_bind_out_callback
+                               )
+               );
 
                if (statement->errcode != OCI_SUCCESS) {
                        php_oci_error(statement->err, statement->errcode 
TSRMLS_CC);
@@ -933,7 +956,17 @@
 #ifdef PHP_OCI8_HAVE_COLLECTIONS
        if (type == SQLT_NTY) {
                /* Bind object */
-               statement->errcode = PHP_OCI_CALL(OCIBindObject, (bindp->bind, 
statement->err, bind_collection->tdo, (dvoid **) 
&(bind_collection->collection), (ub4 *) 0, (dvoid **) 0, (ub4 *) 0));
+               statement->errcode = PHP_OCI_CALL(OCIBindObject, 
+                               (
+                                bindp->bind,
+                                statement->err,
+                                bind_collection->tdo,
+                                (dvoid **) &(bind_collection->collection),
+                                (ub4 *) 0,
+                                (dvoid **) 0,
+                                (ub4 *) 0
+                               )
+               );
                
                if (statement->errcode) {
                        php_oci_error(statement->err, statement->errcode 
TSRMLS_CC);
@@ -1070,8 +1103,7 @@
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
column name \"%s\"", Z_STRVAL_P(column_index));
                        return NULL;
                }
-       }
-       else {
+       } else {
                convert_to_long(column_index);
                column = php_oci_statement_get_column(statement, 
Z_LVAL_P(column_index), NULL, 0 TSRMLS_CC);
                if (!column) {
@@ -1273,8 +1305,7 @@
                        ((text *)bind->array.elements)[i*maxlength + 
element_length] = '\0';
                        
                        zend_hash_move_forward(hash);
-               }
-               else {
+               } else {
                        ((text *)bind->array.elements)[i*maxlength] = '\0';
                }
        }
@@ -1310,8 +1341,7 @@
                        convert_to_long_ex(entry);
                        ((ub4 *)bind->array.elements)[i] = (ub4) 
Z_LVAL_PP(entry);
                        zend_hash_move_forward(hash);
-               }
-               else {
+               } else {
                        ((ub4 *)bind->array.elements)[i] = 0;
                }
        }
@@ -1347,8 +1377,7 @@
                        convert_to_double_ex(entry);
                        ((double *)bind->array.elements)[i] = (double) 
Z_DVAL_PP(entry);
                        zend_hash_move_forward(hash);
-               }
-               else {
+               } else {
                        ((double *)bind->array.elements)[i] = 0;
                }
        }
@@ -1397,8 +1426,7 @@
                        
                        ((OCIDate *)bind->array.elements)[i] = oci_date;
                        zend_hash_move_forward(hash);
-               }
-               else {
+               } else {
                        connection->errcode = PHP_OCI_CALL(OCIDateFromText, 
(connection->err, "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

Reply via email to