aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2002-01-08 14:25:06 +0000
committerMichael Meskes <meskes@postgresql.org>2002-01-08 14:25:06 +0000
commit1e15f9e11925467ec8799175b13296eca2a15b98 (patch)
tree5b92eb1e18347a4480f1f538c24416abb6b205ac
parent055d4f9208b5bbd54caf33af676e6b15c53dcad5 (diff)
downloadpostgresql-1e15f9e11925467ec8799175b13296eca2a15b98.tar.gz
postgresql-1e15f9e11925467ec8799175b13296eca2a15b98.zip
Fixed array pointers, no longer using void * in arithmetics.
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/lib/data.c4
-rw-r--r--src/interfaces/ecpg/lib/execute.c18
-rw-r--r--src/interfaces/ecpg/lib/extern.h2
-rw-r--r--src/interfaces/ecpg/preproc/type.c2
5 files changed, 17 insertions, 13 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 976618ea92e..9e1125e0931 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -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.
diff --git a/src/interfaces/ecpg/lib/data.c b/src/interfaces/ecpg/lib/data.c
index 678dde39a79..b460331ff8f 100644
--- a/src/interfaces/ecpg/lib/data.c
+++ b/src/interfaces/ecpg/lib/data.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.21 2001/12/23 12:17:41 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.22 2002/01/08 14:25:04 meskes Exp $ */
#include "postgres_fe.h"
@@ -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);
diff --git a/src/interfaces/ecpg/lib/execute.c b/src/interfaces/ecpg/lib/execute.c
index c2f1e6bda48..dba99a1bd6c 100644
--- a/src/interfaces/ecpg/lib/execute.c
+++ b/src/interfaces/ecpg/lib/execute.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.34 2001/12/23 12:17:41 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.35 2002/01/08 14:25:04 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
@@ -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);
}
diff --git a/src/interfaces/ecpg/lib/extern.h b/src/interfaces/ecpg/lib/extern.h
index 478ec4b99f2..3fa935d6f0e 100644
--- a/src/interfaces/ecpg/lib/extern.h
+++ b/src/interfaces/ecpg/lib/extern.h
@@ -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);
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index 6f6a6ff8d3a..c064f34d8be 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -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