aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-06-08 16:38:57 +0100
committergingerBill <bill@gingerbill.org>2023-06-08 16:38:57 +0100
commit9ee4b76cd950e5eef9d480831670ae7bcff64775 (patch)
treeb3dd5c9074cf1c26ff2e169fe2b92c7998ce6e48 /core
parent3f6775e29b2378d189cca72733cf8953681281e4 (diff)
Just make the `io.Reader` etc aliases
Diffstat (limited to 'core')
-rw-r--r--core/bufio/writer.odin2
-rw-r--r--core/compress/common.odin2
-rw-r--r--core/crypto/blake/blake.odin8
-rw-r--r--core/crypto/blake2b/blake2b.odin2
-rw-r--r--core/crypto/blake2s/blake2s.odin2
-rw-r--r--core/crypto/gost/gost.odin2
-rw-r--r--core/crypto/groestl/groestl.odin8
-rw-r--r--core/crypto/haval/haval.odin30
-rw-r--r--core/crypto/jh/jh.odin8
-rw-r--r--core/crypto/keccak/keccak.odin8
-rw-r--r--core/crypto/md2/md2.odin2
-rw-r--r--core/crypto/md4/md4.odin2
-rw-r--r--core/crypto/md5/md5.odin2
-rw-r--r--core/crypto/ripemd/ripemd.odin8
-rw-r--r--core/crypto/sha1/sha1.odin2
-rw-r--r--core/crypto/sha2/sha2.odin8
-rw-r--r--core/crypto/sha3/sha3.odin8
-rw-r--r--core/crypto/shake/shake.odin4
-rw-r--r--core/crypto/sm3/sm3.odin2
-rw-r--r--core/crypto/streebog/streebog.odin4
-rw-r--r--core/crypto/tiger/tiger.odin6
-rw-r--r--core/crypto/tiger2/tiger2.odin6
-rw-r--r--core/crypto/whirlpool/whirlpool.odin2
-rw-r--r--core/fmt/fmt_os.odin10
-rw-r--r--core/io/conv.odin30
-rw-r--r--core/io/io.odin57
26 files changed, 110 insertions, 115 deletions
diff --git a/core/bufio/writer.odin b/core/bufio/writer.odin
index b4234af43..bfa8b804f 100644
--- a/core/bufio/writer.odin
+++ b/core/bufio/writer.odin
@@ -221,7 +221,7 @@ writer_to_stream :: proc(b: ^Writer) -> (s: io.Stream) {
// writer_to_stream converts a Writer into an io.Stream
writer_to_writer :: proc(b: ^Writer) -> (s: io.Writer) {
- return {writer_to_stream(b)}
+ return writer_to_stream(b)
}
diff --git a/core/compress/common.odin b/core/compress/common.odin
index 2d00ed359..bc56229c2 100644
--- a/core/compress/common.odin
+++ b/core/compress/common.odin
@@ -216,7 +216,7 @@ read_slice_from_stream :: #force_inline proc(z: ^Context_Stream_Input, size: int
// TODO: REMOVE ALL USE OF context.temp_allocator here
// the is literally no need for it
b := make([]u8, size, context.temp_allocator)
- _, e := io.read({z.input}, b[:])
+ _, e := io.read(z.input, b[:])
if e == .None {
return b, .None
}
diff --git a/core/crypto/blake/blake.odin b/core/crypto/blake/blake.odin
index 67f3c0d35..3685109e4 100644
--- a/core/crypto/blake/blake.odin
+++ b/core/crypto/blake/blake.odin
@@ -70,7 +70,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -149,7 +149,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -228,7 +228,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -307,7 +307,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/blake2b/blake2b.odin b/core/crypto/blake2b/blake2b.odin
index 82dabc542..8f0770f82 100644
--- a/core/crypto/blake2b/blake2b.odin
+++ b/core/crypto/blake2b/blake2b.odin
@@ -77,7 +77,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_blake2.update(&ctx, buf[:read])
}
diff --git a/core/crypto/blake2s/blake2s.odin b/core/crypto/blake2s/blake2s.odin
index a767d4d70..6a2d4ab9b 100644
--- a/core/crypto/blake2s/blake2s.odin
+++ b/core/crypto/blake2s/blake2s.odin
@@ -77,7 +77,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_blake2.update(&ctx, buf[:read])
}
diff --git a/core/crypto/gost/gost.odin b/core/crypto/gost/gost.odin
index fa2df862f..5aca8ce95 100644
--- a/core/crypto/gost/gost.odin
+++ b/core/crypto/gost/gost.odin
@@ -65,7 +65,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/groestl/groestl.odin b/core/crypto/groestl/groestl.odin
index 604a3eb9b..61460808f 100644
--- a/core/crypto/groestl/groestl.odin
+++ b/core/crypto/groestl/groestl.odin
@@ -70,7 +70,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -149,7 +149,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -228,7 +228,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -307,7 +307,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/haval/haval.odin b/core/crypto/haval/haval.odin
index 76cfbecbe..b98facb33 100644
--- a/core/crypto/haval/haval.odin
+++ b/core/crypto/haval/haval.odin
@@ -79,7 +79,7 @@ hash_stream_128_3 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -164,7 +164,7 @@ hash_stream_128_4 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -249,7 +249,7 @@ hash_stream_128_5 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -334,7 +334,7 @@ hash_stream_160_3 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -419,7 +419,7 @@ hash_stream_160_4 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -504,7 +504,7 @@ hash_stream_160_5 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -589,7 +589,7 @@ hash_stream_192_3 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -674,7 +674,7 @@ hash_stream_192_4 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -759,7 +759,7 @@ hash_stream_192_5 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -844,7 +844,7 @@ hash_stream_224_3 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -929,7 +929,7 @@ hash_stream_224_4 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -1014,7 +1014,7 @@ hash_stream_224_5 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -1099,7 +1099,7 @@ hash_stream_256_3 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -1184,7 +1184,7 @@ hash_stream_256_4 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
@@ -1270,7 +1270,7 @@ hash_stream_256_5 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
ctx.str_len = u32(len(buf[:read]))
if read > 0 {
update(&ctx, buf[:read])
diff --git a/core/crypto/jh/jh.odin b/core/crypto/jh/jh.odin
index 6b4a73b46..5dc6c4e6b 100644
--- a/core/crypto/jh/jh.odin
+++ b/core/crypto/jh/jh.odin
@@ -70,7 +70,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -149,7 +149,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -228,7 +228,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -307,7 +307,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/keccak/keccak.odin b/core/crypto/keccak/keccak.odin
index c09c9ddbe..4c74858d2 100644
--- a/core/crypto/keccak/keccak.odin
+++ b/core/crypto/keccak/keccak.odin
@@ -77,7 +77,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -159,7 +159,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -241,7 +241,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -323,7 +323,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
diff --git a/core/crypto/md2/md2.odin b/core/crypto/md2/md2.odin
index 693e2c6b0..4942183e1 100644
--- a/core/crypto/md2/md2.odin
+++ b/core/crypto/md2/md2.odin
@@ -64,7 +64,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/md4/md4.odin b/core/crypto/md4/md4.odin
index 1f161e1cb..8efdbb5a5 100644
--- a/core/crypto/md4/md4.odin
+++ b/core/crypto/md4/md4.odin
@@ -68,7 +68,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/md5/md5.odin b/core/crypto/md5/md5.odin
index db04e67df..858480b04 100644
--- a/core/crypto/md5/md5.odin
+++ b/core/crypto/md5/md5.odin
@@ -67,7 +67,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/ripemd/ripemd.odin b/core/crypto/ripemd/ripemd.odin
index 257f4144e..f9edb121b 100644
--- a/core/crypto/ripemd/ripemd.odin
+++ b/core/crypto/ripemd/ripemd.odin
@@ -69,7 +69,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -145,7 +145,7 @@ hash_stream_160 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -221,7 +221,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -297,7 +297,7 @@ hash_stream_320 :: proc(s: io.Stream) -> ([DIGEST_SIZE_320]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/sha1/sha1.odin b/core/crypto/sha1/sha1.odin
index 2e1991444..599d1791e 100644
--- a/core/crypto/sha1/sha1.odin
+++ b/core/crypto/sha1/sha1.odin
@@ -67,7 +67,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/sha2/sha2.odin b/core/crypto/sha2/sha2.odin
index cbd3a6b39..0f55c4be1 100644
--- a/core/crypto/sha2/sha2.odin
+++ b/core/crypto/sha2/sha2.odin
@@ -74,7 +74,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -153,7 +153,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -232,7 +232,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -311,7 +311,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/sha3/sha3.odin b/core/crypto/sha3/sha3.odin
index ec6fbc971..5d8ad2106 100644
--- a/core/crypto/sha3/sha3.odin
+++ b/core/crypto/sha3/sha3.odin
@@ -73,7 +73,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -152,7 +152,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -231,7 +231,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -310,7 +310,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
diff --git a/core/crypto/shake/shake.odin b/core/crypto/shake/shake.odin
index 50ef756aa..020ba68f3 100644
--- a/core/crypto/shake/shake.odin
+++ b/core/crypto/shake/shake.odin
@@ -73,7 +73,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
@@ -155,7 +155,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_sha3.update(&ctx, buf[:read])
}
diff --git a/core/crypto/sm3/sm3.odin b/core/crypto/sm3/sm3.odin
index b35e20e37..9e684ff08 100644
--- a/core/crypto/sm3/sm3.odin
+++ b/core/crypto/sm3/sm3.odin
@@ -66,7 +66,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/streebog/streebog.odin b/core/crypto/streebog/streebog.odin
index aa4dd7906..42da1e695 100644
--- a/core/crypto/streebog/streebog.odin
+++ b/core/crypto/streebog/streebog.odin
@@ -70,7 +70,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
@@ -146,7 +146,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/crypto/tiger/tiger.odin b/core/crypto/tiger/tiger.odin
index a4982d7c4..614926129 100644
--- a/core/crypto/tiger/tiger.odin
+++ b/core/crypto/tiger/tiger.odin
@@ -71,7 +71,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
@@ -150,7 +150,7 @@ hash_stream_160 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
@@ -229,7 +229,7 @@ hash_stream_192 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
diff --git a/core/crypto/tiger2/tiger2.odin b/core/crypto/tiger2/tiger2.odin
index 432387bdf..ead874d56 100644
--- a/core/crypto/tiger2/tiger2.odin
+++ b/core/crypto/tiger2/tiger2.odin
@@ -71,7 +71,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
@@ -150,7 +150,7 @@ hash_stream_160 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
@@ -229,7 +229,7 @@ hash_stream_192 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
_tiger.update(&ctx, buf[:read])
}
diff --git a/core/crypto/whirlpool/whirlpool.odin b/core/crypto/whirlpool/whirlpool.odin
index 8ae6f413e..cf0bf6490 100644
--- a/core/crypto/whirlpool/whirlpool.odin
+++ b/core/crypto/whirlpool/whirlpool.odin
@@ -66,7 +66,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
read := 1
for read > 0 {
- read, _ = io.read({s}, buf)
+ read, _ = io.read(s, buf)
if read > 0 {
update(&ctx, buf[:read])
}
diff --git a/core/fmt/fmt_os.odin b/core/fmt/fmt_os.odin
index 861b0c3b9..299d8f017 100644
--- a/core/fmt/fmt_os.odin
+++ b/core/fmt/fmt_os.odin
@@ -12,7 +12,7 @@ fprint :: proc(fd: os.Handle, args: ..any, sep := " ") -> int {
b: bufio.Writer
defer bufio.writer_flush(&b)
- bufio.writer_init_with_buf(&b, {os.stream_from_handle(fd)}, buf[:])
+ bufio.writer_init_with_buf(&b, os.stream_from_handle(fd), buf[:])
w := bufio.writer_to_writer(&b)
return wprint(w=w, args=args, sep=sep)
}
@@ -23,7 +23,7 @@ fprintln :: proc(fd: os.Handle, args: ..any, sep := " ") -> int {
b: bufio.Writer
defer bufio.writer_flush(&b)
- bufio.writer_init_with_buf(&b, {os.stream_from_handle(fd)}, buf[:])
+ bufio.writer_init_with_buf(&b, os.stream_from_handle(fd), buf[:])
w := bufio.writer_to_writer(&b)
return wprintln(w=w, args=args, sep=sep)
@@ -34,7 +34,7 @@ fprintf :: proc(fd: os.Handle, fmt: string, args: ..any) -> int {
b: bufio.Writer
defer bufio.writer_flush(&b)
- bufio.writer_init_with_buf(&b, {os.stream_from_handle(fd)}, buf[:])
+ bufio.writer_init_with_buf(&b, os.stream_from_handle(fd), buf[:])
w := bufio.writer_to_writer(&b)
return wprintf(w, fmt, ..args)
@@ -44,7 +44,7 @@ fprint_type :: proc(fd: os.Handle, info: ^runtime.Type_Info) -> (n: int, err: io
b: bufio.Writer
defer bufio.writer_flush(&b)
- bufio.writer_init_with_buf(&b, {os.stream_from_handle(fd)}, buf[:])
+ bufio.writer_init_with_buf(&b, os.stream_from_handle(fd), buf[:])
w := bufio.writer_to_writer(&b)
return wprint_type(w, info)
@@ -54,7 +54,7 @@ fprint_typeid :: proc(fd: os.Handle, id: typeid) -> (n: int, err: io.Error) {
b: bufio.Writer
defer bufio.writer_flush(&b)
- bufio.writer_init_with_buf(&b, {os.stream_from_handle(fd)}, buf[:])
+ bufio.writer_init_with_buf(&b, os.stream_from_handle(fd), buf[:])
w := bufio.writer_to_writer(&b)
return wprint_typeid(w, id)
diff --git a/core/io/conv.odin b/core/io/conv.odin
index 2b1351e18..e3286baca 100644
--- a/core/io/conv.odin
+++ b/core/io/conv.odin
@@ -1,80 +1,80 @@
package io
to_reader :: proc(s: Stream) -> (r: Reader, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = .Read in query(s)
return
}
to_writer :: proc(s: Stream) -> (w: Writer, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = .Write in query(s)
return
}
to_closer :: proc(s: Stream) -> (c: Closer, ok: bool = true) #optional_ok {
- c.stream = s
+ c = s
ok = .Close in query(s)
return
}
to_flusher :: proc(s: Stream) -> (f: Flusher, ok: bool = true) #optional_ok {
- f.stream = s
+ f = s
ok = .Flush in query(s)
return
}
to_seeker :: proc(s: Stream) -> (seeker: Seeker, ok: bool = true) #optional_ok {
- seeker.stream = s
+ seeker = s
ok = .Seek in query(s)
return
}
to_read_writer :: proc(s: Stream) -> (r: Read_Writer, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = query(s) >= {.Read, .Write}
return
}
to_read_closer :: proc(s: Stream) -> (r: Read_Closer, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = query(s) >= {.Read, .Close}
return
}
to_read_write_closer :: proc(s: Stream) -> (r: Read_Write_Closer, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = query(s) >= {.Read, .Write, .Close}
return
}
to_read_write_seeker :: proc(s: Stream) -> (r: Read_Write_Seeker, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = query(s) >= {.Read, .Write, .Seek}
return
}
to_write_flusher :: proc(s: Stream) -> (w: Write_Flusher, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = query(s) >= {.Write, .Flush}
return
}
to_write_flush_closer :: proc(s: Stream) -> (w: Write_Flush_Closer, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = query(s) >= {.Write, .Flush, .Close}
return
}
to_reader_at :: proc(s: Stream) -> (r: Reader_At, ok: bool = true) #optional_ok {
- r.stream = s
+ r = s
ok = query(s) >= {.Read_At}
return
}
to_writer_at :: proc(s: Stream) -> (w: Writer_At, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = query(s) >= {.Write_At}
return
}
to_write_closer :: proc(s: Stream) -> (w: Write_Closer, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = query(s) >= {.Write, .Close}
return
}
to_write_seeker :: proc(s: Stream) -> (w: Write_Seeker, ok: bool = true) #optional_ok {
- w.stream = s
+ w = s
ok = query(s) >= {.Write, .Seek}
return
}
diff --git a/core/io/io.odin b/core/io/io.odin
index 868e16204..566e13c54 100644
--- a/core/io/io.odin
+++ b/core/io/io.odin
@@ -75,29 +75,29 @@ Stream :: struct {
data: rawptr,
}
-Reader :: struct {using stream: Stream}
-Writer :: struct {using stream: Stream}
-Closer :: struct {using stream: Stream}
-Flusher :: struct {using stream: Stream}
-Seeker :: struct {using stream: Stream}
+Reader :: Stream
+Writer :: Stream
+Closer :: Stream
+Flusher :: Stream
+Seeker :: Stream
-Read_Writer :: struct {using stream: Stream}
-Read_Closer :: struct {using stream: Stream}
-Read_Write_Closer :: struct {using stream: Stream}
-Read_Write_Seeker :: struct {using stream: Stream}
+Read_Writer :: Stream
+Read_Closer :: Stream
+Read_Write_Closer :: Stream
+Read_Write_Seeker :: Stream
-Write_Closer :: struct {using stream: Stream}
-Write_Seeker :: struct {using stream: Stream}
-Write_Flusher :: struct {using stream: Stream}
-Write_Flush_Closer :: struct {using stream: Stream}
+Write_Closer :: Stream
+Write_Seeker :: Stream
+Write_Flusher :: Stream
+Write_Flush_Closer :: Stream
-Reader_At :: struct {using stream: Stream}
-Writer_At :: struct {using stream: Stream}
+Reader_At :: Stream
+Writer_At :: Stream
destroy :: proc(s: Stream) -> (err: Error) {
- _ = flush({s})
- _ = close({s})
+ _ = flush(s)
+ _ = close(s)
if s.procedure != nil {
_, err = s.procedure(s.data, .Destroy, nil, 0, nil)
} else {
@@ -192,11 +192,10 @@ size :: proc(s: Stream) -> (n: i64, err: Error) {
if s.procedure != nil {
n, err = s.procedure(s.data, .Size, nil, 0, nil)
if err == .Empty {
- seeker := Seeker{s}
n = 0
- curr := seek(seeker, 0, .Current) or_return
- end := seek(seeker, 0, .End) or_return
- seek(seeker, curr, .Start) or_return
+ curr := seek(s, 0, .Current) or_return
+ end := seek(s, 0, .End) or_return
+ seek(s, curr, .Start) or_return
n = end
}
} else {
@@ -220,11 +219,9 @@ read_at :: proc(r: Reader_At, p: []byte, offset: i64, n_read: ^int = nil) -> (n:
if err != .Empty {
n = int(n64)
} else {
- seeker := Seeker{r}
- reader := Reader{r}
- curr := seek(seeker, offset, .Current) or_return
- n, err = read(reader, p)
- _, err1 := seek(seeker, curr, .Start)
+ curr := seek(r, offset, .Current) or_return
+ n, err = read(r, p)
+ _, err1 := seek(r, curr, .Start)
if err1 != nil && err == nil {
err = err1
}
@@ -248,11 +245,9 @@ write_at :: proc(w: Writer_At, p: []byte, offset: i64, n_written: ^int = nil) ->
if err != .Empty {
n = int(n64)
} else {
- seeker := Seeker{w}
- writer := Writer{w}
- curr := seek(seeker, offset, .Current) or_return
- n, err = write(writer, p)
- _, err1 := seek(seeker, curr, .Start)
+ curr := seek(w, offset, .Current) or_return
+ n, err = write(w, p)
+ _, err1 := seek(w, curr, .Start)
if err1 != nil && err == nil {
err = err1
}