1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

make function arguments immutable by default

This commit is contained in:
Alexander Medvednikov
2019-08-07 08:19:27 +02:00
parent 06b8bd9382
commit 34e0b164eb
22 changed files with 107 additions and 83 deletions

View File

@@ -58,7 +58,7 @@ pub fn new() &Digest {
return d
}
pub fn (d mut Digest) write(p []byte) ?int {
pub fn (d mut Digest) write(p mut []byte) ?int {
nn := p.len
d.len += u64(nn)
@@ -108,9 +108,9 @@ fn (d mut Digest) checksum() []byte {
tmp[0] = 0x80
if int(len)%64 < 56 {
d.write(tmp.left(56-int(len)%64))
d.write(mut tmp.left(56-int(len)%64))
} else {
d.write(tmp.left(64+56-int(len)%64))
d.write(mut tmp.left(64+56-int(len)%64))
}
// Length in bits.

View File

@@ -17,7 +17,7 @@ const (
_K3 = 0xCA62C1D6
)
fn block_generic(dig &Digest, p []byte) {
fn block_generic(dig mut Digest, p []byte) {
mut w := [u32(0); 16]
mut h0 := dig.h[0]
mut h1 := dig.h[1]