From 7f38f46e208723612cfde61a7fad4af336186545 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 17 Jun 2016 15:16:26 +0530 Subject: [PATCH] vendor: update klauspost/reedsomon package with upstream changes. (#1912) --- .../klauspost/reedsolomon/appveyor.yml | 20 +++++++++++++++++++ .../klauspost/reedsolomon/reedsolomon.go | 12 +++++++---- vendor/vendor.json | 4 ++-- 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 vendor/github.com/klauspost/reedsolomon/appveyor.yml diff --git a/vendor/github.com/klauspost/reedsolomon/appveyor.yml b/vendor/github.com/klauspost/reedsolomon/appveyor.yml new file mode 100644 index 000000000..9bb067fdd --- /dev/null +++ b/vendor/github.com/klauspost/reedsolomon/appveyor.yml @@ -0,0 +1,20 @@ +os: Visual Studio 2015 + +platform: x64 + +clone_folder: c:\gopath\src\github.com\klauspost\reedsolomon + +# environment variables +environment: + GOPATH: c:\gopath + +install: + - echo %PATH% + - echo %GOPATH% + - go version + - go env + - go get -d ./... + +build_script: + - go test -v -cpu=2 ./... + - go test -cpu=1,2,4 -short -race ./... diff --git a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go index 6ea8b41bb..b89a1dcd7 100644 --- a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go +++ b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go @@ -85,10 +85,14 @@ type reedSolomon struct { } // ErrInvShardNum will be returned by New, if you attempt to create -// an Encoder where either data or parity shards is zero or less, -// or the number of data shards is higher than 256. +// an Encoder where either data or parity shards is zero or less. var ErrInvShardNum = errors.New("cannot create Encoder with zero or less data/parity shards") +// ErrMaxShardNum will be returned by New, if you attempt to create +// an Encoder where data and parity shards cannot be bigger than +// Galois field GF(2^8) - 1. +var ErrMaxShardNum = errors.New("cannot create Encoder with 255 or more data+parity shards") + // New creates a new encoder and initializes it to // the number of data shards and parity shards that // you want to use. You can reuse this encoder. @@ -104,8 +108,8 @@ func New(dataShards, parityShards int) (Encoder, error) { return nil, ErrInvShardNum } - if dataShards > 256 { - return nil, ErrInvShardNum + if dataShards+parityShards > 255 { + return nil, ErrMaxShardNum } // Start with a Vandermonde matrix. This matrix would work, diff --git a/vendor/vendor.json b/vendor/vendor.json index f071f1158..f86a4d520 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -69,8 +69,8 @@ }, { "path": "github.com/klauspost/reedsolomon", - "revision": "4fadad856421f3f13883bd681de8a9283809076e", - "revisionTime": "2016-05-01T12:00:51+02:00" + "revision": "2fde63d2889a399426862a16611c489b1fed87bc", + "revisionTime": "2016-06-04T08:05:20+02:00" }, { "path": "github.com/mattn/go-colorable",