forked from forgejo/forgejo
go1.16 (#14783)
This commit is contained in:
parent
030646eea4
commit
47f6a4ec3f
947 changed files with 26119 additions and 7062 deletions
7
vendor/github.com/ulikunitz/xz/lzma/bintree.go
generated
vendored
7
vendor/github.com/ulikunitz/xz/lzma/bintree.go
generated
vendored
|
@ -1,14 +1,11 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package lzma
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
|
@ -349,6 +346,7 @@ func dumpX(x uint32) string {
|
|||
return string(a)
|
||||
}
|
||||
|
||||
/*
|
||||
// dumpNode writes a representation of the node v into the io.Writer.
|
||||
func (t *binTree) dumpNode(w io.Writer, v uint32, indent int) {
|
||||
if v == null {
|
||||
|
@ -377,6 +375,7 @@ func (t *binTree) dump(w io.Writer) error {
|
|||
t.dumpNode(bw, t.root, 0)
|
||||
return bw.Flush()
|
||||
}
|
||||
*/
|
||||
|
||||
func (t *binTree) distance(v uint32) int {
|
||||
dist := int(t.front) - int(v)
|
||||
|
|
4
vendor/github.com/ulikunitz/xz/lzma/bitops.go
generated
vendored
4
vendor/github.com/ulikunitz/xz/lzma/bitops.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -18,6 +18,7 @@ var ntz32Table = [32]int8{
|
|||
30, 17, 8, 14, 29, 13, 28, 27,
|
||||
}
|
||||
|
||||
/*
|
||||
// ntz32 computes the number of trailing zeros for an unsigned 32-bit integer.
|
||||
func ntz32(x uint32) int {
|
||||
if x == 0 {
|
||||
|
@ -26,6 +27,7 @@ func ntz32(x uint32) int {
|
|||
x = (x & -x) * ntz32Const
|
||||
return int(ntz32Table[x>>27])
|
||||
}
|
||||
*/
|
||||
|
||||
// nlz32 computes the number of leading zeros for an unsigned 32-bit integer.
|
||||
func nlz32(x uint32) int {
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/breader.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/breader.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/buffer.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/buffer.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/bytewriter.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/bytewriter.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
4
vendor/github.com/ulikunitz/xz/lzma/decoder.go
generated
vendored
4
vendor/github.com/ulikunitz/xz/lzma/decoder.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -200,7 +200,7 @@ func (d *decoder) decompress() error {
|
|||
op, err := d.readOp()
|
||||
switch err {
|
||||
case nil:
|
||||
break
|
||||
// break
|
||||
case errEOS:
|
||||
d.eos = true
|
||||
if !d.rd.possiblyAtEnd() {
|
||||
|
|
9
vendor/github.com/ulikunitz/xz/lzma/decoderdict.go
generated
vendored
9
vendor/github.com/ulikunitz/xz/lzma/decoderdict.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -126,10 +126,3 @@ func (d *decoderDict) Available() int { return d.buf.Available() }
|
|||
|
||||
// Read reads data from the buffer contained in the decoder dictionary.
|
||||
func (d *decoderDict) Read(p []byte) (n int, err error) { return d.buf.Read(p) }
|
||||
|
||||
// Buffered returns the number of bytes currently buffered in the
|
||||
// decoder dictionary.
|
||||
func (d *decoderDict) buffered() int { return d.buf.Buffered() }
|
||||
|
||||
// Peek gets data from the buffer without advancing the rear index.
|
||||
func (d *decoderDict) peek(p []byte) (n int, err error) { return d.buf.Peek(p) }
|
||||
|
|
13
vendor/github.com/ulikunitz/xz/lzma/directcodec.go
generated
vendored
13
vendor/github.com/ulikunitz/xz/lzma/directcodec.go
generated
vendored
|
@ -1,24 +1,13 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package lzma
|
||||
|
||||
import "fmt"
|
||||
|
||||
// directCodec allows the encoding and decoding of values with a fixed number
|
||||
// of bits. The number of bits must be in the range [1,32].
|
||||
type directCodec byte
|
||||
|
||||
// makeDirectCodec creates a directCodec. The function panics if the number of
|
||||
// bits is not in the range [1,32].
|
||||
func makeDirectCodec(bits int) directCodec {
|
||||
if !(1 <= bits && bits <= 32) {
|
||||
panic(fmt.Errorf("bits=%d out of range", bits))
|
||||
}
|
||||
return directCodec(bits)
|
||||
}
|
||||
|
||||
// Bits returns the number of bits supported by this codec.
|
||||
func (dc directCodec) Bits() int {
|
||||
return int(dc)
|
||||
|
|
18
vendor/github.com/ulikunitz/xz/lzma/distcodec.go
generated
vendored
18
vendor/github.com/ulikunitz/xz/lzma/distcodec.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -20,8 +20,6 @@ const (
|
|||
posSlotBits = 6
|
||||
// number of align bits
|
||||
alignBits = 4
|
||||
// maximum position slot
|
||||
maxPosSlot = 63
|
||||
)
|
||||
|
||||
// distCodec provides encoding and decoding of distance values.
|
||||
|
@ -45,20 +43,6 @@ func (dc *distCodec) deepcopy(src *distCodec) {
|
|||
dc.alignCodec.deepcopy(&src.alignCodec)
|
||||
}
|
||||
|
||||
// distBits returns the number of bits required to encode dist.
|
||||
func distBits(dist uint32) int {
|
||||
if dist < startPosModel {
|
||||
return 6
|
||||
}
|
||||
// slot s > 3, dist d
|
||||
// s = 2(bits(d)-1) + bit(d, bits(d)-2)
|
||||
// s>>1 = bits(d)-1
|
||||
// bits(d) = 32-nlz32(d)
|
||||
// s>>1=31-nlz32(d)
|
||||
// n = 5 + (s>>1) = 36 - nlz32(d)
|
||||
return 36 - nlz32(dist)
|
||||
}
|
||||
|
||||
// newDistCodec creates a new distance codec.
|
||||
func (dc *distCodec) init() {
|
||||
for i := range dc.posSlotCodecs {
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/encoder.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/encoder.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
4
vendor/github.com/ulikunitz/xz/lzma/encoderdict.go
generated
vendored
4
vendor/github.com/ulikunitz/xz/lzma/encoderdict.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -19,7 +19,7 @@ type matcher interface {
|
|||
}
|
||||
|
||||
// encoderDict provides the dictionary of the encoder. It includes an
|
||||
// addtional buffer atop of the actual dictionary.
|
||||
// additional buffer atop of the actual dictionary.
|
||||
type encoderDict struct {
|
||||
buf buffer
|
||||
m matcher
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/hashtable.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/hashtable.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/header.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/header.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
4
vendor/github.com/ulikunitz/xz/lzma/header2.go
generated
vendored
4
vendor/github.com/ulikunitz/xz/lzma/header2.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -264,7 +264,7 @@ type chunkState byte
|
|||
// state
|
||||
const (
|
||||
start chunkState = 'S'
|
||||
stop = 'T'
|
||||
stop chunkState = 'T'
|
||||
)
|
||||
|
||||
// errors for the chunk state handling
|
||||
|
|
15
vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go
generated
vendored
15
vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -56,19 +56,6 @@ func (lc *lengthCodec) init() {
|
|||
lc.high = makeTreeCodec(8)
|
||||
}
|
||||
|
||||
// lBits gives the number of bits used for the encoding of the l value
|
||||
// provided to the range encoder.
|
||||
func lBits(l uint32) int {
|
||||
switch {
|
||||
case l < 8:
|
||||
return 4
|
||||
case l < 16:
|
||||
return 5
|
||||
default:
|
||||
return 10
|
||||
}
|
||||
}
|
||||
|
||||
// Encode encodes the length offset. The length offset l can be compute by
|
||||
// subtracting minMatchLen (2) from the actual length.
|
||||
//
|
||||
|
|
9
vendor/github.com/ulikunitz/xz/lzma/literalcodec.go
generated
vendored
9
vendor/github.com/ulikunitz/xz/lzma/literalcodec.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -123,10 +123,3 @@ const (
|
|||
minLP = 0
|
||||
maxLP = 4
|
||||
)
|
||||
|
||||
// minState and maxState define a range for the state values stored in
|
||||
// the State values.
|
||||
const (
|
||||
minState = 0
|
||||
maxState = 11
|
||||
)
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
27
vendor/github.com/ulikunitz/xz/lzma/operation.go
generated
vendored
27
vendor/github.com/ulikunitz/xz/lzma/operation.go
generated
vendored
|
@ -1,11 +1,10 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package lzma
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"unicode"
|
||||
)
|
||||
|
@ -24,30 +23,6 @@ type match struct {
|
|||
n int
|
||||
}
|
||||
|
||||
// verify checks whether the match is valid. If that is not the case an
|
||||
// error is returned.
|
||||
func (m match) verify() error {
|
||||
if !(minDistance <= m.distance && m.distance <= maxDistance) {
|
||||
return errors.New("distance out of range")
|
||||
}
|
||||
if !(1 <= m.n && m.n <= maxMatchLen) {
|
||||
return errors.New("length out of range")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// l return the l-value for the match, which is the difference of length
|
||||
// n and 2.
|
||||
func (m match) l() uint32 {
|
||||
return uint32(m.n - minMatchLen)
|
||||
}
|
||||
|
||||
// dist returns the dist value for the match, which is one less of the
|
||||
// distance stored in the match.
|
||||
func (m match) dist() uint32 {
|
||||
return uint32(m.distance - minDistance)
|
||||
}
|
||||
|
||||
// Len returns the number of bytes matched.
|
||||
func (m match) Len() int {
|
||||
return m.n
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/prob.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/prob.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/properties.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/properties.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
28
vendor/github.com/ulikunitz/xz/lzma/rangecodec.go
generated
vendored
28
vendor/github.com/ulikunitz/xz/lzma/rangecodec.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -131,32 +131,6 @@ type rangeDecoder struct {
|
|||
code uint32
|
||||
}
|
||||
|
||||
// init initializes the range decoder, by reading from the byte reader.
|
||||
func (d *rangeDecoder) init() error {
|
||||
d.nrange = 0xffffffff
|
||||
d.code = 0
|
||||
|
||||
b, err := d.br.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != 0 {
|
||||
return errors.New("newRangeDecoder: first byte not zero")
|
||||
}
|
||||
|
||||
for i := 0; i < 4; i++ {
|
||||
if err = d.updateCode(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if d.code >= d.nrange {
|
||||
return errors.New("newRangeDecoder: d.code >= d.nrange")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// newRangeDecoder initializes a range decoder. It reads five bytes from the
|
||||
// reader and therefore may return an error.
|
||||
func newRangeDecoder(br io.ByteReader) (d *rangeDecoder, err error) {
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/reader.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/reader.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
3
vendor/github.com/ulikunitz/xz/lzma/reader2.go
generated
vendored
3
vendor/github.com/ulikunitz/xz/lzma/reader2.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -48,7 +48,6 @@ type Reader2 struct {
|
|||
chunkReader io.Reader
|
||||
|
||||
cstate chunkState
|
||||
ctype chunkType
|
||||
}
|
||||
|
||||
// NewReader2 creates a reader for an LZMA2 chunk sequence.
|
||||
|
|
8
vendor/github.com/ulikunitz/xz/lzma/state.go
generated
vendored
8
vendor/github.com/ulikunitz/xz/lzma/state.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
@ -53,12 +53,6 @@ func (s *state) Reset() {
|
|||
s.distCodec.init()
|
||||
}
|
||||
|
||||
// initState initializes the state.
|
||||
func initState(s *state, p Properties) {
|
||||
*s = state{Properties: p}
|
||||
s.Reset()
|
||||
}
|
||||
|
||||
// newState creates a new state from the give Properties.
|
||||
func newState(p Properties) *state {
|
||||
s := &state{Properties: p}
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/treecodecs.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/treecodecs.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/writer.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/writer.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
2
vendor/github.com/ulikunitz/xz/lzma/writer2.go
generated
vendored
2
vendor/github.com/ulikunitz/xz/lzma/writer2.go
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue