Fixed array pointers, no longer using void * in arithmetics.
authorMichael Meskes <[email protected]>
Tue, 8 Jan 2002 14:25:06 +0000 (14:25 +0000)
committerMichael Meskes <[email protected]>
Tue, 8 Jan 2002 14:25:06 +0000 (14:25 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/lib/data.c
src/interfaces/ecpg/lib/execute.c
src/interfaces/ecpg/lib/extern.h
src/interfaces/ecpg/preproc/type.c

index 976618ea92e07dddb1d7670e6b2c81af2dd32f1b..9e1125e09315c280eaad8b699c690524acdb94e7 100644 (file)
@@ -1188,5 +1188,9 @@ Sun Dec 23 13:08:36 CET 2001
 Mon Jan  7 12:18:01 CET 2002
 
        - Fixed parser to accept initializing expressions starting with "(".
+
+Tue Jan  8 15:16:37 CET 2002
+
+       - Fixed array pointers, no longer using void *.
        - Set ecpg version to 2.9.0.
         - Set library version to 3.3.0.
index 4d8e2096b44d3238266ef3e12ac4eb9c9ab50afc..54062bb67f14bb5eab6eccf501c58bae380c09fc 100644 (file)
@@ -14,7 +14,7 @@
 bool
 ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                 enum ECPGttype type, enum ECPGttype ind_type,
-                void *var, void *ind, long varcharsize, long offset,
+                char *var, char *ind, long varcharsize, long offset,
                 long ind_offset, bool isarray)
 {
        char       *pval = (char *) PQgetvalue(results, act_tuple, act_field);
index a17584bc8e01fb1eef5b6fb6172494b41d306dfd..c4053246d00a0fd5a8e60827f72fd784991f872f 100644 (file)
@@ -142,7 +142,7 @@ create_statement(int lineno, struct connection * connection, struct statement **
                                return false;
 
                        var->type = type;
-                       var->pointer = va_arg(ap, void *);
+                       var->pointer = va_arg(ap, char *);
 
                        /* if variable is NULL, the statement hasn't been prepared */
                        if (var->pointer == NULL)
@@ -157,12 +157,12 @@ create_statement(int lineno, struct connection * connection, struct statement **
                        var->offset = va_arg(ap, long);
 
                        if (var->arrsize == 0 || var->varcharsize == 0)
-                               var->value = *((void **) (var->pointer));
+                               var->value = *((char **) (var->pointer));
                        else
                                var->value = var->pointer;
 
                        var->ind_type = va_arg(ap, enum ECPGttype);
-                       var->ind_pointer = va_arg(ap, void *);
+                       var->ind_pointer = va_arg(ap, char *);
                        var->ind_varcharsize = va_arg(ap, long);
                        var->ind_arrsize = va_arg(ap, long);
                        var->ind_offset = va_arg(ap, long);
@@ -170,7 +170,7 @@ create_statement(int lineno, struct connection * connection, struct statement **
 
                        if (var->ind_type != ECPGt_NO_INDICATOR
                                        && (var->ind_arrsize == 0 || var->ind_varcharsize == 0))
-                               var->ind_value = *((void **) (var->ind_pointer));
+                               var->ind_value = *((char **) (var->ind_pointer));
                        else
                                var->ind_value = var->ind_pointer;
 
@@ -422,8 +422,8 @@ ECPGstore_result(const PGresult *results, int act_field,
                                len = var->offset * ntuples;
                                break;
                }
-               var->value = (void *) ECPGalloc(len, stmt->lineno);
-               *((void **) var->pointer) = var->value;
+               var->value = (char *) ECPGalloc(len, stmt->lineno);
+               *((char **) var->pointer) = var->value;
                ECPGadd_mem(var->value, stmt->lineno);
        }
 
@@ -431,8 +431,8 @@ ECPGstore_result(const PGresult *results, int act_field,
        if ((var->ind_arrsize == 0 || var->ind_varcharsize == 0) && var->ind_value == NULL && var->ind_pointer!=NULL)
        {
                int     len = var->ind_offset * ntuples;
-               var->ind_value = (void *) ECPGalloc(len, stmt->lineno);
-               *((void **) var->ind_pointer) = var->ind_value;
+               var->ind_value = (char *) ECPGalloc(len, stmt->lineno);
+               *((char **) var->ind_pointer) = var->ind_value;
                ECPGadd_mem(var->ind_value, stmt->lineno);
        }
        
index 478ec4b99f2ff02091707cc614bb974bd79a29b2..3fa935d6f0e75e06bdcab070bce0284f86c6e6db 100644 (file)
@@ -6,7 +6,7 @@
 void           ECPGadd_mem(void *ptr, int lineno);
 
 bool ECPGget_data(const PGresult *, int, int, int, enum ECPGttype type,
-                enum ECPGttype, void *, void *, long, long, long, bool);
+                enum ECPGttype, char *, char *, long, long, long, bool);
 struct connection *ECPGget_connection(const char *);
 void           ECPGinit_sqlca(void);
 char      *ECPGalloc(long, int);
index 6f6a6ff8d3a7d8d1c007f5ff4f5d06892817226c..c064f34d8be33a359ce66d89e2187645136dbb4c 100644 (file)
@@ -183,7 +183,7 @@ get_type(enum ECPGttype type)
 /* Dump a type.
    The type is dumped as:
    type-tag <comma>                               - enum ECPGttype
-   reference-to-variable <comma>   - void *
+   reference-to-variable <comma>                  - char *
    size <comma>                                           - long size of this field (if varchar)
    arrsize <comma>                                - long number of elements in the arr
    offset <comma>                                 - offset to the next element