iliaa           Mon Mar 23 22:30:56 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/odbc   php_odbc.c 
  Log:
  
  Improved parameter handling
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.14&r2=1.189.2.4.2.7.2.15&diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.14 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.15
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.14      Tue Feb 17 12:38:21 2009
+++ php-src/ext/odbc/php_odbc.c Mon Mar 23 22:30:56 2009
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.14 2009/02/17 12:38:21 felipe Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.15 2009/03/23 22:30:56 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1629,17 +1629,15 @@
 #ifdef HAVE_SQL_EXTENDED_FETCH
        SQLULEN crow;
        SQLUSMALLINT RowStatus[1];
-       SQLLEN rownum = -1;
+       SQLLEN rownum;
        zval *pv_res, *tmp;
-       long pv_row;
+       long pv_row - 1;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, 
&pv_row) == FAILURE) {
                return;
        }
        
-       if (ZEND_NUM_ARGS() > 1) {
-               rownum = pv_row;
-       }
+       rownum = pv_row;
 #else
        zval *pv_res, *tmp;
 
@@ -1928,11 +1926,11 @@
    Fetch a row */
 PHP_FUNCTION(odbc_fetch_row)
 {
-       SQLLEN rownum = 1;
+       SQLLEN rownum;
        odbc_result *result;
        RETCODE rc;
        zval *pv_res;
-       long pv_row;
+       long pv_row = 1;
 #ifdef HAVE_SQL_EXTENDED_FETCH
        SQLULEN crow;
        SQLUSMALLINT RowStatus[1];
@@ -1942,9 +1940,7 @@
                return;
        }
        
-       if (ZEND_NUM_ARGS() > 1){
-               rownum = pv_row;
-       }
+       rownum = pv_row;
        
        ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", 
le_result);
        
@@ -3307,19 +3303,17 @@
 PHP_FUNCTION(odbc_gettypeinfo)
 {
        zval *pv_conn;
-       long pv_data_type;
+       long pv_data_type = SQL_ALL_TYPES;
        odbc_result *result = NULL;
        odbc_connection *conn;
        RETCODE rc;
-       SQLSMALLINT data_type = SQL_ALL_TYPES;
+       SQLSMALLINT data_type;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, 
&pv_data_type) == FAILURE) {
                return;
        }
        
-       if (ZEND_NUM_ARGS() > 1) {
-               data_type = (SQLSMALLINT) pv_data_type;
-       }
+       data_type = (SQLSMALLINT) pv_data_type;
 
        ZEND_FETCH_RESOURCE2(conn, odbc_connection *, &pv_conn, -1, 
"ODBC-Link", le_conn, le_pconn);
 



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

Reply via email to