From: Antony Dovgal Date: Tue, 15 Aug 2006 13:08:18 +0000 (+0000) Subject: minor CS/WS fixes X-Git-Tag: RELEASE_1_0_0RC1~1946 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1789473eba3022b2ab6bf19075dc0954e5e554c9;p=php minor CS/WS fixes --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 5b28f35b8e..d01a6539bd 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -443,8 +443,7 @@ oci_error: 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); } } @@ -1072,8 +1071,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char 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 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * */ 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 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char 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 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* 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 @@ open: 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 @@ open: 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 @@ open: 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 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) free(connection->hash_key); } free(connection); - } - else { + } else { if (connection->hash_key) { efree(connection->hash_key); } @@ -1592,8 +1581,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR 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 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR } 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 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR 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 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg 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 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg 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 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC) 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; diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index c84ca9844b..3f01457aac 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -57,7 +57,22 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c 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 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c } /* 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 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c } /* 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 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c 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 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i 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 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe 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 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme 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 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z 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 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind 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 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i 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 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i 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); diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 04e7695f1c..787d77f14d 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -464,8 +464,7 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS 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 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor TSRMLS_DC) { if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) { return 1; - } - else { + } else { return 0; } } /* }}} */ @@ -507,8 +505,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d if (length == -1) { copy_len = length_from - descriptor_from->lob_current_position; - } - else { + } else { copy_len = length; } @@ -517,7 +514,17 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d 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 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data, 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); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 5186b33d9f..1348ffb8e5 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -62,7 +62,19 @@ php_oci_statement *php_oci_statement_create (php_oci_connection *connection, cha 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 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) 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 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) #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 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) } 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 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) 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 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) 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 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) 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 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) 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 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, } 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 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, } 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 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, #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_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME 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 @@ php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length, ((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 @@ php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length 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 @@ php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length 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 @@ php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, p ((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) {