Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid using / in xsubstring and string-xcopy!, since srfi-13 is compi…

…led with (declare (fixnum))

This patch fixes #869

Signed-off-by: Peter Bex <peter.bex@xs4all.nl>
(cherry picked from commit 250fa01)
  • Loading branch information...
commit 186b26b9a8123c694483a1bcebac2d12c7b4e7f6 1 parent 047bae1
@mario-goulart mario-goulart authored committed
Showing with 19 additions and 7 deletions.
  1. +19 −7 srfi-13.scm
View
26 srfi-13.scm
@@ -1766,10 +1766,16 @@
((= 1 slen) ; Fast path for 1-char replication.
(make-string anslen (string-ref s start)))
+ ;; CHICKEN compiles this file with (declare (fixnum)), so
+ ;; flonum operations are not reliable. Since this clause
+ ;; just provides a shorter path to avoid calling
+ ;; %multispan-repcopy!, we comment it out and leave the
+ ;; fixnum declaration.
+ ;;
;; Selected text falls entirely within one span.
- ((= (floor (/ from slen)) (floor (/ to slen)))
- (##sys#substring s (+ start (modulo from slen))
- (+ start (modulo to slen))))
+ ;; ((= (floor (/ from slen)) (floor (/ to slen)))
+ ;; (##sys#substring s (+ start (modulo from slen))
+ ;; (+ start (modulo to slen))))
;; Selected text requires multiple spans.
(else (let ((ans (make-string anslen)))
@@ -1813,11 +1819,17 @@
((= 1 slen) ; Fast path for 1-char replication.
(##srfi13#string-fill! target (string-ref s start) tstart tend))
+ ;; CHICKEN compiles this file with (declare (fixnum)), so
+ ;; flonum operations are not reliable. Since this clause
+ ;; just provides a shorter path to avoid calling
+ ;; %multispan-repcopy!, we comment it out and leave the
+ ;; fixnum declaration.
+ ;;
;; Selected text falls entirely within one span.
- ((= (floor (/ sfrom slen)) (floor (/ sto slen)))
- (%string-copy! target tstart s
- (+ start (modulo sfrom slen))
- (+ start (modulo sto slen))))
+ ;; ((= (floor (/ sfrom slen)) (floor (/ sto slen)))
+ ;; (%string-copy! target tstart s
+ ;; (+ start (modulo sfrom slen))
+ ;; (+ start (modulo sto slen))))
;; Multi-span copy.
(else (%multispan-repcopy! target tstart s sfrom sto start end))))))
Please sign in to comment.
Something went wrong with that request. Please try again.