Raymond Toy pushed to branch issue-367-count-octets-for-encoding at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/pcl/simple-streams/external-formats/mac-roman.lisp
    ... ... @@ -49,4 +49,19 @@ character and illegal outputs are replaced by a question mark.")
    49 49
     				(declare (optimize (ext:inhibit-warnings 3)))
    
    50 50
     			      (funcall ,error "Cannot output codepoint #x~X to MAC-ROMAN stream"
    
    51 51
     				       ,code))
    
    52
    -			    #x3F)))))))
    52
    +			    #x3F))))))
    
    53
    +  ()
    
    54
    +  ()
    
    55
    +  (octet-count (code state error present)
    
    56
    +    `(if (< ,code 128)
    
    57
    +	 1
    
    58
    +	 (let ((,present (get-inverse ,itable ,code)))
    
    59
    +	   (if ,present
    
    60
    +	       1
    
    61
    +	       (if ,error
    
    62
    +		   (locally
    
    63
    +		       ;; No warnings about fdefinition
    
    64
    +		       (declare (optimize (ext:inhibit-warnings 3)))
    
    65
    +		     (funcall ,error "Cannot output codepoint #x~X to MAC-ROMAN stream"
    
    66
    +			      ,code))
    
    67
    +		   1))))))

  • tests/external-formats.lisp
    ... ... @@ -108,5 +108,8 @@
    108 108
         (:tag :octet-count)
    
    109 109
       (test-octet-count *test-iso8859-1* :iso8859-15))
    
    110 110
     
    
    111
    -
    
    111
    +(define-test octet-count.mac-roman
    
    112
    +    (:tag :octet-count)
    
    113
    +  (test-octet-count *test-iso8859-1* :mac-roman))
    
    114
    +  
    
    112 115