From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#32644: bytevector bug Date: Thu, 06 Sep 2018 13:27:11 -0400 Message-ID: <87a7ousfio.fsf@netris.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536254838 20766 195.159.176.226 (6 Sep 2018 17:27:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2018 17:27:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32644@debbugs.gnu.org To: Stefan Israelsson Tampe Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Sep 06 19:27:04 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxy3Z-0004zc-RG for guile-bugs@m.gmane.org; Thu, 06 Sep 2018 19:27:01 +0200 Original-Received: from localhost ([::1]:34792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxy5f-0001jg-VU for guile-bugs@m.gmane.org; Thu, 06 Sep 2018 13:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxy5a-0001iV-Uj for bug-guile@gnu.org; Thu, 06 Sep 2018 13:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxy5W-0008WT-Nt for bug-guile@gnu.org; Thu, 06 Sep 2018 13:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxy5W-0008WO-JO for bug-guile@gnu.org; Thu, 06 Sep 2018 13:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fxy5W-0003JS-F9 for bug-guile@gnu.org; Thu, 06 Sep 2018 13:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 06 Sep 2018 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32644 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 32644-submit@debbugs.gnu.org id=B32644.153625493712722 (code B ref 32644); Thu, 06 Sep 2018 17:29:02 +0000 Original-Received: (at 32644) by debbugs.gnu.org; 6 Sep 2018 17:28:57 +0000 Original-Received: from localhost ([127.0.0.1]:48345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxy5R-0003J8-4r for submit@debbugs.gnu.org; Thu, 06 Sep 2018 13:28:57 -0400 Original-Received: from world.peace.net ([64.112.178.59]:45188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxy5O-0003Ip-Ja for 32644@debbugs.gnu.org; Thu, 06 Sep 2018 13:28:55 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxy5I-0001rS-Lm; Thu, 06 Sep 2018 13:28:48 -0400 In-Reply-To: (Stefan Israelsson Tampe's message of "Wed, 5 Sep 2018 19:53:02 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9150 Archived-At: Stefan Israelsson Tampe writes: > The code velow does not compile when the define-inlinable of id is active. If in stead > id defined by define is used it all compiles just fine. > > Tested on latest tar ball for guile 2.4 Did you mean to write guile 2.2.4? Mark > ------------------------------------------- > (use-modules (rnrs bytevectors)) > > (define-inlinable (id x) x) > ;(define (id x) x) > (define-syntax-rule (mkcrc crc_hqx high xor mask) > (define (crc_hqx data value) > (let ((n (bytevector-length data)) > (d data)) > (let lp ((i 0) (v value)) > (if (< i n) > (let ((b (id (bytevector-u8-ref d i)))) > (let lp2 ((j 0) (x 1) (v v)) > (if (> j -8) > (let ((bit (ash (logand x b) j)) > (hbit (logand v high))) > (if (= hbit 0) > (lp2 (- j 1) (ash x 1) (logior bit (ash v 1))) > (lp2 (- j 1) (ash x 1) (logxor > xor > (logand mask > (logior > bit > (ash v 1))))))) > (lp (+ i 1) v)))) > v))))) > > (mkcrc crc_hqx #x8000 #x1021 #xffff) > (mkcrc crc32 #x80000000 #x04c11db7 #xffffffff)