abies Sun Mar 7 13:01:14 2004 EDT Modified files: /php-src/ext/interbase interbase.c Log: Simplify / fix http://cvs.php.net/diff.php/php-src/ext/interbase/interbase.c?r1=1.204&r2=1.205&ty=u Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.204 php-src/ext/interbase/interbase.c:1.205 --- php-src/ext/interbase/interbase.c:1.204 Sun Mar 7 09:25:08 2004 +++ php-src/ext/interbase/interbase.c Sun Mar 7 13:01:12 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interbase.c,v 1.204 2004/03/07 14:25:08 abies Exp $ */ +/* $Id: interbase.c,v 1.205 2004/03/07 18:01:12 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -30,7 +30,7 @@ #include "php.h" -#define FILE_REVISION "$Revision: 1.204 $" +#define FILE_REVISION "$Revision: 1.205 $" #if HAVE_IBASE @@ -1571,6 +1571,8 @@ var->sqltype = SQL_TEXT; } + var->sqldata = (void*)&buf[i]; + switch (var->sqltype & ~1) { struct tm t; @@ -1579,9 +1581,9 @@ if (Z_LVAL_P(b_var) > SHRT_MAX || Z_LVAL_P(b_var) < SHRT_MIN) { _php_ibase_module_error("Parameter %d exceeds field width" TSRMLS_CC, i+1); rv = FAILURE; + break; } buf[i].val.sval = (short) Z_LVAL_P(b_var); - var->sqldata = (void *) &buf[i].val.sval; break; case SQL_LONG: convert_to_long(b_var); @@ -1590,10 +1592,10 @@ if (Z_LVAL_P(b_var) > ISC_LONG_MAX || Z_LVAL_P(b_var) < ISC_LONG_MIN) { _php_ibase_module_error("Parameter %d exceeds field width" TSRMLS_CC, i+1); rv = FAILURE; + break; } #endif buf[i].val.lval = (ISC_LONG) Z_LVAL_P(b_var); - var->sqldata = (void *) &buf[i].val.lval; break; #if defined(SQL_INT64) && (SIZEOF_LONG == 8) case SQL_INT64: @@ -1604,7 +1606,6 @@ case SQL_FLOAT: convert_to_double(b_var); buf[i].val.fval = (float) Z_DVAL_P(b_var); - var->sqldata = (void *) &buf[i].val.fval; break; case SQL_DOUBLE: convert_to_double(b_var); @@ -1660,22 +1661,16 @@ #ifndef SQL_TIMESTAMP isc_encode_date(&t, &buf[i].val.qval); - var->sqldata = (void *) (&buf[i].val.qval); #else switch (var->sqltype & ~1) { default: /* == case SQL_TIMESTAMP */ isc_encode_timestamp(&t, &buf[i].val.tsval); - var->sqldata = (void *) (&buf[i].val.tsval); break; case SQL_TYPE_DATE: - strptime(Z_STRVAL_P(b_var), IBG(dateformat), &t); isc_encode_sql_date(&t, &buf[i].val.dtval); - var->sqldata = (void *) (&buf[i].val.dtval); break; case SQL_TYPE_TIME: - strptime(Z_STRVAL_P(b_var), IBG(timeformat), &t); isc_encode_sql_time(&t, &buf[i].val.tmval); - var->sqldata = (void *) (&buf[i].val.tmval); break; #endif } @@ -1705,7 +1700,6 @@ } buf[i].val.qval = ib_blob.bl_qd; } - var->sqldata = (void *) &buf[i].val.qval; break; case SQL_ARRAY: if (Z_TYPE_P(b_var) != IS_ARRAY) { @@ -1747,7 +1741,6 @@ buf[i].val.qval = array_id; efree(array_data); } - var->sqldata = (void *) &buf[i].val.qval; break; default: php_ibase_bind_default:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php