diff options
| author | gingerBill <bill@gingerbill.org> | 2022-09-15 10:00:50 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-09-15 10:00:50 +0100 |
| commit | f50fc33749d550187a41b62f203c33549073fbf3 (patch) | |
| tree | f34732c0db5b9be5bcb7e50da9ab09720f8b6ac4 /core/strings | |
| parent | 1e595f2e2697342e82af7cae6682378a64ae5897 (diff) | |
Clean up of the core library to make the stream vtables not be pointers directly.
Diffstat (limited to 'core/strings')
| -rw-r--r-- | core/strings/builder.odin | 4 | ||||
| -rw-r--r-- | core/strings/reader.odin | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/strings/builder.odin b/core/strings/builder.odin index 6de42804d..0386431f1 100644 --- a/core/strings/builder.odin +++ b/core/strings/builder.odin @@ -67,7 +67,7 @@ builder_init :: proc{ } @(private) -_builder_stream_vtable := &io.Stream_VTable{ +_builder_stream_vtable := io.Stream_VTable{ impl_write = proc(s: io.Stream, p: []byte) -> (n: int, err: io.Error) { b := (^Builder)(s.stream_data) n = write_bytes(b, p) @@ -97,7 +97,7 @@ _builder_stream_vtable := &io.Stream_VTable{ // return an `io.Stream` from a builder to_stream :: proc(b: ^Builder) -> io.Stream { - return io.Stream{stream_vtable=_builder_stream_vtable, stream_data=b} + return io.Stream{stream_vtable=&_builder_stream_vtable, stream_data=b} } // return an `io.Writer` from a builder diff --git a/core/strings/reader.odin b/core/strings/reader.odin index a38f1fbe4..038740526 100644 --- a/core/strings/reader.odin +++ b/core/strings/reader.odin @@ -24,7 +24,7 @@ reader_init :: proc(r: ^Reader, s: string) { // returns a stream from the reader data reader_to_stream :: proc(r: ^Reader) -> (s: io.Stream) { s.stream_data = r - s.stream_vtable = _reader_vtable + s.stream_vtable = &_reader_vtable return } @@ -177,7 +177,7 @@ reader_write_to :: proc(r: ^Reader, w: io.Writer) -> (n: i64, err: io.Error) { } @(private) -_reader_vtable := &io.Stream_VTable{ +_reader_vtable := io.Stream_VTable{ impl_size = proc(s: io.Stream) -> i64 { r := (^Reader)(s.stream_data) return reader_size(r) |