abies           Tue Sep  2 18:37:26 2003 EDT

  Modified files:              
    /php-src/ext/interbase      interbase.c php_interbase.h 
  Log:
  Nuke far pointers
  # Unfortunately, this does break compatibility with Windows 3.x :-)
  
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.168 php-src/ext/interbase/interbase.c:1.169
--- php-src/ext/interbase/interbase.c:1.168     Tue Sep  2 18:19:18 2003
+++ php-src/ext/interbase/interbase.c   Tue Sep  2 18:37:26 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: interbase.c,v 1.168 2003/09/02 22:19:18 abies Exp $ */
+/* $Id: interbase.c,v 1.169 2003/09/02 22:37:26 abies Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -706,7 +706,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "Interbase Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.168 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.169 $");
 #ifdef COMPILE_DL_INTERBASE
        php_info_print_table_row(2, "Dynamic Module", "Yes");
 #endif
@@ -1337,7 +1337,7 @@
                        case SQL_TEXT:                     /* direct to variable */
                        case SQL_VARYING:
                                convert_to_string(b_var);
-                               var->sqldata = (void ISC_FAR *) Z_STRVAL_P(b_var);
+                               var->sqldata = (void *) Z_STRVAL_P(b_var);
                                var->sqllen      = Z_STRLEN_P(b_var);
                                var->sqltype = SQL_TEXT + (var->sqltype & 1);
                                break;
@@ -1348,7 +1348,7 @@
                                        return FAILURE;
                                }
                                buf[i].val.sval = (short) Z_LVAL_P(b_var);
-                               var->sqldata = (void ISC_FAR *) (&buf[i].val.sval);
+                               var->sqldata = (void *) (&buf[i].val.sval);
                                break;
                        case SQL_LONG:
                                if (var->sqlscale < 0) {
@@ -1358,22 +1358,22 @@
                                          handle it.
                                        */
                                        convert_to_string(b_var);
-                                       var->sqldata = (void ISC_FAR *) 
Z_STRVAL_P(b_var);
+                                       var->sqldata = (void *) Z_STRVAL_P(b_var);
                                        var->sqllen      = Z_STRLEN_P(b_var);
                                        var->sqltype = SQL_TEXT;
                                } else {
                                        convert_to_long(b_var);
-                                       var->sqldata = (void ISC_FAR *) 
(&Z_LVAL_P(b_var));
+                                       var->sqldata = (void *) (&Z_LVAL_P(b_var));
                                }
                                break;
                        case SQL_FLOAT:
                                convert_to_double(b_var);
                                buf[i].val.fval = (float) Z_DVAL_P(b_var);
-                               var->sqldata = (void ISC_FAR *) (&buf[i].val.fval);
+                               var->sqldata = (void *) (&buf[i].val.fval);
                                break;
                        case SQL_DOUBLE:  /* direct to variable */
                                convert_to_double(b_var);
-                               var->sqldata = (void ISC_FAR *) (&Z_DVAL_P(b_var));
+                               var->sqldata = (void *) (&Z_DVAL_P(b_var));
                                break;
 #ifdef SQL_INT64
                        case SQL_INT64:
@@ -1383,7 +1383,7 @@
                                  to avoid rounding errors...
                                */
                                convert_to_string(b_var);
-                               var->sqldata = (void ISC_FAR *) Z_STRVAL_P(b_var);
+                               var->sqldata = (void *) Z_STRVAL_P(b_var);
                                var->sqllen      = Z_STRLEN_P(b_var);
                                var->sqltype = SQL_TEXT;
                                break;
@@ -1415,7 +1415,7 @@
                                        t.tm_year -= 1900;
                                        t.tm_mon--;
                                        isc_encode_date(&t, &buf[i].val.qval);
-                                       var->sqldata = (void ISC_FAR *) 
(&buf[i].val.qval);
+                                       var->sqldata = (void *) (&buf[i].val.qval);
                                }
 #else
                                /*
@@ -1426,7 +1426,7 @@
                                  ask Sascha?
                                */
                                convert_to_string(b_var);
-                               var->sqldata = (void ISC_FAR *) Z_STRVAL_P(b_var);
+                               var->sqldata = (void *) Z_STRVAL_P(b_var);
                                var->sqllen = Z_STRLEN_P(b_var);
                                var->sqltype = SQL_TEXT;
 #endif
@@ -1438,23 +1438,23 @@
 #ifndef SQL_TIMESTAMP
                                        strptime(Z_STRVAL_P(b_var), 
IBG(timestampformat), &t);
                                        isc_encode_date(&t, &buf[i].val.qval);
-                                       var->sqldata = (void ISC_FAR *) 
(&buf[i].val.qval);
+                                       var->sqldata = (void *) (&buf[i].val.qval);
 #else
                                        switch (var->sqltype & ~1) {
                                                case SQL_TIMESTAMP:
                                                        strptime(Z_STRVAL_P(b_var), 
IBG(timestampformat), &t);
                                                        isc_encode_timestamp(&t, 
&buf[i].val.tsval);
-                                                       var->sqldata = (void ISC_FAR 
*) (&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 ISC_FAR 
*) (&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 ISC_FAR 
*) (&buf[i].val.tmval);
+                                                       var->sqldata = (void *) 
(&buf[i].val.tmval);
                                                        break;
                                        }
 #endif
@@ -1485,7 +1485,7 @@
                                        }
                                        buf[i].val.qval = ib_blob.bl_qd;
                                }
-                               var->sqldata = (void ISC_FAR *) &buf[i].val.qval;
+                               var->sqldata = (void *) &buf[i].val.qval;
                                break;
                        case SQL_ARRAY:
                                _php_ibase_module_error("Binding arrays not supported 
yet" TSRMLS_CC);
@@ -2591,7 +2591,7 @@
                                                unsigned short i;
        
                                                blob_handle.bl_handle = NULL;
-                                               blob_handle.bl_qd = *(ISC_QUAD ISC_FAR 
*) var->sqldata;
+                                               blob_handle.bl_qd = *(ISC_QUAD *) 
var->sqldata;
                        
                                                if (isc_open_blob(IB_STATUS, 
&ib_result->link->handle, &ib_result->trans->handle, &blob_handle.bl_handle, 
&blob_handle.bl_qd)) {
                                                        _php_ibase_error(TSRMLS_C);
@@ -2637,13 +2637,13 @@
                                                }
        
                                        } else { /* blob id only */
-                                               ISC_QUAD bl_qd = *(ISC_QUAD ISC_FAR *) 
var->sqldata;
+                                               ISC_QUAD bl_qd = *(ISC_QUAD *) 
var->sqldata;
                                                
ZVAL_STRINGL(&tmp,_php_ibase_quad_to_string(bl_qd), BLOB_ID_LEN, 0);
                                        }
                                        break;
                                case SQL_ARRAY: {
                                        if (flag & PHP_IBASE_FETCH_ARRAYS) { /* array 
can be *huge* so only fetch if asked */
-                                               ISC_QUAD ar_qd = *(ISC_QUAD ISC_FAR *) 
var->sqldata;
+                                               ISC_QUAD ar_qd = *(ISC_QUAD *) 
var->sqldata;
                                                ibase_array *ib_array = 
&ib_result->out_array[arr_cnt];
                                                void *ar_data;
                                                char *tmp_ptr;
@@ -2664,7 +2664,7 @@
                                                efree(ar_data);
 
                                        } else { /* blob id only */
-                                               ISC_QUAD ar_qd = *(ISC_QUAD ISC_FAR *) 
var->sqldata;
+                                               ISC_QUAD ar_qd = *(ISC_QUAD *) 
var->sqldata;
                                                
ZVAL_STRINGL(&tmp,_php_ibase_quad_to_string(ar_qd), BLOB_ID_LEN, 0);
                                        }
                                }
Index: php-src/ext/interbase/php_interbase.h
diff -u php-src/ext/interbase/php_interbase.h:1.57 
php-src/ext/interbase/php_interbase.h:1.58
--- php-src/ext/interbase/php_interbase.h:1.57  Wed Aug 27 18:55:06 2003
+++ php-src/ext/interbase/php_interbase.h       Tue Sep  2 18:37:26 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_interbase.h,v 1.57 2003/08/27 22:55:06 abies Exp $ */
+/* $Id: php_interbase.h,v 1.58 2003/09/02 22:37:26 abies Exp $ */
 
 #ifndef PHP_INTERBASE_H
 #define PHP_INTERBASE_H
@@ -132,7 +132,7 @@
        ISC_ARRAY_DESC ar_desc;
        int el_type, /* sqltype kinda SQL_TEXT, ...*/
                el_size; /* element size in bytes */
-       ISC_LONG ISC_FAR ar_size; /* all array size in bytes */
+       ISC_LONG ar_size; /* all array size in bytes */
 } ibase_array;
 
 typedef struct {
@@ -146,10 +146,9 @@
        ibase_trans *trans;
        isc_stmt_handle stmt;
        unsigned short type;
+       unsigned char has_more_rows, statement_type;
        XSQLDA *out_sqlda;
        ibase_array *out_array;
-       unsigned char has_more_rows;
-       char statement_type;
 } ibase_result;
 
 typedef struct {
@@ -163,12 +162,12 @@
        unsigned short dialect;
        char statement_type;
        char *query;
-       int trans_res_id;
+       long trans_res_id;
 } ibase_query;
 
 typedef struct {
        ibase_db_link *link;
-       int link_res_id;
+       long link_res_id;
        ISC_LONG event_id;
        unsigned short event_count;
        char **events;

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

Reply via email to