Skip to content

Commit 279db5e

Browse files
committed
io: Add type declarations to <typed-stream> mapper functions
These changes fix inlining failure warnings for inline-only functions. * sources/io/streams/typed-stream.dylan (typed-tsm, typed-fsm): Move to new top level definitions and add parameter type declarations. (<typed-stream>): Move out initializers for to-sequence-mapper and from-sequence-mapper.
1 parent 5841840 commit 279db5e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

sources/io/streams/typed-stream.dylan

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,25 @@ define function byte-to-byte (byte :: <byte>) => (byte :: <byte>)
2222
byte
2323
end function byte-to-byte;
2424

25+
define function typed-tsm
26+
(s :: <sequence>, ss :: <integer>, d :: <mutable-sequence>, ds :: <integer>, n :: <integer>)
27+
=> ()
28+
copy-bytes(d, ds, s, ss, n);
29+
end;
30+
31+
define function typed-fsm
32+
(s :: <sequence>, ss :: <integer>, d :: <mutable-sequence>, ds :: <integer>, n :: <integer>)
33+
=> ()
34+
copy-bytes(d, ds, s, ss, n)
35+
end;
2536

2637
define open abstract class <typed-stream> (<basic-stream>)
2738
// Assume that
2839
slot sequence-type /* ---*** :: subclass(<sequence>) */ = <byte-string>;
2940
slot to-element-mapper :: <function> = byte-to-byte-char;
3041
slot from-element-mapper :: <function> = byte-char-to-byte;
31-
constant slot to-sequence-mapper :: <function> =
32-
method (s, ss, d, ds, n) => () copy-bytes(d, ds, s, ss, n) end;
33-
constant slot from-sequence-mapper :: <function> =
34-
method (s, ss, d, ds, n) => () copy-bytes(d, ds, s, ss, n) end;
42+
constant slot to-sequence-mapper :: <function> = typed-tsm;
43+
constant slot from-sequence-mapper :: <function> = typed-fsm;
3544
end class <typed-stream>;
3645

3746
define open abstract class <general-typed-stream> (<typed-stream>)

0 commit comments

Comments
 (0)