feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
34
vendor/go.starlark.net/starlark/int_generic.go
generated
vendored
Normal file
34
vendor/go.starlark.net/starlark/int_generic.go
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
//go:build (!linux && !darwin && !dragonfly && !freebsd && !netbsd && !solaris) || (!amd64 && !arm64 && !mips64x && !ppc64x && !loong64)
|
||||
// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!solaris !amd64,!arm64,!mips64x,!ppc64x,!loong64
|
||||
|
||||
package starlark
|
||||
|
||||
// generic Int implementation as a union
|
||||
|
||||
import "math/big"
|
||||
|
||||
type intImpl struct {
|
||||
// We use only the signed 32-bit range of small to ensure
|
||||
// that small+small and small*small do not overflow.
|
||||
small_ int64 // minint32 <= small <= maxint32
|
||||
big_ *big.Int // big != nil <=> value is not representable as int32
|
||||
}
|
||||
|
||||
// --- low-level accessors ---
|
||||
|
||||
// get returns the small and big components of the Int.
|
||||
// small is defined only if big is nil.
|
||||
// small is sign-extended to 64 bits for ease of subsequent arithmetic.
|
||||
func (i Int) get() (small int64, big *big.Int) {
|
||||
return i.impl.small_, i.impl.big_
|
||||
}
|
||||
|
||||
// Precondition: math.MinInt32 <= x && x <= math.MaxInt32
|
||||
func makeSmallInt(x int64) Int {
|
||||
return Int{intImpl{small_: x}}
|
||||
}
|
||||
|
||||
// Precondition: x cannot be represented as int32.
|
||||
func makeBigInt(x *big.Int) Int {
|
||||
return Int{intImpl{big_: x}}
|
||||
}
|
||||
Reference in New Issue
Block a user