From 6707c35f1112aa22f13f97d4d3f233495f44e015 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 6 Mar 2010 18:35:03 +0200 Subject: Bugfixes. * src/mysql.c, src/pgsql.c: Use scm_from_ulong. * src/pgsql.c (s_pgsql_connect): Call gamma_parmlist_parse (ouch!) * src/gsql_conn.c, src/gsql_lib.c: Remove unused variables * src/guile-sql.h (gsql_conn_init) (sql_register_iface): New protos. --- src/pgsql.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pgsql.c') diff --git a/src/pgsql.c b/src/pgsql.c index c1a8e41..609fedb 100644 --- a/src/pgsql.c +++ b/src/pgsql.c @@ -59,6 +59,8 @@ s_pgsql_connect (SCM parmlist, const char *func_name) SCM smob; struct sql_connect *conn; + gamma_parmlist_parse (parmlist, dcltab, 0, func_name); + pgconn = PQsetdbLogin(hostname, port, NULL, NULL, dbname, user, pass); if (PQstatus(pgconn) == CONNECTION_BAD) { @@ -91,7 +93,7 @@ result_to_list(PGresult *res) int i, j; int ntuples = PQntuples(res); int nfields = PQnfields(res); - SCM row_head = SCM_EOL, row_tail; + SCM row_head = SCM_EOL, row_tail = SCM_EOL; for (i = 0; i < ntuples; i++) { SCM new_row; @@ -123,7 +125,7 @@ s_pgsql_query(struct sql_connect *conn, const char *query) { PGconn *pgconn = (PGconn*) conn->data; PGresult *res; - SCM cell; + SCM cell = SCM_EOL; ExecStatusType stat; res = PQexec(pgconn, query); @@ -137,7 +139,7 @@ s_pgsql_query(struct sql_connect *conn, const char *query) switch (stat) { case PGRES_COMMAND_OK: /* Successful completion of a command returning no data */ - cell = scm_to_ulong(strtoul(PQcmdTuples(res), NULL, 0)); + cell = scm_from_ulong(strtoul(PQcmdTuples(res), NULL, 0)); break; case PGRES_TUPLES_OK: /* The query successfully executed */ -- cgit v1.2.1