Skip to content

Commit

Permalink
fix: correct type cast error
Browse files Browse the repository at this point in the history
Closes pjbgf#6
Closes pjbgf#8
  • Loading branch information
yann-soubeyrand committed Dec 3, 2022
1 parent 6aedff0 commit 52128f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cgo/sha1_nix.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (d *digest) Write(p []byte) (nn int, err error) {
}

data := (*C.char)(unsafe.Pointer(&p[0]))
C.SHA1DCUpdate(&d.ctx, data, (C.ulong)(len(p)))
C.SHA1DCUpdate(&d.ctx, data, (C.size_t)(len(p)))

return len(p), nil
}
2 changes: 1 addition & 1 deletion cgo/sha1_nix_armhf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (d *digest) Write(p []byte) (nn int, err error) {
}

data := (*C.char)(unsafe.Pointer(&p[0]))
C.SHA1DCUpdate(&d.ctx, data, (C.uint)(len(p)))
C.SHA1DCUpdate(&d.ctx, data, (C.size_t)(len(p)))

return len(p), nil
}
2 changes: 1 addition & 1 deletion cgo/sha1_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (d *digest) Write(p []byte) (nn int, err error) {
}

data := (*C.char)(unsafe.Pointer(&p[0]))
C.SHA1DCUpdate(&d.ctx, data, (C.ulonglong)(len(p)))
C.SHA1DCUpdate(&d.ctx, data, (C.size_t)(len(p)))

return len(p), nil
}

0 comments on commit 52128f4

Please sign in to comment.