From d9df2f28b224c955dd452de888d331be1a32f15c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 6 Feb 2017 21:49:15 -0800 Subject: [PATCH] Fix bug: typo broke linear dispatch coding. --- src/etc/ucd-converter.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/etc/ucd-converter.scm b/src/etc/ucd-converter.scm index 304ebd3c3..4b4e6cfb5 100644 --- a/src/etc/ucd-converter.scm +++ b/src/etc/ucd-converter.scm @@ -641,10 +641,10 @@ USA. (and (pair? indexes) (pair? (cdr indexes)) (let ((slope (- (cadr indexes) (car indexes)))) - (let loop ((indexes (cdr indexes))) - (if (pair? (cdr indexes)) - (and (= slope (- (cadr indexes) (car indexes))) - (loop (cdr indexes))) + (let loop ((indexes* (cdr indexes))) + (if (pair? (cdr indexes*)) + (and (= slope (- (cadr indexes*) (car indexes*))) + (loop (cdr indexes*))) (linear-coder slope indexes)))))) (define (linear-coder slope indexes) @@ -662,7 +662,7 @@ USA. (make-index-code power) (code:* slope (make-index-code 0))))))) (if (< slope 0) - (code:+ (last indexes) (make-offset (- slope))) + (code:- (car indexes) (make-offset (- slope))) (code:+ (car indexes) (make-offset slope))))))) (define (try-8-bit-direct indexes) @@ -712,6 +712,10 @@ USA. ((eqv? 0 b) a) (else `(fix:+ ,a ,b)))) +(define (code:- a b) + (cond ((eqv? 0 b) a) + (else `(fix:- ,a ,b)))) + (define (code:* a b) (cond ((or (eqv? 0 a) (eqv? 0 b)) 0) ((eqv? 1 a) b) -- 2.25.1