From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ludovic =?iso-8859-1?Q?Court=E8s?= Newsgroups: gmane.lisp.guile.devel Subject: Fixing a few C99isms Date: Wed, 4 May 2005 17:52:51 +0200 Message-ID: <20050504155219.GA8471@cassis.laas.fr> Reply-To: ludovic.courtes@laas.fr NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115244645 10483 80.91.229.2 (4 May 2005 22:10:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 May 2005 22:10:45 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 05 00:10:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DTS4D-0005xN-Eg for guile-devel@m.gmane.org; Thu, 05 May 2005 00:10:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTSBb-0001ie-Io for guile-devel@m.gmane.org; Wed, 04 May 2005 18:17:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DTN7a-0000oq-5h for guile-devel@gnu.org; Wed, 04 May 2005 12:53:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DTN7V-0000lx-KJ for guile-devel@gnu.org; Wed, 04 May 2005 12:53:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTN7V-0000lg-BZ for guile-devel@gnu.org; Wed, 04 May 2005 12:53:09 -0400 Original-Received: from [213.228.0.62] (helo=postfix4-1.free.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DTNB4-000802-Sl for guile-devel@gnu.org; Wed, 04 May 2005 12:56:51 -0400 Original-Received: from cassis.glacis.crous (languedoc-5-82-225-111-76.fbx.proxad.net [82.225.111.76]) by postfix4-1.free.fr (Postfix) with ESMTP id ADF77317A0B for ; Wed, 4 May 2005 18:51:45 +0200 (CEST) Original-Received: by cassis.glacis.crous (Postfix, from userid 1000) id 4A7B13E06E; Wed, 4 May 2005 17:52:52 +0200 (CEST) Original-To: guile-devel@gnu.org Content-Disposition: inline X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://ludo.humanoidz.org/ludovic.asc X-OS: GNU/Linux X-URL: http://ludo.humanoidz.org/ User-Agent: Mutt/1.5.4i [Guile enabled] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:4945 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4945 Hi, Guile 1.7.2 contains a few C99isms, namely local variable declarations in the middle of a block. GCC 3 expects C99 by default. However, older versions or other compilers may expect raw ANSI code. Here's a patch for this. Thanks, Ludovic. --- guile-1.7.2/libguile/gc-card.c~ 2005-03-09 22:16:56.000000000 +0100 +++ guile-1.7.2/libguile/gc-card.c 2005-05-04 17:35:25.000000000 +0200 @@ -308,7 +308,9 @@ for (p += offset; p < end; p += span, offset += span) { + scm_t_bits tag; SCM scmptr = PTR2SCM (p); + if (!SCM_C_BVEC_GET (bitvec, offset)) continue; @@ -312,7 +314,7 @@ if (!SCM_C_BVEC_GET (bitvec, offset)) continue; - scm_t_bits tag = SCM_TYP7 (scmptr); + tag = SCM_TYP7 (scmptr); if (tag == scm_tc7_smob) { tag = SCM_TYP16(scmptr); @@ -338,12 +340,16 @@ break; } - SCM tag_as_scm = scm_from_int (tag); - SCM current = scm_hashq_ref (hashtab, tag_as_scm, SCM_I_MAKINUM (0)); + { + SCM tag_as_scm, current; + + tag_as_scm = scm_from_int (tag); + current = scm_hashq_ref (hashtab, tag_as_scm, SCM_I_MAKINUM (0)); scm_hashq_set_x (hashtab, tag_as_scm, scm_from_int (scm_to_int (current) + 1)); } + } } --- guile-1.7.2/libguile/gc.c~ 2005-03-03 23:12:32.000000000 +0100 +++ guile-1.7.2/libguile/gc.c 2005-05-04 17:18:57.000000000 +0200 @@ -292,10 +292,11 @@ "Return an alist of statistics of the current live objects. ") #define FUNC_NAME s_scm_gc_live_object_stats { + SCM alist; SCM tab = scm_make_hash_table (scm_from_int (57)); scm_i_all_segments_statistics (tab); - SCM alist + alist = scm_internal_hash_fold (&tag_table_to_type_alist, NULL, SCM_EOL, tab); return alist; --- guile-1.7.2/libguile/threads.c~ 2005-03-09 22:16:56.000000000 +0100 +++ guile-1.7.2/libguile/threads.c 2005-05-04 17:34:58.000000000 +0200 @@ -882,8 +882,8 @@ "thread. That is, Guile's mutexes are @emph{recursive}. ") #define FUNC_NAME s_scm_lock_mutex { - SCM_VALIDATE_MUTEX (1, mx); char *msg; + SCM_VALIDATE_MUTEX (1, mx); msg = fat_mutex_lock (mx); if (msg) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel