summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/zstd/bitwriter.go
diff options
context:
space:
mode:
authorAditya R <arajan@redhat.com>2022-01-20 12:40:07 +0530
committerAditya R <arajan@redhat.com>2022-01-20 12:40:11 +0530
commit2c492be00a13bfbc389d2b1b97c6bf91520e280e (patch)
treea0603d66b29dcc9ab91354ef583ba5e349f8409f /vendor/github.com/klauspost/compress/zstd/bitwriter.go
parentf46478c1e9af601759e341de76d4c655b4a66068 (diff)
downloadpodman-2c492be00a13bfbc389d2b1b97c6bf91520e280e.tar.gz
podman-2c492be00a13bfbc389d2b1b97c6bf91520e280e.tar.bz2
podman-2c492be00a13bfbc389d2b1b97c6bf91520e280e.zip
vendor: bump c/common and other vendors
This commit bumps majorly c/common so netavark features could be synced with podman. But there are some other vendor bumps as well [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd/bitwriter.go')
-rw-r--r--vendor/github.com/klauspost/compress/zstd/bitwriter.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go
index 303ae90f9..b36618285 100644
--- a/vendor/github.com/klauspost/compress/zstd/bitwriter.go
+++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go
@@ -38,7 +38,7 @@ func (b *bitWriter) addBits16NC(value uint16, bits uint8) {
b.nBits += bits
}
-// addBits32NC will add up to 32 bits.
+// addBits32NC will add up to 31 bits.
// It will not check if there is space for them,
// so the caller must ensure that it has flushed recently.
func (b *bitWriter) addBits32NC(value uint32, bits uint8) {
@@ -46,6 +46,26 @@ func (b *bitWriter) addBits32NC(value uint32, bits uint8) {
b.nBits += bits
}
+// addBits64NC will add up to 64 bits.
+// There must be space for 32 bits.
+func (b *bitWriter) addBits64NC(value uint64, bits uint8) {
+ if bits <= 31 {
+ b.addBits32Clean(uint32(value), bits)
+ return
+ }
+ b.addBits32Clean(uint32(value), 32)
+ b.flush32()
+ b.addBits32Clean(uint32(value>>32), bits-32)
+}
+
+// addBits32Clean will add up to 32 bits.
+// It will not check if there is space for them.
+// The input must not contain more bits than specified.
+func (b *bitWriter) addBits32Clean(value uint32, bits uint8) {
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated.
// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {