mirror of
https://github.com/restic/restic.git
synced 2025-08-25 23:47:29 +00:00
Remove unnecessary type conversions.
This commit is contained in:
@@ -150,7 +150,7 @@ func getFileEA(handle windows.Handle, iosb *ioStatusBlock, buf *uint8, bufLen ui
|
||||
if restartScan {
|
||||
_p1 = 1
|
||||
}
|
||||
r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(buf)), uintptr(bufLen), uintptr(_p0), uintptr(eaList), uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1))
|
||||
r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(buf)), uintptr(bufLen), uintptr(_p0), eaList, uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1))
|
||||
status = ntStatus(r0)
|
||||
return
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ func clearAttribute(path string, attribute uint32) error {
|
||||
}
|
||||
if fileAttributes&attribute != 0 {
|
||||
// Clear the attribute
|
||||
fileAttributes &= ^uint32(attribute)
|
||||
fileAttributes &= ^attribute
|
||||
err = windows.SetFileAttributes(ptr, fileAttributes)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@@ -211,6 +211,6 @@ func securityDescriptorBytesToStruct(sd []byte) (*windows.SECURITY_DESCRIPTOR, e
|
||||
// securityDescriptorStructToBytes converts the pointer to windows SECURITY_DESCRIPTOR
|
||||
// into a security descriptor bytes representation.
|
||||
func securityDescriptorStructToBytes(sd *windows.SECURITY_DESCRIPTOR) ([]byte, error) {
|
||||
b := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length())
|
||||
b := unsafe.Slice(unsafe.Pointer(sd), sd.Length())
|
||||
return b, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user