erasure-code: var-sized array init is done separatly.

```
/home/jenkins/workspace/ceph-master/src/erasure-code/clay/ErasureCodeClay.cc:391:21: error: variable-sized object may not be initialized
  int weight_vector[t] = {0};
                    ^
1 error generated.
```
And GCC doesn't like:
```
  weight_vector = {0};
```

So use std:fill()

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
This commit is contained in:
Willem Jan Withagen 2018-10-02 10:48:59 +02:00
parent d97e479dec
commit c1660067e3

View File

@ -388,7 +388,8 @@ void ErasureCodeClay::get_repair_subchunks(const int &lost_node,
int ErasureCodeClay::get_repair_sub_chunk_count(const set<int> &want_to_read)
{
int weight_vector[t] = {0};
int weight_vector[t];
std::fill(weight_vector, weight_vector + t, 0);
for (auto to_read : want_to_read) {
weight_vector[to_read / q]++;
}