mirror of
https://github.com/ceph/ceph
synced 2024-12-29 15:03:33 +00:00
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:
parent
d97e479dec
commit
c1660067e3
@ -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]++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user