From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: [PATCH 2/12] Guile-DBI: minor cleanup Date: Fri, 19 Sep 2008 09:05:04 -0500 Message-ID: <20080919140504.GB13684@linas.org> References: <3ae3aa420809190645o2fe2b746id80f53c5cb123e5b@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3lcZGd9BuhuYXNfi" X-Trace: ger.gmane.org 1221833563 5337 80.91.229.12 (19 Sep 2008 14:12:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2008 14:12:43 +0000 (UTC) Cc: Guile User Mailing List To: Maurizio Boriani Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Sep 19 16:13:39 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KggeQ-0003Qi-Tp for guile-user@m.gmane.org; Fri, 19 Sep 2008 16:08:05 +0200 Original-Received: from localhost ([127.0.0.1]:51802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KggdA-0005yh-L9 for guile-user@m.gmane.org; Fri, 19 Sep 2008 10:06:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kggbf-0005Ub-EW for guile-user@gnu.org; Fri, 19 Sep 2008 10:05:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kggbc-0005TS-VB for guile-user@gnu.org; Fri, 19 Sep 2008 10:05:10 -0400 Original-Received: from [199.232.76.173] (port=57078 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kggbc-0005TL-Le for guile-user@gnu.org; Fri, 19 Sep 2008 10:05:08 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.246]:48320) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kggbc-00034I-Bn for guile-user@gnu.org; Fri, 19 Sep 2008 10:05:08 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so496486rvb.6 for ; Fri, 19 Sep 2008 07:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:from; bh=HhaEYL8emuoKtMheDvTZbiPAQFOrjiVlmYVZYcjdeKE=; b=YtWeeVm9q4PAYy/KtOvUDmAc2QXbScsa+naHjP0Kd57+Pplqtt10s+VVnQjPqcXev2 hlXFEyvBvFfUCZn/jDx/l0HKzp/OzEtWe0cIW5t2bHHozFcS2RGbJMCYcrVnNrbvmHtp zlzdFnrpBMis/m5HVgUgKbTmNCQv/4mQdhna0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:from; b=co3ZRPaw+6UMveIK+EdcspYvibQsYGWGzmzyEmkE3c77+mue3pIz3k/+NVDnn+hirK baKzbn2a0tWNZ0mwuf6vLSXEnkLsrLgt1YFs+ut1EX5XLDJT+aQ1ZfqweqSbKLVmckqB roEm9kWLcaod+T+R7AzpphfRNym0Lwpa3uEBc= Original-Received: by 10.141.15.19 with SMTP id s19mr50853rvi.205.1221833107756; Fri, 19 Sep 2008 07:05:07 -0700 (PDT) Original-Received: from linas.org ( [67.100.217.179]) by mx.google.com with ESMTPS id 30sm1110657yxk.4.2008.09.19.07.05.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Sep 2008 07:05:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <3ae3aa420809190645o2fe2b746id80f53c5cb123e5b@mail.gmail.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6786 Archived-At: --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Minor cleanup: -- avoid forward decarations -- rename confusingly named function -- free function should return zero, per current guile specs. -- remove deprecated header=20 -- fix typo Signed-off-by: Linas Vepstas --- 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@ =20 =20 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); - =20 #define DBI_SMOB_P(obj) ((SCM_NIMP(obj)) && (SCM_TYP16(obj)=3D=3Dg_db_hand= le_tag)) =20 @@ -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 =3D NULL; - void (*dbi_close)(gdbi_db_handle_t*); + void (*dbd_close)(gdbi_db_handle_t*); =20 SCM_ASSERT (DBI_SMOB_P(db_handle), db_handle, SCM_ARG1, "close_g_db_hand= le"); g_db_handle =3D (struct g_db_handle*)SCM_SMOB_DATA(db_handle); @@ -164,12 +159,12 @@ SCM_DEFINE (close_g_db_handle, "dbi-clos return SCM_UNSPECIFIED; } =20 - __gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbi_close); = =20 + __gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbd_close); = =20 if (scm_equal_p (SCM_CAR(g_db_handle->status),scm_from_int(0)) =3D=3D SC= M_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=20 free_db_handle (SCM g_db_handle_smob) { struct g_db_handle *g_db_handle =3D NULL; - size_t size =3D sizeof(struct g_db_handle); =20 g_db_handle =3D (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) } =20 SCM_SETCDR (g_db_handle_smob, (SCM)NULL); - return (size); + return 0; } =20 =20 Index: guile-dbi-2.0.0/include/guile-dbi/guile-dbi.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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.00000= 0000 -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, U= SA - * - * Process this file with autoconf to produce a configure script. */ + */ =20 =20 #ifndef __GUILE_DBI_H__ #define __GUILE_DBI_H__ =20 - #include -#include - =20 /* guile smob struct */ typedef struct g_db_handle @@ -50,8 +46,8 @@ void init_dbi(void); =20 =20 =0C -/* 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 --3lcZGd9BuhuYXNfi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBSNOxkISDRXfAOJJBAQJ2pQf+KRRoFcgUadD0nyAf5itqIR0+xVbsuiuj R0tol6f/dgGAKOLb+BU8sgnb1PbPNq10oSuybomINOpdx1DlHD8rXvyRugFeeZ3B KH5/kCLAzESnhbDwkkPcI6G1SWTXZwU+dRFiogZyYmJZGBc/edCT/IkQKGg+I6ND 9W6jHCfthT4uWfon2U+pN7ppIS6xVpoIXjFABLpzPBzwXxQPoYrarcMweDXijPj3 TJ1GsoNy2jiXwSX+hSEqOo7t2a5PRC72JoxaHhPCY5l6icnb74qd93iQMxYB2xSw mJ0VjgWjRMllwBAJdA6rxWYSi9/25LP78KVEPBPgTB5sDknm4HD3Eg== =bc/m -----END PGP SIGNATURE----- --3lcZGd9BuhuYXNfi--