Procházet zdrojové kódy

all: make bit clear operator explicitly

Change-Id: If72588778b815bc5d8f3e9f41d888cffc0d2a18d
Reviewed-on: https://go-review.googlesource.com/c/net/+/168298
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara před 6 roky
rodič
revize
77544e6953
3 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 1 1
      icmp/multipart.go
  2. 1 1
      internal/socket/sys.go
  3. 1 1
      route/sys.go

+ 1 - 1
icmp/multipart.go

@@ -43,7 +43,7 @@ func multipartMessageOrigDatagramLen(proto int, b []byte) int {
 			return 128
 		}
 		r := len(b)
-		return (r + align - 1) & ^(align - 1)
+		return (r + align - 1) &^ (align - 1)
 	}
 	switch proto {
 	case iana.ProtocolICMP:

+ 1 - 1
internal/socket/sys.go

@@ -29,5 +29,5 @@ func init() {
 }
 
 func roundup(l int) int {
-	return (l + kernelAlign - 1) & ^(kernelAlign - 1)
+	return (l + kernelAlign - 1) &^ (kernelAlign - 1)
 }

+ 1 - 1
route/sys.go

@@ -29,7 +29,7 @@ func roundup(l int) int {
 	if l == 0 {
 		return kernelAlign
 	}
-	return (l + kernelAlign - 1) & ^(kernelAlign - 1)
+	return (l + kernelAlign - 1) &^ (kernelAlign - 1)
 }
 
 type wireFormat struct {