Skip to content

Commit 77544e6

Browse files
committed
all: make bit clear operator explicitly
Change-Id: If72588778b815bc5d8f3e9f41d888cffc0d2a18d Reviewed-on: https://go-review.googlesource.com/c/net/+/168298 Run-TryBot: Mikio Hara <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent d196dff commit 77544e6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

icmp/multipart.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func multipartMessageOrigDatagramLen(proto int, b []byte) int {
4343
return 128
4444
}
4545
r := len(b)
46-
return (r + align - 1) & ^(align - 1)
46+
return (r + align - 1) &^ (align - 1)
4747
}
4848
switch proto {
4949
case iana.ProtocolICMP:

internal/socket/sys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ func init() {
2929
}
3030

3131
func roundup(l int) int {
32-
return (l + kernelAlign - 1) & ^(kernelAlign - 1)
32+
return (l + kernelAlign - 1) &^ (kernelAlign - 1)
3333
}

route/sys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func roundup(l int) int {
2929
if l == 0 {
3030
return kernelAlign
3131
}
32-
return (l + kernelAlign - 1) & ^(kernelAlign - 1)
32+
return (l + kernelAlign - 1) &^ (kernelAlign - 1)
3333
}
3434

3535
type wireFormat struct {

0 commit comments

Comments
 (0)