Changeset 35446 in project


Ignore:
Timestamp:
04/26/18 12:33:32 (4 months ago)
Author:
evhan
Message:

buffer-ports 0.8: Apply read-byte fix from Simon Haines

Location:
release/4/buffer-ports
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/buffer-ports/tags/0.8/buffer-ports.scm

    r33962 r35446  
    3636(foreign-declare #<<EOF
    3737#define C_get_char_at_pointer(ptr, i)  \
    38   C_make_character(((C_char *)C_block_item(ptr, 0))[ C_unfix(i) ])
     38  C_make_character(((C_uchar *)C_block_item(ptr, 0))[ C_unfix(i) ])
    3939#define C_set_char_at_pointer(ptr, i, c)  \
    4040  ((((C_char *)C_block_item(ptr, 0))[ C_unfix(i) ] = C_character_code(c)), C_SCHEME_UNDEFINED)
  • release/4/buffer-ports/tags/0.8/buffer-ports.setup

    r33962 r35446  
    22
    33
    4 (standard-extension 'buffer-ports "0.7")
     4(standard-extension 'buffer-ports "0.8")
  • release/4/buffer-ports/tags/0.8/tests/run.scm

    r30341 r35446  
    8484  (display "yes.1" out)
    8585  (print buf))
     86
     87(print "read/write u8vector:")
     88(let* ((buf #u8(0 0 0))
     89       (out (open-output-buffer buf))
     90       (in (open-input-buffer buf)))
     91  (write-byte 127 out)
     92  (write-byte 128 out)
     93  (print buf)
     94  (assert (= 127 (read-byte in)))
     95  (assert (= 128 (read-byte in)))
     96  (assert (= 0 (read-byte in)))
     97  (assert (eq? #!eof (read-byte in))))
  • release/4/buffer-ports/trunk/buffer-ports.scm

    r33962 r35446  
    3636(foreign-declare #<<EOF
    3737#define C_get_char_at_pointer(ptr, i)  \
    38   C_make_character(((C_char *)C_block_item(ptr, 0))[ C_unfix(i) ])
     38  C_make_character(((C_uchar *)C_block_item(ptr, 0))[ C_unfix(i) ])
    3939#define C_set_char_at_pointer(ptr, i, c)  \
    4040  ((((C_char *)C_block_item(ptr, 0))[ C_unfix(i) ] = C_character_code(c)), C_SCHEME_UNDEFINED)
  • release/4/buffer-ports/trunk/buffer-ports.setup

    r33962 r35446  
    22
    33
    4 (standard-extension 'buffer-ports "0.7")
     4(standard-extension 'buffer-ports "0.8")
  • release/4/buffer-ports/trunk/tests/run.scm

    r30341 r35446  
    8484  (display "yes.1" out)
    8585  (print buf))
     86
     87(print "read/write u8vector:")
     88(let* ((buf #u8(0 0 0))
     89       (out (open-output-buffer buf))
     90       (in (open-input-buffer buf)))
     91  (write-byte 127 out)
     92  (write-byte 128 out)
     93  (print buf)
     94  (assert (= 127 (read-byte in)))
     95  (assert (= 128 (read-byte in)))
     96  (assert (= 0 (read-byte in)))
     97  (assert (eq? #!eof (read-byte in))))
Note: See TracChangeset for help on using the changeset viewer.