From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: make-uniform-vector bit vector versus array-set! Date: Sun, 26 Feb 2006 07:44:59 +1100 Message-ID: <87zmkfuq0k.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1140900351 4261 80.91.229.2 (25 Feb 2006 20:45:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2006 20:45:51 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Feb 25 21:45:50 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FD6IV-00064L-Ik for guile-devel@m.gmane.org; Sat, 25 Feb 2006 21:45:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FD6IY-0001tv-He for guile-devel@m.gmane.org; Sat, 25 Feb 2006 15:45:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FD6IO-0001fw-Lq for guile-devel@gnu.org; Sat, 25 Feb 2006 15:45:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FD6IM-0001Vu-7U for guile-devel@gnu.org; Sat, 25 Feb 2006 15:45:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FD6IL-0001UK-OI for guile-devel@gnu.org; Sat, 25 Feb 2006 15:45:37 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FD6Ig-0003cP-Kn for guile-devel@gnu.org; Sat, 25 Feb 2006 15:46:00 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (Postfix) with ESMTP id EC0463297B9; Sun, 26 Feb 2006 07:45:24 +1100 (EST) Original-Received: from localhost (ppp2575.dyn.pacific.net.au [61.8.37.117]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k1PKjMmR015019; Sun, 26 Feb 2006 07:45:23 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1FD6Hj-0001s3-00; Sun, 26 Feb 2006 07:44:59 +1100 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) 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:5745 Archived-At: --=-=-= In 1.8 there seems to be something a bit evil in array-set! on a bit vector created by make-uniform-vector, guile> (define a (make-uniform-vector 15 #t #t)) guile> a #*111111111111111 guile> (array-set! a #f 0) guile> a (2207 . #) I don't understand all that stuff, but I got some joy from this change. Can someone (Marius?) confirm or deny? * unif.c (bitvector_set): Should be h->writable_elements not h->elements, the latter results in a segv in array-set! on a bit vector. --=-=-= Content-Disposition: attachment; filename=unif.c.writable_elements.diff --- unif.c.~1.192.2.2.~ 2006-02-14 08:59:03.000000000 +1100 +++ unif.c 2006-02-25 18:22:35.000000000 +1100 @@ -380,9 +380,9 @@ pos += scm_array_handle_bit_elements_offset (h); mask = 1l << (pos % 32); if (scm_to_bool (val)) - ((scm_t_uint32 *)h->elements)[pos/32] |= mask; + ((scm_t_uint32 *)h->writable_elements)[pos/32] |= mask; else - ((scm_t_uint32 *)h->elements)[pos/32] &= ~mask; + ((scm_t_uint32 *)h->writable_elements)[pos/32] &= ~mask; } static void --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--