[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/geas/src/objectstore objectstore.c postgre...
From: |
Reinhard Mueller |
Subject: |
gnue/geas/src/objectstore objectstore.c postgre... |
Date: |
Tue, 22 May 2001 13:06:22 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: Reinhard Mueller <address@hidden> 01/05/22 13:06:21
Modified files:
geas/src/objectstore: objectstore.c postgresql_access.h
Log message:
fixed all compiler warnings
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectstore/objectstore.c.diff?cvsroot=OldCVS&tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/objectstore/postgresql_access.h.diff?cvsroot=OldCVS&tr1=1.26&tr2=1.27&r1=text&r2=text
Patches:
Index: gnue/geas/src/objectstore/objectstore.c
diff -u gnue/geas/src/objectstore/objectstore.c:1.54
gnue/geas/src/objectstore/objectstore.c:1.55
--- gnue/geas/src/objectstore/objectstore.c:1.54 Tue May 22 12:05:11 2001
+++ gnue/geas/src/objectstore/objectstore.c Tue May 22 13:06:21 2001
@@ -19,7 +19,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: objectstore.c,v 1.54 2001/05/22 19:05:11 reinhard Exp $
+ $Id: objectstore.c,v 1.55 2001/05/22 20:06:21 reinhard Exp $
*/
#include "config.h"
@@ -222,10 +222,7 @@
{
struct database_handle *h = NULL;
struct query_result *retval = NULL;
- struct query_result *cacheresult = NULL;
struct query_result *storeresult = NULL;
- struct active_connection *con = NULL;
- GList *l;
const char *database = get_first_active_database (configdata); /*
HACK */
/* TODO: database dependant quote mode selection */
@@ -282,8 +279,6 @@
{
struct database_handle *h = NULL;
struct query_result *retval = NULL;
- struct active_connection *con = NULL;
- GList *l;
const char *database = get_first_active_database (configdata); /*
HACK */
trace_functioncall ();
@@ -322,8 +317,6 @@
{
struct database_handle *h = NULL;
struct query_result *retval = NULL;
- struct active_connection *con = NULL;
- GList *l;
const char *database = get_first_active_database (configdata); /*
HACK */
trace_functioncall ();
@@ -360,9 +353,7 @@
{
struct database_handle *h = NULL;
struct query_result *retval = NULL;
- struct active_connection *con = NULL;
- GList *l;
- const char *database = get_first_active_database (configdata); /*
HACK */
+ const char *database = get_first_active_database (configdata); /* HACK */
trace_functioncall ();
if (!cachedobject)
@@ -530,6 +521,7 @@
}
/* self_test_message( "Initialised %d databases" ,
g_list_length(database_list) ); */
+ return (succeeded);
}
/* ------------------------------------------------------------------------- *\
@@ -562,6 +554,7 @@
if (database_list)
g_list_free (database_list);
database_list = NULL;
+ return (TRUE);
}
/* ========================================================================= *\
Index: gnue/geas/src/objectstore/postgresql_access.h
diff -u gnue/geas/src/objectstore/postgresql_access.h:1.26
gnue/geas/src/objectstore/postgresql_access.h:1.27
--- gnue/geas/src/objectstore/postgresql_access.h:1.26 Tue May 22 12:05:12 2001
+++ gnue/geas/src/objectstore/postgresql_access.h Tue May 22 13:06:21 2001
@@ -19,7 +19,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: postgresql_access.h,v 1.26 2001/05/22 19:05:12 reinhard Exp $
+ $Id: postgresql_access.h,v 1.27 2001/05/22 20:06:21 reinhard Exp $
*/
/* This is not really a header file. It's rather a piece of code that is
@@ -83,8 +83,6 @@
{
struct postgresql_handle *h = (struct postgresql_handle *) hnd;
struct active_connection *retval = NULL;
- struct active_connection *tmp = NULL;
- unsigned long int queue = UINT_MAX;
int i;
/*
@@ -140,7 +138,6 @@
static gboolean
postgresql_connect (struct database_handle *hnd, unsigned long int index)
{
- struct postgresql_handle *h = (struct postgresql_handle *) hnd;
gboolean retval = FALSE;
struct postgresql_connection *c;
char *pgoptions, *pgtty;
@@ -166,7 +163,7 @@
/* TODO: imaginary thread safety for andrewm. */
if (!c->base.connected)
{
- sprintf (tmpport, "%d", hnd->port);
+ sprintf (tmpport, "%lu", hnd->port);
c->handle =
PQsetdbLogin (hnd->hostname, tmpport, pgoptions, pgtty,
hnd->dbname, hnd->username, hnd->password);
@@ -212,7 +209,6 @@
static gboolean
postgresql_disconnect (struct database_handle *hnd, unsigned long int index)
{
- struct postgresql_handle *h = (struct postgresql_handle *) hnd;
struct postgresql_connection *c;
/* range check */
@@ -245,14 +241,12 @@
int dbtype;
struct query_result *result = new_query_result (); /* result pointer */
/* convert to actual type */
- struct postgresql_handle *h = (struct postgresql_handle *) ph;
struct postgresql_connection *conn;
odl_class *c;
char *fieldname;
PGresult *res = NULL;
- int nfields, nrows;
- int row, i;
+ int row;
int tries = 0;
int PQerrorcode;
@@ -317,7 +311,6 @@
/* for each entry, extract object ID */
for (row = 0; row < result->rows_affected; row++)
{
- char *keydata = "";
int i;
DatabaseResultRow_t r = NULL;
@@ -544,15 +537,14 @@
PGresult *res;
char *buf;
char tmpport[20];
- GList *l;
- int i, j, row;
+ int i, row;
DatabaseDefinition *db = NULL;
db = create_database_definition (h->base.name);
if (!db)
return (NULL);
- sprintf (tmpport, "%d", hnd->port);
+ sprintf (tmpport, "%lu", hnd->port);
/* connect to database */
handle =
PQsetdbLogin (hnd->hostname, tmpport, NULL, NULL, hnd->dbname,
@@ -599,9 +591,7 @@
for (i = 0; i < count_database_tables (db); i++)
{
DatabaseTable *tab = get_database_table (db, i);
- DatabaseColumn *c;
enum odl_fieldtype type;
- int err;
/* get list of fields and types */
/* printf( "handling table '%s'\n" , tab->name ); */
@@ -744,12 +734,11 @@
GString *buf;
DatabaseChange *changes = NULL;
GList *required = NULL;
- GList *tmp, *l;
+ GList *tmp;
char tmpport[20];
DatabaseDefinition *database = NULL;
PGconn *handle;
PGresult *res;
- int err;
FILE *changefile;
debug_output (DEBUGLEVEL_HIGH, "pg - updating the tables");
@@ -820,7 +809,7 @@
return (NULL);
}
/* connect to database */
- sprintf (tmpport, "%d", hnd->port);
+ sprintf (tmpport, "%lu", hnd->port);
handle =
PQsetdbLogin (hnd->hostname, tmpport, NULL, NULL, hnd->dbname,
hnd->username, hnd->password);
@@ -865,7 +854,7 @@
{
/* TODO: error handling */
errormsg ("[%s] failed", buf->str);
- errormsg (PQresultErrorMessage (res));
+ errormsg ("%s", PQresultErrorMessage (res));
}
@@ -903,7 +892,7 @@
{
/* TODO: error handling */
message ("[%s] failed", buf->str);
- errormsg (PQresultErrorMessage (res));
+ errormsg ("%s", PQresultErrorMessage (res));
}
g_string_free (buf, TRUE);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/geas/src/objectstore objectstore.c postgre...,
Reinhard Mueller <=