[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/12] Guile-DBI: minor cleanup
From: |
Linas Vepstas |
Subject: |
[PATCH 2/12] Guile-DBI: minor cleanup |
Date: |
Fri, 19 Sep 2008 09:05:04 -0500 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
Minor cleanup:
-- avoid forward decarations
-- rename confusingly named function
-- free function should return zero, per current guile specs.
-- remove deprecated header
-- fix typo
Signed-off-by: Linas Vepstas <address@hidden>
---
include/guile-dbi/guile-dbi.h | 10 +++-------
src/guile-dbi.c | 14 ++++----------
2 files changed, 7 insertions(+), 17 deletions(-)
Index: guile-dbi-2.0.0/src/guile-dbi.c
===================================================================
--- guile-dbi-2.0.0.orig/src/guile-dbi.c 2008-09-16 17:26:58.000000000
-0500
+++ guile-dbi-2.0.0/src/guile-dbi.c 2008-09-16 19:54:42.000000000 -0500
@@ -29,11 +29,6 @@
static scm_t_bits g_db_handle_tag;
-static SCM mark_db_handle (SCM g_db_handle_smob);
-static size_t free_db_handle (SCM g_db_handle_smob);
-static int print_db_handle (SCM g_db_handle_smob, SCM port,
- scm_print_state* pstate);
-
#define DBI_SMOB_P(obj) ((SCM_NIMP(obj)) && (SCM_TYP16(obj)==g_db_handle_tag))
@@ -154,7 +149,7 @@ SCM_DEFINE (close_g_db_handle, "dbi-clos
#define FUNC_NAME s_close_db_handle
{
struct g_db_handle *g_db_handle = NULL;
- void (*dbi_close)(gdbi_db_handle_t*);
+ void (*dbd_close)(gdbi_db_handle_t*);
SCM_ASSERT (DBI_SMOB_P(db_handle), db_handle, SCM_ARG1, "close_g_db_handle");
g_db_handle = (struct g_db_handle*)SCM_SMOB_DATA(db_handle);
@@ -164,12 +159,12 @@ SCM_DEFINE (close_g_db_handle, "dbi-clos
return SCM_UNSPECIFIED;
}
- __gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbi_close);
+ __gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbd_close);
if (scm_equal_p (SCM_CAR(g_db_handle->status),scm_from_int(0)) == SCM_BOOL_F)
{
return SCM_UNSPECIFIED;
}
- (*dbi_close)(g_db_handle);
+ (*dbd_close)(g_db_handle);
if (g_db_handle->handle)
{
dlclose(g_db_handle->handle);
@@ -185,7 +180,6 @@ static size_t
free_db_handle (SCM g_db_handle_smob)
{
struct g_db_handle *g_db_handle = NULL;
- size_t size = sizeof(struct g_db_handle);
g_db_handle = (struct g_db_handle*)SCM_SMOB_DATA(g_db_handle_smob);
close_g_db_handle(g_db_handle_smob);
@@ -196,7 +190,7 @@ free_db_handle (SCM g_db_handle_smob)
}
SCM_SETCDR (g_db_handle_smob, (SCM)NULL);
- return (size);
+ return 0;
}
Index: guile-dbi-2.0.0/include/guile-dbi/guile-dbi.h
===================================================================
--- guile-dbi-2.0.0.orig/include/guile-dbi/guile-dbi.h 2008-09-16
19:03:18.000000000 -0500
+++ guile-dbi-2.0.0/include/guile-dbi/guile-dbi.h 2008-09-16
19:53:09.000000000 -0500
@@ -17,17 +17,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * Process this file with autoconf to produce a configure script. */
+ */
#ifndef __GUILE_DBI_H__
#define __GUILE_DBI_H__
-
#include <libguile.h>
-#include <guile/gh.h>
-
/* guile smob struct */
typedef struct g_db_handle
@@ -50,8 +46,8 @@ void init_dbi(void);
-/* dbd dynamyc wrapper stuff */
+/* dbd dynamic wrapper stuff */
void __gdbi_dbd_wrap(gdbi_db_handle_t* dbh, char* function_name,
void** function_pointer);
-/* end dbd dynamyc wrapper stuff */
+/* end dbd dynamic wrapper stuff */
#endif
signature.asc
Description: Digital signature
- PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres, Linas Vepstas, 2008/09/19
- [PATCH 1/12] Guile-DBI: Avoid multiple init, Linas Vepstas, 2008/09/19
- [PATCH 2/12] Guile-DBI: minor cleanup,
Linas Vepstas <=
- [PATCH 3/12] Guile-DBI: Fix memory leak, Linas Vepstas, 2008/09/19
- [PATCH 4/12] Guile-DBII: replace deprecated gh_ functions, Linas Vepstas, 2008/09/19
- [PATCH 6/12] Guile-DBI: Fix crash, avoid recursive free, Linas Vepstas, 2008/09/19
- [PATCH 5/12] Guile-DBI: Use remember_upto_here, Linas Vepstas, 2008/09/19
- [PATCH 7/12] Guile-DBI: Don't cast away const, Linas Vepstas, 2008/09/19
- [PATCH 8/12] Guile-DBD-postgres: Fix handling of float point columns, Linas Vepstas, 2008/09/19
- [PATCH 9/12] Guile-DBD-postgres: Avoid discouraged functions, Linas Vepstas, 2008/09/19
- [PATCH 10/12] Guile-DBD-postgres: Fix off-by-one when fetching rows, Linas Vepstas, 2008/09/19
- [PATCH 11/12] Guile-DBD-postgres: Avoid deprecated functions, Linas Vepstas, 2008/09/19
- [PATCH 12/12] Guile-DBD-postgres: Crash in GC, Linas Vepstas, 2008/09/19